changeset 6362:cdc7f9be3707

Merge
author lana
date Tue, 23 Oct 2012 09:41:52 -0700
parents 37a6ead4a357 (current diff) 29b58cb8e4fc (diff)
children e6fbbb2c610d
files src/share/classes/sun/security/tools/CertAndKeyGen.java src/share/classes/sun/security/tools/JarSigner.java src/share/classes/sun/security/tools/JarSignerResources.java src/share/classes/sun/security/tools/JarSignerResources_ja.java src/share/classes/sun/security/tools/JarSignerResources_zh_CN.java src/share/classes/sun/security/tools/KeyTool.java src/share/classes/sun/security/tools/TimestampedSigner.java src/windows/classes/java/io/Win32FileSystem.java src/windows/native/java/io/Win32FileSystem_md.c test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java test/com/sun/jndi/ldap/ReadTimeoutTest.java
diffstat 303 files changed, 63798 insertions(+), 15689 deletions(-) [+]
line wrap: on
line diff
--- a/THIRD_PARTY_README	Tue Oct 23 09:40:06 2012 -0700
+++ b/THIRD_PARTY_README	Tue Oct 23 09:41:52 2012 -0700
@@ -2,11 +2,11 @@
 -----------------------------
 
 %% This notice is provided with respect to ASM Bytecode Manipulation 
-Framework v3.1, which is included with JRE 7, JDK 7, and OpenJDK 7.
+Framework v4.0, which is included with JRE 8, and JDK 8.
 
 --- begin of LICENSE ---
 
-Copyright (c) 2000-2005 INRIA, France Telecom
+Copyright (c) 2000-2011 France Télécom
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
--- a/make/Makefile	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -233,7 +233,7 @@
 
 all build:: sanity-all post-sanity-all
 
-SUBDIRS       = tools java javax sun com
+SUBDIRS       = tools java javax sun com jdk
 ifeq ($(PLATFORM), macosx)
   SUBDIRS += apple
 endif
--- a/make/common/Release.gmk	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/common/Release.gmk	Tue Oct 23 09:41:52 2012 -0700
@@ -348,15 +348,15 @@
 	sun/tools/serialver	\
 	sun/tools/tree		\
 	sun/tools/util		\
-	sun/security/tools/JarBASE64Encoder.class \
-	sun/security/tools/JarSigner.class \
-	sun/security/tools/JarSignerParameters.class \
-	sun/security/tools/JarSignerResources.class \
-	sun/security/tools/JarSignerResources_ja.class \
-	sun/security/tools/JarSignerResources_zh_CN.class \
-	sun/security/tools/SignatureFile\$$Block.class \
-	sun/security/tools/SignatureFile.class \
-	sun/security/tools/TimestampedSigner.class \
+	sun/security/tools/jarsigner/JarBASE64Encoder.class \
+	sun/security/tools/jarsigner/Main.class \
+	sun/security/tools/jarsigner/JarSignerParameters.class \
+	sun/security/tools/jarsigner/Resources.class \
+	sun/security/tools/jarsigner/Resources_ja.class \
+	sun/security/tools/jarsigner/Resources_zh_CN.class \
+	sun/security/tools/jarsigner/SignatureFile\$$Block.class \
+	sun/security/tools/jarsigner/SignatureFile.class \
+	sun/security/tools/jarsigner/TimestampedSigner.class \
 	sun/rmi/rmic		\
 	sun/applet		\
 	sun/jvmstat		\
@@ -572,15 +572,15 @@
 	$(ECHO) "sun/tools/serialver/" >> $@
 	$(ECHO) "sun/tools/tree/" >> $@
 	$(ECHO) "sun/tools/util/" >> $@
-	$(ECHO) "sun/security/tools/JarBASE64Encoder.class" >> $@
-	$(ECHO) "sun/security/tools/JarSigner.class" >> $@
-	$(ECHO) "sun/security/tools/JarSignerParameters.class" >> $@
-	$(ECHO) "sun/security/tools/JarSignerResources.class" >> $@
-	$(ECHO) "sun/security/tools/JarSignerResources_ja.class" >> $@
-	$(ECHO) "sun/security/tools/JarSignerResources_zh_CN.class" >> $@
-	$(ECHO) "sun/security/tools/SignatureFile\$$Block.class" >> $@
-	$(ECHO) "sun/security/tools/SignatureFile.class" >> $@
-	$(ECHO) "sun/security/tools/TimestampedSigner.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/JarBASE64Encoder.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/Main.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/JarSignerParameters.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/Resources.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/Resources_ja.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/Resources_zh_CN.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/SignatureFile\$$Block.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/SignatureFile.class" >> $@
+	$(ECHO) "sun/security/tools/jarsigner/TimestampedSigner.class" >> $@
 	$(ECHO) "sun/security/provider/Sun.class" >> $@
 	$(ECHO) "sun/security/rsa/SunRsaSign.class" >> $@
 	$(ECHO) "sun/security/ssl/" >> $@
--- a/make/common/internal/Defs-jaxws.gmk	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/common/internal/Defs-jaxws.gmk	Tue Oct 23 09:41:52 2012 -0700
@@ -34,6 +34,10 @@
      javax/xml/ws \
      javax/jws \
      javax/annotation \
+     com/sun/org/glassfish \
+     com/sun/istack/internal \
+     com/sun/istack/internal/localization \
+     com/sun/istack/internal/logging \
      com/sun/xml/internal/bind \
      com/sun/xml/internal/fastinfoset \
      com/sun/xml/internal/messaging \
--- a/make/java/java/Makefile	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/java/java/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -64,13 +64,11 @@
 include Exportedfiles.gmk
 
 ifeq ($(PLATFORM),windows)
-FILES_java += 	java/io/Win32FileSystem.java \
-		java/io/WinNTFileSystem.java \
+FILES_java += 	java/io/WinNTFileSystem.java \
 		java/util/prefs/WindowsPreferences.java \
                 java/util/prefs/WindowsPreferencesFactory.java
 
 FILES_c    +=   ProcessImpl_md.c \
-		Win32FileSystem_md.c \
 		WinNTFileSystem_md.c \
 		canonicalize_md.c \
 		dirent_md.c \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/jdk/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile for building all of java
+#
+
+BUILDDIR = ..
+PRODUCT = jdk
+include $(BUILDDIR)/common/Defs.gmk
+
+SUBDIRS = asm
+include $(BUILDDIR)/common/Subdirs.gmk
+
+all build clean clobber::
+	$(SUBDIRS-loop)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/jdk/asm/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please 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 = ../..
+PACKAGE = jdk.internal.org.objectweb.asm
+PRODUCT = jdk
+JAVAC_LINT_OPTIONS=-Xlint:all
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files to compile
+#
+AUTO_FILES_JAVA_DIRS = jdk/internal/org/objectweb/asm
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
--- a/make/jprt.properties	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/jprt.properties	Tue Oct 23 09:41:52 2012 -0700
@@ -77,20 +77,18 @@
     ${jprt.my.test.target.set:TESTNAME=jdk_util},               \
     ${jprt.my.test.target.set:TESTNAME=jdk_io},                 \
     ${jprt.my.test.target.set:TESTNAME=jdk_net},                \
-    ${jprt.my.test.target.set:TESTNAME=jdk_nio1},               \
-    ${jprt.my.test.target.set:TESTNAME=jdk_nio2},               \
-    ${jprt.my.test.target.set:TESTNAME=jdk_nio3},               \
+    ${jprt.my.test.target.set:TESTNAME=jdk_nio},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_security1},          \
     ${jprt.my.test.target.set:TESTNAME=jdk_security2},          \
     ${jprt.my.test.target.set:TESTNAME=jdk_security3},          \
     ${jprt.my.test.target.set:TESTNAME=jdk_rmi},                \
-    ${jprt.my.test.target.set:TESTNAME=jdk_management1},        \
-    ${jprt.my.test.target.set:TESTNAME=jdk_management2},        \
+    ${jprt.my.test.target.set:TESTNAME=jdk_management},         \
+    ${jprt.my.test.target.set:TESTNAME=jdk_jmx},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_text},               \
-    ${jprt.my.test.target.set:TESTNAME=jdk_tools1},             \
-    ${jprt.my.test.target.set:TESTNAME=jdk_tools2},             \
+    ${jprt.my.test.target.set:TESTNAME=jdk_tools},              \
+    ${jprt.my.test.target.set:TESTNAME=jdk_jdi},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_jfr},                \
-    ${jprt.my.test.target.set:TESTNAME=jdk_misc}
+    ${jprt.my.test.target.set:TESTNAME=jdk_other}
 
 # All vm test targets (testset=all)
 jprt.vm.all.test.targets=                                       \
--- a/make/launchers/Makefile	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/launchers/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -58,7 +58,7 @@
 $(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , )
 $(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , )
 $(call make-launcher, jar, sun.tools.jar.Main, , )
-$(call make-launcher, jarsigner, sun.security.tools.JarSigner, , )
+$(call make-launcher, jarsigner, sun.security.tools.jarsigner.Main, , )
 $(call make-launcher, javac, com.sun.tools.javac.Main, , )
 $(call make-launcher, javadoc, com.sun.tools.javadoc.Main, , )
 $(call make-launcher, javah, com.sun.tools.javah.Main, , )
--- a/make/sun/security/tools/Makefile	Tue Oct 23 09:40:06 2012 -0700
+++ b/make/sun/security/tools/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
 # 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,7 @@
 # Resources
 #
 LOCALE_SET_DEFINITION = jdk
-RESOURCE_BUNDLES_JAVA = sun/security/tools/JarSignerResources.java
+RESOURCE_BUNDLES_JAVA = sun/security/tools/jarsigner/Resources.java
 
 #
 # Rules
@@ -45,7 +45,7 @@
 include $(BUILDDIR)/common/Classes.gmk
 
 build:
-	$(call make-launcher, keytool, sun.security.tools.KeyTool, , )
+	$(call make-launcher, keytool, sun.security.tools.keytool.Main, , )
 ifndef BUILD_HEADLESS_ONLY
 	$(call make-launcher, policytool, sun.security.tools.policytool.PolicyTool, , )
 endif
--- a/makefiles/CompileLaunchers.gmk	Tue Oct 23 09:40:06 2012 -0700
+++ b/makefiles/CompileLaunchers.gmk	Tue Oct 23 09:41:52 2012 -0700
@@ -232,7 +232,7 @@
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,jarsigner,\
-    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.JarSigner"$(COMMA) }'))
+    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,javac,\
     -DEXPAND_CLASSPATH_WILDCARDS \
@@ -310,7 +310,7 @@
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,keytool,\
-    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.KeyTool"$(COMMA) }'))
+    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.keytool.Main"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,native2ascii,\
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))
--- a/makefiles/CompileNativeLibraries.gmk	Tue Oct 23 09:40:06 2012 -0700
+++ b/makefiles/CompileNativeLibraries.gmk	Tue Oct 23 09:41:52 2012 -0700
@@ -209,7 +209,6 @@
 else
 	LIBJAVA_EXCLUDE_FILES += \
 		ProcessImpl_md.c \
-		Win32FileSystem_md.c \
 		WinNTFileSystem_md.c \
 		dirent_md.c \
 		WindowsPreferences.c \
--- a/makefiles/CreateJars.gmk	Tue Oct 23 09:40:06 2012 -0700
+++ b/makefiles/CreateJars.gmk	Tue Oct 23 09:41:52 2012 -0700
@@ -131,15 +131,15 @@
 	sun/tools/serialver \
 	sun/tools/tree \
 	sun/tools/util \
-	sun/security/tools/JarBASE64Encoder.class \
-	sun/security/tools/JarSigner.class \
-	sun/security/tools/JarSignerParameters.class \
-	sun/security/tools/JarSignerResources.class \
-	sun/security/tools/JarSignerResources_ja.class \
-	sun/security/tools/JarSignerResources_zh_CN.class \
-	sun/security/tools/SignatureFile\$$$$Block.class \
-	sun/security/tools/SignatureFile.class \
-	sun/security/tools/TimestampedSigner.class \
+	sun/security/tools/jarsigner/JarBASE64Encoder.class \
+	sun/security/tools/jarsigner/Main.class \
+	sun/security/tools/jarsigner/JarSignerParameters.class \
+	sun/security/tools/jarsigner/Resources.class \
+	sun/security/tools/jarsigner/Resources_ja.class \
+	sun/security/tools/jarsigner/Resources_zh_CN.class \
+	sun/security/tools/jarsigner/SignatureFile\$$$$Block.class \
+	sun/security/tools/jarsigner/SignatureFile.class \
+	sun/security/tools/jarsigner/TimestampedSigner.class \
 	sun/security/provider/Sun.class \
 	sun/security/rsa/SunRsaSign.class \
 	sun/security/ssl \
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Tue Oct 23 09:41:52 2012 -0700
@@ -100,7 +100,7 @@
         else
             this.isUser = isUserNode();
         path = isRoot ? absolutePath() : absolutePath() + "/";
-        file = cfFileForNode(isUser);
+        file = cfFileForNode(this.isUser);
         if (isNew)
             newNode = isNew;
         else
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/Connection.java	Tue Oct 23 09:41:52 2012 -0700
@@ -157,7 +157,8 @@
     volatile IOException closureReason = null;
     volatile boolean useable = true;  // is Connection still useable
 
-    private int readTimeout;
+    int readTimeout;
+    int connectTimeout;
 
     // true means v3; false means v2
     // Called in LdapClient.authenticate() (which is synchronized)
@@ -187,6 +188,7 @@
         this.port = port;
         this.parent = parent;
         this.readTimeout = readTimeout;
+        this.connectTimeout = connectTimeout;
 
         if (trace != null) {
             traceFile = trace;
--- a/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Tue Oct 23 09:41:52 2012 -0700
@@ -150,149 +150,155 @@
         String authMechanism, Control[] ctls,  Hashtable<?,?> env)
         throws NamingException {
 
-        authenticateCalled = true;
+        int readTimeout = conn.readTimeout;
+        conn.readTimeout = conn.connectTimeout;
+        LdapResult res = null;
 
         try {
-            ensureOpen();
-        } catch (IOException e) {
-            NamingException ne = new CommunicationException();
-            ne.setRootCause(e);
-            throw ne;
-        }
+            authenticateCalled = true;
+
+            try {
+                ensureOpen();
+            } catch (IOException e) {
+                NamingException ne = new CommunicationException();
+                ne.setRootCause(e);
+                throw ne;
+            }
+
+            switch (version) {
+            case LDAP_VERSION3_VERSION2:
+            case LDAP_VERSION3:
+                isLdapv3 = true;
+                break;
+            case LDAP_VERSION2:
+                isLdapv3 = false;
+                break;
+            default:
+                throw new CommunicationException("Protocol version " + version +
+                    " not supported");
+            }
+
+            if (authMechanism.equalsIgnoreCase("none") ||
+                authMechanism.equalsIgnoreCase("anonymous")) {
 
-        switch (version) {
-        case LDAP_VERSION3_VERSION2:
-        case LDAP_VERSION3:
-            isLdapv3 = true;
-            break;
-        case LDAP_VERSION2:
-            isLdapv3 = false;
-            break;
-        default:
-            throw new CommunicationException("Protocol version " + version +
-                " not supported");
-        }
-
-        LdapResult res = null;
-
-        if (authMechanism.equalsIgnoreCase("none") ||
-            authMechanism.equalsIgnoreCase("anonymous")) {
-
-            // Perform LDAP bind if we are reauthenticating, using LDAPv2,
-            // supporting failover to LDAPv2, or controls have been supplied.
-            if (!initial ||
-                (version == LDAP_VERSION2) ||
-                (version == LDAP_VERSION3_VERSION2) ||
-                ((ctls != null) && (ctls.length > 0))) {
+                // Perform LDAP bind if we are reauthenticating, using LDAPv2,
+                // supporting failover to LDAPv2, or controls have been supplied.
+                if (!initial ||
+                    (version == LDAP_VERSION2) ||
+                    (version == LDAP_VERSION3_VERSION2) ||
+                    ((ctls != null) && (ctls.length > 0))) {
+                    try {
+                        // anonymous bind; update name/pw for LDAPv2 retry
+                        res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
+                            false);
+                        if (res.status == LdapClient.LDAP_SUCCESS) {
+                            conn.setBound();
+                        }
+                    } catch (IOException e) {
+                        NamingException ne =
+                            new CommunicationException("anonymous bind failed: " +
+                            conn.host + ":" + conn.port);
+                        ne.setRootCause(e);
+                        throw ne;
+                    }
+                } else {
+                    // Skip LDAP bind for LDAPv3 anonymous bind
+                    res = new LdapResult();
+                    res.status = LdapClient.LDAP_SUCCESS;
+                }
+            } else if (authMechanism.equalsIgnoreCase("simple")) {
+                // simple authentication
+                byte[] encodedPw = null;
                 try {
-                    // anonymous bind; update name/pw for LDAPv2 retry
-                    res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
-                        false);
+                    encodedPw = encodePassword(pw, isLdapv3);
+                    res = ldapBind(name, encodedPw, ctls, null, false);
                     if (res.status == LdapClient.LDAP_SUCCESS) {
                         conn.setBound();
                     }
                 } catch (IOException e) {
                     NamingException ne =
-                        new CommunicationException("anonymous bind failed: " +
+                        new CommunicationException("simple bind failed: " +
+                            conn.host + ":" + conn.port);
+                    ne.setRootCause(e);
+                    throw ne;
+                } finally {
+                    // If pw was copied to a new array, clear that array as
+                    // a security precaution.
+                    if (encodedPw != pw && encodedPw != null) {
+                        for (int i = 0; i < encodedPw.length; i++) {
+                            encodedPw[i] = 0;
+                        }
+                    }
+                }
+            } else if (isLdapv3) {
+                // SASL authentication
+                try {
+                    res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
+                        authMechanism, env, ctls);
+                    if (res.status == LdapClient.LDAP_SUCCESS) {
+                        conn.setBound();
+                    }
+                } catch (IOException e) {
+                    NamingException ne =
+                        new CommunicationException("SASL bind failed: " +
                         conn.host + ":" + conn.port);
                     ne.setRootCause(e);
                     throw ne;
                 }
             } else {
-                // Skip LDAP bind for LDAPv3 anonymous bind
-                res = new LdapResult();
-                res.status = LdapClient.LDAP_SUCCESS;
+                throw new AuthenticationNotSupportedException(authMechanism);
             }
-        } else if (authMechanism.equalsIgnoreCase("simple")) {
-            // simple authentication
-            byte[] encodedPw = null;
-            try {
-                encodedPw = encodePassword(pw, isLdapv3);
-                res = ldapBind(name, encodedPw, ctls, null, false);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException("simple bind failed: " +
-                        conn.host + ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
-            } finally {
-                // If pw was copied to a new array, clear that array as
-                // a security precaution.
-                if (encodedPw != pw && encodedPw != null) {
-                    for (int i = 0; i < encodedPw.length; i++) {
-                        encodedPw[i] = 0;
+
+            //
+            // re-try login using v2 if failing over
+            //
+            if (initial &&
+                (res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
+                (version == LdapClient.LDAP_VERSION3_VERSION2) &&
+                (authMechanism.equalsIgnoreCase("none") ||
+                    authMechanism.equalsIgnoreCase("anonymous") ||
+                    authMechanism.equalsIgnoreCase("simple"))) {
+
+                byte[] encodedPw = null;
+                try {
+                    isLdapv3 = false;
+                    encodedPw = encodePassword(pw, false);
+                    res = ldapBind(name, encodedPw, ctls, null, false);
+                    if (res.status == LdapClient.LDAP_SUCCESS) {
+                        conn.setBound();
+                    }
+                } catch (IOException e) {
+                    NamingException ne =
+                        new CommunicationException(authMechanism + ":" +
+                            conn.host +     ":" + conn.port);
+                    ne.setRootCause(e);
+                    throw ne;
+                } finally {
+                    // If pw was copied to a new array, clear that array as
+                    // a security precaution.
+                    if (encodedPw != pw && encodedPw != null) {
+                        for (int i = 0; i < encodedPw.length; i++) {
+                            encodedPw[i] = 0;
+                        }
                     }
                 }
             }
-        } else if (isLdapv3) {
-            // SASL authentication
-            try {
-                res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
-                    authMechanism, env, ctls);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException("SASL bind failed: " +
-                    conn.host + ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
+
+            // principal name not found
+            // (map NameNotFoundException to AuthenticationException)
+            // %%% This is a workaround for Netscape servers returning
+            // %%% no such object when the principal name is not found
+            // %%% Note that when this workaround is applied, it does not allow
+            // %%% response controls to be recorded by the calling context
+            if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
+                throw new AuthenticationException(
+                    getErrorMessage(res.status, res.errorMessage));
             }
-        } else {
-            throw new AuthenticationNotSupportedException(authMechanism);
+            conn.setV3(isLdapv3);
+            return res;
+        } finally {
+            conn.readTimeout = readTimeout;
         }
-
-        //
-        // re-try login using v2 if failing over
-        //
-        if (initial &&
-            (res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
-            (version == LdapClient.LDAP_VERSION3_VERSION2) &&
-            (authMechanism.equalsIgnoreCase("none") ||
-                authMechanism.equalsIgnoreCase("anonymous") ||
-                authMechanism.equalsIgnoreCase("simple"))) {
-
-            byte[] encodedPw = null;
-            try {
-                isLdapv3 = false;
-                encodedPw = encodePassword(pw, false);
-                res = ldapBind(name, encodedPw, ctls, null, false);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException(authMechanism + ":" +
-                        conn.host +     ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
-            } finally {
-                // If pw was copied to a new array, clear that array as
-                // a security precaution.
-                if (encodedPw != pw && encodedPw != null) {
-                    for (int i = 0; i < encodedPw.length; i++) {
-                        encodedPw[i] = 0;
-                    }
-                }
-            }
-        }
-
-        // principal name not found
-        // (map NameNotFoundException to AuthenticationException)
-        // %%% This is a workaround for Netscape servers returning
-        // %%% no such object when the principal name is not found
-        // %%% Note that when this workaround is applied, it does not allow
-        // %%% response controls to be recorded by the calling context
-        if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
-            throw new AuthenticationException(
-                getErrorMessage(res.status, res.errorMessage));
-        }
-        conn.setV3(isLdapv3);
-        return res;
     }
 
     /**
--- a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1746,12 +1746,7 @@
 
         // convert to a Double and compare to zero
         try {
-            Double d = new Double(value.toString());
-            if (d.compareTo(new Double((double)0)) == 0) {
-                return false;
-            } else {
-                return true;
-            }
+            return Double.compare(Double.parseDouble(value.toString()), 0) != 0;
         } catch (NumberFormatException ex) {
             throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.boolfail").toString(),
                   new Object[] {value.toString().trim(), columnIndex}));
@@ -2039,6 +2034,7 @@
      *            the cursor is not on a valid row, or this method fails
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         Object value;
         BigDecimal bDecimal, retVal;
@@ -2374,6 +2370,7 @@
      * @throws SQLException if an error occurs
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
         // always free an old stream
         unicodeStream = null;
@@ -2643,6 +2640,7 @@
      * @deprecated Use the <code>getBigDecimal(String columnName)</code>
      *             method instead
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         return getBigDecimal(getColIdxByName(columnName), scale);
     }
@@ -2774,6 +2772,7 @@
      *            this rowset's rows or its insert row
      * @deprecated use the method <code>getCharacterStream</code> instead
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         return getUnicodeStream(getColIdxByName(columnName));
     }
@@ -4428,7 +4427,7 @@
         // make sure the cursor is on a valid row
         checkCursor();
 
-        Object obj = convertNumeric(new Float(x),
+        Object obj = convertNumeric(Float.valueOf(x),
         java.sql.Types.REAL,
         RowSetMD.getColumnType(columnIndex));
 
@@ -4463,7 +4462,7 @@
         checkIndex(columnIndex);
         // make sure the cursor is on a valid row
         checkCursor();
-        Object obj = convertNumeric(new Double(x),
+        Object obj = convertNumeric(Double.valueOf(x),
         java.sql.Types.DOUBLE,
         RowSetMD.getColumnType(columnIndex));
 
--- a/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -839,7 +839,7 @@
 
       if(onInsertRow) {
          if(p != null) {
-            bool = p.evaluate(new Float(x) , columnIndex);
+            bool = p.evaluate(Float.valueOf(x), columnIndex);
 
             if(!bool) {
                throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
@@ -906,7 +906,7 @@
 
       if(onInsertRow) {
          if(p != null) {
-            bool = p.evaluate(new Double(x) , columnIndex);
+            bool = p.evaluate(Double.valueOf(x) , columnIndex);
 
             if(!bool) {
                throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
--- a/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1016,6 +1016,7 @@
      *            prepared statement, and result set
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         checkState();
 
@@ -1154,6 +1155,7 @@
      * @deprecated use <code>getCharacterStream</code> in place of
      *              <code>getUnicodeStream</code>
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
         checkState();
 
@@ -1336,6 +1338,7 @@
      *            prepared statement, and result set
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         return getBigDecimal(findColumn(columnName), scale);
     }
@@ -1461,6 +1464,7 @@
      *            prepared statement, and result set
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         return getUnicodeStream(findColumn(columnName));
     }
--- a/src/share/classes/com/sun/rowset/JoinRowSetImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/rowset/JoinRowSetImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1153,6 +1153,7 @@
      *            the cursor is not on a valid row, or this method fails
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         return crsInternal.getBigDecimal(columnIndex);
     }
@@ -1264,6 +1265,7 @@
      * @throws SQLException if an error occurs
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
         return crsInternal.getUnicodeStream(columnIndex);
     }
@@ -1436,6 +1438,7 @@
      * @deprecated use the method <code>getBigDecimal(String columnName)</code>
      *             instead
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         return crsInternal.getBigDecimal(columnName);
     }
@@ -1552,6 +1555,7 @@
      *            this rowset's rows or its insert row
      * @deprecated use the method <code>getCharacterStream</code> instead
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         return crsInternal.getUnicodeStream(columnName);
     }
--- a/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1288,6 +1288,7 @@
      *            the cursor is not on a valid row, or this method fails
      * @deprecated
      */
+    @Deprecated
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
        throw new UnsupportedOperationException();
     }
@@ -1424,6 +1425,7 @@
      * @throws SQLException if an error occurs
      * @deprecated
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
        throw new UnsupportedOperationException();
     }
@@ -1653,6 +1655,7 @@
      * @deprecated Use the <code>getBigDecimal(String columnName)</code>
      *             method instead
      */
+    @Deprecated
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         throw new UnsupportedOperationException();
     }
@@ -1784,6 +1787,7 @@
      *            this rowset's rows or its insert row
      * @deprecated use the method <code>getCharacterStream</code> instead
      */
+    @Deprecated
     public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
         throw new UnsupportedOperationException();
     }
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Tue Oct 23 09:41:52 2012 -0700
@@ -802,7 +802,7 @@
 
         if (doNotPrompt) {
             throw new LoginException
-                ("Unable to obtain Princpal Name for authentication ");
+                ("Unable to obtain Principal Name for authentication ");
         } else {
             if (callbackHandler == null)
                 throw new LoginException("No CallbackHandler "
--- a/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -52,6 +52,7 @@
     private boolean shut_wr = false;
 
     private SocketInputStream socketInputStream = null;
+    private SocketOutputStream socketOutputStream = null;
 
     /* number of threads using the FileDescriptor */
     protected int fdUseCount = 0;
@@ -436,7 +437,10 @@
         if (shut_wr) {
             throw new IOException("Socket output is shutdown");
         }
-        return new SocketOutputStream(this);
+        if (socketOutputStream == null) {
+            socketOutputStream = new SocketOutputStream(this);
+        }
+        return socketOutputStream;
     }
 
     void setFileDescriptor(FileDescriptor fd) {
--- a/src/share/classes/java/net/ProxySelector.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/net/ProxySelector.java	Tue Oct 23 09:41:52 2012 -0700
@@ -127,7 +127,6 @@
      * <UL>
      * <LI>http URI for http connections</LI>
      * <LI>https URI for https connections
-     * <LI>ftp URI for ftp connections</LI>
      * <LI><code>socket://host:port</code><br>
      *     for tcp client sockets connections</LI>
      * </UL>
--- a/src/share/classes/java/net/URL.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/net/URL.java	Tue Oct 23 09:41:52 2012 -0700
@@ -274,7 +274,7 @@
      * <p>Protocol handlers for the following protocols are guaranteed
      * to exist on the search path :-
      * <blockquote><pre>
-     *     http, https, ftp, file, and jar
+     *     http, https, file, and jar
      * </pre></blockquote>
      * Protocol handlers for additional protocols may also be
      * available.
--- a/src/share/classes/java/net/URLStreamHandler.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/net/URLStreamHandler.java	Tue Oct 23 09:41:52 2012 -0700
@@ -37,8 +37,7 @@
  * The abstract class <code>URLStreamHandler</code> is the common
  * superclass for all stream protocol handlers. A stream protocol
  * handler knows how to make a connection for a particular protocol
- * type, such as <code>http</code>, <code>ftp</code>, or
- * <code>gopher</code>.
+ * type, such as <code>http</code> or <code>https</code>.
  * <p>
  * In most cases, an instance of a <code>URLStreamHandler</code>
  * subclass is not created directly by an application. Rather, the
--- a/src/share/classes/java/net/package.html	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/net/package.html	Tue Oct 23 09:41:52 2012 -0700
@@ -72,7 +72,7 @@
 <ul>
       <li>{@link java.net.URI} is the class representing a Universal Resource Identifier, as specified in RFC 2396. As the name indicates, this is just an Identifier and doesn't provide directly the means to access the resource.</li>
       <li>{@link java.net.URL} is the class representing a Universal Resource Locator, which is both an older concept for URIs and a means to access the resources.</li>
-      <li>{@link java.net.URLConnection} is created from a URL and is the communication link used to access the resource pointed by the URL. This abstract class will delegate most of the work to the underlying protocol handlers like http or ftp.</li>
+      <li>{@link java.net.URLConnection} is created from a URL and is the communication link used to access the resource pointed by the URL. This abstract class will delegate most of the work to the underlying protocol handlers like http or https.</li>
       <li>{@link java.net.HttpURLConnection} is a subclass of URLConnection and provides some additional functionalities specific to the HTTP protocol.</li>
 </ul>
 <p>The recommended usage is to use {@link java.net.URI} to identify resources, then convert it into a {@link java.net.URL} when it is time to access the resource. From that URL, you can either get the {@link java.net.URLConnection} for fine control, or get directly the InputStream.<p>
--- a/src/share/classes/java/sql/CallableStatement.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/sql/CallableStatement.java	Tue Oct 23 09:41:52 2012 -0700
@@ -295,6 +295,7 @@
      *             or <code>getBigDecimal(String parameterName)</code>
      * @see #setBigDecimal
      */
+    @Deprecated
     BigDecimal getBigDecimal(int parameterIndex, int scale)
         throws SQLException;
 
--- a/src/share/classes/java/sql/Date.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/sql/Date.java	Tue Oct 23 09:41:52 2012 -0700
@@ -51,6 +51,7 @@
      * @param day 1 to 31
      * @deprecated instead use the constructor <code>Date(long date)</code>
      */
+    @Deprecated
     public Date(int year, int month, int day) {
         super(year, month, day);
     }
@@ -179,6 +180,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #setHours
     */
+    @Deprecated
     public int getHours() {
         throw new java.lang.IllegalArgumentException();
     }
@@ -191,6 +193,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #setMinutes
     */
+    @Deprecated
     public int getMinutes() {
         throw new java.lang.IllegalArgumentException();
     }
@@ -203,6 +206,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #setSeconds
     */
+    @Deprecated
     public int getSeconds() {
         throw new java.lang.IllegalArgumentException();
     }
@@ -215,6 +219,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #getHours
     */
+    @Deprecated
     public void setHours(int i) {
         throw new java.lang.IllegalArgumentException();
     }
@@ -227,6 +232,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #getMinutes
     */
+    @Deprecated
     public void setMinutes(int i) {
         throw new java.lang.IllegalArgumentException();
     }
@@ -239,6 +245,7 @@
     * @exception java.lang.IllegalArgumentException if this method is invoked
     * @see #getSeconds
     */
+    @Deprecated
     public void setSeconds(int i) {
         throw new java.lang.IllegalArgumentException();
     }
--- a/src/share/classes/java/sql/DriverManager.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/sql/DriverManager.java	Tue Oct 23 09:41:52 2012 -0700
@@ -412,13 +412,14 @@
      * method throws a <code>java.lang.SecurityException</code>.
      *
      * @param out the new logging/tracing PrintStream; to disable, set to <code>null</code>
-     * @deprecated
+     * @deprecated Use {@code setLogWriter}
      * @throws SecurityException if a security manager exists and its
      *    <code>checkPermission</code> method denies setting the log stream
      *
      * @see SecurityManager#checkPermission
      * @see #getLogStream
      */
+    @Deprecated
     public static void setLogStream(java.io.PrintStream out) {
 
         SecurityManager sec = System.getSecurityManager();
@@ -438,9 +439,10 @@
      * and all drivers.
      *
      * @return the logging/tracing PrintStream; if disabled, is <code>null</code>
-     * @deprecated
+     * @deprecated  Use {@code getLogWriter}
      * @see #setLogStream
      */
+    @Deprecated
     public static java.io.PrintStream getLogStream() {
         return logStream;
     }
--- a/src/share/classes/java/sql/PreparedStatement.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/sql/PreparedStatement.java	Tue Oct 23 09:41:52 2012 -0700
@@ -342,8 +342,9 @@
      * this method is called on a closed <code>PreparedStatement</code>
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
      * this method
-     * @deprecated
+     * @deprecated Use {@code setCharacterStream}
      */
+    @Deprecated
     void setUnicodeStream(int parameterIndex, java.io.InputStream x,
                           int length) throws SQLException;
 
--- a/src/share/classes/java/sql/ResultSet.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/sql/ResultSet.java	Tue Oct 23 09:41:52 2012 -0700
@@ -356,8 +356,10 @@
      *            called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
      * this method
-     * @deprecated
+     * @deprecated Use {@code getBigDecimal(int columnIndex)}
+     *             or {@code getBigDecimal(String columnLabel)}
      */
+    @Deprecated
     BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException;
 
     /**
@@ -477,6 +479,7 @@
      * @deprecated use <code>getCharacterStream</code> in place of
      *              <code>getUnicodeStream</code>
      */
+    @Deprecated
     java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException;
 
     /**
@@ -641,8 +644,10 @@
      *            called on a closed result set
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
      * this method
-     * @deprecated
+     * @deprecated Use {@code getBigDecimal(int columnIndex)}
+     *             or {@code getBigDecimal(String columnLabel)}
      */
+    @Deprecated
     BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException;
 
     /**
@@ -760,6 +765,7 @@
      * this method
      * @deprecated use <code>getCharacterStream</code> instead
      */
+    @Deprecated
     java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException;
 
     /**
--- a/src/share/classes/java/text/DateFormatSymbols.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/text/DateFormatSymbols.java	Tue Oct 23 09:41:52 2012 -0700
@@ -45,6 +45,7 @@
 import java.text.spi.DateFormatSymbolsProvider;
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.ResourceBundle;
 import java.util.TimeZone;
 import java.util.concurrent.ConcurrentHashMap;
@@ -366,6 +367,7 @@
      */
     public void setEras(String[] newEras) {
         eras = Arrays.copyOf(newEras, newEras.length);
+        cachedHashCode = 0;
     }
 
     /**
@@ -393,6 +395,7 @@
      */
     public void setMonths(String[] newMonths) {
         months = Arrays.copyOf(newMonths, newMonths.length);
+        cachedHashCode = 0;
     }
 
     /**
@@ -420,6 +423,7 @@
      */
     public void setShortMonths(String[] newShortMonths) {
         shortMonths = Arrays.copyOf(newShortMonths, newShortMonths.length);
+        cachedHashCode = 0;
     }
 
     /**
@@ -439,6 +443,7 @@
      */
     public void setWeekdays(String[] newWeekdays) {
         weekdays = Arrays.copyOf(newWeekdays, newWeekdays.length);
+        cachedHashCode = 0;
     }
 
     /**
@@ -458,6 +463,7 @@
      */
     public void setShortWeekdays(String[] newShortWeekdays) {
         shortWeekdays = Arrays.copyOf(newShortWeekdays, newShortWeekdays.length);
+        cachedHashCode = 0;
     }
 
     /**
@@ -474,6 +480,7 @@
      */
     public void setAmPmStrings(String[] newAmpms) {
         ampms = Arrays.copyOf(newAmpms, newAmpms.length);
+        cachedHashCode = 0;
     }
 
     /**
@@ -558,6 +565,7 @@
         }
         zoneStrings = aCopy;
         isZoneStringsSet = true;
+        cachedHashCode = 0;
     }
 
     /**
@@ -576,6 +584,7 @@
     public void setLocalPatternChars(String newLocalPatternChars) {
         // Call toString() to throw an NPE in case the argument is null
         localPatternChars = newLocalPatternChars.toString();
+        cachedHashCode = 0;
     }
 
     /**
@@ -597,12 +606,23 @@
      * Override hashCode.
      * Generates a hash code for the DateFormatSymbols object.
      */
+    @Override
     public int hashCode() {
-        int hashcode = 0;
-        String[][] zoneStrings = getZoneStringsWrapper();
-        for (int index = 0; index < zoneStrings[0].length; ++index)
-            hashcode ^= zoneStrings[0][index].hashCode();
-        return hashcode;
+        int hashCode = cachedHashCode;
+        if (hashCode == 0) {
+            hashCode = 5;
+            hashCode = 11 * hashCode + Arrays.hashCode(eras);
+            hashCode = 11 * hashCode + Arrays.hashCode(months);
+            hashCode = 11 * hashCode + Arrays.hashCode(shortMonths);
+            hashCode = 11 * hashCode + Arrays.hashCode(weekdays);
+            hashCode = 11 * hashCode + Arrays.hashCode(shortWeekdays);
+            hashCode = 11 * hashCode + Arrays.hashCode(ampms);
+            hashCode = 11 * hashCode + Arrays.deepHashCode(getZoneStringsWrapper());
+            hashCode = 11 * hashCode + Objects.hashCode(localPatternChars);
+            cachedHashCode = hashCode;
+        }
+
+        return hashCode;
     }
 
     /**
@@ -641,6 +661,11 @@
 
     private transient int lastZoneIndex = 0;
 
+    /**
+     * Cached hash code
+     */
+    transient volatile int cachedHashCode = 0;
+
     private void initializeData(Locale desiredLocale) {
         locale = desiredLocale;
 
@@ -782,6 +807,7 @@
             dst.zoneStrings = null;
         }
         dst.localPatternChars = src.localPatternChars;
+        dst.cachedHashCode = 0;
     }
 
     /**
--- a/src/share/classes/java/util/Hashtable.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/util/Hashtable.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1059,7 +1059,7 @@
         }
 
         public int hashCode() {
-            return hash ^ (value==null ? 0 : value.hashCode());
+            return (Objects.hashCode(key) ^ Objects.hashCode(value));
         }
 
         public String toString() {
--- a/src/share/classes/java/util/Properties.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/util/Properties.java	Tue Oct 23 09:41:52 2012 -0700
@@ -81,8 +81,9 @@
  * <p> The {@link #loadFromXML(InputStream)} and {@link
  * #storeToXML(OutputStream, String, String)} methods load and store properties
  * in a simple XML format.  By default the UTF-8 character encoding is used,
- * however a specific encoding may be specified if required.  An XML properties
- * document has the following DOCTYPE declaration:
+ * however a specific encoding may be specified if required. Implementations
+ * are required to support UTF-8 and UTF-16 and may support other encodings.
+ * An XML properties document has the following DOCTYPE declaration:
  *
  * <pre>
  * &lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt;
@@ -853,23 +854,30 @@
      * Furthermore, the document must satisfy the properties DTD described
      * above.
      *
+     * <p> An implementation is required to read XML documents that use the
+     * "{@code UTF-8}" or "{@code UTF-16}" encoding. An implementation may
+     * support additional encodings.
+     *
      * <p>The specified stream is closed after this method returns.
      *
      * @param in the input stream from which to read the XML document.
      * @throws IOException if reading from the specified input stream
      *         results in an <tt>IOException</tt>.
+     * @throws java.io.UnsupportedEncodingException if the document's encoding
+     *         declaration can be read and it specifies an encoding that is not
+     *         supported
      * @throws InvalidPropertiesFormatException Data on input stream does not
      *         constitute a valid XML document with the mandated document type.
      * @throws NullPointerException if {@code in} is null.
      * @see    #storeToXML(OutputStream, String, String)
+     * @see    <a href="http://www.w3.org/TR/REC-xml/#charencoding">Character
+     *         Encoding in Entities</a>
      * @since 1.5
      */
     public synchronized void loadFromXML(InputStream in)
         throws IOException, InvalidPropertiesFormatException
     {
-        if (in == null)
-            throw new NullPointerException();
-        XmlSupport.load(this, in);
+        XmlSupport.load(this, Objects.requireNonNull(in));
         in.close();
     }
 
@@ -896,8 +904,6 @@
     public void storeToXML(OutputStream os, String comment)
         throws IOException
     {
-        if (os == null)
-            throw new NullPointerException();
         storeToXML(os, comment, "UTF-8");
     }
 
@@ -910,9 +916,13 @@
      * &lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt;
      * </pre>
      *
-     *<p>If the specified comment is {@code null} then no comment
+     * <p>If the specified comment is {@code null} then no comment
      * will be stored in the document.
      *
+     * <p> An implementation is required to support writing of XML documents
+     * that use the "{@code UTF-8}" or "{@code UTF-16}" encoding. An
+     * implementation may support additional encodings.
+     *
      * <p>The specified stream remains open after this method returns.
      *
      * @param os        the output stream on which to emit the XML document.
@@ -924,20 +934,23 @@
      *
      * @throws IOException if writing to the specified output stream
      *         results in an <tt>IOException</tt>.
+     * @throws java.io.UnsupportedEncodingException if the encoding is not
+     *         supported by the implementation.
      * @throws NullPointerException if {@code os} is {@code null},
      *         or if {@code encoding} is {@code null}.
      * @throws ClassCastException  if this {@code Properties} object
      *         contains any keys or values that are not
      *         {@code Strings}.
      * @see    #loadFromXML(InputStream)
+     * @see    <a href="http://www.w3.org/TR/REC-xml/#charencoding">Character
+     *         Encoding in Entities</a>
      * @since 1.5
      */
     public void storeToXML(OutputStream os, String comment, String encoding)
         throws IOException
     {
-        if (os == null)
-            throw new NullPointerException();
-        XmlSupport.save(this, os, comment, encoding);
+        XmlSupport.save(this, Objects.requireNonNull(os), comment,
+                        Objects.requireNonNull(encoding));
     }
 
     /**
--- a/src/share/classes/java/util/ServiceLoader.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/util/ServiceLoader.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -214,7 +214,7 @@
 
     private ServiceLoader(Class<S> svc, ClassLoader cl) {
         service = Objects.requireNonNull(svc, "Service interface cannot be null");
-        loader = cl;
+        loader = (cl == null) ? ClassLoader.getSystemClassLoader() : cl;
         reload();
     }
 
--- a/src/share/classes/java/util/TimeZone.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/util/TimeZone.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -719,15 +719,16 @@
      * Returns the default TimeZone in an AppContext if any AppContext
      * has ever used. null is returned if any AppContext hasn't been
      * used or if the AppContext doesn't have the default TimeZone.
+     *
+     * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
+     * been loaded. If so, it implies that AWTSecurityManager is not our
+     * SecurityManager and we can use a local static variable.
+     * This works around a build time issue.
      */
-    private synchronized static TimeZone getDefaultInAppContext() {
+    private static TimeZone getDefaultInAppContext() {
         // JavaAWTAccess provides access implementation-private methods without using reflection.
         JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess();
 
-        // Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
-        // been loaded. If so, it implies that AWTSecurityManager is not our
-        // SecurityManager and we can use a local static variable.
-        // This works around a build time issue.
         if (javaAWTAccess == null) {
             return mainAppContextDefault;
         } else {
@@ -749,15 +750,16 @@
      * tz. null is handled special: do nothing if any AppContext
      * hasn't been used, remove the default TimeZone in the
      * AppContext otherwise.
+     *
+     * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
+     * been loaded. If so, it implies that AWTSecurityManager is not our
+     * SecurityManager and we can use a local static variable.
+     * This works around a build time issue.
      */
-    private synchronized static void setDefaultInAppContext(TimeZone tz) {
+    private static void setDefaultInAppContext(TimeZone tz) {
         // JavaAWTAccess provides access implementation-private methods without using reflection.
         JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess();
 
-        // Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't
-        // been loaded. If so, it implies that AWTSecurityManager is not our
-        // SecurityManager and we can use a local static variable.
-        // This works around a build time issue.
         if (javaAWTAccess == null) {
             mainAppContextDefault = tz;
         } else {
@@ -822,7 +824,7 @@
     private static final int    GMT_ID_LENGTH = 3;
 
     // a static TimeZone we can reference if no AppContext is in place
-    private static TimeZone mainAppContextDefault;
+    private static volatile TimeZone mainAppContextDefault;
 
     /**
      * Parses a custom time zone identifier and returns a corresponding zone.
--- a/src/share/classes/java/util/jar/Pack200.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/util/jar/Pack200.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003,2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -456,12 +456,12 @@
          * The unpacker's progress as a percentage, as periodically
          * updated by the unpacker.
          * Values of 0 - 100 are normal, and -1 indicates a stall.
-         * Observe this property with a {@link PropertyChangeListener}.
+         * Progress can be monitored by polling the value of this
+         * property.
          * <p>
          * At a minimum, the unpacker must set progress to 0
          * at the beginning of a packing operation, and to 100
          * at the end.
-         * @see  #addPropertyChangeListener
          */
         String PROGRESS                 = "pack.progress";
 
@@ -577,7 +577,15 @@
          * @see #properties
          * @see #PROGRESS
          * @param listener  An object to be invoked when a property is changed.
+         * @deprecated The dependency on {@code PropertyChangeListener} creates
+         *             a significant impediment to future modularization of the
+         *             Java platform. This method will be removed in a future
+         *             release.
+         *             Applications that need to monitor progress of the packer
+         *             can poll the value of the {@link #PROGRESS PROGRESS}
+         *             property instead.
          */
+        @Deprecated
         void addPropertyChangeListener(PropertyChangeListener listener) ;
 
         /**
@@ -586,7 +594,12 @@
          *
          * @see #addPropertyChangeListener
          * @param listener  The PropertyChange listener to be removed.
+         * @deprecated The dependency on {@code PropertyChangeListener} creates
+         *             a significant impediment to future modularization of the
+         *             Java platform. This method will be removed in a future
+         *             release.
          */
+        @Deprecated
         void removePropertyChangeListener(PropertyChangeListener listener);
 
     }
@@ -640,12 +653,12 @@
          * The unpacker's progress as a percentage, as periodically
          * updated by the unpacker.
          * Values of 0 - 100 are normal, and -1 indicates a stall.
-         * Observe this property with a {@link PropertyChangeListener}.
+         * Progress can be monitored by polling the value of this
+         * property.
          * <p>
          * At a minimum, the unpacker must set progress to 0
          * at the beginning of a packing operation, and to 100
          * at the end.
-         * @see #addPropertyChangeListener
          */
         String PROGRESS         = "unpack.progress";
 
@@ -708,7 +721,15 @@
          * @see #properties
          * @see #PROGRESS
          * @param listener  An object to be invoked when a property is changed.
+         * @deprecated The dependency on {@code PropertyChangeListener} creates
+         *             a significant impediment to future modularization of the
+         *             Java platform. This method will be removed in a future
+         *             release.
+         *             Applications that need to monitor progress of the
+         *             unpacker can poll the value of the {@link #PROGRESS
+         *             PROGRESS} property instead.
          */
+        @Deprecated
         void addPropertyChangeListener(PropertyChangeListener listener) ;
 
         /**
@@ -717,7 +738,12 @@
          *
          * @see #addPropertyChangeListener
          * @param listener  The PropertyChange listener to be removed.
+         * @deprecated The dependency on {@code PropertyChangeListener} creates
+         *             a significant impediment to future modularization of the
+         *             Java platform. This method will be removed in a future
+         *             release.
          */
+        @Deprecated
         void removePropertyChangeListener(PropertyChangeListener listener);
     }
 
--- a/src/share/classes/java/util/logging/LogManager.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/java/util/logging/LogManager.java	Tue Oct 23 09:41:52 2012 -0700
@@ -311,7 +311,14 @@
      * @exception  SecurityException  if a security manager exists and if
      *             the caller does not have LoggingPermission("control").
      * @exception NullPointerException if the PropertyChangeListener is null.
+     * @deprecated The dependency on {@code PropertyChangeListener} creates a
+     *             significant impediment to future modularization of the Java
+     *             platform. This method will be removed in a future release.
+     *             The global {@code LogManager} can detect changes to the
+     *             logging configuration by overridding the {@link
+     *             #readConfiguration readConfiguration} method.
      */
+    @Deprecated
     public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException {
         PropertyChangeListener listener = Objects.requireNonNull(l);
         checkAccess();
@@ -336,7 +343,14 @@
      * @param l  event listener (can be null)
      * @exception  SecurityException  if a security manager exists and if
      *             the caller does not have LoggingPermission("control").
+     * @deprecated The dependency on {@code PropertyChangeListener} creates a
+     *             significant impediment to future modularization of the Java
+     *             platform. This method will be removed in a future release.
+     *             The global {@code LogManager} can detect changes to the
+     *             logging configuration by overridding the {@link
+     *             #readConfiguration readConfiguration} method.
      */
+    @Deprecated
     public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException {
         checkAccess();
         if (l != null) {
--- a/src/share/classes/javax/management/timer/Timer.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/management/timer/Timer.java	Tue Oct 23 09:41:52 2012 -0700
@@ -28,8 +28,7 @@
 import static com.sun.jmx.defaults.JmxProperties.TIMER_LOGGER;
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
@@ -128,8 +127,8 @@
      * Table containing all the timer notifications of this timer,
      * with the associated date, period and number of occurrences.
      */
-    private Map<Integer,Object[]> timerTable =
-        new Hashtable<Integer,Object[]>();
+    final private Map<Integer,Object[]> timerTable =
+        new HashMap<>();
 
     /**
      * Past notifications sending on/off flag value.
@@ -163,7 +162,7 @@
      * The notification counter ID.
      * Used to keep the max key value inserted into the timer table.
      */
-    private int counterID = 0;
+    volatile private int counterID = 0;
 
     private java.util.Timer timer;
 
@@ -776,7 +775,7 @@
      *
      * @return The number of timer notifications.
      */
-    public int getNbNotifications() {
+    public synchronized int getNbNotifications() {
         return timerTable.size();
     }
 
@@ -824,7 +823,7 @@
      * @return The timer notification type or null if the identifier is not mapped to any
      * timer notification registered for this timer MBean.
      */
-    public String getNotificationType(Integer id) {
+    public synchronized String getNotificationType(Integer id) {
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
@@ -841,7 +840,7 @@
      * @return The timer notification detailed message or null if the identifier is not mapped to any
      * timer notification registered for this timer MBean.
      */
-    public String getNotificationMessage(Integer id) {
+    public synchronized String getNotificationMessage(Integer id) {
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
@@ -862,7 +861,7 @@
     //public Serializable getNotificationUserData(Integer id) {
     // end of NPCTE fix for bugId 4464388
 
-    public Object getNotificationUserData(Integer id) {
+    public synchronized Object getNotificationUserData(Integer id) {
         Object[] obj = timerTable.get(id);
         if (obj != null) {
             return ( ((TimerNotification)obj[TIMER_NOTIF_INDEX]).getUserData() );
@@ -878,7 +877,7 @@
      * @return A copy of the date or null if the identifier is not mapped to any
      * timer notification registered for this timer MBean.
      */
-    public Date getDate(Integer id) {
+    public synchronized Date getDate(Integer id) {
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
@@ -896,7 +895,7 @@
      * @return A copy of the period or null if the identifier is not mapped to any
      * timer notification registered for this timer MBean.
      */
-    public Long getPeriod(Integer id) {
+    public synchronized Long getPeriod(Integer id) {
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
@@ -913,7 +912,7 @@
      * @return A copy of the remaining number of occurrences or null if the identifier is not mapped to any
      * timer notification registered for this timer MBean.
      */
-    public Long getNbOccurences(Integer id) {
+    public synchronized Long getNbOccurences(Integer id) {
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
@@ -931,7 +930,7 @@
      * @return A copy of the flag indicating whether a periodic notification is
      *         executed at <i>fixed-delay</i> or at <i>fixed-rate</i>.
      */
-    public Boolean getFixedRate(Integer id) {
+    public synchronized Boolean getFixedRate(Integer id) {
 
       Object[] obj = timerTable.get(id);
       if (obj != null) {
@@ -982,7 +981,7 @@
      *
      * @return <CODE>true</CODE> if the list of timer notifications is empty, <CODE>false</CODE> otherwise.
      */
-    public boolean isEmpty() {
+    public synchronized boolean isEmpty() {
         return (timerTable.isEmpty());
     }
 
@@ -1184,11 +1183,13 @@
         //
         TimerAlarmClock alarmClock = (TimerAlarmClock)notification.getSource();
 
-        for (Object[] obj : timerTable.values()) {
-            if (obj[ALARM_CLOCK_INDEX] == alarmClock) {
-                timerNotification = (TimerNotification)obj[TIMER_NOTIF_INDEX];
-                timerDate = (Date)obj[TIMER_DATE_INDEX];
-                break;
+        synchronized(Timer.this) {
+            for (Object[] obj : timerTable.values()) {
+                if (obj[ALARM_CLOCK_INDEX] == alarmClock) {
+                    timerNotification = (TimerNotification)obj[TIMER_NOTIF_INDEX];
+                    timerDate = (Date)obj[TIMER_DATE_INDEX];
+                    break;
+                }
             }
         }
 
--- a/src/share/classes/javax/net/ssl/ExtendedSSLSession.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/ExtendedSSLSession.java	Tue Oct 23 09:41:52 2012 -0700
@@ -25,6 +25,8 @@
 
 package javax.net.ssl;
 
+import java.util.List;
+
 /**
  * Extends the <code>SSLSession</code> interface to support additional
  * session attributes.
@@ -83,4 +85,34 @@
      * @see X509ExtendedKeyManager
      */
     public abstract String[] getPeerSupportedSignatureAlgorithms();
+
+    /**
+     * Obtains a {@link List} containing all {@link SNIServerName}s
+     * of the requested Server Name Indication (SNI) extension.
+     * <P>
+     * In server mode, unless the return {@link List} is empty,
+     * the server should use the requested server names to guide its
+     * selection of an appropriate authentication certificate, and/or
+     * other aspects of security policy.
+     * <P>
+     * In client mode, unless the return {@link List} is empty,
+     * the client should use the requested server names to guide its
+     * endpoint identification of the peer's identity, and/or
+     * other aspects of security policy.
+     *
+     * @return a non-null immutable list of {@link SNIServerName}s of the
+     *         requested server name indications. The returned list may be
+     *         empty if no server name indications were requested.
+     * @throws UnsupportedOperationException if the underlying provider
+     *         does not implement the operation
+     *
+     * @see SNIServerName
+     * @see X509ExtendedTrustManager
+     * @see X509ExtendedKeyManager
+     *
+     * @since 1.8
+     */
+    public List<SNIServerName> getRequestedServerNames() {
+        throw new UnsupportedOperationException();
+    }
 }
--- a/src/share/classes/javax/net/ssl/HandshakeCompletedEvent.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/HandshakeCompletedEvent.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +186,7 @@
             // if the provider does not support it, fallback to peer certs.
             // return the X500Principal of the end-entity cert.
             Certificate[] certs = getPeerCertificates();
-            principal = (X500Principal)
-                ((X509Certificate)certs[0]).getSubjectX500Principal();
+            principal = ((X509Certificate)certs[0]).getSubjectX500Principal();
         }
         return principal;
     }
@@ -216,7 +215,7 @@
             // return the X500Principal of the end-entity cert.
             Certificate[] certs = getLocalCertificates();
             if (certs != null) {
-                principal = (X500Principal)
+                principal =
                         ((X509Certificate)certs[0]).getSubjectX500Principal();
             }
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/javax/net/ssl/SNIHostName.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,394 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.net.ssl;
+
+import java.net.IDN;
+import java.nio.ByteBuffer;
+import java.nio.charset.CodingErrorAction;
+import java.nio.charset.StandardCharsets;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharacterCodingException;
+import java.util.Locale;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+/**
+ * Instances of this class represent a server name of type
+ * {@link StandardConstants#SNI_HOST_NAME host_name} in a Server Name
+ * Indication (SNI) extension.
+ * <P>
+ * As described in section 3, "Server Name Indication", of
+ * <A HREF="http://www.ietf.org/rfc/rfc6066.txt">TLS Extensions (RFC 6066)</A>,
+ * "HostName" contains the fully qualified DNS hostname of the server, as
+ * understood by the client.  The encoded server name value of a hostname is
+ * represented as a byte string using ASCII encoding without a trailing dot.
+ * This allows the support of Internationalized Domain Names (IDN) through
+ * the use of A-labels (the ASCII-Compatible Encoding (ACE) form of a valid
+ * string of Internationalized Domain Names for Applications (IDNA)) defined
+ * in <A HREF="http://www.ietf.org/rfc/rfc5890.txt">RFC 5890</A>.
+ * <P>
+ * Note that {@code SNIHostName} objects are immutable.
+ *
+ * @see SNIServerName
+ * @see StandardConstants#SNI_HOST_NAME
+ *
+ * @since 1.8
+ */
+public final class SNIHostName extends SNIServerName {
+
+    // the decoded string value of the server name
+    private final String hostname;
+
+    /**
+     * Creates an {@code SNIHostName} using the specified hostname.
+     * <P>
+     * Note that per <A HREF="http://www.ietf.org/rfc/rfc6066.txt">RFC 6066</A>,
+     * the encoded server name value of a hostname is
+     * {@link StandardCharsets#US_ASCII}-compliant.  In this method,
+     * {@code hostname} can be a user-friendly Internationalized Domain Name
+     * (IDN).  {@link IDN#toASCII(String, int)} is used to enforce the
+     * restrictions on ASCII characters in hostnames (see
+     * <A HREF="http://www.ietf.org/rfc/rfc3490.txt">RFC 3490</A>,
+     * <A HREF="http://www.ietf.org/rfc/rfc1122.txt">RFC 1122</A>,
+     * <A HREF="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</A>) and
+     * translate the {@code hostname} into ASCII Compatible Encoding (ACE), as:
+     * <pre>
+     *     IDN.toASCII(hostname, IDN.USE_STD3_ASCII_RULES);
+     * </pre>
+     * <P>
+     * The {@code hostname} argument is illegal if it:
+     * <ul>
+     * <li> {@code hostname} is empty,</li>
+     * <li> {@code hostname} ends with a trailing dot,</li>
+     * <li> {@code hostname} is not a valid Internationalized
+     *      Domain Name (IDN) compliant with the RFC 3490 specification.</li>
+     * </ul>
+     * @param  hostname
+     *         the hostname of this server name
+     *
+     * @throws NullPointerException if {@code hostname} is {@code null}
+     * @throws IllegalArgumentException if {@code hostname} is illegal
+     */
+    public SNIHostName(String hostname) {
+        // IllegalArgumentException will be thrown if {@code hostname} is
+        // not a valid IDN.
+        super(StandardConstants.SNI_HOST_NAME,
+                (hostname = IDN.toASCII(
+                    Objects.requireNonNull(hostname,
+                        "Server name value of host_name cannot be null"),
+                    IDN.USE_STD3_ASCII_RULES))
+                .getBytes(StandardCharsets.US_ASCII));
+
+        this.hostname = hostname;
+
+        // check the validity of the string hostname
+        checkHostName();
+    }
+
+    /**
+     * Creates an {@code SNIHostName} using the specified encoded value.
+     * <P>
+     * This method is normally used to parse the encoded name value in a
+     * requested SNI extension.
+     * <P>
+     * Per <A HREF="http://www.ietf.org/rfc/rfc6066.txt">RFC 6066</A>,
+     * the encoded name value of a hostname is
+     * {@link StandardCharsets#US_ASCII}-compliant.  However, in the previous
+     * version of the SNI extension (
+     * <A HREF="http://www.ietf.org/rfc/rfc4366.txt">RFC 4366</A>),
+     * the encoded hostname is represented as a byte string using UTF-8
+     * encoding.  For the purpose of version tolerance, this method allows
+     * that the charset of {@code encoded} argument can be
+     * {@link StandardCharsets#UTF_8}, as well as
+     * {@link StandardCharsets#US_ASCII}.  {@link IDN#toASCII(String)} is used
+     * to translate the {@code encoded} argument into ASCII Compatible
+     * Encoding (ACE) hostname.
+     * <P>
+     * It is strongly recommended that this constructor is only used to parse
+     * the encoded name value in a requested SNI extension.  Otherwise, to
+     * comply with <A HREF="http://www.ietf.org/rfc/rfc6066.txt">RFC 6066</A>,
+     * please always use {@link StandardCharsets#US_ASCII}-compliant charset
+     * and enforce the restrictions on ASCII characters in hostnames (see
+     * <A HREF="http://www.ietf.org/rfc/rfc3490.txt">RFC 3490</A>,
+     * <A HREF="http://www.ietf.org/rfc/rfc1122.txt">RFC 1122</A>,
+     * <A HREF="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</A>)
+     * for {@code encoded} argument, or use {@link SNIHostName(String)} instead.
+     * <P>
+     * The {@code encoded} argument is illegal if it:
+     * <ul>
+     * <li> {@code encoded} is empty,</li>
+     * <li> {@code encoded} ends with a trailing dot,</li>
+     * <li> {@code encoded} is not encoded in
+     *      {@link StandardCharsets#US_ASCII} or
+     *      {@link StandardCharsets#UTF_8}-compliant charset,</li>
+     * <li> {@code encoded} is not a valid Internationalized
+     *      Domain Name (IDN) compliant with the RFC 3490 specification.</li>
+     * </ul>
+     *
+     * <P>
+     * Note that the {@code encoded} byte array is cloned
+     * to protect against subsequent modification.
+     *
+     * @param  encoded
+     *         the encoded hostname of this server name
+     *
+     * @throws NullPointerException if {@code encoded} is {@code null}
+     * @throws IllegalArgumentException if {@code encoded} is illegal
+     */
+    public SNIHostName(byte[] encoded) {
+        // NullPointerException will be thrown if {@code encoded} is null
+        super(StandardConstants.SNI_HOST_NAME, encoded);
+
+        // Compliance: RFC 4366 requires that the hostname is represented
+        // as a byte string using UTF_8 encoding [UTF8]
+        try {
+            // Please don't use {@link String} constructors because they
+            // do not report coding errors.
+            CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder()
+                    .onMalformedInput(CodingErrorAction.REPORT)
+                    .onUnmappableCharacter(CodingErrorAction.REPORT);
+
+            this.hostname = IDN.toASCII(
+                    decoder.decode(ByteBuffer.wrap(encoded)).toString());
+        } catch (RuntimeException | CharacterCodingException e) {
+            throw new IllegalArgumentException(
+                        "The encoded server name value is invalid", e);
+        }
+
+        // check the validity of the string hostname
+        checkHostName();
+    }
+
+    /**
+     * Returns the {@link StandardCharsets#US_ASCII}-compliant hostname of
+     * this {@code SNIHostName} object.
+     * <P>
+     * Note that, per
+     * <A HREF="http://www.ietf.org/rfc/rfc6066.txt">RFC 6066</A>, the
+     * returned hostname may be an internationalized domain name that
+     * contains A-labels. See
+     * <A HREF="http://www.ietf.org/rfc/rfc5890.txt">RFC 5890</A>
+     * for more information about the detailed A-label specification.
+     *
+     * @return the {@link StandardCharsets#US_ASCII}-compliant hostname
+     *         of this {@code SNIHostName} object
+     */
+    public String getAsciiName() {
+        return hostname;
+    }
+
+    /**
+     * Compares this server name to the specified object.
+     * <P>
+     * Per <A HREF="http://www.ietf.org/rfc/rfc6066.txt">RFC 6066</A>, DNS
+     * hostnames are case-insensitive.  Two server hostnames are equal if,
+     * and only if, they have the same name type, and the hostnames are
+     * equal in a case-independent comparison.
+     *
+     * @param  other
+     *         the other server name object to compare with.
+     * @return true if, and only if, the {@code other} is considered
+     *         equal to this instance
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+
+        if (other instanceof SNIHostName) {
+            return hostname.equalsIgnoreCase(((SNIHostName)other).hostname);
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns a hash code value for this {@code SNIHostName}.
+     * <P>
+     * The hash code value is generated using the case-insensitive hostname
+     * of this {@code SNIHostName}.
+     *
+     * @return a hash code value for this {@code SNIHostName}.
+     */
+    @Override
+    public int hashCode() {
+        int result = 17;        // 17/31: prime number to decrease collisions
+        result = 31 * result + hostname.toUpperCase(Locale.ENGLISH).hashCode();
+
+        return result;
+    }
+
+    /**
+     * Returns a string representation of the object, including the DNS
+     * hostname in this {@code SNIHostName} object.
+     * <P>
+     * The exact details of the representation are unspecified and subject
+     * to change, but the following may be regarded as typical:
+     * <pre>
+     *     "type=host_name (0), value={@literal <hostname>}"
+     * </pre>
+     * The "{@literal <hostname>}" is an ASCII representation of the hostname,
+     * which may contains A-labels.  For example, a returned value of an pseudo
+     * hostname may look like:
+     * <pre>
+     *     "type=host_name (0), value=www.example.com"
+     * </pre>
+     * or
+     * <pre>
+     *     "type=host_name (0), value=xn--fsqu00a.xn--0zwm56d"
+     * </pre>
+     * <P>
+     * Please NOTE that the exact details of the representation are unspecified
+     * and subject to change.
+     *
+     * @return a string representation of the object.
+     */
+    @Override
+    public String toString() {
+        return "type=host_name (0), value=" + hostname;
+    }
+
+    /**
+     * Creates an {@link SNIMatcher} object for {@code SNIHostName}s.
+     * <P>
+     * This method can be used by a server to verify the acceptable
+     * {@code SNIHostName}s.  For example,
+     * <pre>
+     *     SNIMatcher matcher =
+     *         SNIHostName.createSNIMatcher("www\\.example\\.com");
+     * </pre>
+     * will accept the hostname "www.example.com".
+     * <pre>
+     *     SNIMatcher matcher =
+     *         SNIHostName.createSNIMatcher("www\\.example\\.(com|org)");
+     * </pre>
+     * will accept hostnames "www.example.com" and "www.example.org".
+     *
+     * @param  regex
+     *         the <a href="{@docRoot}/java/util/regex/Pattern.html#sum">
+     *         regular expression pattern</a>
+     *         representing the hostname(s) to match
+     * @throws NullPointerException if {@code regex} is
+     *         {@code null}
+     * @throws PatternSyntaxException if the regular expression's syntax
+     *         is invalid
+     */
+    public static SNIMatcher createSNIMatcher(String regex) {
+        if (regex == null) {
+            throw new NullPointerException(
+                "The regular expression cannot be null");
+        }
+
+        return new SNIHostNameMatcher(regex);
+    }
+
+    // check the validity of the string hostname
+    private void checkHostName() {
+        if (hostname.isEmpty()) {
+            throw new IllegalArgumentException(
+                "Server name value of host_name cannot be empty");
+        }
+
+        if (hostname.endsWith(".")) {
+            throw new IllegalArgumentException(
+                "Server name value of host_name cannot have the trailing dot");
+        }
+    }
+
+    private final static class SNIHostNameMatcher extends SNIMatcher {
+
+        // the compiled representation of a regular expression.
+        private final Pattern pattern;
+
+        /**
+         * Creates an SNIHostNameMatcher object.
+         *
+         * @param  regex
+         *         the <a href="{@docRoot}/java/util/regex/Pattern.html#sum">
+         *         regular expression pattern</a>
+         *         representing the hostname(s) to match
+         * @throws NullPointerException if {@code regex} is
+         *         {@code null}
+         * @throws PatternSyntaxException if the regular expression's syntax
+         *         is invalid
+         */
+        SNIHostNameMatcher(String regex) {
+            super(StandardConstants.SNI_HOST_NAME);
+            pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
+        }
+
+        /**
+         * Attempts to match the given {@link SNIServerName}.
+         *
+         * @param  serverName
+         *         the {@link SNIServerName} instance on which this matcher
+         *         performs match operations
+         *
+         * @return {@code true} if, and only if, the matcher matches the
+         *         given {@code serverName}
+         *
+         * @throws NullPointerException if {@code serverName} is {@code null}
+         * @throws IllegalArgumentException if {@code serverName} is
+         *         not of {@code StandardConstants#SNI_HOST_NAME} type
+         *
+         * @see SNIServerName
+         */
+        @Override
+        public boolean matches(SNIServerName serverName) {
+            if (serverName == null) {
+                throw new NullPointerException(
+                    "The SNIServerName argument cannot be null");
+            }
+
+            SNIHostName hostname;
+            if (!(serverName instanceof SNIHostName)) {
+                if (serverName.getType() != StandardConstants.SNI_HOST_NAME) {
+                    throw new IllegalArgumentException(
+                        "The server name type is not host_name");
+                }
+
+                try {
+                    hostname = new SNIHostName(serverName.getEncoded());
+                } catch (NullPointerException | IllegalArgumentException e) {
+                    return false;
+                }
+            } else {
+                hostname = (SNIHostName)serverName;
+            }
+
+            // Let's first try the ascii name matching
+            String asciiName = hostname.getAsciiName();
+            if (pattern.matcher(asciiName).matches()) {
+                return true;
+            }
+
+            // May be an internationalized domain name, check the Unicode
+            // representations.
+            return pattern.matcher(IDN.toUnicode(asciiName)).matches();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/javax/net/ssl/SNIMatcher.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.net.ssl;
+
+/**
+ * Instances of this class represent a matcher that performs match
+ * operations on an {@link SNIServerName} instance.
+ * <P>
+ * Servers can use Server Name Indication (SNI) information to decide if
+ * specific {@link SSLSocket} or {@link SSLEngine} instances should accept
+ * a connection.  For example, when multiple "virtual" or "name-based"
+ * servers are hosted on a single underlying network address, the server
+ * application can use SNI information to determine whether this server is
+ * the exact server that the client wants to access.  Instances of this
+ * class can be used by a server to verify the acceptable server names of
+ * a particular type, such as host names.
+ * <P>
+ * {@code SNIMatcher} objects are immutable.  Subclasses should not provide
+ * methods that can change the state of an instance once it has been created.
+ *
+ * @see SNIServerName
+ * @see SNIHostName
+ * @see SSLParameters#getSNIMatchers()
+ * @see SSLParameters#setSNIMatchers(Collection<SNIMatcher>)
+ *
+ * @since 1.8
+ */
+public abstract class SNIMatcher {
+
+    // the type of the server name that this matcher performs on
+    private final int type;
+
+    /**
+     * Creates an {@code SNIMatcher} using the specified server name type.
+     *
+     * @param  type
+     *         the type of the server name that this matcher performs on
+     *
+     * @throws IllegalArgumentException if {@code type} is not in the range
+     *         of 0 to 255, inclusive.
+     */
+    protected SNIMatcher(int type) {
+        if (type < 0) {
+            throw new IllegalArgumentException(
+                "Server name type cannot be less than zero");
+        } else if (type > 255) {
+            throw new IllegalArgumentException(
+                "Server name type cannot be greater than 255");
+        }
+
+        this.type = type;
+    }
+
+    /**
+     * Returns the server name type of this {@code SNIMatcher} object.
+     *
+     * @return the server name type of this {@code SNIMatcher} object.
+     *
+     * @see SNIServerName
+     */
+    public final int getType() {
+        return type;
+    }
+
+    /**
+     * Attempts to match the given {@link SNIServerName}.
+     *
+     * @param  serverName
+     *         the {@link SNIServerName} instance on which this matcher
+     *         performs match operations
+     *
+     * @return {@code true} if, and only if, the matcher matches the
+     *         given {@code serverName}
+     *
+     * @throws NullPointerException if {@code serverName} is {@code null}
+     * @throws IllegalArgumentException if {@code serverName} is
+     *         not of the given server name type of this matcher
+     *
+     * @see SNIServerName
+     */
+    public abstract boolean matches(SNIServerName serverName);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/javax/net/ssl/SNIServerName.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.net.ssl;
+
+import java.util.Arrays;
+
+/**
+ * Instances of this class represent a server name in a Server Name
+ * Indication (SNI) extension.
+ * <P>
+ * The SNI extension is a feature that extends the SSL/TLS protocols to
+ * indicate what server name the client is attempting to connect to during
+ * handshaking.  See section 3, "Server Name Indication", of <A
+ * HREF="http://www.ietf.org/rfc/rfc6066.txt">TLS Extensions (RFC 6066)</A>.
+ * <P>
+ * {@code SNIServerName} objects are immutable.  Subclasses should not provide
+ * methods that can change the state of an instance once it has been created.
+ *
+ * @see SSLParameters#getServerNames()
+ * @see SSLParameters#setServerNames(List<SNIServerName>)
+ *
+ * @since 1.8
+ */
+public abstract class SNIServerName {
+
+    // the type of the server name
+    private final int type;
+
+    // the encoded value of the server name
+    private final byte[] encoded;
+
+    // the hex digitals
+    private static final char[] HEXES = "0123456789ABCDEF".toCharArray();
+
+    /**
+     * Creates an {@code SNIServerName} using the specified name type and
+     * encoded value.
+     * <P>
+     * Note that the {@code encoded} byte array is cloned to protect against
+     * subsequent modification.
+     *
+     * @param  type
+     *         the type of the server name
+     * @param  encoded
+     *         the encoded value of the server name
+     *
+     * @throws IllegalArgumentException if {@code type} is not in the range
+     *         of 0 to 255, inclusive.
+     * @throws NullPointerException if {@code encoded} is null
+     */
+    protected SNIServerName(int type, byte[] encoded) {
+        if (type < 0) {
+            throw new IllegalArgumentException(
+                "Server name type cannot be less than zero");
+        } else if (type > 255) {
+            throw new IllegalArgumentException(
+                "Server name type cannot be greater than 255");
+        }
+        this.type = type;
+
+        if (encoded == null) {
+            throw new NullPointerException(
+                "Server name encoded value cannot be null");
+        }
+        this.encoded = encoded.clone();
+    }
+
+
+    /**
+     * Returns the name type of this server name.
+     *
+     * @return the name type of this server name
+     */
+    public final int getType() {
+        return type;
+    }
+
+    /**
+     * Returns a copy of the encoded server name value of this server name.
+     *
+     * @return a copy of the encoded server name value of this server name
+     */
+    public final byte[] getEncoded() {
+        return encoded.clone();
+    }
+
+    /**
+     * Indicates whether some other object is "equal to" this server name.
+     *
+     * @return true if, and only if, {@code other} is of the same class
+     *         of this object, and has the same name type and
+     *         encoded value as this server name.
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+
+        if (this.getClass() != other.getClass()) {
+            return false;
+        }
+
+        SNIServerName that = (SNIServerName)other;
+        return (this.type == that.type) &&
+                    Arrays.equals(this.encoded, that.encoded);
+    }
+
+    /**
+     * Returns a hash code value for this server name.
+     * <P>
+     * The hash code value is generated using the name type and encoded
+     * value of this server name.
+     *
+     * @return a hash code value for this server name.
+     */
+    @Override
+    public int hashCode() {
+        int result = 17;    // 17/31: prime number to decrease collisions
+        result = 31 * result + type;
+        result = 31 * result + Arrays.hashCode(encoded);
+
+        return result;
+    }
+
+    /**
+     * Returns a string representation of this server name, including the server
+     * name type and the encoded server name value in this
+     * {@code SNIServerName} object.
+     * <P>
+     * The exact details of the representation are unspecified and subject
+     * to change, but the following may be regarded as typical:
+     * <pre>
+     *     "type={@literal <name type>}, value={@literal <name value>}"
+     * </pre>
+     * <P>
+     * In this class, the format of "{@literal <name type>}" is
+     * "[LITERAL] (INTEGER)", where the optional "LITERAL" is the literal
+     * name, and INTEGER is the integer value of the name type.  The format
+     * of "{@literal <name value>}" is "XX:...:XX", where "XX" is the
+     * hexadecimal digit representation of a byte value. For example, a
+     * returned value of an pseudo server name may look like:
+     * <pre>
+     *     "type=(31), value=77:77:77:2E:65:78:61:6D:70:6C:65:2E:63:6E"
+     * </pre>
+     * or
+     * <pre>
+     *     "type=host_name (0), value=77:77:77:2E:65:78:61:6D:70:6C:65:2E:63:6E"
+     * </pre>
+     *
+     * <P>
+     * Please NOTE that the exact details of the representation are unspecified
+     * and subject to change, and subclasses may override the method with
+     * their own formats.
+     *
+     * @return a string representation of this server name
+     */
+    @Override
+    public String toString() {
+        if (type == StandardConstants.SNI_HOST_NAME) {
+            return "type=host_name (0), value=" + toHexString(encoded);
+        } else {
+            return "type=(" + type + "), value=" + toHexString(encoded);
+        }
+    }
+
+    // convert byte array to hex string
+    private static String toHexString(byte[] bytes) {
+        if (bytes.length == 0) {
+            return "(empty)";
+        }
+
+        StringBuilder sb = new StringBuilder(bytes.length * 3 - 1);
+        boolean isInitial = true;
+        for (byte b : bytes) {
+            if (isInitial) {
+                isInitial = false;
+            } else {
+                sb.append(':');
+            }
+
+            int k = b & 0xFF;
+            sb.append(HEXES[k >>> 4]);
+            sb.append(HEXES[k & 0xF]);
+        }
+
+        return sb.toString();
+    }
+}
+
--- a/src/share/classes/javax/net/ssl/SSLEngine.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/SSLEngine.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1214,15 +1214,19 @@
      *
      * <p>This means:
      * <ul>
-     * <li>if <code>params.getCipherSuites()</code> is non-null,
-     *   <code>setEnabledCipherSuites()</code> is called with that value
-     * <li>if <code>params.getProtocols()</code> is non-null,
-     *   <code>setEnabledProtocols()</code> is called with that value
-     * <li>if <code>params.getNeedClientAuth()</code> or
-     *   <code>params.getWantClientAuth()</code> return <code>true</code>,
-     *   <code>setNeedClientAuth(true)</code> and
-     *   <code>setWantClientAuth(true)</code> are called, respectively;
-     *   otherwise <code>setWantClientAuth(false)</code> is called.
+     * <li>If {@code params.getCipherSuites()} is non-null,
+     *   {@code setEnabledCipherSuites()} is called with that value.</li>
+     * <li>If {@code params.getProtocols()} is non-null,
+     *   {@code setEnabledProtocols()} is called with that value.</li>
+     * <li>If {@code params.getNeedClientAuth()} or
+     *   {@code params.getWantClientAuth()} return {@code true},
+     *   {@code setNeedClientAuth(true)} and
+     *   {@code setWantClientAuth(true)} are called, respectively;
+     *   otherwise {@code setWantClientAuth(false)} is called.</li>
+     * <li>If {@code params.getServerNames()} is non-null, the engine will
+     *   configure its server names with that value.</li>
+     * <li>If {@code params.getSNIMatchers()} is non-null, the engine will
+     *   configure its SNI matchers with that value.</li>
      * </ul>
      *
      * @param params the parameters
--- a/src/share/classes/javax/net/ssl/SSLParameters.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/SSLParameters.java	Tue Oct 23 09:41:52 2012 -0700
@@ -26,13 +26,23 @@
 package javax.net.ssl;
 
 import java.security.AlgorithmConstraints;
+import java.util.Map;
+import java.util.List;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.regex.Pattern;
 
 /**
  * Encapsulates parameters for an SSL/TLS connection. The parameters
  * are the list of ciphersuites to be accepted in an SSL/TLS handshake,
  * the list of protocols to be allowed, the endpoint identification
- * algorithm during SSL/TLS handshaking, the algorithm constraints and
- * whether SSL/TLS servers should request or require client authentication.
+ * algorithm during SSL/TLS handshaking, the Server Name Indication (SNI),
+ * the algorithm constraints and whether SSL/TLS servers should request
+ * or require client authentication.
  * <p>
  * SSLParameters can be created via the constructors in this class.
  * Objects can also be obtained using the <code>getSSLParameters()</code>
@@ -47,7 +57,7 @@
  * SSLParameters can be applied to a connection via the methods
  * {@link SSLSocket#setSSLParameters SSLSocket.setSSLParameters()} and
  * {@link SSLServerSocket#setSSLParameters SSLServerSocket.setSSLParameters()}
- * and {@link SSLEngine#setSSLParameters SSLEngine.getSSLParameters()}.
+ * and {@link SSLEngine#setSSLParameters SSLEngine.setSSLParameters()}.
  *
  * @see SSLSocket
  * @see SSLEngine
@@ -63,11 +73,15 @@
     private boolean needClientAuth;
     private String identificationAlgorithm;
     private AlgorithmConstraints algorithmConstraints;
+    private Map<Integer, SNIServerName> sniNames = null;
+    private Map<Integer, SNIMatcher> sniMatchers = null;
 
     /**
      * Constructs SSLParameters.
      * <p>
-     * The cipherSuites and protocols values are set to <code>null</code>,
+     * The values of cipherSuites, protocols, cryptographic algorithm
+     * constraints, endpoint identification algorithm, server names and
+     * server name matchers are set to <code>null</code>,
      * wantClientAuth and needClientAuth are set to <code>false</code>.
      */
     public SSLParameters() {
@@ -254,4 +268,173 @@
         this.identificationAlgorithm = algorithm;
     }
 
+    /**
+     * Sets the desired {@link SNIServerName}s of the Server Name
+     * Indication (SNI) parameter.
+     * <P>
+     * This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s
+     * operating in client mode.
+     * <P>
+     * Note that the {@code serverNames} list is cloned
+     * to protect against subsequent modification.
+     *
+     * @param  serverNames
+     *         the list of desired {@link SNIServerName}s (or null)
+     *
+     * @throws NullPointerException if the {@code serverNames}
+     *         contains {@code null} element
+     * @throws IllegalArgumentException if the {@code serverNames}
+     *         contains more than one name of the same name type
+     *
+     * @see SNIServerName
+     * @see #getServerNames()
+     *
+     * @since 1.8
+     */
+    public final void setServerNames(List<SNIServerName> serverNames) {
+        if (serverNames != null) {
+            if (!serverNames.isEmpty()) {
+                sniNames = new LinkedHashMap<>(serverNames.size());
+                for (SNIServerName serverName : serverNames) {
+                    if (sniNames.put(serverName.getType(),
+                                                serverName) != null) {
+                        throw new IllegalArgumentException(
+                                    "Duplicated server name of type " +
+                                    serverName.getType());
+                    }
+                }
+            } else {
+                sniNames = Collections.<Integer, SNIServerName>emptyMap();
+            }
+        } else {
+            sniNames = null;
+        }
+    }
+
+    /**
+     * Returns a {@link List} containing all {@link SNIServerName}s of the
+     * Server Name Indication (SNI) parameter, or null if none has been set.
+     * <P>
+     * This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s
+     * operating in client mode.
+     * <P>
+     * For SSL/TLS connections, the underlying SSL/TLS provider
+     * may specify a default value for a certain server name type.  In
+     * client mode, it is recommended that, by default, providers should
+     * include the server name indication whenever the server can be located
+     * by a supported server name type.
+     * <P>
+     * It is recommended that providers initialize default Server Name
+     * Indications when creating {@code SSLSocket}/{@code SSLEngine}s.
+     * In the following examples, the server name could be represented by an
+     * instance of {@link SNIHostName} which has been initialized with the
+     * hostname "www.example.com" and type
+     * {@link StandardConstants#SNI_HOST_NAME}.
+     *
+     * <pre>
+     *     Socket socket =
+     *         sslSocketFactory.createSocket("www.example.com", 443);
+     * </pre>
+     * or
+     * <pre>
+     *     SSLEngine engine =
+     *         sslContext.createSSLEngine("www.example.com", 443);
+     * </pre>
+     * <P>
+     *
+     * @return null or an immutable list of non-null {@link SNIServerName}s
+     *
+     * @see List
+     * @see #setServerNames(List<SNIServerName>)
+     *
+     * @since 1.8
+     */
+    public final List<SNIServerName> getServerNames() {
+        if (sniNames != null) {
+            if (!sniNames.isEmpty()) {
+                return Collections.<SNIServerName>unmodifiableList(
+                                        new ArrayList<>(sniNames.values()));
+            } else {
+                return Collections.<SNIServerName>emptyList();
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Sets the {@link SNIMatcher}s of the Server Name Indication (SNI)
+     * parameter.
+     * <P>
+     * This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s
+     * operating in server mode.
+     * <P>
+     * Note that the {@code matchers} collection is cloned to protect
+     * against subsequent modification.
+     *
+     * @param  matchers
+     *         the collection of {@link SNIMatcher}s (or null)
+     *
+     * @throws NullPointerException if the {@code matchers}
+     *         contains {@code null} element
+     * @throws IllegalArgumentException if the {@code matchers}
+     *         contains more than one name of the same name type
+     *
+     * @see Collection
+     * @see SNIMatcher
+     * @see #getSNIMatchers()
+     *
+     * @since 1.8
+     */
+    public final void setSNIMatchers(Collection<SNIMatcher> matchers) {
+        if (matchers != null) {
+            if (!matchers.isEmpty()) {
+                sniMatchers = new HashMap<>(matchers.size());
+                for (SNIMatcher matcher : matchers) {
+                    if (sniMatchers.put(matcher.getType(),
+                                                matcher) != null) {
+                        throw new IllegalArgumentException(
+                                    "Duplicated server name of type " +
+                                    matcher.getType());
+                    }
+                }
+            } else {
+                sniMatchers = Collections.<Integer, SNIMatcher>emptyMap();
+            }
+        } else {
+            sniMatchers = null;
+        }
+    }
+
+    /**
+     * Returns a {@link Collection} containing all {@link SNIMatcher}s of the
+     * Server Name Indication (SNI) parameter, or null if none has been set.
+     * <P>
+     * This method is only useful to {@link SSLSocket}s or {@link SSLEngine}s
+     * operating in server mode.
+     * <P>
+     * For better interoperability, providers generally will not define
+     * default matchers so that by default servers will ignore the SNI
+     * extension and continue the handshake.
+     *
+     * @return null or an immutable collection of non-null {@link SNIMatcher}s
+     *
+     * @see SNIMatcher
+     * @see #setSNIMatchers(Collection<SNIMatcher>)
+     *
+     * @since 1.8
+     */
+    public final Collection<SNIMatcher> getSNIMatchers() {
+        if (sniMatchers != null) {
+            if (!sniMatchers.isEmpty()) {
+                return Collections.<SNIMatcher>unmodifiableList(
+                                        new ArrayList<>(sniMatchers.values()));
+            } else {
+                return Collections.<SNIMatcher>emptyList();
+            }
+        }
+
+        return null;
+    }
 }
+
--- a/src/share/classes/javax/net/ssl/SSLServerSocket.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/SSLServerSocket.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -484,15 +484,19 @@
      *
      * <p>This means:
      * <ul>
-     * <li>if <code>params.getCipherSuites()</code> is non-null,
-     *   <code>setEnabledCipherSuites()</code> is called with that value
-     * <li>if <code>params.getProtocols()</code> is non-null,
-     *   <code>setEnabledProtocols()</code> is called with that value
-     * <li>if <code>params.getNeedClientAuth()</code> or
-     *   <code>params.getWantClientAuth()</code> return <code>true</code>,
-     *   <code>setNeedClientAuth(true)</code> and
-     *   <code>setWantClientAuth(true)</code> are called, respectively;
-     *   otherwise <code>setWantClientAuth(false)</code> is called.
+     * <li>If {@code params.getCipherSuites()} is non-null,
+     *   {@code setEnabledCipherSuites()} is called with that value.</li>
+     * <li>If {@code params.getProtocols()} is non-null,
+     *   {@code setEnabledProtocols()} is called with that value.</li>
+     * <li>If {@code params.getNeedClientAuth()} or
+     *   {@code params.getWantClientAuth()} return {@code true},
+     *   {@code setNeedClientAuth(true)} and
+     *   {@code setWantClientAuth(true)} are called, respectively;
+     *   otherwise {@code setWantClientAuth(false)} is called.</li>
+     * <li>If {@code params.getServerNames()} is non-null, the socket will
+     *   configure its server names with that value.</li>
+     * <li>If {@code params.getSNIMatchers()} is non-null, the socket will
+     *   configure its SNI matchers with that value.</li>
      * </ul>
      *
      * @param params the parameters
--- a/src/share/classes/javax/net/ssl/SSLSocket.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/SSLSocket.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -626,15 +626,19 @@
      *
      * <p>This means:
      * <ul>
-     * <li>if <code>params.getCipherSuites()</code> is non-null,
-     *   <code>setEnabledCipherSuites()</code> is called with that value
-     * <li>if <code>params.getProtocols()</code> is non-null,
-     *   <code>setEnabledProtocols()</code> is called with that value
-     * <li>if <code>params.getNeedClientAuth()</code> or
-     *   <code>params.getWantClientAuth()</code> return <code>true</code>,
-     *   <code>setNeedClientAuth(true)</code> and
-     *   <code>setWantClientAuth(true)</code> are called, respectively;
-     *   otherwise <code>setWantClientAuth(false)</code> is called.
+     * <li>If {@code params.getCipherSuites()} is non-null,
+     *   {@code setEnabledCipherSuites()} is called with that value.</li>
+     * <li>If {@code params.getProtocols()} is non-null,
+     *   {@code setEnabledProtocols()} is called with that value.</li>
+     * <li>If {@code params.getNeedClientAuth()} or
+     *   {@code params.getWantClientAuth()} return {@code true},
+     *   {@code setNeedClientAuth(true)} and
+     *   {@code setWantClientAuth(true)} are called, respectively;
+     *   otherwise {@code setWantClientAuth(false)} is called.</li>
+     * <li>If {@code params.getServerNames()} is non-null, the socket will
+     *   configure its server names with that value.</li>
+     * <li>If {@code params.getSNIMatchers()} is non-null, the socket will
+     *   configure its SNI matchers with that value.</li>
      * </ul>
      *
      * @param params the parameters
--- a/src/share/classes/javax/net/ssl/SSLSocketFactory.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/net/ssl/SSLSocketFactory.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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.net.*;
 import javax.net.SocketFactory;
 import java.io.IOException;
+import java.io.InputStream;
 import java.security.*;
 import java.util.Locale;
 
@@ -180,8 +181,55 @@
      * @throws NullPointerException if the parameter s is null
      */
     public abstract Socket createSocket(Socket s, String host,
-                                        int port, boolean autoClose)
-    throws IOException;
+            int port, boolean autoClose) throws IOException;
+
+    /**
+     * Creates a server mode {@link Socket} layered over an
+     * existing connected socket, and is able to read data which has
+     * already been consumed/removed from the {@link Socket}'s
+     * underlying {@link InputStream}.
+     * <p>
+     * This method can be used by a server application that needs to
+     * observe the inbound data but still create valid SSL/TLS
+     * connections: for example, inspection of Server Name Indication
+     * (SNI) extensions (See section 3 of <A
+     * HREF="http://www.ietf.org/rfc/rfc6066.txt">TLS Extensions
+     * (RFC6066)</A>).  Data that has been already removed from the
+     * underlying {@link InputStream} should be loaded into the
+     * {@code consumed} stream before this method is called, perhaps
+     * using a {@link ByteArrayInputStream}.  When this {@link Socket}
+     * begins handshaking, it will read all of the data in
+     * {@code consumed} until it reaches {@code EOF}, then all further
+     * data is read from the underlying {@link InputStream} as
+     * usual.
+     * <p>
+     * The returned socket is configured using the socket options
+     * established for this factory, and is set to use server mode when
+     * handshaking (see {@link SSLSocket#setUseClientMode(boolean)}).
+     *
+     * @param  s
+     *         the existing socket
+     * @param  consumed
+     *         the consumed inbound network data that has already been
+     *         removed from the existing {@link Socket}
+     *         {@link InputStream}.  This parameter may be
+     *         {@code null} if no data has been removed.
+     * @param  autoClose close the underlying socket when this socket is closed.
+     *
+     * @return the {@link Socket} compliant with the socket options
+     *         established for this factory
+     *
+     * @throws IOException if an I/O error occurs when creating the socket
+     * @throws UnsupportedOperationException if the underlying provider
+     *         does not implement the operation
+     * @throws NullPointerException if {@code s} is {@code null}
+     *
+     * @since 1.8
+     */
+    public Socket createSocket(Socket s, InputStream consumed,
+            boolean autoClose) throws IOException {
+        throw new UnsupportedOperationException();
+    }
 }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/javax/net/ssl/StandardConstants.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.net.ssl;
+
+/**
+ * Standard constants definitions
+ *
+ * @since 1.8
+ */
+public final class StandardConstants {
+
+    // Suppress default constructor for noninstantiability
+    private StandardConstants() {
+        throw new AssertionError(
+            "No javax.net.ssl.StandardConstants instances for you!");
+    }
+
+    /**
+     * The "host_name" type representing of a DNS hostname
+     * (see {@link SNIHostName}) in a Server Name Indication (SNI) extension.
+     * <P>
+     * The SNI extension is a feature that extends the SSL/TLS protocols to
+     * indicate what server name the client is attempting to connect to during
+     * handshaking.  See section 3, "Server Name Indication", of <A
+     * HREF="http://www.ietf.org/rfc/rfc6066.txt">TLS Extensions (RFC 6066)</A>.
+     * <P>
+     * The value of this constant is {@value}.
+     *
+     * @see SNIServerName
+     * @see SNIHostName
+     */
+    public static final int SNI_HOST_NAME = 0x00;
+}
--- a/src/share/classes/javax/sql/rowset/BaseRowSet.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/sql/rowset/BaseRowSet.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1850,7 +1850,7 @@
         if(params == null){
              throw new SQLException("Set initParams() before setFloat");
         }
-        params.put(Integer.valueOf(parameterIndex - 1), new Float(x));
+        params.put(Integer.valueOf(parameterIndex - 1), Float.valueOf(x));
     }
 
     /**
@@ -1882,7 +1882,7 @@
         if(params == null){
              throw new SQLException("Set initParams() before setDouble");
         }
-        params.put(Integer.valueOf(parameterIndex - 1), new Double(x));
+        params.put(Integer.valueOf(parameterIndex - 1), Double.valueOf(x));
     }
 
     /**
@@ -2389,7 +2389,7 @@
      * @deprecated getCharacterStream should be used in its place
      * @see #getParams
      */
-
+    @Deprecated
     public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {
         Object unicodeStream[];
         checkParamIndex(parameterIndex);
--- a/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -215,7 +215,7 @@
      */
     @SuppressWarnings("unchecked")
     public void writeFloat(float x) throws SQLException {
-        attribs.add(new Float(x));
+        attribs.add(Float.valueOf(x));
     }
 
     /**
@@ -230,7 +230,7 @@
      */
     @SuppressWarnings("unchecked")
     public void writeDouble(double x) throws SQLException{
-        attribs.add(new Double(x));
+        attribs.add(Double.valueOf(x));
     }
 
     /**
--- a/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,11 +229,7 @@
      * The standard resource file name.
      */
     private static String ROWSET_PROPERTIES = "rowset.properties";
-    /**
-     * The RI Optimistic Provider.
-     */
-    private static String default_provider =
-            "com.sun.rowset.providers.RIOptimisticProvider";
+
     /**
      *  Permission required to invoke setJNDIContext and setLogger
      */
@@ -248,24 +244,13 @@
      * The <code>Logger</code> object to be used by the <code>SyncFactory</code>.
      */
     private static volatile Logger rsLogger;
-    /**
-     *
-     */
-    private static Level rsLevel;
+
     /**
      * The registry of available <code>SyncProvider</code> implementations.
      * See section 2.0 of the class comment for <code>SyncFactory</code> for an
      * explanation of how a provider can be added to this registry.
      */
     private static Hashtable<String, SyncProvider> implementations;
-    /**
-     * Internal sync object used to maintain the SPI as a singleton
-     */
-    private static Object logSync = new Object();
-    /**
-     * Internal PrintWriter field for logging facility
-     */
-    private static java.io.PrintWriter logWriter = null;
 
     /**
      * Adds the the given synchronization provider to the factory register. Guidelines
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/AnnotationVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,186 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java annotation. The methods of this class must be
+ * called in the following order: ( <tt>visit</tt> | <tt>visitEnum</tt> |
+ * <tt>visitAnnotation</tt> | <tt>visitArray</tt> )* <tt>visitEnd</tt>.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public abstract class AnnotationVisitor {
+
+    /**
+     * The ASM API version implemented by this visitor. The value of this field
+     * must be one of {@link Opcodes#ASM4}.
+     */
+    protected final int api;
+
+    /**
+     * The annotation visitor to which this visitor must delegate method calls.
+     * May be null.
+     */
+    protected AnnotationVisitor av;
+
+    /**
+     * Constructs a new {@link AnnotationVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public AnnotationVisitor(final int api) {
+        this(api, null);
+    }
+
+    /**
+     * Constructs a new {@link AnnotationVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param av the annotation visitor to which this visitor must delegate
+     *        method calls. May be null.
+     */
+    public AnnotationVisitor(final int api, final AnnotationVisitor av) {
+        /*if (api != Opcodes.ASM4) {
+            throw new IllegalArgumentException();
+        }*/
+        this.api = api;
+        this.av = av;
+    }
+
+    /**
+     * Visits a primitive value of the annotation.
+     *
+     * @param name the value name.
+     * @param value the actual value, whose type must be {@link Byte},
+     *        {@link Boolean}, {@link Character}, {@link Short}, {@link Integer}
+     *        , {@link Long}, {@link Float}, {@link Double}, {@link String} or
+     *        {@link Type} or OBJECT or ARRAY sort. This value can also be an
+     *        array of byte, boolean, short, char, int, long, float or double
+     *        values (this is equivalent to using {@link #visitArray visitArray}
+     *        and visiting each array element in turn, but is more convenient).
+     */
+    public void visit(String name, Object value) {
+        if (av != null) {
+            av.visit(name, value);
+        }
+    }
+
+    /**
+     * Visits an enumeration value of the annotation.
+     *
+     * @param name the value name.
+     * @param desc the class descriptor of the enumeration class.
+     * @param value the actual enumeration value.
+     */
+    public void visitEnum(String name, String desc, String value) {
+        if (av != null) {
+            av.visitEnum(name, desc, value);
+        }
+    }
+
+    /**
+     * Visits a nested annotation value of the annotation.
+     *
+     * @param name the value name.
+     * @param desc the class descriptor of the nested annotation class.
+     * @return a visitor to visit the actual nested annotation value, or
+     *         <tt>null</tt> if this visitor is not interested in visiting
+     *         this nested annotation. <i>The nested annotation value must be
+     *         fully visited before calling other methods on this annotation
+     *         visitor</i>.
+     */
+    public AnnotationVisitor visitAnnotation(String name, String desc) {
+        if (av != null) {
+            return av.visitAnnotation(name, desc);
+        }
+        return null;
+    }
+
+    /**
+     * Visits an array value of the annotation. Note that arrays of primitive
+     * types (such as byte, boolean, short, char, int, long, float or double)
+     * can be passed as value to {@link #visit visit}. This is what
+     * {@link ClassReader} does.
+     *
+     * @param name the value name.
+     * @return a visitor to visit the actual array value elements, or
+     *         <tt>null</tt> if this visitor is not interested in visiting
+     *         these values. The 'name' parameters passed to the methods of this
+     *         visitor are ignored. <i>All the array values must be visited
+     *         before calling other methods on this annotation visitor</i>.
+     */
+    public AnnotationVisitor visitArray(String name) {
+        if (av != null) {
+            return av.visitArray(name);
+        }
+        return null;
+    }
+
+    /**
+     * Visits the end of the annotation.
+     */
+    public void visitEnd() {
+        if (av != null) {
+            av.visitEnd();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/AnnotationWriter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,351 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * An {@link AnnotationVisitor} that generates annotations in bytecode form.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+final class AnnotationWriter extends AnnotationVisitor {
+
+    /**
+     * The class writer to which this annotation must be added.
+     */
+    private final ClassWriter cw;
+
+    /**
+     * The number of values in this annotation.
+     */
+    private int size;
+
+    /**
+     * <tt>true<tt> if values are named, <tt>false</tt> otherwise. Annotation
+     * writers used for annotation default and annotation arrays use unnamed
+     * values.
+     */
+    private final boolean named;
+
+    /**
+     * The annotation values in bytecode form. This byte vector only contains
+     * the values themselves, i.e. the number of values must be stored as a
+     * unsigned short just before these bytes.
+     */
+    private final ByteVector bv;
+
+    /**
+     * The byte vector to be used to store the number of values of this
+     * annotation. See {@link #bv}.
+     */
+    private final ByteVector parent;
+
+    /**
+     * Where the number of values of this annotation must be stored in
+     * {@link #parent}.
+     */
+    private final int offset;
+
+    /**
+     * Next annotation writer. This field is used to store annotation lists.
+     */
+    AnnotationWriter next;
+
+    /**
+     * Previous annotation writer. This field is used to store annotation lists.
+     */
+    AnnotationWriter prev;
+
+    // ------------------------------------------------------------------------
+    // Constructor
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a new {@link AnnotationWriter}.
+     *
+     * @param cw the class writer to which this annotation must be added.
+     * @param named <tt>true<tt> if values are named, <tt>false</tt> otherwise.
+     * @param bv where the annotation values must be stored.
+     * @param parent where the number of annotation values must be stored.
+     * @param offset where in <tt>parent</tt> the number of annotation values must
+     *      be stored.
+     */
+    AnnotationWriter(
+        final ClassWriter cw,
+        final boolean named,
+        final ByteVector bv,
+        final ByteVector parent,
+        final int offset)
+    {
+        super(Opcodes.ASM4);
+        this.cw = cw;
+        this.named = named;
+        this.bv = bv;
+        this.parent = parent;
+        this.offset = offset;
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the AnnotationVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(final String name, final Object value) {
+        ++size;
+        if (named) {
+            bv.putShort(cw.newUTF8(name));
+        }
+        if (value instanceof String) {
+            bv.put12('s', cw.newUTF8((String) value));
+        } else if (value instanceof Byte) {
+            bv.put12('B', cw.newInteger(((Byte) value).byteValue()).index);
+        } else if (value instanceof Boolean) {
+            int v = ((Boolean) value).booleanValue() ? 1 : 0;
+            bv.put12('Z', cw.newInteger(v).index);
+        } else if (value instanceof Character) {
+            bv.put12('C', cw.newInteger(((Character) value).charValue()).index);
+        } else if (value instanceof Short) {
+            bv.put12('S', cw.newInteger(((Short) value).shortValue()).index);
+        } else if (value instanceof Type) {
+            bv.put12('c', cw.newUTF8(((Type) value).getDescriptor()));
+        } else if (value instanceof byte[]) {
+            byte[] v = (byte[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('B', cw.newInteger(v[i]).index);
+            }
+        } else if (value instanceof boolean[]) {
+            boolean[] v = (boolean[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('Z', cw.newInteger(v[i] ? 1 : 0).index);
+            }
+        } else if (value instanceof short[]) {
+            short[] v = (short[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('S', cw.newInteger(v[i]).index);
+            }
+        } else if (value instanceof char[]) {
+            char[] v = (char[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('C', cw.newInteger(v[i]).index);
+            }
+        } else if (value instanceof int[]) {
+            int[] v = (int[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('I', cw.newInteger(v[i]).index);
+            }
+        } else if (value instanceof long[]) {
+            long[] v = (long[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('J', cw.newLong(v[i]).index);
+            }
+        } else if (value instanceof float[]) {
+            float[] v = (float[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('F', cw.newFloat(v[i]).index);
+            }
+        } else if (value instanceof double[]) {
+            double[] v = (double[]) value;
+            bv.put12('[', v.length);
+            for (int i = 0; i < v.length; i++) {
+                bv.put12('D', cw.newDouble(v[i]).index);
+            }
+        } else {
+            Item i = cw.newConstItem(value);
+            bv.put12(".s.IFJDCS".charAt(i.type), i.index);
+        }
+    }
+
+    @Override
+    public void visitEnum(
+        final String name,
+        final String desc,
+        final String value)
+    {
+        ++size;
+        if (named) {
+            bv.putShort(cw.newUTF8(name));
+        }
+        bv.put12('e', cw.newUTF8(desc)).putShort(cw.newUTF8(value));
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String name,
+        final String desc)
+    {
+        ++size;
+        if (named) {
+            bv.putShort(cw.newUTF8(name));
+        }
+        // write tag and type, and reserve space for values count
+        bv.put12('@', cw.newUTF8(desc)).putShort(0);
+        return new AnnotationWriter(cw, true, bv, bv, bv.length - 2);
+    }
+
+    @Override
+    public AnnotationVisitor visitArray(final String name) {
+        ++size;
+        if (named) {
+            bv.putShort(cw.newUTF8(name));
+        }
+        // write tag, and reserve space for array size
+        bv.put12('[', 0);
+        return new AnnotationWriter(cw, false, bv, bv, bv.length - 2);
+    }
+
+    @Override
+    public void visitEnd() {
+        if (parent != null) {
+            byte[] data = parent.data;
+            data[offset] = (byte) (size >>> 8);
+            data[offset + 1] = (byte) size;
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the size of this annotation writer list.
+     *
+     * @return the size of this annotation writer list.
+     */
+    int getSize() {
+        int size = 0;
+        AnnotationWriter aw = this;
+        while (aw != null) {
+            size += aw.bv.length;
+            aw = aw.next;
+        }
+        return size;
+    }
+
+    /**
+     * Puts the annotations of this annotation writer list into the given byte
+     * vector.
+     *
+     * @param out where the annotations must be put.
+     */
+    void put(final ByteVector out) {
+        int n = 0;
+        int size = 2;
+        AnnotationWriter aw = this;
+        AnnotationWriter last = null;
+        while (aw != null) {
+            ++n;
+            size += aw.bv.length;
+            aw.visitEnd(); // in case user forgot to call visitEnd
+            aw.prev = last;
+            last = aw;
+            aw = aw.next;
+        }
+        out.putInt(size);
+        out.putShort(n);
+        aw = last;
+        while (aw != null) {
+            out.putByteArray(aw.bv.data, 0, aw.bv.length);
+            aw = aw.prev;
+        }
+    }
+
+    /**
+     * Puts the given annotation lists into the given byte vector.
+     *
+     * @param panns an array of annotation writer lists.
+     * @param off index of the first annotation to be written.
+     * @param out where the annotations must be put.
+     */
+    static void put(
+        final AnnotationWriter[] panns,
+        final int off,
+        final ByteVector out)
+    {
+        int size = 1 + 2 * (panns.length - off);
+        for (int i = off; i < panns.length; ++i) {
+            size += panns[i] == null ? 0 : panns[i].getSize();
+        }
+        out.putInt(size).putByte(panns.length - off);
+        for (int i = off; i < panns.length; ++i) {
+            AnnotationWriter aw = panns[i];
+            AnnotationWriter last = null;
+            int n = 0;
+            while (aw != null) {
+                ++n;
+                aw.visitEnd(); // in case user forgot to call visitEnd
+                aw.prev = last;
+                last = aw;
+                aw = aw.next;
+            }
+            out.putShort(n);
+            aw = last;
+            while (aw != null) {
+                out.putByteArray(aw.bv.data, 0, aw.bv.length);
+                aw = aw.prev;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Attribute.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,283 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A non standard class, field, method or code attribute.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class Attribute {
+
+    /**
+     * The type of this attribute.
+     */
+    public final String type;
+
+    /**
+     * The raw value of this attribute, used only for unknown attributes.
+     */
+    byte[] value;
+
+    /**
+     * The next attribute in this attribute list. May be <tt>null</tt>.
+     */
+    Attribute next;
+
+    /**
+     * Constructs a new empty attribute.
+     *
+     * @param type the type of the attribute.
+     */
+    protected Attribute(final String type) {
+        this.type = type;
+    }
+
+    /**
+     * Returns <tt>true</tt> if this type of attribute is unknown. The default
+     * implementation of this method always returns <tt>true</tt>.
+     *
+     * @return <tt>true</tt> if this type of attribute is unknown.
+     */
+    public boolean isUnknown() {
+        return true;
+    }
+
+    /**
+     * Returns <tt>true</tt> if this type of attribute is a code attribute.
+     *
+     * @return <tt>true</tt> if this type of attribute is a code attribute.
+     */
+    public boolean isCodeAttribute() {
+        return false;
+    }
+
+    /**
+     * Returns the labels corresponding to this attribute.
+     *
+     * @return the labels corresponding to this attribute, or <tt>null</tt> if
+     *         this attribute is not a code attribute that contains labels.
+     */
+    protected Label[] getLabels() {
+        return null;
+    }
+
+    /**
+     * Reads a {@link #type type} attribute. This method must return a <i>new</i>
+     * {@link Attribute} object, of type {@link #type type}, corresponding to
+     * the <tt>len</tt> bytes starting at the given offset, in the given class
+     * reader.
+     *
+     * @param cr the class that contains the attribute to be read.
+     * @param off index of the first byte of the attribute's content in {@link
+     *        ClassReader#b cr.b}. The 6 attribute header bytes, containing the
+     *        type and the length of the attribute, are not taken into account
+     *        here.
+     * @param len the length of the attribute's content.
+     * @param buf buffer to be used to call
+     *        {@link ClassReader#readUTF8 readUTF8},
+     *        {@link ClassReader#readClass(int,char[]) readClass} or
+     *        {@link ClassReader#readConst readConst}.
+     * @param codeOff index of the first byte of code's attribute content in
+     *        {@link ClassReader#b cr.b}, or -1 if the attribute to be read is
+     *        not a code attribute. The 6 attribute header bytes, containing the
+     *        type and the length of the attribute, are not taken into account
+     *        here.
+     * @param labels the labels of the method's code, or <tt>null</tt> if the
+     *        attribute to be read is not a code attribute.
+     * @return a <i>new</i> {@link Attribute} object corresponding to the given
+     *         bytes.
+     */
+    protected Attribute read(
+        final ClassReader cr,
+        final int off,
+        final int len,
+        final char[] buf,
+        final int codeOff,
+        final Label[] labels)
+    {
+        Attribute attr = new Attribute(type);
+        attr.value = new byte[len];
+        System.arraycopy(cr.b, off, attr.value, 0, len);
+        return attr;
+    }
+
+    /**
+     * Returns the byte array form of this attribute.
+     *
+     * @param cw the class to which this attribute must be added. This parameter
+     *        can be used to add to the constant pool of this class the items
+     *        that corresponds to this attribute.
+     * @param code the bytecode of the method corresponding to this code
+     *        attribute, or <tt>null</tt> if this attribute is not a code
+     *        attributes.
+     * @param len the length of the bytecode of the method corresponding to this
+     *        code attribute, or <tt>null</tt> if this attribute is not a code
+     *        attribute.
+     * @param maxStack the maximum stack size of the method corresponding to
+     *        this code attribute, or -1 if this attribute is not a code
+     *        attribute.
+     * @param maxLocals the maximum number of local variables of the method
+     *        corresponding to this code attribute, or -1 if this attribute is
+     *        not a code attribute.
+     * @return the byte array form of this attribute.
+     */
+    protected ByteVector write(
+        final ClassWriter cw,
+        final byte[] code,
+        final int len,
+        final int maxStack,
+        final int maxLocals)
+    {
+        ByteVector v = new ByteVector();
+        v.data = value;
+        v.length = value.length;
+        return v;
+    }
+
+    /**
+     * Returns the length of the attribute list that begins with this attribute.
+     *
+     * @return the length of the attribute list that begins with this attribute.
+     */
+    final int getCount() {
+        int count = 0;
+        Attribute attr = this;
+        while (attr != null) {
+            count += 1;
+            attr = attr.next;
+        }
+        return count;
+    }
+
+    /**
+     * Returns the size of all the attributes in this attribute list.
+     *
+     * @param cw the class writer to be used to convert the attributes into byte
+     *        arrays, with the {@link #write write} method.
+     * @param code the bytecode of the method corresponding to these code
+     *        attributes, or <tt>null</tt> if these attributes are not code
+     *        attributes.
+     * @param len the length of the bytecode of the method corresponding to
+     *        these code attributes, or <tt>null</tt> if these attributes are
+     *        not code attributes.
+     * @param maxStack the maximum stack size of the method corresponding to
+     *        these code attributes, or -1 if these attributes are not code
+     *        attributes.
+     * @param maxLocals the maximum number of local variables of the method
+     *        corresponding to these code attributes, or -1 if these attributes
+     *        are not code attributes.
+     * @return the size of all the attributes in this attribute list. This size
+     *         includes the size of the attribute headers.
+     */
+    final int getSize(
+        final ClassWriter cw,
+        final byte[] code,
+        final int len,
+        final int maxStack,
+        final int maxLocals)
+    {
+        Attribute attr = this;
+        int size = 0;
+        while (attr != null) {
+            cw.newUTF8(attr.type);
+            size += attr.write(cw, code, len, maxStack, maxLocals).length + 6;
+            attr = attr.next;
+        }
+        return size;
+    }
+
+    /**
+     * Writes all the attributes of this attribute list in the given byte
+     * vector.
+     *
+     * @param cw the class writer to be used to convert the attributes into byte
+     *        arrays, with the {@link #write write} method.
+     * @param code the bytecode of the method corresponding to these code
+     *        attributes, or <tt>null</tt> if these attributes are not code
+     *        attributes.
+     * @param len the length of the bytecode of the method corresponding to
+     *        these code attributes, or <tt>null</tt> if these attributes are
+     *        not code attributes.
+     * @param maxStack the maximum stack size of the method corresponding to
+     *        these code attributes, or -1 if these attributes are not code
+     *        attributes.
+     * @param maxLocals the maximum number of local variables of the method
+     *        corresponding to these code attributes, or -1 if these attributes
+     *        are not code attributes.
+     * @param out where the attributes must be written.
+     */
+    final void put(
+        final ClassWriter cw,
+        final byte[] code,
+        final int len,
+        final int maxStack,
+        final int maxLocals,
+        final ByteVector out)
+    {
+        Attribute attr = this;
+        while (attr != null) {
+            ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
+            out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
+            out.putByteArray(b.data, 0, b.length);
+            attr = attr.next;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/ByteVector.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,322 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A dynamically extensible vector of bytes. This class is roughly equivalent to
+ * a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
+ *
+ * @author Eric Bruneton
+ */
+public class ByteVector {
+
+    /**
+     * The content of this vector.
+     */
+    byte[] data;
+
+    /**
+     * Actual number of bytes in this vector.
+     */
+    int length;
+
+    /**
+     * Constructs a new {@link ByteVector ByteVector} with a default initial
+     * size.
+     */
+    public ByteVector() {
+        data = new byte[64];
+    }
+
+    /**
+     * Constructs a new {@link ByteVector ByteVector} with the given initial
+     * size.
+     *
+     * @param initialSize the initial size of the byte vector to be constructed.
+     */
+    public ByteVector(final int initialSize) {
+        data = new byte[initialSize];
+    }
+
+    /**
+     * Puts a byte into this byte vector. The byte vector is automatically
+     * enlarged if necessary.
+     *
+     * @param b a byte.
+     * @return this byte vector.
+     */
+    public ByteVector putByte(final int b) {
+        int length = this.length;
+        if (length + 1 > data.length) {
+            enlarge(1);
+        }
+        data[length++] = (byte) b;
+        this.length = length;
+        return this;
+    }
+
+    /**
+     * Puts two bytes into this byte vector. The byte vector is automatically
+     * enlarged if necessary.
+     *
+     * @param b1 a byte.
+     * @param b2 another byte.
+     * @return this byte vector.
+     */
+    ByteVector put11(final int b1, final int b2) {
+        int length = this.length;
+        if (length + 2 > data.length) {
+            enlarge(2);
+        }
+        byte[] data = this.data;
+        data[length++] = (byte) b1;
+        data[length++] = (byte) b2;
+        this.length = length;
+        return this;
+    }
+
+    /**
+     * Puts a short into this byte vector. The byte vector is automatically
+     * enlarged if necessary.
+     *
+     * @param s a short.
+     * @return this byte vector.
+     */
+    public ByteVector putShort(final int s) {
+        int length = this.length;
+        if (length + 2 > data.length) {
+            enlarge(2);
+        }
+        byte[] data = this.data;
+        data[length++] = (byte) (s >>> 8);
+        data[length++] = (byte) s;
+        this.length = length;
+        return this;
+    }
+
+    /**
+     * Puts a byte and a short into this byte vector. The byte vector is
+     * automatically enlarged if necessary.
+     *
+     * @param b a byte.
+     * @param s a short.
+     * @return this byte vector.
+     */
+    ByteVector put12(final int b, final int s) {
+        int length = this.length;
+        if (length + 3 > data.length) {
+            enlarge(3);
+        }
+        byte[] data = this.data;
+        data[length++] = (byte) b;
+        data[length++] = (byte) (s >>> 8);
+        data[length++] = (byte) s;
+        this.length = length;
+        return this;
+    }
+
+    /**
+     * Puts an int into this byte vector. The byte vector is automatically
+     * enlarged if necessary.
+     *
+     * @param i an int.
+     * @return this byte vector.
+     */
+    public ByteVector putInt(final int i) {
+        int length = this.length;
+        if (length + 4 > data.length) {
+            enlarge(4);
+        }
+        byte[] data = this.data;
+        data[length++] = (byte) (i >>> 24);
+        data[length++] = (byte) (i >>> 16);
+        data[length++] = (byte) (i >>> 8);
+        data[length++] = (byte) i;
+        this.length = length;
+        return this;
+    }
+
+    /**
+     * Puts a long into this byte vector. The byte vector is automatically
+     * enlarged if necessary.
+     *
+     * @param l a long.
+     * @return this byte vector.
+     */
+    public ByteVector putLong(final long l) {
+        int length = this.length;
+        if (length + 8 > data.length) {
+            enlarge(8);
+        }
+        byte[] data = this.data;
+        int i = (int) (l >>> 32);
+        data[length++] = (byte) (i >>> 24);
+        data[length++] = (byte) (i >>> 16);
+        data[length++] = (byte) (i >>> 8);
+        data[length++] = (byte) i;
+        i = (int) l;
+        data[length++] = (byte) (i >>> 24);
+        data[length++] = (byte) (i >>> 16);
+        data[length++] = (byte) (i >>> 8);
+        data[length++] = (byte) i;
+        this.length = length;
+        return this;
+    }
+
+    /**
+     * Puts an UTF8 string into this byte vector. The byte vector is
+     * automatically enlarged if necessary.
+     *
+     * @param s a String.
+     * @return this byte vector.
+     */
+    public ByteVector putUTF8(final String s) {
+        int charLength = s.length();
+        int len = length;
+        if (len + 2 + charLength > data.length) {
+            enlarge(2 + charLength);
+        }
+        byte[] data = this.data;
+        // optimistic algorithm: instead of computing the byte length and then
+        // serializing the string (which requires two loops), we assume the byte
+        // length is equal to char length (which is the most frequent case), and
+        // we start serializing the string right away. During the serialization,
+        // if we find that this assumption is wrong, we continue with the
+        // general method.
+        data[len++] = (byte) (charLength >>> 8);
+        data[len++] = (byte) charLength;
+        for (int i = 0; i < charLength; ++i) {
+            char c = s.charAt(i);
+            if (c >= '\001' && c <= '\177') {
+                data[len++] = (byte) c;
+            } else {
+                int byteLength = i;
+                for (int j = i; j < charLength; ++j) {
+                    c = s.charAt(j);
+                    if (c >= '\001' && c <= '\177') {
+                        byteLength++;
+                    } else if (c > '\u07FF') {
+                        byteLength += 3;
+                    } else {
+                        byteLength += 2;
+                    }
+                }
+                data[length] = (byte) (byteLength >>> 8);
+                data[length + 1] = (byte) byteLength;
+                if (length + 2 + byteLength > data.length) {
+                    length = len;
+                    enlarge(2 + byteLength);
+                    data = this.data;
+                }
+                for (int j = i; j < charLength; ++j) {
+                    c = s.charAt(j);
+                    if (c >= '\001' && c <= '\177') {
+                        data[len++] = (byte) c;
+                    } else if (c > '\u07FF') {
+                        data[len++] = (byte) (0xE0 | c >> 12 & 0xF);
+                        data[len++] = (byte) (0x80 | c >> 6 & 0x3F);
+                        data[len++] = (byte) (0x80 | c & 0x3F);
+                    } else {
+                        data[len++] = (byte) (0xC0 | c >> 6 & 0x1F);
+                        data[len++] = (byte) (0x80 | c & 0x3F);
+                    }
+                }
+                break;
+            }
+        }
+        length = len;
+        return this;
+    }
+
+    /**
+     * Puts an array of bytes into this byte vector. The byte vector is
+     * automatically enlarged if necessary.
+     *
+     * @param b an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
+     *        null bytes into this byte vector.
+     * @param off index of the fist byte of b that must be copied.
+     * @param len number of bytes of b that must be copied.
+     * @return this byte vector.
+     */
+    public ByteVector putByteArray(final byte[] b, final int off, final int len)
+    {
+        if (length + len > data.length) {
+            enlarge(len);
+        }
+        if (b != null) {
+            System.arraycopy(b, off, data, length, len);
+        }
+        length += len;
+        return this;
+    }
+
+    /**
+     * Enlarge this byte vector so that it can receive n more bytes.
+     *
+     * @param size number of additional bytes that this byte vector should be
+     *        able to receive.
+     */
+    private void enlarge(final int size) {
+        int length1 = 2 * data.length;
+        int length2 = length + size;
+        byte[] newData = new byte[length1 > length2 ? length1 : length2];
+        System.arraycopy(data, 0, newData, 0, length);
+        data = newData;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,2245 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * A Java class parser to make a {@link ClassVisitor} visit an existing class.
+ * This class parses a byte array conforming to the Java class file format and
+ * calls the appropriate visit methods of a given class visitor for each field,
+ * method and bytecode instruction encountered.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class ClassReader {
+
+    /**
+     * True to enable signatures support.
+     */
+    static final boolean SIGNATURES = true;
+
+    /**
+     * True to enable annotations support.
+     */
+    static final boolean ANNOTATIONS = true;
+
+    /**
+     * True to enable stack map frames support.
+     */
+    static final boolean FRAMES = true;
+
+    /**
+     * True to enable bytecode writing support.
+     */
+    static final boolean WRITER = true;
+
+    /**
+     * True to enable JSR_W and GOTO_W support.
+     */
+    static final boolean RESIZE = true;
+
+    /**
+     * Flag to skip method code. If this class is set <code>CODE</code>
+     * attribute won't be visited. This can be used, for example, to retrieve
+     * annotations for methods and method parameters.
+     */
+    public static final int SKIP_CODE = 1;
+
+    /**
+     * Flag to skip the debug information in the class. If this flag is set the
+     * debug information of the class is not visited, i.e. the
+     * {@link MethodVisitor#visitLocalVariable visitLocalVariable} and
+     * {@link MethodVisitor#visitLineNumber visitLineNumber} methods will not be
+     * called.
+     */
+    public static final int SKIP_DEBUG = 2;
+
+    /**
+     * Flag to skip the stack map frames in the class. If this flag is set the
+     * stack map frames of the class is not visited, i.e. the
+     * {@link MethodVisitor#visitFrame visitFrame} method will not be called.
+     * This flag is useful when the {@link ClassWriter#COMPUTE_FRAMES} option is
+     * used: it avoids visiting frames that will be ignored and recomputed from
+     * scratch in the class writer.
+     */
+    public static final int SKIP_FRAMES = 4;
+
+    /**
+     * Flag to expand the stack map frames. By default stack map frames are
+     * visited in their original format (i.e. "expanded" for classes whose
+     * version is less than V1_6, and "compressed" for the other classes). If
+     * this flag is set, stack map frames are always visited in expanded format
+     * (this option adds a decompression/recompression step in ClassReader and
+     * ClassWriter which degrades performances quite a lot).
+     */
+    public static final int EXPAND_FRAMES = 8;
+
+    /**
+     * The class to be parsed. <i>The content of this array must not be
+     * modified. This field is intended for {@link Attribute} sub classes, and
+     * is normally not needed by class generators or adapters.</i>
+     */
+    public final byte[] b;
+
+    /**
+     * The start index of each constant pool item in {@link #b b}, plus one.
+     * The one byte offset skips the constant pool item tag that indicates its
+     * type.
+     */
+    private final int[] items;
+
+    /**
+     * The String objects corresponding to the CONSTANT_Utf8 items. This cache
+     * avoids multiple parsing of a given CONSTANT_Utf8 constant pool item,
+     * which GREATLY improves performances (by a factor 2 to 3). This caching
+     * strategy could be extended to all constant pool items, but its benefit
+     * would not be so great for these items (because they are much less
+     * expensive to parse than CONSTANT_Utf8 items).
+     */
+    private final String[] strings;
+
+    /**
+     * Maximum length of the strings contained in the constant pool of the
+     * class.
+     */
+    private final int maxStringLength;
+
+    /**
+     * Start index of the class header information (access, name...) in
+     * {@link #b b}.
+     */
+    public final int header;
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a new {@link ClassReader} object.
+     *
+     * @param b the bytecode of the class to be read.
+     */
+    public ClassReader(final byte[] b) {
+        this(b, 0, b.length);
+    }
+
+    /**
+     * Constructs a new {@link ClassReader} object.
+     *
+     * @param b the bytecode of the class to be read.
+     * @param off the start offset of the class data.
+     * @param len the length of the class data.
+     */
+    public ClassReader(final byte[] b, final int off, final int len) {
+        this.b = b;
+        // checks the class version
+        if (readShort(6) > Opcodes.V1_7) {
+            throw new IllegalArgumentException();
+        }
+        // parses the constant pool
+        items = new int[readUnsignedShort(off + 8)];
+        int n = items.length;
+        strings = new String[n];
+        int max = 0;
+        int index = off + 10;
+        for (int i = 1; i < n; ++i) {
+            items[i] = index + 1;
+            int size;
+            switch (b[index]) {
+                case ClassWriter.FIELD:
+                case ClassWriter.METH:
+                case ClassWriter.IMETH:
+                case ClassWriter.INT:
+                case ClassWriter.FLOAT:
+                case ClassWriter.NAME_TYPE:
+                case ClassWriter.INDY:
+                    size = 5;
+                    break;
+                case ClassWriter.LONG:
+                case ClassWriter.DOUBLE:
+                    size = 9;
+                    ++i;
+                    break;
+                case ClassWriter.UTF8:
+                    size = 3 + readUnsignedShort(index + 1);
+                    if (size > max) {
+                        max = size;
+                    }
+                    break;
+                case ClassWriter.HANDLE:
+                    size = 4;
+                    break;
+                // case ClassWriter.CLASS:
+                // case ClassWriter.STR:
+                // case ClassWriter.MTYPE
+                default:
+                    size = 3;
+                    break;
+            }
+            index += size;
+        }
+        maxStringLength = max;
+        // the class header information starts just after the constant pool
+        header = index;
+    }
+
+    /**
+     * Returns the class's access flags (see {@link Opcodes}). This value may
+     * not reflect Deprecated and Synthetic flags when bytecode is before 1.5
+     * and those flags are represented by attributes.
+     *
+     * @return the class access flags
+     *
+     * @see ClassVisitor#visit(int, int, String, String, String, String[])
+     */
+    public int getAccess() {
+        return readUnsignedShort(header);
+    }
+
+    /**
+     * Returns the internal name of the class (see
+     * {@link Type#getInternalName() getInternalName}).
+     *
+     * @return the internal class name
+     *
+     * @see ClassVisitor#visit(int, int, String, String, String, String[])
+     */
+    public String getClassName() {
+        return readClass(header + 2, new char[maxStringLength]);
+    }
+
+    /**
+     * Returns the internal of name of the super class (see
+     * {@link Type#getInternalName() getInternalName}). For interfaces, the
+     * super class is {@link Object}.
+     *
+     * @return the internal name of super class, or <tt>null</tt> for
+     *         {@link Object} class.
+     *
+     * @see ClassVisitor#visit(int, int, String, String, String, String[])
+     */
+    public String getSuperName() {
+        int n = items[readUnsignedShort(header + 4)];
+        return n == 0 ? null : readUTF8(n, new char[maxStringLength]);
+    }
+
+    /**
+     * Returns the internal names of the class's interfaces (see
+     * {@link Type#getInternalName() getInternalName}).
+     *
+     * @return the array of internal names for all implemented interfaces or
+     *         <tt>null</tt>.
+     *
+     * @see ClassVisitor#visit(int, int, String, String, String, String[])
+     */
+    public String[] getInterfaces() {
+        int index = header + 6;
+        int n = readUnsignedShort(index);
+        String[] interfaces = new String[n];
+        if (n > 0) {
+            char[] buf = new char[maxStringLength];
+            for (int i = 0; i < n; ++i) {
+                index += 2;
+                interfaces[i] = readClass(index, buf);
+            }
+        }
+        return interfaces;
+    }
+
+    /**
+     * Copies the constant pool data into the given {@link ClassWriter}. Should
+     * be called before the {@link #accept(ClassVisitor,int)} method.
+     *
+     * @param classWriter the {@link ClassWriter} to copy constant pool into.
+     */
+    void copyPool(final ClassWriter classWriter) {
+        char[] buf = new char[maxStringLength];
+        int ll = items.length;
+        Item[] items2 = new Item[ll];
+        for (int i = 1; i < ll; i++) {
+            int index = items[i];
+            int tag = b[index - 1];
+            Item item = new Item(i);
+            int nameType;
+            switch (tag) {
+                case ClassWriter.FIELD:
+                case ClassWriter.METH:
+                case ClassWriter.IMETH:
+                    nameType = items[readUnsignedShort(index + 2)];
+                    item.set(tag,
+                            readClass(index, buf),
+                            readUTF8(nameType, buf),
+                            readUTF8(nameType + 2, buf));
+                    break;
+
+                case ClassWriter.INT:
+                    item.set(readInt(index));
+                    break;
+
+                case ClassWriter.FLOAT:
+                    item.set(Float.intBitsToFloat(readInt(index)));
+                    break;
+
+                case ClassWriter.NAME_TYPE:
+                    item.set(tag,
+                            readUTF8(index, buf),
+                            readUTF8(index + 2, buf),
+                            null);
+                    break;
+
+                case ClassWriter.LONG:
+                    item.set(readLong(index));
+                    ++i;
+                    break;
+
+                case ClassWriter.DOUBLE:
+                    item.set(Double.longBitsToDouble(readLong(index)));
+                    ++i;
+                    break;
+
+                case ClassWriter.UTF8: {
+                    String s = strings[i];
+                    if (s == null) {
+                        index = items[i];
+                        s = strings[i] = readUTF(index + 2,
+                                readUnsignedShort(index),
+                                buf);
+                    }
+                    item.set(tag, s, null, null);
+                }
+                    break;
+
+                case ClassWriter.HANDLE: {
+                    int fieldOrMethodRef = items[readUnsignedShort(index + 1)];
+                    nameType = items[readUnsignedShort(fieldOrMethodRef + 2)];
+                    item.set(ClassWriter.HANDLE_BASE + readByte(index),
+                            readClass(fieldOrMethodRef, buf),
+                            readUTF8(nameType, buf),
+                            readUTF8(nameType + 2, buf));
+
+                }
+                    break;
+
+
+                case ClassWriter.INDY:
+                    if (classWriter.bootstrapMethods == null) {
+                        copyBootstrapMethods(classWriter, items2, buf);
+                    }
+                    nameType = items[readUnsignedShort(index + 2)];
+                    item.set(readUTF8(nameType, buf),
+                            readUTF8(nameType + 2, buf),
+                            readUnsignedShort(index));
+                    break;
+
+
+                // case ClassWriter.STR:
+                // case ClassWriter.CLASS:
+                // case ClassWriter.MTYPE
+                default:
+                    item.set(tag, readUTF8(index, buf), null, null);
+                    break;
+            }
+
+            int index2 = item.hashCode % items2.length;
+            item.next = items2[index2];
+            items2[index2] = item;
+        }
+
+        int off = items[1] - 1;
+        classWriter.pool.putByteArray(b, off, header - off);
+        classWriter.items = items2;
+        classWriter.threshold = (int) (0.75d * ll);
+        classWriter.index = ll;
+    }
+
+    private void copyBootstrapMethods(ClassWriter classWriter, Item[] items2, char[] buf) {
+        int i, j, k, u, v;
+
+        // skip class header
+        v = header;
+        v += 8 + (readUnsignedShort(v + 6) << 1);
+
+        // skips fields and methods
+        i = readUnsignedShort(v);
+        v += 2;
+        for (; i > 0; --i) {
+            j = readUnsignedShort(v + 6);
+            v += 8;
+            for (; j > 0; --j) {
+                v += 6 + readInt(v + 2);
+            }
+        }
+        i = readUnsignedShort(v);
+        v += 2;
+        for (; i > 0; --i) {
+            j = readUnsignedShort(v + 6);
+            v += 8;
+            for (; j > 0; --j) {
+                v += 6 + readInt(v + 2);
+            }
+        }
+
+        // read class attributes
+        i = readUnsignedShort(v);
+        v += 2;
+        for (; i > 0; --i) {
+            String attrName = readUTF8(v, buf);
+            int size = readInt(v + 2);
+            if ("BootstrapMethods".equals(attrName)) {
+                int boostrapMethodCount = readUnsignedShort(v + 6);
+                int x = v + 8;
+                for (j = 0; j < boostrapMethodCount; j++) {
+                    int hashCode = readConst(readUnsignedShort(x), buf).hashCode();
+                    k = readUnsignedShort(x + 2);
+                    u = x + 4;
+                    for(; k > 0; --k) {
+                        hashCode ^= readConst(readUnsignedShort(u), buf).hashCode();
+                        u += 2;
+                    }
+                    Item item = new Item(j);
+                    item.set(x - v - 8, hashCode & 0x7FFFFFFF);
+
+                    int index2 = item.hashCode % items2.length;
+                    item.next = items2[index2];
+                    items2[index2] = item;
+
+                    x = u;
+                }
+
+                classWriter.bootstrapMethodsCount = boostrapMethodCount;
+                ByteVector bootstrapMethods = new ByteVector(size + 62);
+                bootstrapMethods.putByteArray(b, v + 8, size - 2);
+                classWriter.bootstrapMethods = bootstrapMethods;
+                return;
+            }
+            v += 6 + size;
+        }
+
+        // we are in trouble !!!
+    }
+
+    /**
+     * Constructs a new {@link ClassReader} object.
+     *
+     * @param is an input stream from which to read the class.
+     * @throws IOException if a problem occurs during reading.
+     */
+    public ClassReader(final InputStream is) throws IOException {
+        this(readClass(is, false));
+    }
+
+    /**
+     * Constructs a new {@link ClassReader} object.
+     *
+     * @param name the binary qualified name of the class to be read.
+     * @throws IOException if an exception occurs during reading.
+     */
+    public ClassReader(final String name) throws IOException {
+        this(readClass(ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
+                + ".class"), true));
+    }
+
+    /**
+     * Reads the bytecode of a class.
+     *
+     * @param is an input stream from which to read the class.
+     * @param close true to close the input stream after reading.
+     * @return the bytecode read from the given input stream.
+     * @throws IOException if a problem occurs during reading.
+     */
+    private static byte[] readClass(final InputStream is, boolean close)
+            throws IOException
+    {
+        if (is == null) {
+            throw new IOException("Class not found");
+        }
+        try {
+            byte[] b = new byte[is.available()];
+            int len = 0;
+            while (true) {
+                int n = is.read(b, len, b.length - len);
+                if (n == -1) {
+                    if (len < b.length) {
+                        byte[] c = new byte[len];
+                        System.arraycopy(b, 0, c, 0, len);
+                        b = c;
+                    }
+                    return b;
+                }
+                len += n;
+                if (len == b.length) {
+                    int last = is.read();
+                    if (last < 0) {
+                        return b;
+                    }
+                    byte[] c = new byte[b.length + 1000];
+                    System.arraycopy(b, 0, c, 0, len);
+                    c[len++] = (byte) last;
+                    b = c;
+                }
+            }
+        } finally {
+            if (close) {
+                is.close();
+            }
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Public methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Makes the given visitor visit the Java class of this {@link ClassReader}.
+     * This class is the one specified in the constructor (see
+     * {@link #ClassReader(byte[]) ClassReader}).
+     *
+     * @param classVisitor the visitor that must visit this class.
+     * @param flags option flags that can be used to modify the default behavior
+     *        of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES},
+     *        {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
+     */
+    public void accept(final ClassVisitor classVisitor, final int flags) {
+        accept(classVisitor, new Attribute[0], flags);
+    }
+
+    /**
+     * Makes the given visitor visit the Java class of this {@link ClassReader}.
+     * This class is the one specified in the constructor (see
+     * {@link #ClassReader(byte[]) ClassReader}).
+     *
+     * @param classVisitor the visitor that must visit this class.
+     * @param attrs prototypes of the attributes that must be parsed during the
+     *        visit of the class. Any attribute whose type is not equal to the
+     *        type of one the prototypes will not be parsed: its byte array
+     *        value will be passed unchanged to the ClassWriter. <i>This may
+     *        corrupt it if this value contains references to the constant pool,
+     *        or has syntactic or semantic links with a class element that has
+     *        been transformed by a class adapter between the reader and the
+     *        writer</i>.
+     * @param flags option flags that can be used to modify the default behavior
+     *        of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES},
+     *        {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
+     */
+    public void accept(
+        final ClassVisitor classVisitor,
+        final Attribute[] attrs,
+        final int flags)
+    {
+        byte[] b = this.b; // the bytecode array
+        char[] c = new char[maxStringLength]; // buffer used to read strings
+        int i, j, k; // loop variables
+        int u, v, w; // indexes in b
+        Attribute attr;
+
+        int access;
+        String name;
+        String desc;
+        String attrName;
+        String signature;
+        int anns = 0;
+        int ianns = 0;
+        Attribute cattrs = null;
+
+        // visits the header
+        u = header;
+        access = readUnsignedShort(u);
+        name = readClass(u + 2, c);
+        v = items[readUnsignedShort(u + 4)];
+        String superClassName = v == 0 ? null : readUTF8(v, c);
+        String[] implementedItfs = new String[readUnsignedShort(u + 6)];
+        w = 0;
+        u += 8;
+        for (i = 0; i < implementedItfs.length; ++i) {
+            implementedItfs[i] = readClass(u, c);
+            u += 2;
+        }
+
+        boolean skipCode = (flags & SKIP_CODE) != 0;
+        boolean skipDebug = (flags & SKIP_DEBUG) != 0;
+        boolean unzip = (flags & EXPAND_FRAMES) != 0;
+
+        // skips fields and methods
+        v = u;
+        i = readUnsignedShort(v);
+        v += 2;
+        for (; i > 0; --i) {
+            j = readUnsignedShort(v + 6);
+            v += 8;
+            for (; j > 0; --j) {
+                v += 6 + readInt(v + 2);
+            }
+        }
+        i = readUnsignedShort(v);
+        v += 2;
+        for (; i > 0; --i) {
+            j = readUnsignedShort(v + 6);
+            v += 8;
+            for (; j > 0; --j) {
+                v += 6 + readInt(v + 2);
+            }
+        }
+        // reads the class's attributes
+        signature = null;
+        String sourceFile = null;
+        String sourceDebug = null;
+        String enclosingOwner = null;
+        String enclosingName = null;
+        String enclosingDesc = null;
+        int[] bootstrapMethods = null;  // start indexed of the bsms
+
+        i = readUnsignedShort(v);
+        v += 2;
+        for (; i > 0; --i) {
+            attrName = readUTF8(v, c);
+            // tests are sorted in decreasing frequency order
+            // (based on frequencies observed on typical classes)
+            if ("SourceFile".equals(attrName)) {
+                sourceFile = readUTF8(v + 6, c);
+            } else if ("InnerClasses".equals(attrName)) {
+                w = v + 6;
+            } else if ("EnclosingMethod".equals(attrName)) {
+                enclosingOwner = readClass(v + 6, c);
+                int item = readUnsignedShort(v + 8);
+                if (item != 0) {
+                    enclosingName = readUTF8(items[item], c);
+                    enclosingDesc = readUTF8(items[item] + 2, c);
+                }
+            } else if (SIGNATURES && "Signature".equals(attrName)) {
+                signature = readUTF8(v + 6, c);
+            } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
+                anns = v + 6;
+            } else if ("Deprecated".equals(attrName)) {
+                access |= Opcodes.ACC_DEPRECATED;
+            } else if ("Synthetic".equals(attrName)) {
+                access |= Opcodes.ACC_SYNTHETIC | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
+            } else if ("SourceDebugExtension".equals(attrName)) {
+                int len = readInt(v + 2);
+                sourceDebug = readUTF(v + 6, len, new char[len]);
+            } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
+                ianns = v + 6;
+            } else if ("BootstrapMethods".equals(attrName)) {
+                int boostrapMethodCount = readUnsignedShort(v + 6);
+                bootstrapMethods = new int[boostrapMethodCount];
+                int x = v + 8;
+                for (j = 0; j < boostrapMethodCount; j++) {
+                    bootstrapMethods[j] = x;
+                    x += 2 + readUnsignedShort(x + 2) << 1;
+                }
+            } else {
+                attr = readAttribute(attrs,
+                        attrName,
+                        v + 6,
+                        readInt(v + 2),
+                        c,
+                        -1,
+                        null);
+                if (attr != null) {
+                    attr.next = cattrs;
+                    cattrs = attr;
+                }
+            }
+            v += 6 + readInt(v + 2);
+        }
+        // calls the visit method
+        classVisitor.visit(readInt(4),
+                access,
+                name,
+                signature,
+                superClassName,
+                implementedItfs);
+
+        // calls the visitSource method
+        if (!skipDebug && (sourceFile != null || sourceDebug != null)) {
+            classVisitor.visitSource(sourceFile, sourceDebug);
+        }
+
+        // calls the visitOuterClass method
+        if (enclosingOwner != null) {
+            classVisitor.visitOuterClass(enclosingOwner,
+                    enclosingName,
+                    enclosingDesc);
+        }
+
+        // visits the class annotations
+        if (ANNOTATIONS) {
+            for (i = 1; i >= 0; --i) {
+                v = i == 0 ? ianns : anns;
+                if (v != 0) {
+                    j = readUnsignedShort(v);
+                    v += 2;
+                    for (; j > 0; --j) {
+                        v = readAnnotationValues(v + 2,
+                                c,
+                                true,
+                                classVisitor.visitAnnotation(readUTF8(v, c), i != 0));
+                    }
+                }
+            }
+        }
+
+        // visits the class attributes
+        while (cattrs != null) {
+            attr = cattrs.next;
+            cattrs.next = null;
+            classVisitor.visitAttribute(cattrs);
+            cattrs = attr;
+        }
+
+        // calls the visitInnerClass method
+        if (w != 0) {
+            i = readUnsignedShort(w);
+            w += 2;
+            for (; i > 0; --i) {
+                classVisitor.visitInnerClass(readUnsignedShort(w) == 0
+                        ? null
+                        : readClass(w, c), readUnsignedShort(w + 2) == 0
+                        ? null
+                        : readClass(w + 2, c), readUnsignedShort(w + 4) == 0
+                        ? null
+                        : readUTF8(w + 4, c), readUnsignedShort(w + 6));
+                w += 8;
+            }
+        }
+
+        // visits the fields
+        i = readUnsignedShort(u);
+        u += 2;
+        for (; i > 0; --i) {
+            access = readUnsignedShort(u);
+            name = readUTF8(u + 2, c);
+            desc = readUTF8(u + 4, c);
+            // visits the field's attributes and looks for a ConstantValue
+            // attribute
+            int fieldValueItem = 0;
+            signature = null;
+            anns = 0;
+            ianns = 0;
+            cattrs = null;
+
+            j = readUnsignedShort(u + 6);
+            u += 8;
+            for (; j > 0; --j) {
+                attrName = readUTF8(u, c);
+                // tests are sorted in decreasing frequency order
+                // (based on frequencies observed on typical classes)
+                if ("ConstantValue".equals(attrName)) {
+                    fieldValueItem = readUnsignedShort(u + 6);
+                } else if (SIGNATURES && "Signature".equals(attrName)) {
+                    signature = readUTF8(u + 6, c);
+                } else if ("Deprecated".equals(attrName)) {
+                    access |= Opcodes.ACC_DEPRECATED;
+                } else if ("Synthetic".equals(attrName)) {
+                    access |= Opcodes.ACC_SYNTHETIC  | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
+                } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
+                    anns = u + 6;
+                } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
+                    ianns = u + 6;
+                } else {
+                    attr = readAttribute(attrs,
+                            attrName,
+                            u + 6,
+                            readInt(u + 2),
+                            c,
+                            -1,
+                            null);
+                    if (attr != null) {
+                        attr.next = cattrs;
+                        cattrs = attr;
+                    }
+                }
+                u += 6 + readInt(u + 2);
+            }
+            // visits the field
+            FieldVisitor fv = classVisitor.visitField(access,
+                    name,
+                    desc,
+                    signature,
+                    fieldValueItem == 0 ? null : readConst(fieldValueItem, c));
+            // visits the field annotations and attributes
+            if (fv != null) {
+                if (ANNOTATIONS) {
+                    for (j = 1; j >= 0; --j) {
+                        v = j == 0 ? ianns : anns;
+                        if (v != 0) {
+                            k = readUnsignedShort(v);
+                            v += 2;
+                            for (; k > 0; --k) {
+                                v = readAnnotationValues(v + 2,
+                                        c,
+                                        true,
+                                        fv.visitAnnotation(readUTF8(v, c), j != 0));
+                            }
+                        }
+                    }
+                }
+                while (cattrs != null) {
+                    attr = cattrs.next;
+                    cattrs.next = null;
+                    fv.visitAttribute(cattrs);
+                    cattrs = attr;
+                }
+                fv.visitEnd();
+            }
+        }
+
+        // visits the methods
+        i = readUnsignedShort(u);
+        u += 2;
+        for (; i > 0; --i) {
+            int u0 = u + 6;
+            access = readUnsignedShort(u);
+            name = readUTF8(u + 2, c);
+            desc = readUTF8(u + 4, c);
+            signature = null;
+            anns = 0;
+            ianns = 0;
+            int dann = 0;
+            int mpanns = 0;
+            int impanns = 0;
+            cattrs = null;
+            v = 0;
+            w = 0;
+
+            // looks for Code and Exceptions attributes
+            j = readUnsignedShort(u + 6);
+            u += 8;
+            for (; j > 0; --j) {
+                attrName = readUTF8(u, c);
+                int attrSize = readInt(u + 2);
+                u += 6;
+                // tests are sorted in decreasing frequency order
+                // (based on frequencies observed on typical classes)
+                if ("Code".equals(attrName)) {
+                    if (!skipCode) {
+                        v = u;
+                    }
+                } else if ("Exceptions".equals(attrName)) {
+                    w = u;
+                } else if (SIGNATURES && "Signature".equals(attrName)) {
+                    signature = readUTF8(u, c);
+                } else if ("Deprecated".equals(attrName)) {
+                    access |= Opcodes.ACC_DEPRECATED;
+                } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
+                    anns = u;
+                } else if (ANNOTATIONS && "AnnotationDefault".equals(attrName)) {
+                    dann = u;
+                } else if ("Synthetic".equals(attrName)) {
+                    access |= Opcodes.ACC_SYNTHETIC | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
+                } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
+                    ianns = u;
+                } else if (ANNOTATIONS && "RuntimeVisibleParameterAnnotations".equals(attrName))
+                {
+                    mpanns = u;
+                } else if (ANNOTATIONS && "RuntimeInvisibleParameterAnnotations".equals(attrName))
+                {
+                    impanns = u;
+                } else {
+                    attr = readAttribute(attrs,
+                            attrName,
+                            u,
+                            attrSize,
+                            c,
+                            -1,
+                            null);
+                    if (attr != null) {
+                        attr.next = cattrs;
+                        cattrs = attr;
+                    }
+                }
+                u += attrSize;
+            }
+            // reads declared exceptions
+            String[] exceptions;
+            if (w == 0) {
+                exceptions = null;
+            } else {
+                exceptions = new String[readUnsignedShort(w)];
+                w += 2;
+                for (j = 0; j < exceptions.length; ++j) {
+                    exceptions[j] = readClass(w, c);
+                    w += 2;
+                }
+            }
+
+            // visits the method's code, if any
+            MethodVisitor mv = classVisitor.visitMethod(access,
+                    name,
+                    desc,
+                    signature,
+                    exceptions);
+
+            if (mv != null) {
+                /*
+                 * if the returned MethodVisitor is in fact a MethodWriter, it
+                 * means there is no method adapter between the reader and the
+                 * writer. If, in addition, the writer's constant pool was
+                 * copied from this reader (mw.cw.cr == this), and the signature
+                 * and exceptions of the method have not been changed, then it
+                 * is possible to skip all visit events and just copy the
+                 * original code of the method to the writer (the access, name
+                 * and descriptor can have been changed, this is not important
+                 * since they are not copied as is from the reader).
+                 */
+                if (WRITER && mv instanceof MethodWriter) {
+                    MethodWriter mw = (MethodWriter) mv;
+                    if (mw.cw.cr == this) {
+                        if (signature == mw.signature) {
+                            boolean sameExceptions = false;
+                            if (exceptions == null) {
+                                sameExceptions = mw.exceptionCount == 0;
+                            } else {
+                                if (exceptions.length == mw.exceptionCount) {
+                                    sameExceptions = true;
+                                    for (j = exceptions.length - 1; j >= 0; --j)
+                                    {
+                                        w -= 2;
+                                        if (mw.exceptions[j] != readUnsignedShort(w))
+                                        {
+                                            sameExceptions = false;
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+                            if (sameExceptions) {
+                                /*
+                                 * we do not copy directly the code into
+                                 * MethodWriter to save a byte array copy
+                                 * operation. The real copy will be done in
+                                 * ClassWriter.toByteArray().
+                                 */
+                                mw.classReaderOffset = u0;
+                                mw.classReaderLength = u - u0;
+                                continue;
+                            }
+                        }
+                    }
+                }
+
+                if (ANNOTATIONS && dann != 0) {
+                    AnnotationVisitor dv = mv.visitAnnotationDefault();
+                    readAnnotationValue(dann, c, null, dv);
+                    if (dv != null) {
+                        dv.visitEnd();
+                    }
+                }
+                if (ANNOTATIONS) {
+                    for (j = 1; j >= 0; --j) {
+                        w = j == 0 ? ianns : anns;
+                        if (w != 0) {
+                            k = readUnsignedShort(w);
+                            w += 2;
+                            for (; k > 0; --k) {
+                                w = readAnnotationValues(w + 2,
+                                        c,
+                                        true,
+                                        mv.visitAnnotation(readUTF8(w, c), j != 0));
+                            }
+                        }
+                    }
+                }
+                if (ANNOTATIONS && mpanns != 0) {
+                    readParameterAnnotations(mpanns, desc, c, true, mv);
+                }
+                if (ANNOTATIONS && impanns != 0) {
+                    readParameterAnnotations(impanns, desc, c, false, mv);
+                }
+                while (cattrs != null) {
+                    attr = cattrs.next;
+                    cattrs.next = null;
+                    mv.visitAttribute(cattrs);
+                    cattrs = attr;
+                }
+            }
+
+            if (mv != null && v != 0) {
+                int maxStack = readUnsignedShort(v);
+                int maxLocals = readUnsignedShort(v + 2);
+                int codeLength = readInt(v + 4);
+                v += 8;
+
+                int codeStart = v;
+                int codeEnd = v + codeLength;
+
+                mv.visitCode();
+
+                // 1st phase: finds the labels
+                int label;
+                Label[] labels = new Label[codeLength + 2];
+                readLabel(codeLength + 1, labels);
+                while (v < codeEnd) {
+                    w = v - codeStart;
+                    int opcode = b[v] & 0xFF;
+                    switch (ClassWriter.TYPE[opcode]) {
+                        case ClassWriter.NOARG_INSN:
+                        case ClassWriter.IMPLVAR_INSN:
+                            v += 1;
+                            break;
+                        case ClassWriter.LABEL_INSN:
+                            readLabel(w + readShort(v + 1), labels);
+                            v += 3;
+                            break;
+                        case ClassWriter.LABELW_INSN:
+                            readLabel(w + readInt(v + 1), labels);
+                            v += 5;
+                            break;
+                        case ClassWriter.WIDE_INSN:
+                            opcode = b[v + 1] & 0xFF;
+                            if (opcode == Opcodes.IINC) {
+                                v += 6;
+                            } else {
+                                v += 4;
+                            }
+                            break;
+                        case ClassWriter.TABL_INSN:
+                            // skips 0 to 3 padding bytes*
+                            v = v + 4 - (w & 3);
+                            // reads instruction
+                            readLabel(w + readInt(v), labels);
+                            j = readInt(v + 8) - readInt(v + 4) + 1;
+                            v += 12;
+                            for (; j > 0; --j) {
+                                readLabel(w + readInt(v), labels);
+                                v += 4;
+                            }
+                            break;
+                        case ClassWriter.LOOK_INSN:
+                            // skips 0 to 3 padding bytes*
+                            v = v + 4 - (w & 3);
+                            // reads instruction
+                            readLabel(w + readInt(v), labels);
+                            j = readInt(v + 4);
+                            v += 8;
+                            for (; j > 0; --j) {
+                                readLabel(w + readInt(v + 4), labels);
+                                v += 8;
+                            }
+                            break;
+                        case ClassWriter.VAR_INSN:
+                        case ClassWriter.SBYTE_INSN:
+                        case ClassWriter.LDC_INSN:
+                            v += 2;
+                            break;
+                        case ClassWriter.SHORT_INSN:
+                        case ClassWriter.LDCW_INSN:
+                        case ClassWriter.FIELDORMETH_INSN:
+                        case ClassWriter.TYPE_INSN:
+                        case ClassWriter.IINC_INSN:
+                            v += 3;
+                            break;
+                        case ClassWriter.ITFMETH_INSN:
+                        case ClassWriter.INDYMETH_INSN:
+                            v += 5;
+                            break;
+                        // case MANA_INSN:
+                        default:
+                            v += 4;
+                            break;
+                    }
+                }
+                // parses the try catch entries
+                j = readUnsignedShort(v);
+                v += 2;
+                for (; j > 0; --j) {
+                    Label start = readLabel(readUnsignedShort(v), labels);
+                    Label end = readLabel(readUnsignedShort(v + 2), labels);
+                    Label handler = readLabel(readUnsignedShort(v + 4), labels);
+                    int type = readUnsignedShort(v + 6);
+                    if (type == 0) {
+                        mv.visitTryCatchBlock(start, end, handler, null);
+                    } else {
+                        mv.visitTryCatchBlock(start,
+                                end,
+                                handler,
+                                readUTF8(items[type], c));
+                    }
+                    v += 8;
+                }
+                // parses the local variable, line number tables, and code
+                // attributes
+                int varTable = 0;
+                int varTypeTable = 0;
+                int stackMap = 0;
+                int stackMapSize = 0;
+                int frameCount = 0;
+                int frameMode = 0;
+                int frameOffset = 0;
+                int frameLocalCount = 0;
+                int frameLocalDiff = 0;
+                int frameStackCount = 0;
+                Object[] frameLocal = null;
+                Object[] frameStack = null;
+                boolean zip = true;
+                cattrs = null;
+                j = readUnsignedShort(v);
+                v += 2;
+                for (; j > 0; --j) {
+                    attrName = readUTF8(v, c);
+                    if ("LocalVariableTable".equals(attrName)) {
+                        if (!skipDebug) {
+                            varTable = v + 6;
+                            k = readUnsignedShort(v + 6);
+                            w = v + 8;
+                            for (; k > 0; --k) {
+                                label = readUnsignedShort(w);
+                                if (labels[label] == null) {
+                                    readLabel(label, labels).status |= Label.DEBUG;
+                                }
+                                label += readUnsignedShort(w + 2);
+                                if (labels[label] == null) {
+                                    readLabel(label, labels).status |= Label.DEBUG;
+                                }
+                                w += 10;
+                            }
+                        }
+                    } else if ("LocalVariableTypeTable".equals(attrName)) {
+                        varTypeTable = v + 6;
+                    } else if ("LineNumberTable".equals(attrName)) {
+                        if (!skipDebug) {
+                            k = readUnsignedShort(v + 6);
+                            w = v + 8;
+                            for (; k > 0; --k) {
+                                label = readUnsignedShort(w);
+                                if (labels[label] == null) {
+                                    readLabel(label, labels).status |= Label.DEBUG;
+                                }
+                                labels[label].line = readUnsignedShort(w + 2);
+                                w += 4;
+                            }
+                        }
+                    } else if (FRAMES && "StackMapTable".equals(attrName)) {
+                        if ((flags & SKIP_FRAMES) == 0) {
+                            stackMap = v + 8;
+                            stackMapSize = readInt(v + 2);
+                            frameCount = readUnsignedShort(v + 6);
+                        }
+                        /*
+                         * here we do not extract the labels corresponding to
+                         * the attribute content. This would require a full
+                         * parsing of the attribute, which would need to be
+                         * repeated in the second phase (see below). Instead the
+                         * content of the attribute is read one frame at a time
+                         * (i.e. after a frame has been visited, the next frame
+                         * is read), and the labels it contains are also
+                         * extracted one frame at a time. Thanks to the ordering
+                         * of frames, having only a "one frame lookahead" is not
+                         * a problem, i.e. it is not possible to see an offset
+                         * smaller than the offset of the current insn and for
+                         * which no Label exist.
+                         */
+                        /*
+                         * This is not true for UNINITIALIZED type offsets. We
+                         * solve this by parsing the stack map table without a
+                         * full decoding (see below).
+                         */
+                    } else if (FRAMES && "StackMap".equals(attrName)) {
+                        if ((flags & SKIP_FRAMES) == 0) {
+                            stackMap = v + 8;
+                            stackMapSize = readInt(v + 2);
+                            frameCount = readUnsignedShort(v + 6);
+                            zip = false;
+                        }
+                        /*
+                         * IMPORTANT! here we assume that the frames are
+                         * ordered, as in the StackMapTable attribute, although
+                         * this is not guaranteed by the attribute format.
+                         */
+                    } else {
+                        for (k = 0; k < attrs.length; ++k) {
+                            if (attrs[k].type.equals(attrName)) {
+                                attr = attrs[k].read(this,
+                                        v + 6,
+                                        readInt(v + 2),
+                                        c,
+                                        codeStart - 8,
+                                        labels);
+                                if (attr != null) {
+                                    attr.next = cattrs;
+                                    cattrs = attr;
+                                }
+                            }
+                        }
+                    }
+                    v += 6 + readInt(v + 2);
+                }
+
+                // 2nd phase: visits each instruction
+                if (FRAMES && stackMap != 0) {
+                    // creates the very first (implicit) frame from the method
+                    // descriptor
+                    frameLocal = new Object[maxLocals];
+                    frameStack = new Object[maxStack];
+                    if (unzip) {
+                        int local = 0;
+                        if ((access & Opcodes.ACC_STATIC) == 0) {
+                            if ("<init>".equals(name)) {
+                                frameLocal[local++] = Opcodes.UNINITIALIZED_THIS;
+                            } else {
+                                frameLocal[local++] = readClass(header + 2, c);
+                            }
+                        }
+                        j = 1;
+                        loop: while (true) {
+                            k = j;
+                            switch (desc.charAt(j++)) {
+                                case 'Z':
+                                case 'C':
+                                case 'B':
+                                case 'S':
+                                case 'I':
+                                    frameLocal[local++] = Opcodes.INTEGER;
+                                    break;
+                                case 'F':
+                                    frameLocal[local++] = Opcodes.FLOAT;
+                                    break;
+                                case 'J':
+                                    frameLocal[local++] = Opcodes.LONG;
+                                    break;
+                                case 'D':
+                                    frameLocal[local++] = Opcodes.DOUBLE;
+                                    break;
+                                case '[':
+                                    while (desc.charAt(j) == '[') {
+                                        ++j;
+                                    }
+                                    if (desc.charAt(j) == 'L') {
+                                        ++j;
+                                        while (desc.charAt(j) != ';') {
+                                            ++j;
+                                        }
+                                    }
+                                    frameLocal[local++] = desc.substring(k, ++j);
+                                    break;
+                                case 'L':
+                                    while (desc.charAt(j) != ';') {
+                                        ++j;
+                                    }
+                                    frameLocal[local++] = desc.substring(k + 1,
+                                            j++);
+                                    break;
+                                default:
+                                    break loop;
+                            }
+                        }
+                        frameLocalCount = local;
+                    }
+                    /*
+                     * for the first explicit frame the offset is not
+                     * offset_delta + 1 but only offset_delta; setting the
+                     * implicit frame offset to -1 allow the use of the
+                     * "offset_delta + 1" rule in all cases
+                     */
+                    frameOffset = -1;
+                    /*
+                     * Finds labels for UNINITIALIZED frame types. Instead of
+                     * decoding each element of the stack map table, we look
+                     * for 3 consecutive bytes that "look like" an UNINITIALIZED
+                     * type (tag 8, offset within code bounds, NEW instruction
+                     * at this offset). We may find false positives (i.e. not
+                     * real UNINITIALIZED types), but this should be rare, and
+                     * the only consequence will be the creation of an unneeded
+                     * label. This is better than creating a label for each NEW
+                     * instruction, and faster than fully decoding the whole
+                     * stack map table.
+                     */
+                    for (j = stackMap; j < stackMap + stackMapSize - 2; ++j) {
+                        if (b[j] == 8) { // UNINITIALIZED FRAME TYPE
+                            k = readUnsignedShort(j + 1);
+                            if (k >= 0 && k < codeLength) { // potential offset
+                                if ((b[codeStart + k] & 0xFF) == Opcodes.NEW) { // NEW at this offset
+                                    readLabel(k, labels);
+                                }
+                            }
+                        }
+                    }
+                }
+                v = codeStart;
+                Label l;
+                while (v < codeEnd) {
+                    w = v - codeStart;
+
+                    l = labels[w];
+                    if (l != null) {
+                        mv.visitLabel(l);
+                        if (!skipDebug && l.line > 0) {
+                            mv.visitLineNumber(l.line, l);
+                        }
+                    }
+
+                    while (FRAMES && frameLocal != null
+                            && (frameOffset == w || frameOffset == -1))
+                    {
+                        // if there is a frame for this offset,
+                        // makes the visitor visit it,
+                        // and reads the next frame if there is one.
+                        if (!zip || unzip) {
+                            mv.visitFrame(Opcodes.F_NEW,
+                                    frameLocalCount,
+                                    frameLocal,
+                                    frameStackCount,
+                                    frameStack);
+                        } else if (frameOffset != -1) {
+                            mv.visitFrame(frameMode,
+                                    frameLocalDiff,
+                                    frameLocal,
+                                    frameStackCount,
+                                    frameStack);
+                        }
+
+                        if (frameCount > 0) {
+                            int tag, delta, n;
+                            if (zip) {
+                                tag = b[stackMap++] & 0xFF;
+                            } else {
+                                tag = MethodWriter.FULL_FRAME;
+                                frameOffset = -1;
+                            }
+                            frameLocalDiff = 0;
+                            if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME)
+                            {
+                                delta = tag;
+                                frameMode = Opcodes.F_SAME;
+                                frameStackCount = 0;
+                            } else if (tag < MethodWriter.RESERVED) {
+                                delta = tag
+                                        - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
+                                stackMap = readFrameType(frameStack,
+                                        0,
+                                        stackMap,
+                                        c,
+                                        labels);
+                                frameMode = Opcodes.F_SAME1;
+                                frameStackCount = 1;
+                            } else {
+                                delta = readUnsignedShort(stackMap);
+                                stackMap += 2;
+                                if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
+                                {
+                                    stackMap = readFrameType(frameStack,
+                                            0,
+                                            stackMap,
+                                            c,
+                                            labels);
+                                    frameMode = Opcodes.F_SAME1;
+                                    frameStackCount = 1;
+                                } else if (tag >= MethodWriter.CHOP_FRAME
+                                        && tag < MethodWriter.SAME_FRAME_EXTENDED)
+                                {
+                                    frameMode = Opcodes.F_CHOP;
+                                    frameLocalDiff = MethodWriter.SAME_FRAME_EXTENDED
+                                            - tag;
+                                    frameLocalCount -= frameLocalDiff;
+                                    frameStackCount = 0;
+                                } else if (tag == MethodWriter.SAME_FRAME_EXTENDED)
+                                {
+                                    frameMode = Opcodes.F_SAME;
+                                    frameStackCount = 0;
+                                } else if (tag < MethodWriter.FULL_FRAME) {
+                                    j = unzip ? frameLocalCount : 0;
+                                    for (k = tag
+                                            - MethodWriter.SAME_FRAME_EXTENDED; k > 0; k--)
+                                    {
+                                        stackMap = readFrameType(frameLocal,
+                                                j++,
+                                                stackMap,
+                                                c,
+                                                labels);
+                                    }
+                                    frameMode = Opcodes.F_APPEND;
+                                    frameLocalDiff = tag
+                                            - MethodWriter.SAME_FRAME_EXTENDED;
+                                    frameLocalCount += frameLocalDiff;
+                                    frameStackCount = 0;
+                                } else { // if (tag == FULL_FRAME) {
+                                    frameMode = Opcodes.F_FULL;
+                                    n = frameLocalDiff = frameLocalCount = readUnsignedShort(stackMap);
+                                    stackMap += 2;
+                                    for (j = 0; n > 0; n--) {
+                                        stackMap = readFrameType(frameLocal,
+                                                j++,
+                                                stackMap,
+                                                c,
+                                                labels);
+                                    }
+                                    n = frameStackCount = readUnsignedShort(stackMap);
+                                    stackMap += 2;
+                                    for (j = 0; n > 0; n--) {
+                                        stackMap = readFrameType(frameStack,
+                                                j++,
+                                                stackMap,
+                                                c,
+                                                labels);
+                                    }
+                                }
+                            }
+                            frameOffset += delta + 1;
+                            readLabel(frameOffset, labels);
+
+                            --frameCount;
+                        } else {
+                            frameLocal = null;
+                        }
+                    }
+
+                    int opcode = b[v] & 0xFF;
+                    switch (ClassWriter.TYPE[opcode]) {
+                        case ClassWriter.NOARG_INSN:
+                            mv.visitInsn(opcode);
+                            v += 1;
+                            break;
+                        case ClassWriter.IMPLVAR_INSN:
+                            if (opcode > Opcodes.ISTORE) {
+                                opcode -= 59; // ISTORE_0
+                                mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2),
+                                        opcode & 0x3);
+                            } else {
+                                opcode -= 26; // ILOAD_0
+                                mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2),
+                                        opcode & 0x3);
+                            }
+                            v += 1;
+                            break;
+                        case ClassWriter.LABEL_INSN:
+                            mv.visitJumpInsn(opcode, labels[w
+                                    + readShort(v + 1)]);
+                            v += 3;
+                            break;
+                        case ClassWriter.LABELW_INSN:
+                            mv.visitJumpInsn(opcode - 33, labels[w
+                                    + readInt(v + 1)]);
+                            v += 5;
+                            break;
+                        case ClassWriter.WIDE_INSN:
+                            opcode = b[v + 1] & 0xFF;
+                            if (opcode == Opcodes.IINC) {
+                                mv.visitIincInsn(readUnsignedShort(v + 2),
+                                        readShort(v + 4));
+                                v += 6;
+                            } else {
+                                mv.visitVarInsn(opcode,
+                                        readUnsignedShort(v + 2));
+                                v += 4;
+                            }
+                            break;
+                        case ClassWriter.TABL_INSN:
+                            // skips 0 to 3 padding bytes
+                            v = v + 4 - (w & 3);
+                            // reads instruction
+                            label = w + readInt(v);
+                            int min = readInt(v + 4);
+                            int max = readInt(v + 8);
+                            v += 12;
+                            Label[] table = new Label[max - min + 1];
+                            for (j = 0; j < table.length; ++j) {
+                                table[j] = labels[w + readInt(v)];
+                                v += 4;
+                            }
+                            mv.visitTableSwitchInsn(min,
+                                    max,
+                                    labels[label],
+                                    table);
+                            break;
+                        case ClassWriter.LOOK_INSN:
+                            // skips 0 to 3 padding bytes
+                            v = v + 4 - (w & 3);
+                            // reads instruction
+                            label = w + readInt(v);
+                            j = readInt(v + 4);
+                            v += 8;
+                            int[] keys = new int[j];
+                            Label[] values = new Label[j];
+                            for (j = 0; j < keys.length; ++j) {
+                                keys[j] = readInt(v);
+                                values[j] = labels[w + readInt(v + 4)];
+                                v += 8;
+                            }
+                            mv.visitLookupSwitchInsn(labels[label],
+                                    keys,
+                                    values);
+                            break;
+                        case ClassWriter.VAR_INSN:
+                            mv.visitVarInsn(opcode, b[v + 1] & 0xFF);
+                            v += 2;
+                            break;
+                        case ClassWriter.SBYTE_INSN:
+                            mv.visitIntInsn(opcode, b[v + 1]);
+                            v += 2;
+                            break;
+                        case ClassWriter.SHORT_INSN:
+                            mv.visitIntInsn(opcode, readShort(v + 1));
+                            v += 3;
+                            break;
+                        case ClassWriter.LDC_INSN:
+                            mv.visitLdcInsn(readConst(b[v + 1] & 0xFF, c));
+                            v += 2;
+                            break;
+                        case ClassWriter.LDCW_INSN:
+                            mv.visitLdcInsn(readConst(readUnsignedShort(v + 1),
+                                    c));
+                            v += 3;
+                            break;
+                        case ClassWriter.FIELDORMETH_INSN:
+                        case ClassWriter.ITFMETH_INSN: {
+                            int cpIndex = items[readUnsignedShort(v + 1)];
+                            String iowner = readClass(cpIndex, c);
+                            cpIndex = items[readUnsignedShort(cpIndex + 2)];
+                            String iname = readUTF8(cpIndex, c);
+                            String idesc = readUTF8(cpIndex + 2, c);
+                            if (opcode < Opcodes.INVOKEVIRTUAL) {
+                                mv.visitFieldInsn(opcode, iowner, iname, idesc);
+                            } else {
+                                mv.visitMethodInsn(opcode, iowner, iname, idesc);
+                            }
+                            if (opcode == Opcodes.INVOKEINTERFACE) {
+                                v += 5;
+                            } else {
+                                v += 3;
+                            }
+                            break;
+                        }
+                        case ClassWriter.INDYMETH_INSN: {
+                            int cpIndex = items[readUnsignedShort(v + 1)];
+                            int bsmIndex = bootstrapMethods[readUnsignedShort(cpIndex)];
+                            cpIndex = items[readUnsignedShort(cpIndex + 2)];
+                            String iname = readUTF8(cpIndex, c);
+                            String idesc = readUTF8(cpIndex + 2, c);
+
+                            int mhIndex = readUnsignedShort(bsmIndex);
+                            Handle bsm = (Handle) readConst(mhIndex, c);
+                            int bsmArgCount = readUnsignedShort(bsmIndex + 2);
+                            Object[] bsmArgs = new Object[bsmArgCount];
+                            bsmIndex += 4;
+                            for(int a = 0; a < bsmArgCount; a++) {
+                                int argIndex = readUnsignedShort(bsmIndex);
+                                bsmArgs[a] = readConst(argIndex, c);
+                                bsmIndex += 2;
+                            }
+                            mv.visitInvokeDynamicInsn(iname, idesc, bsm, bsmArgs);
+
+                            v += 5;
+                            break;
+                        }
+                        case ClassWriter.TYPE_INSN:
+                            mv.visitTypeInsn(opcode, readClass(v + 1, c));
+                            v += 3;
+                            break;
+                        case ClassWriter.IINC_INSN:
+                            mv.visitIincInsn(b[v + 1] & 0xFF, b[v + 2]);
+                            v += 3;
+                            break;
+                        // case MANA_INSN:
+                        default:
+                            mv.visitMultiANewArrayInsn(readClass(v + 1, c),
+                                    b[v + 3] & 0xFF);
+                            v += 4;
+                            break;
+                    }
+                }
+                l = labels[codeEnd - codeStart];
+                if (l != null) {
+                    mv.visitLabel(l);
+                }
+                // visits the local variable tables
+                if (!skipDebug && varTable != 0) {
+                    int[] typeTable = null;
+                    if (varTypeTable != 0) {
+                        k = readUnsignedShort(varTypeTable) * 3;
+                        w = varTypeTable + 2;
+                        typeTable = new int[k];
+                        while (k > 0) {
+                            typeTable[--k] = w + 6; // signature
+                            typeTable[--k] = readUnsignedShort(w + 8); // index
+                            typeTable[--k] = readUnsignedShort(w); // start
+                            w += 10;
+                        }
+                    }
+                    k = readUnsignedShort(varTable);
+                    w = varTable + 2;
+                    for (; k > 0; --k) {
+                        int start = readUnsignedShort(w);
+                        int length = readUnsignedShort(w + 2);
+                        int index = readUnsignedShort(w + 8);
+                        String vsignature = null;
+                        if (typeTable != null) {
+                            for (int a = 0; a < typeTable.length; a += 3) {
+                                if (typeTable[a] == start
+                                        && typeTable[a + 1] == index)
+                                {
+                                    vsignature = readUTF8(typeTable[a + 2], c);
+                                    break;
+                                }
+                            }
+                        }
+                        mv.visitLocalVariable(readUTF8(w + 4, c),
+                                readUTF8(w + 6, c),
+                                vsignature,
+                                labels[start],
+                                labels[start + length],
+                                index);
+                        w += 10;
+                    }
+                }
+                // visits the other attributes
+                while (cattrs != null) {
+                    attr = cattrs.next;
+                    cattrs.next = null;
+                    mv.visitAttribute(cattrs);
+                    cattrs = attr;
+                }
+                // visits the max stack and max locals values
+                mv.visitMaxs(maxStack, maxLocals);
+            }
+
+            if (mv != null) {
+                mv.visitEnd();
+            }
+        }
+
+        // visits the end of the class
+        classVisitor.visitEnd();
+    }
+
+    /**
+     * Reads parameter annotations and makes the given visitor visit them.
+     *
+     * @param v start offset in {@link #b b} of the annotations to be read.
+     * @param desc the method descriptor.
+     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+     *        {@link #readClass(int,char[]) readClass} or
+     *        {@link #readConst readConst}.
+     * @param visible <tt>true</tt> if the annotations to be read are visible
+     *        at runtime.
+     * @param mv the visitor that must visit the annotations.
+     */
+    private void readParameterAnnotations(
+        int v,
+        final String desc,
+        final char[] buf,
+        final boolean visible,
+        final MethodVisitor mv)
+    {
+        int i;
+        int n = b[v++] & 0xFF;
+        // workaround for a bug in javac (javac compiler generates a parameter
+        // annotation array whose size is equal to the number of parameters in
+        // the Java source file, while it should generate an array whose size is
+        // equal to the number of parameters in the method descriptor - which
+        // includes the synthetic parameters added by the compiler). This work-
+        // around supposes that the synthetic parameters are the first ones.
+        int synthetics = Type.getArgumentTypes(desc).length - n;
+        AnnotationVisitor av;
+        for (i = 0; i < synthetics; ++i) {
+            // virtual annotation to detect synthetic parameters in MethodWriter
+            av = mv.visitParameterAnnotation(i, "Ljava/lang/Synthetic;", false);
+            if (av != null) {
+                av.visitEnd();
+            }
+        }
+        for (; i < n + synthetics; ++i) {
+            int j = readUnsignedShort(v);
+            v += 2;
+            for (; j > 0; --j) {
+                av = mv.visitParameterAnnotation(i, readUTF8(v, buf), visible);
+                v = readAnnotationValues(v + 2, buf, true, av);
+            }
+        }
+    }
+
+    /**
+     * Reads the values of an annotation and makes the given visitor visit them.
+     *
+     * @param v the start offset in {@link #b b} of the values to be read
+     *        (including the unsigned short that gives the number of values).
+     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+     *        {@link #readClass(int,char[]) readClass} or
+     *        {@link #readConst readConst}.
+     * @param named if the annotation values are named or not.
+     * @param av the visitor that must visit the values.
+     * @return the end offset of the annotation values.
+     */
+    private int readAnnotationValues(
+        int v,
+        final char[] buf,
+        final boolean named,
+        final AnnotationVisitor av)
+    {
+        int i = readUnsignedShort(v);
+        v += 2;
+        if (named) {
+            for (; i > 0; --i) {
+                v = readAnnotationValue(v + 2, buf, readUTF8(v, buf), av);
+            }
+        } else {
+            for (; i > 0; --i) {
+                v = readAnnotationValue(v, buf, null, av);
+            }
+        }
+        if (av != null) {
+            av.visitEnd();
+        }
+        return v;
+    }
+
+    /**
+     * Reads a value of an annotation and makes the given visitor visit it.
+     *
+     * @param v the start offset in {@link #b b} of the value to be read (<i>not
+     *        including the value name constant pool index</i>).
+     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+     *        {@link #readClass(int,char[]) readClass} or
+     *        {@link #readConst readConst}.
+     * @param name the name of the value to be read.
+     * @param av the visitor that must visit the value.
+     * @return the end offset of the annotation value.
+     */
+    private int readAnnotationValue(
+        int v,
+        final char[] buf,
+        final String name,
+        final AnnotationVisitor av)
+    {
+        int i;
+        if (av == null) {
+            switch (b[v] & 0xFF) {
+                case 'e': // enum_const_value
+                    return v + 5;
+                case '@': // annotation_value
+                    return readAnnotationValues(v + 3, buf, true, null);
+                case '[': // array_value
+                    return readAnnotationValues(v + 1, buf, false, null);
+                default:
+                    return v + 3;
+            }
+        }
+        switch (b[v++] & 0xFF) {
+            case 'I': // pointer to CONSTANT_Integer
+            case 'J': // pointer to CONSTANT_Long
+            case 'F': // pointer to CONSTANT_Float
+            case 'D': // pointer to CONSTANT_Double
+                av.visit(name, readConst(readUnsignedShort(v), buf));
+                v += 2;
+                break;
+            case 'B': // pointer to CONSTANT_Byte
+                av.visit(name,
+                        new Byte((byte) readInt(items[readUnsignedShort(v)])));
+                v += 2;
+                break;
+            case 'Z': // pointer to CONSTANT_Boolean
+                av.visit(name, readInt(items[readUnsignedShort(v)]) == 0
+                        ? Boolean.FALSE
+                        : Boolean.TRUE);
+                v += 2;
+                break;
+            case 'S': // pointer to CONSTANT_Short
+                av.visit(name,
+                        new Short((short) readInt(items[readUnsignedShort(v)])));
+                v += 2;
+                break;
+            case 'C': // pointer to CONSTANT_Char
+                av.visit(name,
+                        new Character((char) readInt(items[readUnsignedShort(v)])));
+                v += 2;
+                break;
+            case 's': // pointer to CONSTANT_Utf8
+                av.visit(name, readUTF8(v, buf));
+                v += 2;
+                break;
+            case 'e': // enum_const_value
+                av.visitEnum(name, readUTF8(v, buf), readUTF8(v + 2, buf));
+                v += 4;
+                break;
+            case 'c': // class_info
+                av.visit(name, Type.getType(readUTF8(v, buf)));
+                v += 2;
+                break;
+            case '@': // annotation_value
+                v = readAnnotationValues(v + 2,
+                        buf,
+                        true,
+                        av.visitAnnotation(name, readUTF8(v, buf)));
+                break;
+            case '[': // array_value
+                int size = readUnsignedShort(v);
+                v += 2;
+                if (size == 0) {
+                    return readAnnotationValues(v - 2,
+                            buf,
+                            false,
+                            av.visitArray(name));
+                }
+                switch (this.b[v++] & 0xFF) {
+                    case 'B':
+                        byte[] bv = new byte[size];
+                        for (i = 0; i < size; i++) {
+                            bv[i] = (byte) readInt(items[readUnsignedShort(v)]);
+                            v += 3;
+                        }
+                        av.visit(name, bv);
+                        --v;
+                        break;
+                    case 'Z':
+                        boolean[] zv = new boolean[size];
+                        for (i = 0; i < size; i++) {
+                            zv[i] = readInt(items[readUnsignedShort(v)]) != 0;
+                            v += 3;
+                        }
+                        av.visit(name, zv);
+                        --v;
+                        break;
+                    case 'S':
+                        short[] sv = new short[size];
+                        for (i = 0; i < size; i++) {
+                            sv[i] = (short) readInt(items[readUnsignedShort(v)]);
+                            v += 3;
+                        }
+                        av.visit(name, sv);
+                        --v;
+                        break;
+                    case 'C':
+                        char[] cv = new char[size];
+                        for (i = 0; i < size; i++) {
+                            cv[i] = (char) readInt(items[readUnsignedShort(v)]);
+                            v += 3;
+                        }
+                        av.visit(name, cv);
+                        --v;
+                        break;
+                    case 'I':
+                        int[] iv = new int[size];
+                        for (i = 0; i < size; i++) {
+                            iv[i] = readInt(items[readUnsignedShort(v)]);
+                            v += 3;
+                        }
+                        av.visit(name, iv);
+                        --v;
+                        break;
+                    case 'J':
+                        long[] lv = new long[size];
+                        for (i = 0; i < size; i++) {
+                            lv[i] = readLong(items[readUnsignedShort(v)]);
+                            v += 3;
+                        }
+                        av.visit(name, lv);
+                        --v;
+                        break;
+                    case 'F':
+                        float[] fv = new float[size];
+                        for (i = 0; i < size; i++) {
+                            fv[i] = Float.intBitsToFloat(readInt(items[readUnsignedShort(v)]));
+                            v += 3;
+                        }
+                        av.visit(name, fv);
+                        --v;
+                        break;
+                    case 'D':
+                        double[] dv = new double[size];
+                        for (i = 0; i < size; i++) {
+                            dv[i] = Double.longBitsToDouble(readLong(items[readUnsignedShort(v)]));
+                            v += 3;
+                        }
+                        av.visit(name, dv);
+                        --v;
+                        break;
+                    default:
+                        v = readAnnotationValues(v - 3,
+                                buf,
+                                false,
+                                av.visitArray(name));
+                }
+        }
+        return v;
+    }
+
+    private int readFrameType(
+        final Object[] frame,
+        final int index,
+        int v,
+        final char[] buf,
+        final Label[] labels)
+    {
+        int type = b[v++] & 0xFF;
+        switch (type) {
+            case 0:
+                frame[index] = Opcodes.TOP;
+                break;
+            case 1:
+                frame[index] = Opcodes.INTEGER;
+                break;
+            case 2:
+                frame[index] = Opcodes.FLOAT;
+                break;
+            case 3:
+                frame[index] = Opcodes.DOUBLE;
+                break;
+            case 4:
+                frame[index] = Opcodes.LONG;
+                break;
+            case 5:
+                frame[index] = Opcodes.NULL;
+                break;
+            case 6:
+                frame[index] = Opcodes.UNINITIALIZED_THIS;
+                break;
+            case 7: // Object
+                frame[index] = readClass(v, buf);
+                v += 2;
+                break;
+            default: // Uninitialized
+                frame[index] = readLabel(readUnsignedShort(v), labels);
+                v += 2;
+        }
+        return v;
+    }
+
+    /**
+     * Returns the label corresponding to the given offset. The default
+     * implementation of this method creates a label for the given offset if it
+     * has not been already created.
+     *
+     * @param offset a bytecode offset in a method.
+     * @param labels the already created labels, indexed by their offset. If a
+     *        label already exists for offset this method must not create a new
+     *        one. Otherwise it must store the new label in this array.
+     * @return a non null Label, which must be equal to labels[offset].
+     */
+    protected Label readLabel(int offset, Label[] labels) {
+        if (labels[offset] == null) {
+            labels[offset] = new Label();
+        }
+        return labels[offset];
+    }
+
+    /**
+     * Reads an attribute in {@link #b b}.
+     *
+     * @param attrs prototypes of the attributes that must be parsed during the
+     *        visit of the class. Any attribute whose type is not equal to the
+     *        type of one the prototypes is ignored (i.e. an empty
+     *        {@link Attribute} instance is returned).
+     * @param type the type of the attribute.
+     * @param off index of the first byte of the attribute's content in
+     *        {@link #b b}. The 6 attribute header bytes, containing the type
+     *        and the length of the attribute, are not taken into account here
+     *        (they have already been read).
+     * @param len the length of the attribute's content.
+     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+     *        {@link #readClass(int,char[]) readClass} or
+     *        {@link #readConst readConst}.
+     * @param codeOff index of the first byte of code's attribute content in
+     *        {@link #b b}, or -1 if the attribute to be read is not a code
+     *        attribute. The 6 attribute header bytes, containing the type and
+     *        the length of the attribute, are not taken into account here.
+     * @param labels the labels of the method's code, or <tt>null</tt> if the
+     *        attribute to be read is not a code attribute.
+     * @return the attribute that has been read, or <tt>null</tt> to skip this
+     *         attribute.
+     */
+    private Attribute readAttribute(
+        final Attribute[] attrs,
+        final String type,
+        final int off,
+        final int len,
+        final char[] buf,
+        final int codeOff,
+        final Label[] labels)
+    {
+        for (int i = 0; i < attrs.length; ++i) {
+            if (attrs[i].type.equals(type)) {
+                return attrs[i].read(this, off, len, buf, codeOff, labels);
+            }
+        }
+        return new Attribute(type).read(this, off, len, null, -1, null);
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods: low level parsing
+    // ------------------------------------------------------------------------
+
+    /**
+     *  Returns the number of constant pool items in {@link #b b}.
+     *
+     *  @return the number of constant pool items in {@link #b b}.
+     */
+    public int getItemCount() {
+        return items.length;
+    }
+
+    /**
+     * Returns the start index of the constant pool item in {@link #b b}, plus
+     * one. <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param item the index a constant pool item.
+     * @return the start index of the constant pool item in {@link #b b}, plus
+     *         one.
+     */
+    public int getItem(final int item) {
+        return items[item];
+    }
+
+    /**
+     * Returns the maximum length of the strings contained in the constant pool
+     * of the class.
+     *
+     * @return the maximum length of the strings contained in the constant pool
+     *         of the class.
+     */
+    public int getMaxStringLength() {
+        return maxStringLength;
+    }
+
+    /**
+     * Reads a byte value in {@link #b b}. <i>This method is intended for
+     * {@link Attribute} sub classes, and is normally not needed by class
+     * generators or adapters.</i>
+     *
+     * @param index the start index of the value to be read in {@link #b b}.
+     * @return the read value.
+     */
+    public int readByte(final int index) {
+        return b[index] & 0xFF;
+    }
+
+    /**
+     * Reads an unsigned short value in {@link #b b}. <i>This method is
+     * intended for {@link Attribute} sub classes, and is normally not needed by
+     * class generators or adapters.</i>
+     *
+     * @param index the start index of the value to be read in {@link #b b}.
+     * @return the read value.
+     */
+    public int readUnsignedShort(final int index) {
+        byte[] b = this.b;
+        return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
+    }
+
+    /**
+     * Reads a signed short value in {@link #b b}. <i>This method is intended
+     * for {@link Attribute} sub classes, and is normally not needed by class
+     * generators or adapters.</i>
+     *
+     * @param index the start index of the value to be read in {@link #b b}.
+     * @return the read value.
+     */
+    public short readShort(final int index) {
+        byte[] b = this.b;
+        return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
+    }
+
+    /**
+     * Reads a signed int value in {@link #b b}. <i>This method is intended for
+     * {@link Attribute} sub classes, and is normally not needed by class
+     * generators or adapters.</i>
+     *
+     * @param index the start index of the value to be read in {@link #b b}.
+     * @return the read value.
+     */
+    public int readInt(final int index) {
+        byte[] b = this.b;
+        return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
+                | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
+    }
+
+    /**
+     * Reads a signed long value in {@link #b b}. <i>This method is intended
+     * for {@link Attribute} sub classes, and is normally not needed by class
+     * generators or adapters.</i>
+     *
+     * @param index the start index of the value to be read in {@link #b b}.
+     * @return the read value.
+     */
+    public long readLong(final int index) {
+        long l1 = readInt(index);
+        long l0 = readInt(index + 4) & 0xFFFFFFFFL;
+        return (l1 << 32) | l0;
+    }
+
+    /**
+     * Reads an UTF8 string constant pool item in {@link #b b}. <i>This method
+     * is intended for {@link Attribute} sub classes, and is normally not needed
+     * by class generators or adapters.</i>
+     *
+     * @param index the start index of an unsigned short value in {@link #b b},
+     *        whose value is the index of an UTF8 constant pool item.
+     * @param buf buffer to be used to read the item. This buffer must be
+     *        sufficiently large. It is not automatically resized.
+     * @return the String corresponding to the specified UTF8 item.
+     */
+    public String readUTF8(int index, final char[] buf) {
+        int item = readUnsignedShort(index);
+        String s = strings[item];
+        if (s != null) {
+            return s;
+        }
+        index = items[item];
+        return strings[item] = readUTF(index + 2, readUnsignedShort(index), buf);
+    }
+
+    /**
+     * Reads UTF8 string in {@link #b b}.
+     *
+     * @param index start offset of the UTF8 string to be read.
+     * @param utfLen length of the UTF8 string to be read.
+     * @param buf buffer to be used to read the string. This buffer must be
+     *        sufficiently large. It is not automatically resized.
+     * @return the String corresponding to the specified UTF8 string.
+     */
+    private String readUTF(int index, final int utfLen, final char[] buf) {
+        int endIndex = index + utfLen;
+        byte[] b = this.b;
+        int strLen = 0;
+        int c;
+        int st = 0;
+        char cc = 0;
+        while (index < endIndex) {
+            c = b[index++];
+            switch (st) {
+                case 0:
+                    c = c & 0xFF;
+                    if (c < 0x80) {  // 0xxxxxxx
+                        buf[strLen++] = (char) c;
+                    } else if (c < 0xE0 && c > 0xBF) {  // 110x xxxx 10xx xxxx
+                        cc = (char) (c & 0x1F);
+                        st = 1;
+                    } else {  // 1110 xxxx 10xx xxxx 10xx xxxx
+                        cc = (char) (c & 0x0F);
+                        st = 2;
+                    }
+                    break;
+
+                case 1:  // byte 2 of 2-byte char or byte 3 of 3-byte char
+                    buf[strLen++] = (char) ((cc << 6) | (c & 0x3F));
+                    st = 0;
+                    break;
+
+                case 2:  // byte 2 of 3-byte char
+                    cc = (char) ((cc << 6) | (c & 0x3F));
+                    st = 1;
+                    break;
+            }
+        }
+        return new String(buf, 0, strLen);
+    }
+
+    /**
+     * Reads a class constant pool item in {@link #b b}. <i>This method is
+     * intended for {@link Attribute} sub classes, and is normally not needed by
+     * class generators or adapters.</i>
+     *
+     * @param index the start index of an unsigned short value in {@link #b b},
+     *        whose value is the index of a class constant pool item.
+     * @param buf buffer to be used to read the item. This buffer must be
+     *        sufficiently large. It is not automatically resized.
+     * @return the String corresponding to the specified class item.
+     */
+    public String readClass(final int index, final char[] buf) {
+        // computes the start index of the CONSTANT_Class item in b
+        // and reads the CONSTANT_Utf8 item designated by
+        // the first two bytes of this CONSTANT_Class item
+        return readUTF8(items[readUnsignedShort(index)], buf);
+    }
+
+    /**
+     * Reads a numeric or string constant pool item in {@link #b b}. <i>This
+     * method is intended for {@link Attribute} sub classes, and is normally not
+     * needed by class generators or adapters.</i>
+     *
+     * @param item the index of a constant pool item.
+     * @param buf buffer to be used to read the item. This buffer must be
+     *        sufficiently large. It is not automatically resized.
+     * @return the {@link Integer}, {@link Float}, {@link Long}, {@link Double},
+     *         {@link String}, {@link Type} or {@link Handle} corresponding to
+     *         the given constant pool item.
+     */
+    public Object readConst(final int item, final char[] buf) {
+        int index = items[item];
+        switch (b[index - 1]) {
+            case ClassWriter.INT:
+                return new Integer(readInt(index));
+            case ClassWriter.FLOAT:
+                return new Float(Float.intBitsToFloat(readInt(index)));
+            case ClassWriter.LONG:
+                return new Long(readLong(index));
+            case ClassWriter.DOUBLE:
+                return new Double(Double.longBitsToDouble(readLong(index)));
+            case ClassWriter.CLASS:
+                return Type.getObjectType(readUTF8(index, buf));
+            case ClassWriter.STR:
+                return readUTF8(index, buf);
+            case ClassWriter.MTYPE:
+                return Type.getMethodType(readUTF8(index, buf));
+
+            //case ClassWriter.HANDLE_BASE + [1..9]:
+            default: {
+                int tag = readByte(index);
+                int[] items = this.items;
+                int cpIndex = items[readUnsignedShort(index + 1)];
+                String owner = readClass(cpIndex, buf);
+                cpIndex = items[readUnsignedShort(cpIndex + 2)];
+                String name = readUTF8(cpIndex, buf);
+                String desc = readUTF8(cpIndex + 2, buf);
+                return new Handle(tag, owner, name, desc);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/ClassVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,306 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java class. The methods of this class must be called
+ * in the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
+ * <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
+ * <tt>visitAttribute</tt> )* ( <tt>visitInnerClass</tt> |
+ * <tt>visitField</tt> | <tt>visitMethod</tt> )* <tt>visitEnd</tt>.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class ClassVisitor {
+
+    /**
+     * The ASM API version implemented by this visitor. The value of this field
+     * must be one of {@link Opcodes#ASM4}.
+     */
+    protected final int api;
+
+    /**
+     * The class visitor to which this visitor must delegate method calls. May
+     * be null.
+     */
+    protected ClassVisitor cv;
+
+    /**
+     * Constructs a new {@link ClassVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public ClassVisitor(final int api) {
+        this(api, null);
+    }
+
+    /**
+     * Constructs a new {@link ClassVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param cv the class visitor to which this visitor must delegate method
+     *        calls. May be null.
+     */
+    public ClassVisitor(final int api, final ClassVisitor cv) {
+        /*if (api != Opcodes.ASM4) {
+            throw new IllegalArgumentException();
+        }*/
+        this.api = api;
+        this.cv = cv;
+    }
+
+    /**
+     * Visits the header of the class.
+     *
+     * @param version the class version.
+     * @param access the class's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the class is deprecated.
+     * @param name the internal name of the class (see
+     *        {@link Type#getInternalName() getInternalName}).
+     * @param signature the signature of this class. May be <tt>null</tt> if
+     *        the class is not a generic one, and does not extend or implement
+     *        generic classes or interfaces.
+     * @param superName the internal of name of the super class (see
+     *        {@link Type#getInternalName() getInternalName}). For interfaces,
+     *        the super class is {@link Object}. May be <tt>null</tt>, but
+     *        only for the {@link Object} class.
+     * @param interfaces the internal names of the class's interfaces (see
+     *        {@link Type#getInternalName() getInternalName}). May be
+     *        <tt>null</tt>.
+     */
+    public void visit(
+        int version,
+        int access,
+        String name,
+        String signature,
+        String superName,
+        String[] interfaces)
+    {
+        if (cv != null) {
+            cv.visit(version, access, name, signature, superName, interfaces);
+        }
+    }
+
+    /**
+     * Visits the source of the class.
+     *
+     * @param source the name of the source file from which the class was
+     *        compiled. May be <tt>null</tt>.
+     * @param debug additional debug information to compute the correspondance
+     *        between source and compiled elements of the class. May be
+     *        <tt>null</tt>.
+     */
+    public void visitSource(String source, String debug) {
+        if (cv != null) {
+            cv.visitSource(source, debug);
+        }
+    }
+
+    /**
+     * Visits the enclosing class of the class. This method must be called only
+     * if the class has an enclosing class.
+     *
+     * @param owner internal name of the enclosing class of the class.
+     * @param name the name of the method that contains the class, or
+     *        <tt>null</tt> if the class is not enclosed in a method of its
+     *        enclosing class.
+     * @param desc the descriptor of the method that contains the class, or
+     *        <tt>null</tt> if the class is not enclosed in a method of its
+     *        enclosing class.
+     */
+    public void visitOuterClass(String owner, String name, String desc) {
+        if (cv != null)  {
+            cv.visitOuterClass(owner, name, desc);
+        }
+    }
+
+    /**
+     * Visits an annotation of the class.
+     *
+     * @param desc the class descriptor of the annotation class.
+     * @param visible <tt>true</tt> if the annotation is visible at runtime.
+     * @return a visitor to visit the annotation values, or <tt>null</tt> if
+     *         this visitor is not interested in visiting this annotation.
+     */
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        if (cv != null) {
+            return cv.visitAnnotation(desc, visible);
+        }
+        return null;
+    }
+
+    /**
+     * Visits a non standard attribute of the class.
+     *
+     * @param attr an attribute.
+     */
+    public void visitAttribute(Attribute attr) {
+        if (cv != null) {
+            cv.visitAttribute(attr);
+        }
+    }
+
+    /**
+     * Visits information about an inner class. This inner class is not
+     * necessarily a member of the class being visited.
+     *
+     * @param name the internal name of an inner class (see
+     *        {@link Type#getInternalName() getInternalName}).
+     * @param outerName the internal name of the class to which the inner class
+     *        belongs (see {@link Type#getInternalName() getInternalName}). May
+     *        be <tt>null</tt> for not member classes.
+     * @param innerName the (simple) name of the inner class inside its
+     *        enclosing class. May be <tt>null</tt> for anonymous inner
+     *        classes.
+     * @param access the access flags of the inner class as originally declared
+     *        in the enclosing class.
+     */
+    public void visitInnerClass(
+        String name,
+        String outerName,
+        String innerName,
+        int access)
+    {
+        if (cv != null) {
+            cv.visitInnerClass(name, outerName, innerName, access);
+        }
+    }
+
+    /**
+     * Visits a field of the class.
+     *
+     * @param access the field's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the field is synthetic and/or
+     *        deprecated.
+     * @param name the field's name.
+     * @param desc the field's descriptor (see {@link Type Type}).
+     * @param signature the field's signature. May be <tt>null</tt> if the
+     *        field's type does not use generic types.
+     * @param value the field's initial value. This parameter, which may be
+     *        <tt>null</tt> if the field does not have an initial value, must
+     *        be an {@link Integer}, a {@link Float}, a {@link Long}, a
+     *        {@link Double} or a {@link String} (for <tt>int</tt>,
+     *        <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
+     *        respectively). <i>This parameter is only used for static fields</i>.
+     *        Its value is ignored for non static fields, which must be
+     *        initialized through bytecode instructions in constructors or
+     *        methods.
+     * @return a visitor to visit field annotations and attributes, or
+     *         <tt>null</tt> if this class visitor is not interested in
+     *         visiting these annotations and attributes.
+     */
+    public FieldVisitor visitField(
+        int access,
+        String name,
+        String desc,
+        String signature,
+        Object value)
+    {
+        if (cv != null) {
+            return cv.visitField(access, name, desc, signature, value);
+        }
+        return null;
+    }
+
+    /**
+     * Visits a method of the class. This method <i>must</i> return a new
+     * {@link MethodVisitor} instance (or <tt>null</tt>) each time it is
+     * called, i.e., it should not return a previously returned visitor.
+     *
+     * @param access the method's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the method is synthetic and/or
+     *        deprecated.
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param signature the method's signature. May be <tt>null</tt> if the
+     *        method parameters, return type and exceptions do not use generic
+     *        types.
+     * @param exceptions the internal names of the method's exception classes
+     *        (see {@link Type#getInternalName() getInternalName}). May be
+     *        <tt>null</tt>.
+     * @return an object to visit the byte code of the method, or <tt>null</tt>
+     *         if this class visitor is not interested in visiting the code of
+     *         this method.
+     */
+    public MethodVisitor visitMethod(
+        int access,
+        String name,
+        String desc,
+        String signature,
+        String[] exceptions)
+    {
+        if (cv != null) {
+            return cv.visitMethod(access, name, desc, signature, exceptions);
+        }
+        return null;
+    }
+
+    /**
+     * Visits the end of the class. This method, which is the last one to be
+     * called, is used to inform the visitor that all the fields and methods of
+     * the class have been visited.
+     */
+    public void visitEnd() {
+        if (cv != null) {
+            cv.visitEnd();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/ClassWriter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1701 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A {@link ClassVisitor} that generates classes in bytecode form. More
+ * precisely this visitor generates a byte array conforming to the Java class
+ * file format. It can be used alone, to generate a Java class "from scratch",
+ * or with one or more {@link ClassReader ClassReader} and adapter class visitor
+ * to generate a modified class from one or more existing Java classes.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassWriter extends ClassVisitor {
+
+    /**
+     * Flag to automatically compute the maximum stack size and the maximum
+     * number of local variables of methods. If this flag is set, then the
+     * arguments of the {@link MethodVisitor#visitMaxs visitMaxs} method of the
+     * {@link MethodVisitor} returned by the {@link #visitMethod visitMethod}
+     * method will be ignored, and computed automatically from the signature and
+     * the bytecode of each method.
+     *
+     * @see #ClassWriter(int)
+     */
+    public static final int COMPUTE_MAXS = 1;
+
+    /**
+     * Flag to automatically compute the stack map frames of methods from
+     * scratch. If this flag is set, then the calls to the
+     * {@link MethodVisitor#visitFrame} method are ignored, and the stack map
+     * frames are recomputed from the methods bytecode. The arguments of the
+     * {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and
+     * recomputed from the bytecode. In other words, computeFrames implies
+     * computeMaxs.
+     *
+     * @see #ClassWriter(int)
+     */
+    public static final int COMPUTE_FRAMES = 2;
+
+    /**
+     * Pseudo access flag to distinguish between the synthetic attribute and
+     * the synthetic access flag.
+     */
+    static final int ACC_SYNTHETIC_ATTRIBUTE = 0x40000;
+
+    /**
+     * The type of instructions without any argument.
+     */
+    static final int NOARG_INSN = 0;
+
+    /**
+     * The type of instructions with an signed byte argument.
+     */
+    static final int SBYTE_INSN = 1;
+
+    /**
+     * The type of instructions with an signed short argument.
+     */
+    static final int SHORT_INSN = 2;
+
+    /**
+     * The type of instructions with a local variable index argument.
+     */
+    static final int VAR_INSN = 3;
+
+    /**
+     * The type of instructions with an implicit local variable index argument.
+     */
+    static final int IMPLVAR_INSN = 4;
+
+    /**
+     * The type of instructions with a type descriptor argument.
+     */
+    static final int TYPE_INSN = 5;
+
+    /**
+     * The type of field and method invocations instructions.
+     */
+    static final int FIELDORMETH_INSN = 6;
+
+    /**
+     * The type of the INVOKEINTERFACE/INVOKEDYNAMIC instruction.
+     */
+    static final int ITFMETH_INSN = 7;
+
+    /**
+     * The type of the INVOKEDYNAMIC instruction.
+     */
+    static final int INDYMETH_INSN = 8;
+
+    /**
+     * The type of instructions with a 2 bytes bytecode offset label.
+     */
+    static final int LABEL_INSN = 9;
+
+    /**
+     * The type of instructions with a 4 bytes bytecode offset label.
+     */
+    static final int LABELW_INSN = 10;
+
+    /**
+     * The type of the LDC instruction.
+     */
+    static final int LDC_INSN = 11;
+
+    /**
+     * The type of the LDC_W and LDC2_W instructions.
+     */
+    static final int LDCW_INSN = 12;
+
+    /**
+     * The type of the IINC instruction.
+     */
+    static final int IINC_INSN = 13;
+
+    /**
+     * The type of the TABLESWITCH instruction.
+     */
+    static final int TABL_INSN = 14;
+
+    /**
+     * The type of the LOOKUPSWITCH instruction.
+     */
+    static final int LOOK_INSN = 15;
+
+    /**
+     * The type of the MULTIANEWARRAY instruction.
+     */
+    static final int MANA_INSN = 16;
+
+    /**
+     * The type of the WIDE instruction.
+     */
+    static final int WIDE_INSN = 17;
+
+    /**
+     * The instruction types of all JVM opcodes.
+     */
+    static final byte[] TYPE;
+
+    /**
+     * The type of CONSTANT_Class constant pool items.
+     */
+    static final int CLASS = 7;
+
+    /**
+     * The type of CONSTANT_Fieldref constant pool items.
+     */
+    static final int FIELD = 9;
+
+    /**
+     * The type of CONSTANT_Methodref constant pool items.
+     */
+    static final int METH = 10;
+
+    /**
+     * The type of CONSTANT_InterfaceMethodref constant pool items.
+     */
+    static final int IMETH = 11;
+
+    /**
+     * The type of CONSTANT_String constant pool items.
+     */
+    static final int STR = 8;
+
+    /**
+     * The type of CONSTANT_Integer constant pool items.
+     */
+    static final int INT = 3;
+
+    /**
+     * The type of CONSTANT_Float constant pool items.
+     */
+    static final int FLOAT = 4;
+
+    /**
+     * The type of CONSTANT_Long constant pool items.
+     */
+    static final int LONG = 5;
+
+    /**
+     * The type of CONSTANT_Double constant pool items.
+     */
+    static final int DOUBLE = 6;
+
+    /**
+     * The type of CONSTANT_NameAndType constant pool items.
+     */
+    static final int NAME_TYPE = 12;
+
+    /**
+     * The type of CONSTANT_Utf8 constant pool items.
+     */
+    static final int UTF8 = 1;
+
+    /**
+     * The type of CONSTANT_MethodType constant pool items.
+     */
+    static final int MTYPE = 16;
+
+    /**
+     * The type of CONSTANT_MethodHandle constant pool items.
+     */
+    static final int HANDLE = 15;
+
+    /**
+     * The type of CONSTANT_InvokeDynamic constant pool items.
+     */
+    static final int INDY = 18;
+
+    /**
+     * The base value for all CONSTANT_MethodHandle constant pool items.
+     * Internally, ASM store the 9 variations of CONSTANT_MethodHandle into
+     * 9 different items.
+     */
+    static final int HANDLE_BASE = 20;
+
+    /**
+     * Normal type Item stored in the ClassWriter {@link ClassWriter#typeTable},
+     * instead of the constant pool, in order to avoid clashes with normal
+     * constant pool items in the ClassWriter constant pool's hash table.
+     */
+    static final int TYPE_NORMAL = 30;
+
+    /**
+     * Uninitialized type Item stored in the ClassWriter
+     * {@link ClassWriter#typeTable}, instead of the constant pool, in order to
+     * avoid clashes with normal constant pool items in the ClassWriter constant
+     * pool's hash table.
+     */
+    static final int TYPE_UNINIT = 31;
+
+    /**
+     * Merged type Item stored in the ClassWriter {@link ClassWriter#typeTable},
+     * instead of the constant pool, in order to avoid clashes with normal
+     * constant pool items in the ClassWriter constant pool's hash table.
+     */
+    static final int TYPE_MERGED = 32;
+
+    /**
+     * The type of BootstrapMethods items. These items are stored in a
+     * special class attribute named BootstrapMethods and
+     * not in the constant pool.
+     */
+    static final int BSM = 33;
+
+    /**
+     * The class reader from which this class writer was constructed, if any.
+     */
+    ClassReader cr;
+
+    /**
+     * Minor and major version numbers of the class to be generated.
+     */
+    int version;
+
+    /**
+     * Index of the next item to be added in the constant pool.
+     */
+    int index;
+
+    /**
+     * The constant pool of this class.
+     */
+    final ByteVector pool;
+
+    /**
+     * The constant pool's hash table data.
+     */
+    Item[] items;
+
+    /**
+     * The threshold of the constant pool's hash table.
+     */
+    int threshold;
+
+    /**
+     * A reusable key used to look for items in the {@link #items} hash table.
+     */
+    final Item key;
+
+    /**
+     * A reusable key used to look for items in the {@link #items} hash table.
+     */
+    final Item key2;
+
+    /**
+     * A reusable key used to look for items in the {@link #items} hash table.
+     */
+    final Item key3;
+
+    /**
+     * A reusable key used to look for items in the {@link #items} hash table.
+     */
+    final Item key4;
+
+    /**
+     * A type table used to temporarily store internal names that will not
+     * necessarily be stored in the constant pool. This type table is used by
+     * the control flow and data flow analysis algorithm used to compute stack
+     * map frames from scratch. This array associates to each index <tt>i</tt>
+     * the Item whose index is <tt>i</tt>. All Item objects stored in this
+     * array are also stored in the {@link #items} hash table. These two arrays
+     * allow to retrieve an Item from its index or, conversely, to get the index
+     * of an Item from its value. Each Item stores an internal name in its
+     * {@link Item#strVal1} field.
+     */
+    Item[] typeTable;
+
+    /**
+     * Number of elements in the {@link #typeTable} array.
+     */
+    private short typeCount;
+
+    /**
+     * The access flags of this class.
+     */
+    private int access;
+
+    /**
+     * The constant pool item that contains the internal name of this class.
+     */
+    private int name;
+
+    /**
+     * The internal name of this class.
+     */
+    String thisName;
+
+    /**
+     * The constant pool item that contains the signature of this class.
+     */
+    private int signature;
+
+    /**
+     * The constant pool item that contains the internal name of the super class
+     * of this class.
+     */
+    private int superName;
+
+    /**
+     * Number of interfaces implemented or extended by this class or interface.
+     */
+    private int interfaceCount;
+
+    /**
+     * The interfaces implemented or extended by this class or interface. More
+     * precisely, this array contains the indexes of the constant pool items
+     * that contain the internal names of these interfaces.
+     */
+    private int[] interfaces;
+
+    /**
+     * The index of the constant pool item that contains the name of the source
+     * file from which this class was compiled.
+     */
+    private int sourceFile;
+
+    /**
+     * The SourceDebug attribute of this class.
+     */
+    private ByteVector sourceDebug;
+
+    /**
+     * The constant pool item that contains the name of the enclosing class of
+     * this class.
+     */
+    private int enclosingMethodOwner;
+
+    /**
+     * The constant pool item that contains the name and descriptor of the
+     * enclosing method of this class.
+     */
+    private int enclosingMethod;
+
+    /**
+     * The runtime visible annotations of this class.
+     */
+    private AnnotationWriter anns;
+
+    /**
+     * The runtime invisible annotations of this class.
+     */
+    private AnnotationWriter ianns;
+
+    /**
+     * The non standard attributes of this class.
+     */
+    private Attribute attrs;
+
+    /**
+     * The number of entries in the InnerClasses attribute.
+     */
+    private int innerClassesCount;
+
+    /**
+     * The InnerClasses attribute.
+     */
+    private ByteVector innerClasses;
+
+    /**
+     * The number of entries in the BootstrapMethods attribute.
+     */
+    int bootstrapMethodsCount;
+
+    /**
+     * The BootstrapMethods attribute.
+     */
+    ByteVector bootstrapMethods;
+
+    /**
+     * The fields of this class. These fields are stored in a linked list of
+     * {@link FieldWriter} objects, linked to each other by their
+     * {@link FieldWriter#fv} field. This field stores the first element of
+     * this list.
+     */
+    FieldWriter firstField;
+
+    /**
+     * The fields of this class. These fields are stored in a linked list of
+     * {@link FieldWriter} objects, linked to each other by their
+     * {@link FieldWriter#fv} field. This field stores the last element of
+     * this list.
+     */
+    FieldWriter lastField;
+
+    /**
+     * The methods of this class. These methods are stored in a linked list of
+     * {@link MethodWriter} objects, linked to each other by their
+     * {@link MethodWriter#mv} field. This field stores the first element of
+     * this list.
+     */
+    MethodWriter firstMethod;
+
+    /**
+     * The methods of this class. These methods are stored in a linked list of
+     * {@link MethodWriter} objects, linked to each other by their
+     * {@link MethodWriter#mv} field. This field stores the last element of
+     * this list.
+     */
+    MethodWriter lastMethod;
+
+    /**
+     * <tt>true</tt> if the maximum stack size and number of local variables
+     * must be automatically computed.
+     */
+    private final boolean computeMaxs;
+
+    /**
+     * <tt>true</tt> if the stack map frames must be recomputed from scratch.
+     */
+    private final boolean computeFrames;
+
+    /**
+     * <tt>true</tt> if the stack map tables of this class are invalid. The
+     * {@link MethodWriter#resizeInstructions} method cannot transform existing
+     * stack map tables, and so produces potentially invalid classes when it is
+     * executed. In this case the class is reread and rewritten with the
+     * {@link #COMPUTE_FRAMES} option (the resizeInstructions method can resize
+     * stack map tables when this option is used).
+     */
+    boolean invalidFrames;
+
+    // ------------------------------------------------------------------------
+    // Static initializer
+    // ------------------------------------------------------------------------
+
+    /**
+     * Computes the instruction types of JVM opcodes.
+     */
+    static {
+        int i;
+        byte[] b = new byte[220];
+        String s = "AAAAAAAAAAAAAAAABCLMMDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
+                + "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+                + "AAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAJJJJJJJJJJJJJJJJDOPAA"
+                + "AAAAGGGGGGGHIFBFAAFFAARQJJKKJJJJJJJJJJJJJJJJJJ";
+        for (i = 0; i < b.length; ++i) {
+            b[i] = (byte) (s.charAt(i) - 'A');
+        }
+        TYPE = b;
+
+        // code to generate the above string
+        //
+        // // SBYTE_INSN instructions
+        // b[Constants.NEWARRAY] = SBYTE_INSN;
+        // b[Constants.BIPUSH] = SBYTE_INSN;
+        //
+        // // SHORT_INSN instructions
+        // b[Constants.SIPUSH] = SHORT_INSN;
+        //
+        // // (IMPL)VAR_INSN instructions
+        // b[Constants.RET] = VAR_INSN;
+        // for (i = Constants.ILOAD; i <= Constants.ALOAD; ++i) {
+        // b[i] = VAR_INSN;
+        // }
+        // for (i = Constants.ISTORE; i <= Constants.ASTORE; ++i) {
+        // b[i] = VAR_INSN;
+        // }
+        // for (i = 26; i <= 45; ++i) { // ILOAD_0 to ALOAD_3
+        // b[i] = IMPLVAR_INSN;
+        // }
+        // for (i = 59; i <= 78; ++i) { // ISTORE_0 to ASTORE_3
+        // b[i] = IMPLVAR_INSN;
+        // }
+        //
+        // // TYPE_INSN instructions
+        // b[Constants.NEW] = TYPE_INSN;
+        // b[Constants.ANEWARRAY] = TYPE_INSN;
+        // b[Constants.CHECKCAST] = TYPE_INSN;
+        // b[Constants.INSTANCEOF] = TYPE_INSN;
+        //
+        // // (Set)FIELDORMETH_INSN instructions
+        // for (i = Constants.GETSTATIC; i <= Constants.INVOKESTATIC; ++i) {
+        // b[i] = FIELDORMETH_INSN;
+        // }
+        // b[Constants.INVOKEINTERFACE] = ITFMETH_INSN;
+        // b[Constants.INVOKEDYNAMIC] = INDYMETH_INSN;
+        //
+        // // LABEL(W)_INSN instructions
+        // for (i = Constants.IFEQ; i <= Constants.JSR; ++i) {
+        // b[i] = LABEL_INSN;
+        // }
+        // b[Constants.IFNULL] = LABEL_INSN;
+        // b[Constants.IFNONNULL] = LABEL_INSN;
+        // b[200] = LABELW_INSN; // GOTO_W
+        // b[201] = LABELW_INSN; // JSR_W
+        // // temporary opcodes used internally by ASM - see Label and
+        // MethodWriter
+        // for (i = 202; i < 220; ++i) {
+        // b[i] = LABEL_INSN;
+        // }
+        //
+        // // LDC(_W) instructions
+        // b[Constants.LDC] = LDC_INSN;
+        // b[19] = LDCW_INSN; // LDC_W
+        // b[20] = LDCW_INSN; // LDC2_W
+        //
+        // // special instructions
+        // b[Constants.IINC] = IINC_INSN;
+        // b[Constants.TABLESWITCH] = TABL_INSN;
+        // b[Constants.LOOKUPSWITCH] = LOOK_INSN;
+        // b[Constants.MULTIANEWARRAY] = MANA_INSN;
+        // b[196] = WIDE_INSN; // WIDE
+        //
+        // for (i = 0; i < b.length; ++i) {
+        // System.err.print((char)('A' + b[i]));
+        // }
+        // System.err.println();
+    }
+
+    // ------------------------------------------------------------------------
+    // Constructor
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a new {@link ClassWriter} object.
+     *
+     * @param flags option flags that can be used to modify the default behavior
+     *        of this class. See {@link #COMPUTE_MAXS}, {@link #COMPUTE_FRAMES}.
+     */
+    public ClassWriter(final int flags) {
+        super(Opcodes.ASM4);
+        index = 1;
+        pool = new ByteVector();
+        items = new Item[256];
+        threshold = (int) (0.75d * items.length);
+        key = new Item();
+        key2 = new Item();
+        key3 = new Item();
+        key4 = new Item();
+        this.computeMaxs = (flags & COMPUTE_MAXS) != 0;
+        this.computeFrames = (flags & COMPUTE_FRAMES) != 0;
+    }
+
+    /**
+     * Constructs a new {@link ClassWriter} object and enables optimizations for
+     * "mostly add" bytecode transformations. These optimizations are the
+     * following:
+     *
+     * <ul> <li>The constant pool from the original class is copied as is in the
+     * new class, which saves time. New constant pool entries will be added at
+     * the end if necessary, but unused constant pool entries <i>won't be
+     * removed</i>.</li> <li>Methods that are not transformed are copied as is
+     * in the new class, directly from the original class bytecode (i.e. without
+     * emitting visit events for all the method instructions), which saves a
+     * <i>lot</i> of time. Untransformed methods are detected by the fact that
+     * the {@link ClassReader} receives {@link MethodVisitor} objects that come
+     * from a {@link ClassWriter} (and not from any other {@link ClassVisitor}
+     * instance).</li> </ul>
+     *
+     * @param classReader the {@link ClassReader} used to read the original
+     *        class. It will be used to copy the entire constant pool from the
+     *        original class and also to copy other fragments of original
+     *        bytecode where applicable.
+     * @param flags option flags that can be used to modify the default behavior
+     *        of this class. <i>These option flags do not affect methods that
+     *        are copied as is in the new class. This means that the maximum
+     *        stack size nor the stack frames will be computed for these
+     *        methods</i>. See {@link #COMPUTE_MAXS}, {@link #COMPUTE_FRAMES}.
+     */
+    public ClassWriter(final ClassReader classReader, final int flags) {
+        this(flags);
+        classReader.copyPool(this);
+        this.cr = classReader;
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the ClassVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public final void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        this.version = version;
+        this.access = access;
+        this.name = newClass(name);
+        thisName = name;
+        if (ClassReader.SIGNATURES && signature != null) {
+            this.signature = newUTF8(signature);
+        }
+        this.superName = superName == null ? 0 : newClass(superName);
+        if (interfaces != null && interfaces.length > 0) {
+            interfaceCount = interfaces.length;
+            this.interfaces = new int[interfaceCount];
+            for (int i = 0; i < interfaceCount; ++i) {
+                this.interfaces[i] = newClass(interfaces[i]);
+            }
+        }
+    }
+
+    @Override
+    public final void visitSource(final String file, final String debug) {
+        if (file != null) {
+            sourceFile = newUTF8(file);
+        }
+        if (debug != null) {
+            sourceDebug = new ByteVector().putUTF8(debug);
+        }
+    }
+
+    @Override
+    public final void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        enclosingMethodOwner = newClass(owner);
+        if (name != null && desc != null) {
+            enclosingMethod = newNameType(name, desc);
+        }
+    }
+
+    @Override
+    public final AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        if (!ClassReader.ANNOTATIONS) {
+            return null;
+        }
+        ByteVector bv = new ByteVector();
+        // write type, and reserve space for values count
+        bv.putShort(newUTF8(desc)).putShort(0);
+        AnnotationWriter aw = new AnnotationWriter(this, true, bv, bv, 2);
+        if (visible) {
+            aw.next = anns;
+            anns = aw;
+        } else {
+            aw.next = ianns;
+            ianns = aw;
+        }
+        return aw;
+    }
+
+    @Override
+    public final void visitAttribute(final Attribute attr) {
+        attr.next = attrs;
+        attrs = attr;
+    }
+
+    @Override
+    public final void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        if (innerClasses == null) {
+            innerClasses = new ByteVector();
+        }
+        ++innerClassesCount;
+        innerClasses.putShort(name == null ? 0 : newClass(name));
+        innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
+        innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
+        innerClasses.putShort(access);
+    }
+
+    @Override
+    public final FieldVisitor visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        return new FieldWriter(this, access, name, desc, signature, value);
+    }
+
+    @Override
+    public final MethodVisitor visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        return new MethodWriter(this,
+                access,
+                name,
+                desc,
+                signature,
+                exceptions,
+                computeMaxs,
+                computeFrames);
+    }
+
+    @Override
+    public final void visitEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Other public methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the bytecode of the class that was build with this class writer.
+     *
+     * @return the bytecode of the class that was build with this class writer.
+     */
+    public byte[] toByteArray() {
+        if (index > Short.MAX_VALUE) {
+            throw new RuntimeException("Class file too large!");
+        }
+        // computes the real size of the bytecode of this class
+        int size = 24 + 2 * interfaceCount;
+        int nbFields = 0;
+        FieldWriter fb = firstField;
+        while (fb != null) {
+            ++nbFields;
+            size += fb.getSize();
+            fb = (FieldWriter) fb.fv;
+        }
+        int nbMethods = 0;
+        MethodWriter mb = firstMethod;
+        while (mb != null) {
+            ++nbMethods;
+            size += mb.getSize();
+            mb = (MethodWriter) mb.mv;
+        }
+        int attributeCount = 0;
+        if (bootstrapMethods != null) {  // we put it as first argument in order
+                                         // to improve a bit ClassReader.copyBootstrapMethods
+            ++attributeCount;
+            size += 8 + bootstrapMethods.length;
+            newUTF8("BootstrapMethods");
+        }
+        if (ClassReader.SIGNATURES && signature != 0) {
+            ++attributeCount;
+            size += 8;
+            newUTF8("Signature");
+        }
+        if (sourceFile != 0) {
+            ++attributeCount;
+            size += 8;
+            newUTF8("SourceFile");
+        }
+        if (sourceDebug != null) {
+            ++attributeCount;
+            size += sourceDebug.length + 4;
+            newUTF8("SourceDebugExtension");
+        }
+        if (enclosingMethodOwner != 0) {
+            ++attributeCount;
+            size += 10;
+            newUTF8("EnclosingMethod");
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            ++attributeCount;
+            size += 6;
+            newUTF8("Deprecated");
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((version & 0xFFFF) < Opcodes.V1_5 || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            ++attributeCount;
+            size += 6;
+            newUTF8("Synthetic");
+        }
+        if (innerClasses != null) {
+            ++attributeCount;
+            size += 8 + innerClasses.length;
+            newUTF8("InnerClasses");
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            ++attributeCount;
+            size += 8 + anns.getSize();
+            newUTF8("RuntimeVisibleAnnotations");
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            ++attributeCount;
+            size += 8 + ianns.getSize();
+            newUTF8("RuntimeInvisibleAnnotations");
+        }
+        if (attrs != null) {
+            attributeCount += attrs.getCount();
+            size += attrs.getSize(this, null, 0, -1, -1);
+        }
+        size += pool.length;
+        // allocates a byte vector of this size, in order to avoid unnecessary
+        // arraycopy operations in the ByteVector.enlarge() method
+        ByteVector out = new ByteVector(size);
+        out.putInt(0xCAFEBABE).putInt(version);
+        out.putShort(index).putByteArray(pool.data, 0, pool.length);
+        int mask = Opcodes.ACC_DEPRECATED
+                | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+                | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / (ClassWriter.ACC_SYNTHETIC_ATTRIBUTE / Opcodes.ACC_SYNTHETIC));
+        out.putShort(access & ~mask).putShort(name).putShort(superName);
+        out.putShort(interfaceCount);
+        for (int i = 0; i < interfaceCount; ++i) {
+            out.putShort(interfaces[i]);
+        }
+        out.putShort(nbFields);
+        fb = firstField;
+        while (fb != null) {
+            fb.put(out);
+            fb = (FieldWriter) fb.fv;
+        }
+        out.putShort(nbMethods);
+        mb = firstMethod;
+        while (mb != null) {
+            mb.put(out);
+            mb = (MethodWriter) mb.mv;
+        }
+        out.putShort(attributeCount);
+        if (bootstrapMethods != null) {   // should be the first class attribute ?
+            out.putShort(newUTF8("BootstrapMethods"));
+            out.putInt(bootstrapMethods.length + 2).putShort(bootstrapMethodsCount);
+            out.putByteArray(bootstrapMethods.data, 0, bootstrapMethods.length);
+        }
+        if (ClassReader.SIGNATURES && signature != 0) {
+            out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
+        }
+        if (sourceFile != 0) {
+            out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
+        }
+        if (sourceDebug != null) {
+            int len = sourceDebug.length - 2;
+            out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
+            out.putByteArray(sourceDebug.data, 2, len);
+        }
+        if (enclosingMethodOwner != 0) {
+            out.putShort(newUTF8("EnclosingMethod")).putInt(4);
+            out.putShort(enclosingMethodOwner).putShort(enclosingMethod);
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            out.putShort(newUTF8("Deprecated")).putInt(0);
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((version & 0xFFFF) < Opcodes.V1_5 || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            out.putShort(newUTF8("Synthetic")).putInt(0);
+        }
+        if (innerClasses != null) {
+            out.putShort(newUTF8("InnerClasses"));
+            out.putInt(innerClasses.length + 2).putShort(innerClassesCount);
+            out.putByteArray(innerClasses.data, 0, innerClasses.length);
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            out.putShort(newUTF8("RuntimeVisibleAnnotations"));
+            anns.put(out);
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
+            ianns.put(out);
+        }
+        if (attrs != null) {
+            attrs.put(this, null, 0, -1, -1, out);
+        }
+        if (invalidFrames) {
+            ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);
+            new ClassReader(out.data).accept(cw, ClassReader.SKIP_FRAMES);
+            return cw.toByteArray();
+        }
+        return out.data;
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods: constant pool management
+    // ------------------------------------------------------------------------
+
+    /**
+     * Adds a number or string constant to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     *
+     * @param cst the value of the constant to be added to the constant pool.
+     *        This parameter must be an {@link Integer}, a {@link Float}, a
+     *        {@link Long}, a {@link Double}, a {@link String} or a
+     *        {@link Type}.
+     * @return a new or already existing constant item with the given value.
+     */
+    Item newConstItem(final Object cst) {
+        if (cst instanceof Integer) {
+            int val = ((Integer) cst).intValue();
+            return newInteger(val);
+        } else if (cst instanceof Byte) {
+            int val = ((Byte) cst).intValue();
+            return newInteger(val);
+        } else if (cst instanceof Character) {
+            int val = ((Character) cst).charValue();
+            return newInteger(val);
+        } else if (cst instanceof Short) {
+            int val = ((Short) cst).intValue();
+            return newInteger(val);
+        } else if (cst instanceof Boolean) {
+            int val = ((Boolean) cst).booleanValue() ? 1 : 0;
+            return newInteger(val);
+        } else if (cst instanceof Float) {
+            float val = ((Float) cst).floatValue();
+            return newFloat(val);
+        } else if (cst instanceof Long) {
+            long val = ((Long) cst).longValue();
+            return newLong(val);
+        } else if (cst instanceof Double) {
+            double val = ((Double) cst).doubleValue();
+            return newDouble(val);
+        } else if (cst instanceof String) {
+            return newString((String) cst);
+        } else if (cst instanceof Type) {
+            Type t = (Type) cst;
+            int s = t.getSort();
+            if (s == Type.ARRAY) {
+                return newClassItem(t.getDescriptor());
+            } else if (s == Type.OBJECT) {
+                return newClassItem(t.getInternalName());
+            } else { // s == Type.METHOD
+                return newMethodTypeItem(t.getDescriptor());
+            }
+        } else if (cst instanceof Handle) {
+            Handle h = (Handle) cst;
+            return newHandleItem(h.tag, h.owner, h.name, h.desc);
+        } else {
+            throw new IllegalArgumentException("value " + cst);
+        }
+    }
+
+    /**
+     * Adds a number or string constant to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param cst the value of the constant to be added to the constant pool.
+     *        This parameter must be an {@link Integer}, a {@link Float}, a
+     *        {@link Long}, a {@link Double} or a {@link String}.
+     * @return the index of a new or already existing constant item with the
+     *         given value.
+     */
+    public int newConst(final Object cst) {
+        return newConstItem(cst).index;
+    }
+
+    /**
+     * Adds an UTF8 string to the constant pool of the class being build. Does
+     * nothing if the constant pool already contains a similar item. <i>This
+     * method is intended for {@link Attribute} sub classes, and is normally not
+     * needed by class generators or adapters.</i>
+     *
+     * @param value the String value.
+     * @return the index of a new or already existing UTF8 item.
+     */
+    public int newUTF8(final String value) {
+        key.set(UTF8, value, null, null);
+        Item result = get(key);
+        if (result == null) {
+            pool.putByte(UTF8).putUTF8(value);
+            result = new Item(index++, key);
+            put(result);
+        }
+        return result.index;
+    }
+
+    /**
+     * Adds a class reference to the constant pool of the class being build.
+     * Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param value the internal name of the class.
+     * @return a new or already existing class reference item.
+     */
+    Item newClassItem(final String value) {
+        key2.set(CLASS, value, null, null);
+        Item result = get(key2);
+        if (result == null) {
+            pool.put12(CLASS, newUTF8(value));
+            result = new Item(index++, key2);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a class reference to the constant pool of the class being build.
+     * Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param value the internal name of the class.
+     * @return the index of a new or already existing class reference item.
+     */
+    public int newClass(final String value) {
+        return newClassItem(value).index;
+    }
+
+    /**
+     * Adds a method type reference to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param methodDesc method descriptor of the method type.
+     * @return a new or already existing method type reference item.
+     */
+    Item newMethodTypeItem(final String methodDesc) {
+        key2.set(MTYPE, methodDesc, null, null);
+        Item result = get(key2);
+        if (result == null) {
+            pool.put12(MTYPE, newUTF8(methodDesc));
+            result = new Item(index++, key2);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a method type reference to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param methodDesc method descriptor of the method type.
+     * @return the index of a new or already existing method type reference
+     *         item.
+     */
+    public int newMethodType(final String methodDesc) {
+        return newMethodTypeItem(methodDesc).index;
+    }
+
+    /**
+     * Adds a handle to the constant pool of the class being build. Does nothing
+     * if the constant pool already contains a similar item. <i>This method is
+     * intended for {@link Attribute} sub classes, and is normally not needed by
+     * class generators or adapters.</i>
+     *
+     * @param tag the kind of this handle. Must be {@link Opcodes#H_GETFIELD},
+     *        {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
+     *        {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL},
+     *        {@link Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL},
+     *        {@link Opcodes#H_NEWINVOKESPECIAL} or
+     *        {@link Opcodes#H_INVOKEINTERFACE}.
+     * @param owner the internal name of the field or method owner class.
+     * @param name the name of the field or method.
+     * @param desc the descriptor of the field or method.
+     * @return a new or an already existing method type reference item.
+     */
+    Item newHandleItem(
+        final int tag,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        key4.set(HANDLE_BASE + tag, owner, name, desc);
+        Item result = get(key4);
+        if (result == null) {
+            if (tag <= Opcodes.H_PUTSTATIC) {
+                put112(HANDLE, tag, newField(owner, name, desc));
+            } else {
+                put112(HANDLE, tag, newMethod(owner,
+                        name,
+                        desc,
+                        tag == Opcodes.H_INVOKEINTERFACE));
+            }
+            result = new Item(index++, key4);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a handle to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param tag the kind of this handle. Must be {@link Opcodes#H_GETFIELD},
+     *        {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
+     *        {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL},
+     *        {@link Opcodes#H_INVOKESTATIC}, {@link Opcodes#H_INVOKESPECIAL},
+     *        {@link Opcodes#H_NEWINVOKESPECIAL} or
+     *        {@link Opcodes#H_INVOKEINTERFACE}.
+     * @param owner the internal name of the field or method owner class.
+     * @param name the name of the field or method.
+     * @param desc the descriptor of the field or method.
+     * @return the index of a new or already existing method type reference
+     *         item.
+     */
+    public int newHandle(
+        final int tag,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        return newHandleItem(tag, owner, name, desc).index;
+    }
+
+    /**
+     * Adds an invokedynamic reference to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param name name of the invoked method.
+     * @param desc descriptor of the invoke method.
+     * @param bsm the bootstrap method.
+     * @param bsmArgs the bootstrap method constant arguments.
+     *
+     * @return a new or an already existing invokedynamic type reference item.
+     */
+    Item newInvokeDynamicItem(
+        final String name,
+        final String desc,
+        final Handle bsm,
+        final Object... bsmArgs)
+    {
+        // cache for performance
+        ByteVector bootstrapMethods = this.bootstrapMethods;
+        if (bootstrapMethods == null) {
+            bootstrapMethods = this.bootstrapMethods = new ByteVector();
+        }
+
+        int position = bootstrapMethods.length; // record current position
+
+        int hashCode = bsm.hashCode();
+        bootstrapMethods.putShort(newHandle(bsm.tag,
+                bsm.owner,
+                bsm.name,
+                bsm.desc));
+
+        int argsLength = bsmArgs.length;
+        bootstrapMethods.putShort(argsLength);
+
+        for (int i = 0; i < argsLength; i++) {
+            Object bsmArg = bsmArgs[i];
+            hashCode ^= bsmArg.hashCode();
+            bootstrapMethods.putShort(newConst(bsmArg));
+        }
+
+        byte[] data = bootstrapMethods.data;
+        int length = (1 + 1 + argsLength) << 1; // (bsm + argCount + arguments)
+        hashCode &= 0x7FFFFFFF;
+        Item result = items[hashCode % items.length];
+        loop: while (result != null) {
+            if (result.type != BSM || result.hashCode != hashCode) {
+                result = result.next;
+                continue;
+            }
+
+            // because the data encode the size of the argument
+            // we don't need to test if these size are equals
+            int resultPosition = result.intVal;
+            for (int p = 0; p < length; p++) {
+                if (data[position + p] != data[resultPosition + p]) {
+                    result = result.next;
+                    continue loop;
+                }
+            }
+            break;
+        }
+
+        int bootstrapMethodIndex;
+        if (result != null) {
+            bootstrapMethodIndex = result.index;
+            bootstrapMethods.length = position; // revert to old position
+        } else {
+            bootstrapMethodIndex = bootstrapMethodsCount++;
+            result = new Item(bootstrapMethodIndex);
+            result.set(position, hashCode);
+            put(result);
+        }
+
+        // now, create the InvokeDynamic constant
+        key3.set(name, desc, bootstrapMethodIndex);
+        result = get(key3);
+        if (result == null) {
+            put122(INDY, bootstrapMethodIndex, newNameType(name, desc));
+            result = new Item(index++, key3);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds an invokedynamic reference to the constant pool of the class being
+     * build. Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param name name of the invoked method.
+     * @param desc descriptor of the invoke method.
+     * @param bsm the bootstrap method.
+     * @param bsmArgs the bootstrap method constant arguments.
+     *
+     * @return the index of a new or already existing invokedynamic
+     *         reference item.
+     */
+    public int newInvokeDynamic(
+        final String name,
+        final String desc,
+        final Handle bsm,
+        final Object... bsmArgs)
+    {
+        return newInvokeDynamicItem(name, desc, bsm, bsmArgs).index;
+    }
+
+    /**
+     * Adds a field reference to the constant pool of the class being build.
+     * Does nothing if the constant pool already contains a similar item.
+     *
+     * @param owner the internal name of the field's owner class.
+     * @param name the field's name.
+     * @param desc the field's descriptor.
+     * @return a new or already existing field reference item.
+     */
+    Item newFieldItem(final String owner, final String name, final String desc)
+    {
+        key3.set(FIELD, owner, name, desc);
+        Item result = get(key3);
+        if (result == null) {
+            put122(FIELD, newClass(owner), newNameType(name, desc));
+            result = new Item(index++, key3);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a field reference to the constant pool of the class being build.
+     * Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param owner the internal name of the field's owner class.
+     * @param name the field's name.
+     * @param desc the field's descriptor.
+     * @return the index of a new or already existing field reference item.
+     */
+    public int newField(final String owner, final String name, final String desc)
+    {
+        return newFieldItem(owner, name, desc).index;
+    }
+
+    /**
+     * Adds a method reference to the constant pool of the class being build.
+     * Does nothing if the constant pool already contains a similar item.
+     *
+     * @param owner the internal name of the method's owner class.
+     * @param name the method's name.
+     * @param desc the method's descriptor.
+     * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
+     * @return a new or already existing method reference item.
+     */
+    Item newMethodItem(
+        final String owner,
+        final String name,
+        final String desc,
+        final boolean itf)
+    {
+        int type = itf ? IMETH : METH;
+        key3.set(type, owner, name, desc);
+        Item result = get(key3);
+        if (result == null) {
+            put122(type, newClass(owner), newNameType(name, desc));
+            result = new Item(index++, key3);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a method reference to the constant pool of the class being build.
+     * Does nothing if the constant pool already contains a similar item.
+     * <i>This method is intended for {@link Attribute} sub classes, and is
+     * normally not needed by class generators or adapters.</i>
+     *
+     * @param owner the internal name of the method's owner class.
+     * @param name the method's name.
+     * @param desc the method's descriptor.
+     * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
+     * @return the index of a new or already existing method reference item.
+     */
+    public int newMethod(
+        final String owner,
+        final String name,
+        final String desc,
+        final boolean itf)
+    {
+        return newMethodItem(owner, name, desc, itf).index;
+    }
+
+    /**
+     * Adds an integer to the constant pool of the class being build. Does
+     * nothing if the constant pool already contains a similar item.
+     *
+     * @param value the int value.
+     * @return a new or already existing int item.
+     */
+    Item newInteger(final int value) {
+        key.set(value);
+        Item result = get(key);
+        if (result == null) {
+            pool.putByte(INT).putInt(value);
+            result = new Item(index++, key);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a float to the constant pool of the class being build. Does nothing
+     * if the constant pool already contains a similar item.
+     *
+     * @param value the float value.
+     * @return a new or already existing float item.
+     */
+    Item newFloat(final float value) {
+        key.set(value);
+        Item result = get(key);
+        if (result == null) {
+            pool.putByte(FLOAT).putInt(key.intVal);
+            result = new Item(index++, key);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a long to the constant pool of the class being build. Does nothing
+     * if the constant pool already contains a similar item.
+     *
+     * @param value the long value.
+     * @return a new or already existing long item.
+     */
+    Item newLong(final long value) {
+        key.set(value);
+        Item result = get(key);
+        if (result == null) {
+            pool.putByte(LONG).putLong(value);
+            result = new Item(index, key);
+            index += 2;
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a double to the constant pool of the class being build. Does nothing
+     * if the constant pool already contains a similar item.
+     *
+     * @param value the double value.
+     * @return a new or already existing double item.
+     */
+    Item newDouble(final double value) {
+        key.set(value);
+        Item result = get(key);
+        if (result == null) {
+            pool.putByte(DOUBLE).putLong(key.longVal);
+            result = new Item(index, key);
+            index += 2;
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a string to the constant pool of the class being build. Does nothing
+     * if the constant pool already contains a similar item.
+     *
+     * @param value the String value.
+     * @return a new or already existing string item.
+     */
+    private Item newString(final String value) {
+        key2.set(STR, value, null, null);
+        Item result = get(key2);
+        if (result == null) {
+            pool.put12(STR, newUTF8(value));
+            result = new Item(index++, key2);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds a name and type to the constant pool of the class being build. Does
+     * nothing if the constant pool already contains a similar item. <i>This
+     * method is intended for {@link Attribute} sub classes, and is normally not
+     * needed by class generators or adapters.</i>
+     *
+     * @param name a name.
+     * @param desc a type descriptor.
+     * @return the index of a new or already existing name and type item.
+     */
+    public int newNameType(final String name, final String desc) {
+        return newNameTypeItem(name, desc).index;
+    }
+
+    /**
+     * Adds a name and type to the constant pool of the class being build. Does
+     * nothing if the constant pool already contains a similar item.
+     *
+     * @param name a name.
+     * @param desc a type descriptor.
+     * @return a new or already existing name and type item.
+     */
+    Item newNameTypeItem(final String name, final String desc) {
+        key2.set(NAME_TYPE, name, desc, null);
+        Item result = get(key2);
+        if (result == null) {
+            put122(NAME_TYPE, newUTF8(name), newUTF8(desc));
+            result = new Item(index++, key2);
+            put(result);
+        }
+        return result;
+    }
+
+    /**
+     * Adds the given internal name to {@link #typeTable} and returns its index.
+     * Does nothing if the type table already contains this internal name.
+     *
+     * @param type the internal name to be added to the type table.
+     * @return the index of this internal name in the type table.
+     */
+    int addType(final String type) {
+        key.set(TYPE_NORMAL, type, null, null);
+        Item result = get(key);
+        if (result == null) {
+            result = addType(key);
+        }
+        return result.index;
+    }
+
+    /**
+     * Adds the given "uninitialized" type to {@link #typeTable} and returns its
+     * index. This method is used for UNINITIALIZED types, made of an internal
+     * name and a bytecode offset.
+     *
+     * @param type the internal name to be added to the type table.
+     * @param offset the bytecode offset of the NEW instruction that created
+     *        this UNINITIALIZED type value.
+     * @return the index of this internal name in the type table.
+     */
+    int addUninitializedType(final String type, final int offset) {
+        key.type = TYPE_UNINIT;
+        key.intVal = offset;
+        key.strVal1 = type;
+        key.hashCode = 0x7FFFFFFF & (TYPE_UNINIT + type.hashCode() + offset);
+        Item result = get(key);
+        if (result == null) {
+            result = addType(key);
+        }
+        return result.index;
+    }
+
+    /**
+     * Adds the given Item to {@link #typeTable}.
+     *
+     * @param item the value to be added to the type table.
+     * @return the added Item, which a new Item instance with the same value as
+     *         the given Item.
+     */
+    private Item addType(final Item item) {
+        ++typeCount;
+        Item result = new Item(typeCount, key);
+        put(result);
+        if (typeTable == null) {
+            typeTable = new Item[16];
+        }
+        if (typeCount == typeTable.length) {
+            Item[] newTable = new Item[2 * typeTable.length];
+            System.arraycopy(typeTable, 0, newTable, 0, typeTable.length);
+            typeTable = newTable;
+        }
+        typeTable[typeCount] = result;
+        return result;
+    }
+
+    /**
+     * Returns the index of the common super type of the two given types. This
+     * method calls {@link #getCommonSuperClass} and caches the result in the
+     * {@link #items} hash table to speedup future calls with the same
+     * parameters.
+     *
+     * @param type1 index of an internal name in {@link #typeTable}.
+     * @param type2 index of an internal name in {@link #typeTable}.
+     * @return the index of the common super type of the two given types.
+     */
+    int getMergedType(final int type1, final int type2) {
+        key2.type = TYPE_MERGED;
+        key2.longVal = type1 | (((long) type2) << 32);
+        key2.hashCode = 0x7FFFFFFF & (TYPE_MERGED + type1 + type2);
+        Item result = get(key2);
+        if (result == null) {
+            String t = typeTable[type1].strVal1;
+            String u = typeTable[type2].strVal1;
+            key2.intVal = addType(getCommonSuperClass(t, u));
+            result = new Item((short) 0, key2);
+            put(result);
+        }
+        return result.intVal;
+    }
+
+    /**
+     * Returns the common super type of the two given types. The default
+     * implementation of this method <i>loads<i> the two given classes and uses
+     * the java.lang.Class methods to find the common super class. It can be
+     * overridden to compute this common super type in other ways, in particular
+     * without actually loading any class, or to take into account the class
+     * that is currently being generated by this ClassWriter, which can of
+     * course not be loaded since it is under construction.
+     *
+     * @param type1 the internal name of a class.
+     * @param type2 the internal name of another class.
+     * @return the internal name of the common super class of the two given
+     *         classes.
+     */
+    protected String getCommonSuperClass(final String type1, final String type2)
+    {
+        Class<?> c, d;
+        ClassLoader classLoader = getClass().getClassLoader();
+        try {
+            c = Class.forName(type1.replace('/', '.'), false, classLoader);
+            d = Class.forName(type2.replace('/', '.'), false, classLoader);
+        } catch (Exception e) {
+            throw new RuntimeException(e.toString());
+        }
+        if (c.isAssignableFrom(d)) {
+            return type1;
+        }
+        if (d.isAssignableFrom(c)) {
+            return type2;
+        }
+        if (c.isInterface() || d.isInterface()) {
+            return "java/lang/Object";
+        } else {
+            do {
+                c = c.getSuperclass();
+            } while (!c.isAssignableFrom(d));
+            return c.getName().replace('.', '/');
+        }
+    }
+
+    /**
+     * Returns the constant pool's hash table item which is equal to the given
+     * item.
+     *
+     * @param key a constant pool item.
+     * @return the constant pool's hash table item which is equal to the given
+     *         item, or <tt>null</tt> if there is no such item.
+     */
+    private Item get(final Item key) {
+        Item i = items[key.hashCode % items.length];
+        while (i != null && (i.type != key.type || !key.isEqualTo(i))) {
+            i = i.next;
+        }
+        return i;
+    }
+
+    /**
+     * Puts the given item in the constant pool's hash table. The hash table
+     * <i>must</i> not already contains this item.
+     *
+     * @param i the item to be added to the constant pool's hash table.
+     */
+    private void put(final Item i) {
+        if (index + typeCount > threshold) {
+            int ll = items.length;
+            int nl = ll * 2 + 1;
+            Item[] newItems = new Item[nl];
+            for (int l = ll - 1; l >= 0; --l) {
+                Item j = items[l];
+                while (j != null) {
+                    int index = j.hashCode % newItems.length;
+                    Item k = j.next;
+                    j.next = newItems[index];
+                    newItems[index] = j;
+                    j = k;
+                }
+            }
+            items = newItems;
+            threshold = (int) (nl * 0.75);
+        }
+        int index = i.hashCode % items.length;
+        i.next = items[index];
+        items[index] = i;
+    }
+
+    /**
+     * Puts one byte and two shorts into the constant pool.
+     *
+     * @param b a byte.
+     * @param s1 a short.
+     * @param s2 another short.
+     */
+    private void put122(final int b, final int s1, final int s2) {
+        pool.put12(b, s1).putShort(s2);
+    }
+
+    /**
+     * Puts two bytes and one short into the constant pool.
+     *
+     * @param b1 a byte.
+     * @param b2 another byte.
+     * @param s a short.
+     */
+    private void put112(final int b1, final int b2, final int s) {
+        pool.put11(b1, b2).putShort(s);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Edge.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,104 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * An edge in the control flow graph of a method body. See {@link Label Label}.
+ *
+ * @author Eric Bruneton
+ */
+class Edge {
+
+    /**
+     * Denotes a normal control flow graph edge.
+     */
+    static final int NORMAL = 0;
+
+    /**
+     * Denotes a control flow graph edge corresponding to an exception handler.
+     * More precisely any {@link Edge} whose {@link #info} is strictly positive
+     * corresponds to an exception handler. The actual value of {@link #info} is
+     * the index, in the {@link ClassWriter} type table, of the exception that
+     * is catched.
+     */
+    static final int EXCEPTION = 0x7FFFFFFF;
+
+    /**
+     * Information about this control flow graph edge. If
+     * {@link ClassWriter#COMPUTE_MAXS} is used this field is the (relative)
+     * stack size in the basic block from which this edge originates. This size
+     * is equal to the stack size at the "jump" instruction to which this edge
+     * corresponds, relatively to the stack size at the beginning of the
+     * originating basic block. If {@link ClassWriter#COMPUTE_FRAMES} is used,
+     * this field is the kind of this control flow graph edge (i.e. NORMAL or
+     * EXCEPTION).
+     */
+    int info;
+
+    /**
+     * The successor block of the basic block from which this edge originates.
+     */
+    Label successor;
+
+    /**
+     * The next edge in the list of successors of the originating basic block.
+     * See {@link Label#successors successors}.
+     */
+    Edge next;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/FieldVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,144 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java field. The methods of this class must be called
+ * in the following order: ( <tt>visitAnnotation</tt> |
+ * <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class FieldVisitor {
+
+    /**
+     * The ASM API version implemented by this visitor. The value of this field
+     * must be one of {@link Opcodes#ASM4}.
+     */
+    protected final int api;
+
+    /**
+     * The field visitor to which this visitor must delegate method calls. May
+     * be null.
+     */
+    protected FieldVisitor fv;
+
+    /**
+     * Constructs a new {@link FieldVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public FieldVisitor(final int api) {
+        this(api, null);
+    }
+
+    /**
+     * Constructs a new {@link FieldVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param fv the field visitor to which this visitor must delegate method
+     *        calls. May be null.
+     */
+    public FieldVisitor(final int api, final FieldVisitor fv) {
+        /*if (api != Opcodes.ASM4) {
+            throw new IllegalArgumentException();
+        }*/
+        this.api = api;
+        this.fv = fv;
+    }
+
+    /**
+     * Visits an annotation of the field.
+     *
+     * @param desc the class descriptor of the annotation class.
+     * @param visible <tt>true</tt> if the annotation is visible at runtime.
+     * @return a visitor to visit the annotation values, or <tt>null</tt> if
+     *         this visitor is not interested in visiting this annotation.
+     */
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        if (fv != null) {
+            return fv.visitAnnotation(desc, visible);
+        }
+        return null;
+    }
+
+    /**
+     * Visits a non standard attribute of the field.
+     *
+     * @param attr an attribute.
+     */
+    public void visitAttribute(Attribute attr) {
+        if (fv != null) {
+            fv.visitAttribute(attr);
+        }
+    }
+
+    /**
+     * Visits the end of the field. This method, which is the last one to be
+     * called, is used to inform the visitor that all the annotations and
+     * attributes of the field have been visited.
+     */
+    public void visitEnd() {
+        if (fv != null) {
+            fv.visitEnd();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/FieldWriter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,300 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * An {@link FieldVisitor} that generates Java fields in bytecode form.
+ *
+ * @author Eric Bruneton
+ */
+final class FieldWriter extends FieldVisitor {
+
+    /**
+     * The class writer to which this field must be added.
+     */
+    private final ClassWriter cw;
+
+    /**
+     * Access flags of this field.
+     */
+    private final int access;
+
+    /**
+     * The index of the constant pool item that contains the name of this
+     * method.
+     */
+    private final int name;
+
+    /**
+     * The index of the constant pool item that contains the descriptor of this
+     * field.
+     */
+    private final int desc;
+
+    /**
+     * The index of the constant pool item that contains the signature of this
+     * field.
+     */
+    private int signature;
+
+    /**
+     * The index of the constant pool item that contains the constant value of
+     * this field.
+     */
+    private int value;
+
+    /**
+     * The runtime visible annotations of this field. May be <tt>null</tt>.
+     */
+    private AnnotationWriter anns;
+
+    /**
+     * The runtime invisible annotations of this field. May be <tt>null</tt>.
+     */
+    private AnnotationWriter ianns;
+
+    /**
+     * The non standard attributes of this field. May be <tt>null</tt>.
+     */
+    private Attribute attrs;
+
+    // ------------------------------------------------------------------------
+    // Constructor
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a new {@link FieldWriter}.
+     *
+     * @param cw the class writer to which this field must be added.
+     * @param access the field's access flags (see {@link Opcodes}).
+     * @param name the field's name.
+     * @param desc the field's descriptor (see {@link Type}).
+     * @param signature the field's signature. May be <tt>null</tt>.
+     * @param value the field's constant value. May be <tt>null</tt>.
+     */
+    FieldWriter(
+        final ClassWriter cw,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        super(Opcodes.ASM4);
+        if (cw.firstField == null) {
+            cw.firstField = this;
+        } else {
+            cw.lastField.fv = this;
+        }
+        cw.lastField = this;
+        this.cw = cw;
+        this.access = access;
+        this.name = cw.newUTF8(name);
+        this.desc = cw.newUTF8(desc);
+        if (ClassReader.SIGNATURES && signature != null) {
+            this.signature = cw.newUTF8(signature);
+        }
+        if (value != null) {
+            this.value = cw.newConstItem(value).index;
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the FieldVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        if (!ClassReader.ANNOTATIONS) {
+            return null;
+        }
+        ByteVector bv = new ByteVector();
+        // write type, and reserve space for values count
+        bv.putShort(cw.newUTF8(desc)).putShort(0);
+        AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
+        if (visible) {
+            aw.next = anns;
+            anns = aw;
+        } else {
+            aw.next = ianns;
+            ianns = aw;
+        }
+        return aw;
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        attr.next = attrs;
+        attrs = attr;
+    }
+
+    @Override
+    public void visitEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the size of this field.
+     *
+     * @return the size of this field.
+     */
+    int getSize() {
+        int size = 8;
+        if (value != 0) {
+            cw.newUTF8("ConstantValue");
+            size += 8;
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            cw.newUTF8("Synthetic");
+            size += 6;
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            cw.newUTF8("Deprecated");
+            size += 6;
+        }
+        if (ClassReader.SIGNATURES && signature != 0) {
+            cw.newUTF8("Signature");
+            size += 8;
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            cw.newUTF8("RuntimeVisibleAnnotations");
+            size += 8 + anns.getSize();
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            cw.newUTF8("RuntimeInvisibleAnnotations");
+            size += 8 + ianns.getSize();
+        }
+        if (attrs != null) {
+            size += attrs.getSize(cw, null, 0, -1, -1);
+        }
+        return size;
+    }
+
+    /**
+     * Puts the content of this field into the given byte vector.
+     *
+     * @param out where the content of this field must be put.
+     */
+    void put(final ByteVector out) {
+        int mask = Opcodes.ACC_DEPRECATED
+                | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+                | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / (ClassWriter.ACC_SYNTHETIC_ATTRIBUTE / Opcodes.ACC_SYNTHETIC));
+        out.putShort(access & ~mask).putShort(name).putShort(desc);
+        int attributeCount = 0;
+        if (value != 0) {
+            ++attributeCount;
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            ++attributeCount;
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            ++attributeCount;
+        }
+        if (ClassReader.SIGNATURES && signature != 0) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            ++attributeCount;
+        }
+        if (attrs != null) {
+            attributeCount += attrs.getCount();
+        }
+        out.putShort(attributeCount);
+        if (value != 0) {
+            out.putShort(cw.newUTF8("ConstantValue"));
+            out.putInt(2).putShort(value);
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            out.putShort(cw.newUTF8("Synthetic")).putInt(0);
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            out.putShort(cw.newUTF8("Deprecated")).putInt(0);
+        }
+        if (ClassReader.SIGNATURES && signature != 0) {
+            out.putShort(cw.newUTF8("Signature"));
+            out.putInt(2).putShort(signature);
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
+            anns.put(out);
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
+            ianns.put(out);
+        }
+        if (attrs != null) {
+            attrs.put(cw, null, 0, -1, -1, out);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Frame.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1464 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * Information about the input and output stack map frames of a basic block.
+ *
+ * @author Eric Bruneton
+ */
+final class Frame {
+
+    /*
+     * Frames are computed in a two steps process: during the visit of each
+     * instruction, the state of the frame at the end of current basic block is
+     * updated by simulating the action of the instruction on the previous state
+     * of this so called "output frame". In visitMaxs, a fix point algorithm is
+     * used to compute the "input frame" of each basic block, i.e. the stack map
+     * frame at the beginning of the basic block, starting from the input frame
+     * of the first basic block (which is computed from the method descriptor),
+     * and by using the previously computed output frames to compute the input
+     * state of the other blocks.
+     *
+     * All output and input frames are stored as arrays of integers. Reference
+     * and array types are represented by an index into a type table (which is
+     * not the same as the constant pool of the class, in order to avoid adding
+     * unnecessary constants in the pool - not all computed frames will end up
+     * being stored in the stack map table). This allows very fast type
+     * comparisons.
+     *
+     * Output stack map frames are computed relatively to the input frame of the
+     * basic block, which is not yet known when output frames are computed. It
+     * is therefore necessary to be able to represent abstract types such as
+     * "the type at position x in the input frame locals" or "the type at
+     * position x from the top of the input frame stack" or even "the type at
+     * position x in the input frame, with y more (or less) array dimensions".
+     * This explains the rather complicated type format used in output frames.
+     *
+     * This format is the following: DIM KIND VALUE (4, 4 and 24 bits). DIM is a
+     * signed number of array dimensions (from -8 to 7). KIND is either BASE,
+     * LOCAL or STACK. BASE is used for types that are not relative to the input
+     * frame. LOCAL is used for types that are relative to the input local
+     * variable types. STACK is used for types that are relative to the input
+     * stack types. VALUE depends on KIND. For LOCAL types, it is an index in
+     * the input local variable types. For STACK types, it is a position
+     * relatively to the top of input frame stack. For BASE types, it is either
+     * one of the constants defined in FrameVisitor, or for OBJECT and
+     * UNINITIALIZED types, a tag and an index in the type table.
+     *
+     * Output frames can contain types of any kind and with a positive or
+     * negative dimension (and even unassigned types, represented by 0 - which
+     * does not correspond to any valid type value). Input frames can only
+     * contain BASE types of positive or null dimension. In all cases the type
+     * table contains only internal type names (array type descriptors are
+     * forbidden - dimensions must be represented through the DIM field).
+     *
+     * The LONG and DOUBLE types are always represented by using two slots (LONG +
+     * TOP or DOUBLE + TOP), for local variable types as well as in the operand
+     * stack. This is necessary to be able to simulate DUPx_y instructions,
+     * whose effect would be dependent on the actual type values if types were
+     * always represented by a single slot in the stack (and this is not
+     * possible, since actual type values are not always known - cf LOCAL and
+     * STACK type kinds).
+     */
+
+    /**
+     * Mask to get the dimension of a frame type. This dimension is a signed
+     * integer between -8 and 7.
+     */
+    static final int DIM = 0xF0000000;
+
+    /**
+     * Constant to be added to a type to get a type with one more dimension.
+     */
+    static final int ARRAY_OF = 0x10000000;
+
+    /**
+     * Constant to be added to a type to get a type with one less dimension.
+     */
+    static final int ELEMENT_OF = 0xF0000000;
+
+    /**
+     * Mask to get the kind of a frame type.
+     *
+     * @see #BASE
+     * @see #LOCAL
+     * @see #STACK
+     */
+    static final int KIND = 0xF000000;
+
+    /**
+     * Flag used for LOCAL and STACK types. Indicates that if this type happens
+     * to be a long or double type (during the computations of input frames),
+     * then it must be set to TOP because the second word of this value has
+     * been reused to store other data in the basic block. Hence the first word
+     * no longer stores a valid long or double value.
+     */
+    static final int TOP_IF_LONG_OR_DOUBLE = 0x800000;
+
+    /**
+     * Mask to get the value of a frame type.
+     */
+    static final int VALUE = 0x7FFFFF;
+
+    /**
+     * Mask to get the kind of base types.
+     */
+    static final int BASE_KIND = 0xFF00000;
+
+    /**
+     * Mask to get the value of base types.
+     */
+    static final int BASE_VALUE = 0xFFFFF;
+
+    /**
+     * Kind of the types that are not relative to an input stack map frame.
+     */
+    static final int BASE = 0x1000000;
+
+    /**
+     * Base kind of the base reference types. The BASE_VALUE of such types is an
+     * index into the type table.
+     */
+    static final int OBJECT = BASE | 0x700000;
+
+    /**
+     * Base kind of the uninitialized base types. The BASE_VALUE of such types
+     * in an index into the type table (the Item at that index contains both an
+     * instruction offset and an internal class name).
+     */
+    static final int UNINITIALIZED = BASE | 0x800000;
+
+    /**
+     * Kind of the types that are relative to the local variable types of an
+     * input stack map frame. The value of such types is a local variable index.
+     */
+    private static final int LOCAL = 0x2000000;
+
+    /**
+     * Kind of the the types that are relative to the stack of an input stack
+     * map frame. The value of such types is a position relatively to the top of
+     * this stack.
+     */
+    private static final int STACK = 0x3000000;
+
+    /**
+     * The TOP type. This is a BASE type.
+     */
+    static final int TOP = BASE | 0;
+
+    /**
+     * The BOOLEAN type. This is a BASE type mainly used for array types.
+     */
+    static final int BOOLEAN = BASE | 9;
+
+    /**
+     * The BYTE type. This is a BASE type mainly used for array types.
+     */
+    static final int BYTE = BASE | 10;
+
+    /**
+     * The CHAR type. This is a BASE type mainly used for array types.
+     */
+    static final int CHAR = BASE | 11;
+
+    /**
+     * The SHORT type. This is a BASE type mainly used for array types.
+     */
+    static final int SHORT = BASE | 12;
+
+    /**
+     * The INTEGER type. This is a BASE type.
+     */
+    static final int INTEGER = BASE | 1;
+
+    /**
+     * The FLOAT type. This is a BASE type.
+     */
+    static final int FLOAT = BASE | 2;
+
+    /**
+     * The DOUBLE type. This is a BASE type.
+     */
+    static final int DOUBLE = BASE | 3;
+
+    /**
+     * The LONG type. This is a BASE type.
+     */
+    static final int LONG = BASE | 4;
+
+    /**
+     * The NULL type. This is a BASE type.
+     */
+    static final int NULL = BASE | 5;
+
+    /**
+     * The UNINITIALIZED_THIS type. This is a BASE type.
+     */
+    static final int UNINITIALIZED_THIS = BASE | 6;
+
+    /**
+     * The stack size variation corresponding to each JVM instruction. This
+     * stack variation is equal to the size of the values produced by an
+     * instruction, minus the size of the values consumed by this instruction.
+     */
+    static final int[] SIZE;
+
+    /**
+     * Computes the stack size variation corresponding to each JVM instruction.
+     */
+    static {
+        int i;
+        int[] b = new int[202];
+        String s = "EFFFFFFFFGGFFFGGFFFEEFGFGFEEEEEEEEEEEEEEEEEEEEDEDEDDDDD"
+                + "CDCDEEEEEEEEEEEEEEEEEEEEBABABBBBDCFFFGGGEDCDCDCDCDCDCDCDCD"
+                + "CDCEEEEDDDDDDDCDCDCEFEFDDEEFFDEDEEEBDDBBDDDDDDCCCCCCCCEFED"
+                + "DDCDCDEEEEEEEEEEFEEEEEEDDEEDDEE";
+        for (i = 0; i < b.length; ++i) {
+            b[i] = s.charAt(i) - 'E';
+        }
+        SIZE = b;
+
+        // code to generate the above string
+        //
+        // int NA = 0; // not applicable (unused opcode or variable size opcode)
+        //
+        // b = new int[] {
+        // 0, //NOP, // visitInsn
+        // 1, //ACONST_NULL, // -
+        // 1, //ICONST_M1, // -
+        // 1, //ICONST_0, // -
+        // 1, //ICONST_1, // -
+        // 1, //ICONST_2, // -
+        // 1, //ICONST_3, // -
+        // 1, //ICONST_4, // -
+        // 1, //ICONST_5, // -
+        // 2, //LCONST_0, // -
+        // 2, //LCONST_1, // -
+        // 1, //FCONST_0, // -
+        // 1, //FCONST_1, // -
+        // 1, //FCONST_2, // -
+        // 2, //DCONST_0, // -
+        // 2, //DCONST_1, // -
+        // 1, //BIPUSH, // visitIntInsn
+        // 1, //SIPUSH, // -
+        // 1, //LDC, // visitLdcInsn
+        // NA, //LDC_W, // -
+        // NA, //LDC2_W, // -
+        // 1, //ILOAD, // visitVarInsn
+        // 2, //LLOAD, // -
+        // 1, //FLOAD, // -
+        // 2, //DLOAD, // -
+        // 1, //ALOAD, // -
+        // NA, //ILOAD_0, // -
+        // NA, //ILOAD_1, // -
+        // NA, //ILOAD_2, // -
+        // NA, //ILOAD_3, // -
+        // NA, //LLOAD_0, // -
+        // NA, //LLOAD_1, // -
+        // NA, //LLOAD_2, // -
+        // NA, //LLOAD_3, // -
+        // NA, //FLOAD_0, // -
+        // NA, //FLOAD_1, // -
+        // NA, //FLOAD_2, // -
+        // NA, //FLOAD_3, // -
+        // NA, //DLOAD_0, // -
+        // NA, //DLOAD_1, // -
+        // NA, //DLOAD_2, // -
+        // NA, //DLOAD_3, // -
+        // NA, //ALOAD_0, // -
+        // NA, //ALOAD_1, // -
+        // NA, //ALOAD_2, // -
+        // NA, //ALOAD_3, // -
+        // -1, //IALOAD, // visitInsn
+        // 0, //LALOAD, // -
+        // -1, //FALOAD, // -
+        // 0, //DALOAD, // -
+        // -1, //AALOAD, // -
+        // -1, //BALOAD, // -
+        // -1, //CALOAD, // -
+        // -1, //SALOAD, // -
+        // -1, //ISTORE, // visitVarInsn
+        // -2, //LSTORE, // -
+        // -1, //FSTORE, // -
+        // -2, //DSTORE, // -
+        // -1, //ASTORE, // -
+        // NA, //ISTORE_0, // -
+        // NA, //ISTORE_1, // -
+        // NA, //ISTORE_2, // -
+        // NA, //ISTORE_3, // -
+        // NA, //LSTORE_0, // -
+        // NA, //LSTORE_1, // -
+        // NA, //LSTORE_2, // -
+        // NA, //LSTORE_3, // -
+        // NA, //FSTORE_0, // -
+        // NA, //FSTORE_1, // -
+        // NA, //FSTORE_2, // -
+        // NA, //FSTORE_3, // -
+        // NA, //DSTORE_0, // -
+        // NA, //DSTORE_1, // -
+        // NA, //DSTORE_2, // -
+        // NA, //DSTORE_3, // -
+        // NA, //ASTORE_0, // -
+        // NA, //ASTORE_1, // -
+        // NA, //ASTORE_2, // -
+        // NA, //ASTORE_3, // -
+        // -3, //IASTORE, // visitInsn
+        // -4, //LASTORE, // -
+        // -3, //FASTORE, // -
+        // -4, //DASTORE, // -
+        // -3, //AASTORE, // -
+        // -3, //BASTORE, // -
+        // -3, //CASTORE, // -
+        // -3, //SASTORE, // -
+        // -1, //POP, // -
+        // -2, //POP2, // -
+        // 1, //DUP, // -
+        // 1, //DUP_X1, // -
+        // 1, //DUP_X2, // -
+        // 2, //DUP2, // -
+        // 2, //DUP2_X1, // -
+        // 2, //DUP2_X2, // -
+        // 0, //SWAP, // -
+        // -1, //IADD, // -
+        // -2, //LADD, // -
+        // -1, //FADD, // -
+        // -2, //DADD, // -
+        // -1, //ISUB, // -
+        // -2, //LSUB, // -
+        // -1, //FSUB, // -
+        // -2, //DSUB, // -
+        // -1, //IMUL, // -
+        // -2, //LMUL, // -
+        // -1, //FMUL, // -
+        // -2, //DMUL, // -
+        // -1, //IDIV, // -
+        // -2, //LDIV, // -
+        // -1, //FDIV, // -
+        // -2, //DDIV, // -
+        // -1, //IREM, // -
+        // -2, //LREM, // -
+        // -1, //FREM, // -
+        // -2, //DREM, // -
+        // 0, //INEG, // -
+        // 0, //LNEG, // -
+        // 0, //FNEG, // -
+        // 0, //DNEG, // -
+        // -1, //ISHL, // -
+        // -1, //LSHL, // -
+        // -1, //ISHR, // -
+        // -1, //LSHR, // -
+        // -1, //IUSHR, // -
+        // -1, //LUSHR, // -
+        // -1, //IAND, // -
+        // -2, //LAND, // -
+        // -1, //IOR, // -
+        // -2, //LOR, // -
+        // -1, //IXOR, // -
+        // -2, //LXOR, // -
+        // 0, //IINC, // visitIincInsn
+        // 1, //I2L, // visitInsn
+        // 0, //I2F, // -
+        // 1, //I2D, // -
+        // -1, //L2I, // -
+        // -1, //L2F, // -
+        // 0, //L2D, // -
+        // 0, //F2I, // -
+        // 1, //F2L, // -
+        // 1, //F2D, // -
+        // -1, //D2I, // -
+        // 0, //D2L, // -
+        // -1, //D2F, // -
+        // 0, //I2B, // -
+        // 0, //I2C, // -
+        // 0, //I2S, // -
+        // -3, //LCMP, // -
+        // -1, //FCMPL, // -
+        // -1, //FCMPG, // -
+        // -3, //DCMPL, // -
+        // -3, //DCMPG, // -
+        // -1, //IFEQ, // visitJumpInsn
+        // -1, //IFNE, // -
+        // -1, //IFLT, // -
+        // -1, //IFGE, // -
+        // -1, //IFGT, // -
+        // -1, //IFLE, // -
+        // -2, //IF_ICMPEQ, // -
+        // -2, //IF_ICMPNE, // -
+        // -2, //IF_ICMPLT, // -
+        // -2, //IF_ICMPGE, // -
+        // -2, //IF_ICMPGT, // -
+        // -2, //IF_ICMPLE, // -
+        // -2, //IF_ACMPEQ, // -
+        // -2, //IF_ACMPNE, // -
+        // 0, //GOTO, // -
+        // 1, //JSR, // -
+        // 0, //RET, // visitVarInsn
+        // -1, //TABLESWITCH, // visiTableSwitchInsn
+        // -1, //LOOKUPSWITCH, // visitLookupSwitch
+        // -1, //IRETURN, // visitInsn
+        // -2, //LRETURN, // -
+        // -1, //FRETURN, // -
+        // -2, //DRETURN, // -
+        // -1, //ARETURN, // -
+        // 0, //RETURN, // -
+        // NA, //GETSTATIC, // visitFieldInsn
+        // NA, //PUTSTATIC, // -
+        // NA, //GETFIELD, // -
+        // NA, //PUTFIELD, // -
+        // NA, //INVOKEVIRTUAL, // visitMethodInsn
+        // NA, //INVOKESPECIAL, // -
+        // NA, //INVOKESTATIC, // -
+        // NA, //INVOKEINTERFACE, // -
+        // NA, //INVOKEDYNAMIC, // visitInvokeDynamicInsn
+        // 1, //NEW, // visitTypeInsn
+        // 0, //NEWARRAY, // visitIntInsn
+        // 0, //ANEWARRAY, // visitTypeInsn
+        // 0, //ARRAYLENGTH, // visitInsn
+        // NA, //ATHROW, // -
+        // 0, //CHECKCAST, // visitTypeInsn
+        // 0, //INSTANCEOF, // -
+        // -1, //MONITORENTER, // visitInsn
+        // -1, //MONITOREXIT, // -
+        // NA, //WIDE, // NOT VISITED
+        // NA, //MULTIANEWARRAY, // visitMultiANewArrayInsn
+        // -1, //IFNULL, // visitJumpInsn
+        // -1, //IFNONNULL, // -
+        // NA, //GOTO_W, // -
+        // NA, //JSR_W, // -
+        // };
+        // for (i = 0; i < b.length; ++i) {
+        // System.err.print((char)('E' + b[i]));
+        // }
+        // System.err.println();
+    }
+
+    /**
+     * The label (i.e. basic block) to which these input and output stack map
+     * frames correspond.
+     */
+    Label owner;
+
+    /**
+     * The input stack map frame locals.
+     */
+    int[] inputLocals;
+
+    /**
+     * The input stack map frame stack.
+     */
+    int[] inputStack;
+
+    /**
+     * The output stack map frame locals.
+     */
+    private int[] outputLocals;
+
+    /**
+     * The output stack map frame stack.
+     */
+    private int[] outputStack;
+
+    /**
+     * Relative size of the output stack. The exact semantics of this field
+     * depends on the algorithm that is used.
+     *
+     * When only the maximum stack size is computed, this field is the size of
+     * the output stack relatively to the top of the input stack.
+     *
+     * When the stack map frames are completely computed, this field is the
+     * actual number of types in {@link #outputStack}.
+     */
+    private int outputStackTop;
+
+    /**
+     * Number of types that are initialized in the basic block.
+     *
+     * @see #initializations
+     */
+    private int initializationCount;
+
+    /**
+     * The types that are initialized in the basic block. A constructor
+     * invocation on an UNINITIALIZED or UNINITIALIZED_THIS type must replace
+     * <i>every occurence</i> of this type in the local variables and in the
+     * operand stack. This cannot be done during the first phase of the
+     * algorithm since, during this phase, the local variables and the operand
+     * stack are not completely computed. It is therefore necessary to store the
+     * types on which constructors are invoked in the basic block, in order to
+     * do this replacement during the second phase of the algorithm, where the
+     * frames are fully computed. Note that this array can contain types that
+     * are relative to input locals or to the input stack (see below for the
+     * description of the algorithm).
+     */
+    private int[] initializations;
+
+    /**
+     * Returns the output frame local variable type at the given index.
+     *
+     * @param local the index of the local that must be returned.
+     * @return the output frame local variable type at the given index.
+     */
+    private int get(final int local) {
+        if (outputLocals == null || local >= outputLocals.length) {
+            // this local has never been assigned in this basic block,
+            // so it is still equal to its value in the input frame
+            return LOCAL | local;
+        } else {
+            int type = outputLocals[local];
+            if (type == 0) {
+                // this local has never been assigned in this basic block,
+                // so it is still equal to its value in the input frame
+                type = outputLocals[local] = LOCAL | local;
+            }
+            return type;
+        }
+    }
+
+    /**
+     * Sets the output frame local variable type at the given index.
+     *
+     * @param local the index of the local that must be set.
+     * @param type the value of the local that must be set.
+     */
+    private void set(final int local, final int type) {
+        // creates and/or resizes the output local variables array if necessary
+        if (outputLocals == null) {
+            outputLocals = new int[10];
+        }
+        int n = outputLocals.length;
+        if (local >= n) {
+            int[] t = new int[Math.max(local + 1, 2 * n)];
+            System.arraycopy(outputLocals, 0, t, 0, n);
+            outputLocals = t;
+        }
+        // sets the local variable
+        outputLocals[local] = type;
+    }
+
+    /**
+     * Pushes a new type onto the output frame stack.
+     *
+     * @param type the type that must be pushed.
+     */
+    private void push(final int type) {
+        // creates and/or resizes the output stack array if necessary
+        if (outputStack == null) {
+            outputStack = new int[10];
+        }
+        int n = outputStack.length;
+        if (outputStackTop >= n) {
+            int[] t = new int[Math.max(outputStackTop + 1, 2 * n)];
+            System.arraycopy(outputStack, 0, t, 0, n);
+            outputStack = t;
+        }
+        // pushes the type on the output stack
+        outputStack[outputStackTop++] = type;
+        // updates the maximun height reached by the output stack, if needed
+        int top = owner.inputStackTop + outputStackTop;
+        if (top > owner.outputStackMax) {
+            owner.outputStackMax = top;
+        }
+    }
+
+    /**
+     * Pushes a new type onto the output frame stack.
+     *
+     * @param cw the ClassWriter to which this label belongs.
+     * @param desc the descriptor of the type to be pushed. Can also be a method
+     *        descriptor (in this case this method pushes its return type onto
+     *        the output frame stack).
+     */
+    private void push(final ClassWriter cw, final String desc) {
+        int type = type(cw, desc);
+        if (type != 0) {
+            push(type);
+            if (type == LONG || type == DOUBLE) {
+                push(TOP);
+            }
+        }
+    }
+
+    /**
+     * Returns the int encoding of the given type.
+     *
+     * @param cw the ClassWriter to which this label belongs.
+     * @param desc a type descriptor.
+     * @return the int encoding of the given type.
+     */
+    private static int type(final ClassWriter cw, final String desc) {
+        String t;
+        int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
+        switch (desc.charAt(index)) {
+            case 'V':
+                return 0;
+            case 'Z':
+            case 'C':
+            case 'B':
+            case 'S':
+            case 'I':
+                return INTEGER;
+            case 'F':
+                return FLOAT;
+            case 'J':
+                return LONG;
+            case 'D':
+                return DOUBLE;
+            case 'L':
+                // stores the internal name, not the descriptor!
+                t = desc.substring(index + 1, desc.length() - 1);
+                return OBJECT | cw.addType(t);
+                // case '[':
+            default:
+                // extracts the dimensions and the element type
+                int data;
+                int dims = index + 1;
+                while (desc.charAt(dims) == '[') {
+                    ++dims;
+                }
+                switch (desc.charAt(dims)) {
+                    case 'Z':
+                        data = BOOLEAN;
+                        break;
+                    case 'C':
+                        data = CHAR;
+                        break;
+                    case 'B':
+                        data = BYTE;
+                        break;
+                    case 'S':
+                        data = SHORT;
+                        break;
+                    case 'I':
+                        data = INTEGER;
+                        break;
+                    case 'F':
+                        data = FLOAT;
+                        break;
+                    case 'J':
+                        data = LONG;
+                        break;
+                    case 'D':
+                        data = DOUBLE;
+                        break;
+                    // case 'L':
+                    default:
+                        // stores the internal name, not the descriptor
+                        t = desc.substring(dims + 1, desc.length() - 1);
+                        data = OBJECT | cw.addType(t);
+                }
+                return (dims - index) << 28 | data;
+        }
+    }
+
+    /**
+     * Pops a type from the output frame stack and returns its value.
+     *
+     * @return the type that has been popped from the output frame stack.
+     */
+    private int pop() {
+        if (outputStackTop > 0) {
+            return outputStack[--outputStackTop];
+        } else {
+            // if the output frame stack is empty, pops from the input stack
+            return STACK | -(--owner.inputStackTop);
+        }
+    }
+
+    /**
+     * Pops the given number of types from the output frame stack.
+     *
+     * @param elements the number of types that must be popped.
+     */
+    private void pop(final int elements) {
+        if (outputStackTop >= elements) {
+            outputStackTop -= elements;
+        } else {
+            // if the number of elements to be popped is greater than the number
+            // of elements in the output stack, clear it, and pops the remaining
+            // elements from the input stack.
+            owner.inputStackTop -= elements - outputStackTop;
+            outputStackTop = 0;
+        }
+    }
+
+    /**
+     * Pops a type from the output frame stack.
+     *
+     * @param desc the descriptor of the type to be popped. Can also be a method
+     *        descriptor (in this case this method pops the types corresponding
+     *        to the method arguments).
+     */
+    private void pop(final String desc) {
+        char c = desc.charAt(0);
+        if (c == '(') {
+            pop((Type.getArgumentsAndReturnSizes(desc) >> 2) - 1);
+        } else if (c == 'J' || c == 'D') {
+            pop(2);
+        } else {
+            pop(1);
+        }
+    }
+
+    /**
+     * Adds a new type to the list of types on which a constructor is invoked in
+     * the basic block.
+     *
+     * @param var a type on a which a constructor is invoked.
+     */
+    private void init(final int var) {
+        // creates and/or resizes the initializations array if necessary
+        if (initializations == null) {
+            initializations = new int[2];
+        }
+        int n = initializations.length;
+        if (initializationCount >= n) {
+            int[] t = new int[Math.max(initializationCount + 1, 2 * n)];
+            System.arraycopy(initializations, 0, t, 0, n);
+            initializations = t;
+        }
+        // stores the type to be initialized
+        initializations[initializationCount++] = var;
+    }
+
+    /**
+     * Replaces the given type with the appropriate type if it is one of the
+     * types on which a constructor is invoked in the basic block.
+     *
+     * @param cw the ClassWriter to which this label belongs.
+     * @param t a type
+     * @return t or, if t is one of the types on which a constructor is invoked
+     *         in the basic block, the type corresponding to this constructor.
+     */
+    private int init(final ClassWriter cw, final int t) {
+        int s;
+        if (t == UNINITIALIZED_THIS) {
+            s = OBJECT | cw.addType(cw.thisName);
+        } else if ((t & (DIM | BASE_KIND)) == UNINITIALIZED) {
+            String type = cw.typeTable[t & BASE_VALUE].strVal1;
+            s = OBJECT | cw.addType(type);
+        } else {
+            return t;
+        }
+        for (int j = 0; j < initializationCount; ++j) {
+            int u = initializations[j];
+            int dim = u & DIM;
+            int kind = u & KIND;
+            if (kind == LOCAL) {
+                u = dim + inputLocals[u & VALUE];
+            } else if (kind == STACK) {
+                u = dim + inputStack[inputStack.length - (u & VALUE)];
+            }
+            if (t == u) {
+                return s;
+            }
+        }
+        return t;
+    }
+
+    /**
+     * Initializes the input frame of the first basic block from the method
+     * descriptor.
+     *
+     * @param cw the ClassWriter to which this label belongs.
+     * @param access the access flags of the method to which this label belongs.
+     * @param args the formal parameter types of this method.
+     * @param maxLocals the maximum number of local variables of this method.
+     */
+    void initInputFrame(
+        final ClassWriter cw,
+        final int access,
+        final Type[] args,
+        final int maxLocals)
+    {
+        inputLocals = new int[maxLocals];
+        inputStack = new int[0];
+        int i = 0;
+        if ((access & Opcodes.ACC_STATIC) == 0) {
+            if ((access & MethodWriter.ACC_CONSTRUCTOR) == 0) {
+                inputLocals[i++] = OBJECT | cw.addType(cw.thisName);
+            } else {
+                inputLocals[i++] = UNINITIALIZED_THIS;
+            }
+        }
+        for (int j = 0; j < args.length; ++j) {
+            int t = type(cw, args[j].getDescriptor());
+            inputLocals[i++] = t;
+            if (t == LONG || t == DOUBLE) {
+                inputLocals[i++] = TOP;
+            }
+        }
+        while (i < maxLocals) {
+            inputLocals[i++] = TOP;
+        }
+    }
+
+    /**
+     * Simulates the action of the given instruction on the output stack frame.
+     *
+     * @param opcode the opcode of the instruction.
+     * @param arg the operand of the instruction, if any.
+     * @param cw the class writer to which this label belongs.
+     * @param item the operand of the instructions, if any.
+     */
+    void execute(
+        final int opcode,
+        final int arg,
+        final ClassWriter cw,
+        final Item item)
+    {
+        int t1, t2, t3, t4;
+        switch (opcode) {
+            case Opcodes.NOP:
+            case Opcodes.INEG:
+            case Opcodes.LNEG:
+            case Opcodes.FNEG:
+            case Opcodes.DNEG:
+            case Opcodes.I2B:
+            case Opcodes.I2C:
+            case Opcodes.I2S:
+            case Opcodes.GOTO:
+            case Opcodes.RETURN:
+                break;
+            case Opcodes.ACONST_NULL:
+                push(NULL);
+                break;
+            case Opcodes.ICONST_M1:
+            case Opcodes.ICONST_0:
+            case Opcodes.ICONST_1:
+            case Opcodes.ICONST_2:
+            case Opcodes.ICONST_3:
+            case Opcodes.ICONST_4:
+            case Opcodes.ICONST_5:
+            case Opcodes.BIPUSH:
+            case Opcodes.SIPUSH:
+            case Opcodes.ILOAD:
+                push(INTEGER);
+                break;
+            case Opcodes.LCONST_0:
+            case Opcodes.LCONST_1:
+            case Opcodes.LLOAD:
+                push(LONG);
+                push(TOP);
+                break;
+            case Opcodes.FCONST_0:
+            case Opcodes.FCONST_1:
+            case Opcodes.FCONST_2:
+            case Opcodes.FLOAD:
+                push(FLOAT);
+                break;
+            case Opcodes.DCONST_0:
+            case Opcodes.DCONST_1:
+            case Opcodes.DLOAD:
+                push(DOUBLE);
+                push(TOP);
+                break;
+            case Opcodes.LDC:
+                switch (item.type) {
+                    case ClassWriter.INT:
+                        push(INTEGER);
+                        break;
+                    case ClassWriter.LONG:
+                        push(LONG);
+                        push(TOP);
+                        break;
+                    case ClassWriter.FLOAT:
+                        push(FLOAT);
+                        break;
+                    case ClassWriter.DOUBLE:
+                        push(DOUBLE);
+                        push(TOP);
+                        break;
+                    case ClassWriter.CLASS:
+                        push(OBJECT | cw.addType("java/lang/Class"));
+                        break;
+                    case ClassWriter.STR:
+                        push(OBJECT | cw.addType("java/lang/String"));
+                        break;
+                    case ClassWriter.MTYPE:
+                        push(OBJECT | cw.addType("java/lang/invoke/MethodType"));
+                        break;
+                    // case ClassWriter.HANDLE_BASE + [1..9]:
+                    default:
+                        push(OBJECT | cw.addType("java/lang/invoke/MethodHandle"));
+                }
+                break;
+            case Opcodes.ALOAD:
+                push(get(arg));
+                break;
+            case Opcodes.IALOAD:
+            case Opcodes.BALOAD:
+            case Opcodes.CALOAD:
+            case Opcodes.SALOAD:
+                pop(2);
+                push(INTEGER);
+                break;
+            case Opcodes.LALOAD:
+            case Opcodes.D2L:
+                pop(2);
+                push(LONG);
+                push(TOP);
+                break;
+            case Opcodes.FALOAD:
+                pop(2);
+                push(FLOAT);
+                break;
+            case Opcodes.DALOAD:
+            case Opcodes.L2D:
+                pop(2);
+                push(DOUBLE);
+                push(TOP);
+                break;
+            case Opcodes.AALOAD:
+                pop(1);
+                t1 = pop();
+                push(ELEMENT_OF + t1);
+                break;
+            case Opcodes.ISTORE:
+            case Opcodes.FSTORE:
+            case Opcodes.ASTORE:
+                t1 = pop();
+                set(arg, t1);
+                if (arg > 0) {
+                    t2 = get(arg - 1);
+                    // if t2 is of kind STACK or LOCAL we cannot know its size!
+                    if (t2 == LONG || t2 == DOUBLE) {
+                        set(arg - 1, TOP);
+                    } else if ((t2 & KIND) != BASE) {
+                        set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
+                    }
+                }
+                break;
+            case Opcodes.LSTORE:
+            case Opcodes.DSTORE:
+                pop(1);
+                t1 = pop();
+                set(arg, t1);
+                set(arg + 1, TOP);
+                if (arg > 0) {
+                    t2 = get(arg - 1);
+                    // if t2 is of kind STACK or LOCAL we cannot know its size!
+                    if (t2 == LONG || t2 == DOUBLE) {
+                        set(arg - 1, TOP);
+                    } else if ((t2 & KIND) != BASE) {
+                        set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
+                    }
+                }
+                break;
+            case Opcodes.IASTORE:
+            case Opcodes.BASTORE:
+            case Opcodes.CASTORE:
+            case Opcodes.SASTORE:
+            case Opcodes.FASTORE:
+            case Opcodes.AASTORE:
+                pop(3);
+                break;
+            case Opcodes.LASTORE:
+            case Opcodes.DASTORE:
+                pop(4);
+                break;
+            case Opcodes.POP:
+            case Opcodes.IFEQ:
+            case Opcodes.IFNE:
+            case Opcodes.IFLT:
+            case Opcodes.IFGE:
+            case Opcodes.IFGT:
+            case Opcodes.IFLE:
+            case Opcodes.IRETURN:
+            case Opcodes.FRETURN:
+            case Opcodes.ARETURN:
+            case Opcodes.TABLESWITCH:
+            case Opcodes.LOOKUPSWITCH:
+            case Opcodes.ATHROW:
+            case Opcodes.MONITORENTER:
+            case Opcodes.MONITOREXIT:
+            case Opcodes.IFNULL:
+            case Opcodes.IFNONNULL:
+                pop(1);
+                break;
+            case Opcodes.POP2:
+            case Opcodes.IF_ICMPEQ:
+            case Opcodes.IF_ICMPNE:
+            case Opcodes.IF_ICMPLT:
+            case Opcodes.IF_ICMPGE:
+            case Opcodes.IF_ICMPGT:
+            case Opcodes.IF_ICMPLE:
+            case Opcodes.IF_ACMPEQ:
+            case Opcodes.IF_ACMPNE:
+            case Opcodes.LRETURN:
+            case Opcodes.DRETURN:
+                pop(2);
+                break;
+            case Opcodes.DUP:
+                t1 = pop();
+                push(t1);
+                push(t1);
+                break;
+            case Opcodes.DUP_X1:
+                t1 = pop();
+                t2 = pop();
+                push(t1);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP_X2:
+                t1 = pop();
+                t2 = pop();
+                t3 = pop();
+                push(t1);
+                push(t3);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP2:
+                t1 = pop();
+                t2 = pop();
+                push(t2);
+                push(t1);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP2_X1:
+                t1 = pop();
+                t2 = pop();
+                t3 = pop();
+                push(t2);
+                push(t1);
+                push(t3);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP2_X2:
+                t1 = pop();
+                t2 = pop();
+                t3 = pop();
+                t4 = pop();
+                push(t2);
+                push(t1);
+                push(t4);
+                push(t3);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.SWAP:
+                t1 = pop();
+                t2 = pop();
+                push(t1);
+                push(t2);
+                break;
+            case Opcodes.IADD:
+            case Opcodes.ISUB:
+            case Opcodes.IMUL:
+            case Opcodes.IDIV:
+            case Opcodes.IREM:
+            case Opcodes.IAND:
+            case Opcodes.IOR:
+            case Opcodes.IXOR:
+            case Opcodes.ISHL:
+            case Opcodes.ISHR:
+            case Opcodes.IUSHR:
+            case Opcodes.L2I:
+            case Opcodes.D2I:
+            case Opcodes.FCMPL:
+            case Opcodes.FCMPG:
+                pop(2);
+                push(INTEGER);
+                break;
+            case Opcodes.LADD:
+            case Opcodes.LSUB:
+            case Opcodes.LMUL:
+            case Opcodes.LDIV:
+            case Opcodes.LREM:
+            case Opcodes.LAND:
+            case Opcodes.LOR:
+            case Opcodes.LXOR:
+                pop(4);
+                push(LONG);
+                push(TOP);
+                break;
+            case Opcodes.FADD:
+            case Opcodes.FSUB:
+            case Opcodes.FMUL:
+            case Opcodes.FDIV:
+            case Opcodes.FREM:
+            case Opcodes.L2F:
+            case Opcodes.D2F:
+                pop(2);
+                push(FLOAT);
+                break;
+            case Opcodes.DADD:
+            case Opcodes.DSUB:
+            case Opcodes.DMUL:
+            case Opcodes.DDIV:
+            case Opcodes.DREM:
+                pop(4);
+                push(DOUBLE);
+                push(TOP);
+                break;
+            case Opcodes.LSHL:
+            case Opcodes.LSHR:
+            case Opcodes.LUSHR:
+                pop(3);
+                push(LONG);
+                push(TOP);
+                break;
+            case Opcodes.IINC:
+                set(arg, INTEGER);
+                break;
+            case Opcodes.I2L:
+            case Opcodes.F2L:
+                pop(1);
+                push(LONG);
+                push(TOP);
+                break;
+            case Opcodes.I2F:
+                pop(1);
+                push(FLOAT);
+                break;
+            case Opcodes.I2D:
+            case Opcodes.F2D:
+                pop(1);
+                push(DOUBLE);
+                push(TOP);
+                break;
+            case Opcodes.F2I:
+            case Opcodes.ARRAYLENGTH:
+            case Opcodes.INSTANCEOF:
+                pop(1);
+                push(INTEGER);
+                break;
+            case Opcodes.LCMP:
+            case Opcodes.DCMPL:
+            case Opcodes.DCMPG:
+                pop(4);
+                push(INTEGER);
+                break;
+            case Opcodes.JSR:
+            case Opcodes.RET:
+                throw new RuntimeException("JSR/RET are not supported with computeFrames option");
+            case Opcodes.GETSTATIC:
+                push(cw, item.strVal3);
+                break;
+            case Opcodes.PUTSTATIC:
+                pop(item.strVal3);
+                break;
+            case Opcodes.GETFIELD:
+                pop(1);
+                push(cw, item.strVal3);
+                break;
+            case Opcodes.PUTFIELD:
+                pop(item.strVal3);
+                pop();
+                break;
+            case Opcodes.INVOKEVIRTUAL:
+            case Opcodes.INVOKESPECIAL:
+            case Opcodes.INVOKESTATIC:
+            case Opcodes.INVOKEINTERFACE:
+                pop(item.strVal3);
+                if (opcode != Opcodes.INVOKESTATIC) {
+                    t1 = pop();
+                    if (opcode == Opcodes.INVOKESPECIAL
+                            && item.strVal2.charAt(0) == '<')
+                    {
+                        init(t1);
+                    }
+                }
+                push(cw, item.strVal3);
+                break;
+            case Opcodes.INVOKEDYNAMIC:
+                pop(item.strVal2);
+                push(cw, item.strVal2);
+                break;
+            case Opcodes.NEW:
+                push(UNINITIALIZED | cw.addUninitializedType(item.strVal1, arg));
+                break;
+            case Opcodes.NEWARRAY:
+                pop();
+                switch (arg) {
+                    case Opcodes.T_BOOLEAN:
+                        push(ARRAY_OF | BOOLEAN);
+                        break;
+                    case Opcodes.T_CHAR:
+                        push(ARRAY_OF | CHAR);
+                        break;
+                    case Opcodes.T_BYTE:
+                        push(ARRAY_OF | BYTE);
+                        break;
+                    case Opcodes.T_SHORT:
+                        push(ARRAY_OF | SHORT);
+                        break;
+                    case Opcodes.T_INT:
+                        push(ARRAY_OF | INTEGER);
+                        break;
+                    case Opcodes.T_FLOAT:
+                        push(ARRAY_OF | FLOAT);
+                        break;
+                    case Opcodes.T_DOUBLE:
+                        push(ARRAY_OF | DOUBLE);
+                        break;
+                    // case Opcodes.T_LONG:
+                    default:
+                        push(ARRAY_OF | LONG);
+                        break;
+                }
+                break;
+            case Opcodes.ANEWARRAY:
+                String s = item.strVal1;
+                pop();
+                if (s.charAt(0) == '[') {
+                    push(cw, '[' + s);
+                } else {
+                    push(ARRAY_OF | OBJECT | cw.addType(s));
+                }
+                break;
+            case Opcodes.CHECKCAST:
+                s = item.strVal1;
+                pop();
+                if (s.charAt(0) == '[') {
+                    push(cw, s);
+                } else {
+                    push(OBJECT | cw.addType(s));
+                }
+                break;
+            // case Opcodes.MULTIANEWARRAY:
+            default:
+                pop(arg);
+                push(cw, item.strVal1);
+                break;
+        }
+    }
+
+    /**
+     * Merges the input frame of the given basic block with the input and output
+     * frames of this basic block. Returns <tt>true</tt> if the input frame of
+     * the given label has been changed by this operation.
+     *
+     * @param cw the ClassWriter to which this label belongs.
+     * @param frame the basic block whose input frame must be updated.
+     * @param edge the kind of the {@link Edge} between this label and 'label'.
+     *        See {@link Edge#info}.
+     * @return <tt>true</tt> if the input frame of the given label has been
+     *         changed by this operation.
+     */
+    boolean merge(final ClassWriter cw, final Frame frame, final int edge) {
+        boolean changed = false;
+        int i, s, dim, kind, t;
+
+        int nLocal = inputLocals.length;
+        int nStack = inputStack.length;
+        if (frame.inputLocals == null) {
+            frame.inputLocals = new int[nLocal];
+            changed = true;
+        }
+
+        for (i = 0; i < nLocal; ++i) {
+            if (outputLocals != null && i < outputLocals.length) {
+                s = outputLocals[i];
+                if (s == 0) {
+                    t = inputLocals[i];
+                } else {
+                    dim = s & DIM;
+                    kind = s & KIND;
+                    if (kind == BASE) {
+                        t = s;
+                    } else {
+                        if (kind == LOCAL) {
+                            t = dim + inputLocals[s & VALUE];
+                        } else {
+                            t = dim + inputStack[nStack - (s & VALUE)];
+                        }
+                        if ((s & TOP_IF_LONG_OR_DOUBLE) != 0 && (t == LONG || t == DOUBLE)) {
+                            t = TOP;
+                        }
+                    }
+                }
+            } else {
+                t = inputLocals[i];
+            }
+            if (initializations != null) {
+                t = init(cw, t);
+            }
+            changed |= merge(cw, t, frame.inputLocals, i);
+        }
+
+        if (edge > 0) {
+            for (i = 0; i < nLocal; ++i) {
+                t = inputLocals[i];
+                changed |= merge(cw, t, frame.inputLocals, i);
+            }
+            if (frame.inputStack == null) {
+                frame.inputStack = new int[1];
+                changed = true;
+            }
+            changed |= merge(cw, edge, frame.inputStack, 0);
+            return changed;
+        }
+
+        int nInputStack = inputStack.length + owner.inputStackTop;
+        if (frame.inputStack == null) {
+            frame.inputStack = new int[nInputStack + outputStackTop];
+            changed = true;
+        }
+
+        for (i = 0; i < nInputStack; ++i) {
+            t = inputStack[i];
+            if (initializations != null) {
+                t = init(cw, t);
+            }
+            changed |= merge(cw, t, frame.inputStack, i);
+        }
+        for (i = 0; i < outputStackTop; ++i) {
+            s = outputStack[i];
+            dim = s & DIM;
+            kind = s & KIND;
+            if (kind == BASE) {
+                t = s;
+            } else {
+                if (kind == LOCAL) {
+                    t = dim + inputLocals[s & VALUE];
+                } else {
+                    t = dim + inputStack[nStack - (s & VALUE)];
+                }
+                if ((s & TOP_IF_LONG_OR_DOUBLE) != 0 && (t == LONG || t == DOUBLE)) {
+                    t = TOP;
+                }
+            }
+            if (initializations != null) {
+                t = init(cw, t);
+            }
+            changed |= merge(cw, t, frame.inputStack, nInputStack + i);
+        }
+        return changed;
+    }
+
+    /**
+     * Merges the type at the given index in the given type array with the given
+     * type. Returns <tt>true</tt> if the type array has been modified by this
+     * operation.
+     *
+     * @param cw the ClassWriter to which this label belongs.
+     * @param t the type with which the type array element must be merged.
+     * @param types an array of types.
+     * @param index the index of the type that must be merged in 'types'.
+     * @return <tt>true</tt> if the type array has been modified by this
+     *         operation.
+     */
+    private static boolean merge(
+        final ClassWriter cw,
+        int t,
+        final int[] types,
+        final int index)
+    {
+        int u = types[index];
+        if (u == t) {
+            // if the types are equal, merge(u,t)=u, so there is no change
+            return false;
+        }
+        if ((t & ~DIM) == NULL) {
+            if (u == NULL) {
+                return false;
+            }
+            t = NULL;
+        }
+        if (u == 0) {
+            // if types[index] has never been assigned, merge(u,t)=t
+            types[index] = t;
+            return true;
+        }
+        int v;
+        if ((u & BASE_KIND) == OBJECT || (u & DIM) != 0) {
+            // if u is a reference type of any dimension
+            if (t == NULL) {
+                // if t is the NULL type, merge(u,t)=u, so there is no change
+                return false;
+            } else if ((t & (DIM | BASE_KIND)) == (u & (DIM | BASE_KIND))) {
+                if ((u & BASE_KIND) == OBJECT) {
+                    // if t is also a reference type, and if u and t have the
+                    // same dimension merge(u,t) = dim(t) | common parent of the
+                    // element types of u and t
+                    v = (t & DIM) | OBJECT
+                            | cw.getMergedType(t & BASE_VALUE, u & BASE_VALUE);
+                } else {
+                    // if u and t are array types, but not with the same element
+                    // type, merge(u,t)=java/lang/Object
+                    v = OBJECT | cw.addType("java/lang/Object");
+                }
+            } else if ((t & BASE_KIND) == OBJECT || (t & DIM) != 0) {
+                // if t is any other reference or array type,
+                // merge(u,t)=java/lang/Object
+                v = OBJECT | cw.addType("java/lang/Object");
+            } else {
+                // if t is any other type, merge(u,t)=TOP
+                v = TOP;
+            }
+        } else if (u == NULL) {
+            // if u is the NULL type, merge(u,t)=t,
+            // or TOP if t is not a reference type
+            v = (t & BASE_KIND) == OBJECT || (t & DIM) != 0 ? t : TOP;
+        } else {
+            // if u is any other type, merge(u,t)=TOP whatever t
+            v = TOP;
+        }
+        if (u != v) {
+            types[index] = v;
+            return true;
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Handle.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,188 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A reference to a field or a method.
+ *
+ * @author Remi Forax
+ * @author Eric Bruneton
+ */
+public final class Handle {
+
+    /**
+     * The kind of field or method designated by this Handle. Should be
+     * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
+     * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
+     * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+     * {@link Opcodes#H_INVOKESPECIAL}, {@link Opcodes#H_NEWINVOKESPECIAL} or
+     * {@link Opcodes#H_INVOKEINTERFACE}.
+     */
+    final int tag;
+
+    /**
+     * The internal name of the field or method designed by this handle.
+     */
+    final String owner;
+
+    /**
+     * The name of the field or method designated by this handle.
+     */
+    final String name;
+
+    /**
+     * The descriptor of the field or method designated by this handle.
+     */
+    final String desc;
+
+    /**
+     * Constructs a new field or method handle.
+     *
+     * @param tag the kind of field or method designated by this Handle. Must be
+     *        {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
+     *        {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
+     *        {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+     *        {@link Opcodes#H_INVOKESPECIAL},
+     *        {@link Opcodes#H_NEWINVOKESPECIAL} or
+     *        {@link Opcodes#H_INVOKEINTERFACE}.
+     * @param owner the internal name of the field or method designed by this
+     *        handle.
+     * @param name the name of the field or method designated by this handle.
+     * @param desc the descriptor of the field or method designated by this
+     *        handle.
+     */
+    public Handle(int tag, String owner, String name, String desc) {
+        this.tag = tag;
+        this.owner = owner;
+        this.name = name;
+        this.desc = desc;
+    }
+
+    /**
+     * Returns the kind of field or method designated by this handle.
+     *
+     * @return {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
+     *         {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
+     *         {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+     *         {@link Opcodes#H_INVOKESPECIAL},
+     *         {@link Opcodes#H_NEWINVOKESPECIAL} or
+     *         {@link Opcodes#H_INVOKEINTERFACE}.
+     */
+    public int getTag() {
+        return tag;
+    }
+
+    /**
+     * Returns the internal name of the field or method designed by this
+     * handle.
+     *
+     * @return the internal name of the field or method designed by this
+     *         handle.
+     */
+    public String getOwner() {
+        return owner;
+    }
+
+    /**
+     * Returns the name of the field or method designated by this handle.
+     *
+     * @return the name of the field or method designated by this handle.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Returns the descriptor of the field or method designated by this handle.
+     *
+     * @return the descriptor of the field or method designated by this handle.
+     */
+    public String getDesc() {
+        return desc;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof Handle)) {
+            return false;
+        }
+        Handle h = (Handle) obj;
+        return tag == h.tag && owner.equals(h.owner)
+                && name.equals(h.name) && desc.equals(h.desc);
+    }
+
+    @Override
+    public int hashCode() {
+        return tag + owner.hashCode() * name.hashCode() * desc.hashCode();
+    }
+
+    /**
+     * Returns the textual representation of this handle. The textual
+     * representation is: <pre>owner '.' name desc ' ' '(' tag ')'</pre>. As
+     * this format is unambiguous, it can be parsed if necessary.
+     */
+    @Override
+    public String toString() {
+        return owner + '.' + name + desc + " (" + tag + ')';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Handler.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,147 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * Information about an exception handler block.
+ *
+ * @author Eric Bruneton
+ */
+class Handler {
+
+    /**
+     * Beginning of the exception handler's scope (inclusive).
+     */
+    Label start;
+
+    /**
+     * End of the exception handler's scope (exclusive).
+     */
+    Label end;
+
+    /**
+     * Beginning of the exception handler's code.
+     */
+    Label handler;
+
+    /**
+     * Internal name of the type of exceptions handled by this handler, or
+     * <tt>null</tt> to catch any exceptions.
+     */
+    String desc;
+
+    /**
+     * Constant pool index of the internal name of the type of exceptions
+     * handled by this handler, or 0 to catch any exceptions.
+     */
+    int type;
+
+    /**
+     * Next exception handler block info.
+     */
+    Handler next;
+
+    /**
+     * Removes the range between start and end from the given exception
+     * handlers.
+     *
+     * @param h an exception handler list.
+     * @param start the start of the range to be removed.
+     * @param end the end of the range to be removed. Maybe null.
+     * @return the exception handler list with the start-end range removed.
+     */
+    static Handler remove(Handler h, Label start, Label end) {
+        if (h == null) {
+            return null;
+        } else {
+            h.next = remove(h.next, start, end);
+        }
+        int hstart = h.start.position;
+        int hend = h.end.position;
+        int s = start.position;
+        int e = end == null ? Integer.MAX_VALUE : end.position;
+        // if [hstart,hend[ and [s,e[ intervals intersect...
+        if (s < hend && e > hstart) {
+            if (s <= hstart) {
+                if (e >= hend) {
+                    // [hstart,hend[ fully included in [s,e[, h removed
+                    h = h.next;
+                } else {
+                    // [hstart,hend[ minus [s,e[ = [e,hend[
+                    h.start = end;
+                }
+            } else if (e >= hend) {
+                // [hstart,hend[ minus [s,e[ = [hstart,s[
+                h.end = start;
+            } else {
+                // [hstart,hend[ minus [s,e[ = [hstart,s[ + [e,hend[
+                Handler g = new Handler();
+                g.start = end;
+                g.end = h.end;
+                g.handler = h.handler;
+                g.desc = h.desc;
+                g.type = h.type;
+                g.next = h.next;
+                h.end = start;
+                h.next = g;
+            }
+        }
+        return h;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Item.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,326 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A constant pool item. Constant pool items can be created with the 'newXXX'
+ * methods in the {@link ClassWriter} class.
+ *
+ * @author Eric Bruneton
+ */
+final class Item {
+
+    /**
+     * Index of this item in the constant pool.
+     */
+    int index;
+
+    /**
+     * Type of this constant pool item. A single class is used to represent all
+     * constant pool item types, in order to minimize the bytecode size of this
+     * package. The value of this field is one of {@link ClassWriter#INT},
+     * {@link ClassWriter#LONG}, {@link ClassWriter#FLOAT},
+     * {@link ClassWriter#DOUBLE}, {@link ClassWriter#UTF8},
+     * {@link ClassWriter#STR}, {@link ClassWriter#CLASS},
+     * {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD},
+     * {@link ClassWriter#METH}, {@link ClassWriter#IMETH},
+     * {@link ClassWriter#MTYPE}, {@link ClassWriter#INDY}.
+     *
+     * MethodHandle constant 9 variations are stored using a range
+     * of 9 values from {@link ClassWriter#HANDLE_BASE} + 1 to
+     * {@link ClassWriter#HANDLE_BASE} + 9.
+     *
+     * Special Item types are used for Items that are stored in the ClassWriter
+     * {@link ClassWriter#typeTable}, instead of the constant pool, in order to
+     * avoid clashes with normal constant pool items in the ClassWriter constant
+     * pool's hash table. These special item types are
+     * {@link ClassWriter#TYPE_NORMAL}, {@link ClassWriter#TYPE_UNINIT} and
+     * {@link ClassWriter#TYPE_MERGED}.
+     */
+    int type;
+
+    /**
+     * Value of this item, for an integer item.
+     */
+    int intVal;
+
+    /**
+     * Value of this item, for a long item.
+     */
+    long longVal;
+
+    /**
+     * First part of the value of this item, for items that do not hold a
+     * primitive value.
+     */
+    String strVal1;
+
+    /**
+     * Second part of the value of this item, for items that do not hold a
+     * primitive value.
+     */
+    String strVal2;
+
+    /**
+     * Third part of the value of this item, for items that do not hold a
+     * primitive value.
+     */
+    String strVal3;
+
+    /**
+     * The hash code value of this constant pool item.
+     */
+    int hashCode;
+
+    /**
+     * Link to another constant pool item, used for collision lists in the
+     * constant pool's hash table.
+     */
+    Item next;
+
+    /**
+     * Constructs an uninitialized {@link Item}.
+     */
+    Item() {
+    }
+
+    /**
+     * Constructs an uninitialized {@link Item} for constant pool element at
+     * given position.
+     *
+     * @param index index of the item to be constructed.
+     */
+    Item(final int index) {
+        this.index = index;
+    }
+
+    /**
+     * Constructs a copy of the given item.
+     *
+     * @param index index of the item to be constructed.
+     * @param i the item that must be copied into the item to be constructed.
+     */
+    Item(final int index, final Item i) {
+        this.index = index;
+        type = i.type;
+        intVal = i.intVal;
+        longVal = i.longVal;
+        strVal1 = i.strVal1;
+        strVal2 = i.strVal2;
+        strVal3 = i.strVal3;
+        hashCode = i.hashCode;
+    }
+
+    /**
+     * Sets this item to an integer item.
+     *
+     * @param intVal the value of this item.
+     */
+    void set(final int intVal) {
+        this.type = ClassWriter.INT;
+        this.intVal = intVal;
+        this.hashCode = 0x7FFFFFFF & (type + intVal);
+    }
+
+    /**
+     * Sets this item to a long item.
+     *
+     * @param longVal the value of this item.
+     */
+    void set(final long longVal) {
+        this.type = ClassWriter.LONG;
+        this.longVal = longVal;
+        this.hashCode = 0x7FFFFFFF & (type + (int) longVal);
+    }
+
+    /**
+     * Sets this item to a float item.
+     *
+     * @param floatVal the value of this item.
+     */
+    void set(final float floatVal) {
+        this.type = ClassWriter.FLOAT;
+        this.intVal = Float.floatToRawIntBits(floatVal);
+        this.hashCode = 0x7FFFFFFF & (type + (int) floatVal);
+    }
+
+    /**
+     * Sets this item to a double item.
+     *
+     * @param doubleVal the value of this item.
+     */
+    void set(final double doubleVal) {
+        this.type = ClassWriter.DOUBLE;
+        this.longVal = Double.doubleToRawLongBits(doubleVal);
+        this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal);
+    }
+
+    /**
+     * Sets this item to an item that do not hold a primitive value.
+     *
+     * @param type the type of this item.
+     * @param strVal1 first part of the value of this item.
+     * @param strVal2 second part of the value of this item.
+     * @param strVal3 third part of the value of this item.
+     */
+    void set(
+        final int type,
+        final String strVal1,
+        final String strVal2,
+        final String strVal3)
+    {
+        this.type = type;
+        this.strVal1 = strVal1;
+        this.strVal2 = strVal2;
+        this.strVal3 = strVal3;
+        switch (type) {
+            case ClassWriter.UTF8:
+            case ClassWriter.STR:
+            case ClassWriter.CLASS:
+            case ClassWriter.MTYPE:
+            case ClassWriter.TYPE_NORMAL:
+                hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
+                return;
+            case ClassWriter.NAME_TYPE:
+                hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+                        * strVal2.hashCode());
+                return;
+                // ClassWriter.FIELD:
+                // ClassWriter.METH:
+                // ClassWriter.IMETH:
+                // ClassWriter.HANDLE_BASE + 1..9
+            default:
+                hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+                        * strVal2.hashCode() * strVal3.hashCode());
+        }
+    }
+
+    /**
+     * Sets the item to an InvokeDynamic item.
+     *
+     * @param name invokedynamic's name.
+     * @param desc invokedynamic's desc.
+     * @param bsmIndex zero based index into the class attribute BootrapMethods.
+     */
+    void set(String name, String desc, int bsmIndex) {
+        this.type = ClassWriter.INDY;
+        this.longVal = bsmIndex;
+        this.strVal1 = name;
+        this.strVal2 = desc;
+        this.hashCode = 0x7FFFFFFF & (ClassWriter.INDY + bsmIndex
+                * strVal1.hashCode() * strVal2.hashCode());
+    }
+
+    /**
+     * Sets the item to a BootstrapMethod item.
+     *
+     * @param position position in byte in the class attribute BootrapMethods.
+     * @param hashCode hashcode of the item. This hashcode is processed from
+     *        the hashcode of the bootstrap method and the hashcode of
+     *        all bootstrap arguments.
+     */
+    void set(int position, int hashCode) {
+        this.type = ClassWriter.BSM;
+        this.intVal = position;
+        this.hashCode = hashCode;
+    }
+
+    /**
+     * Indicates if the given item is equal to this one. <i>This method assumes
+     * that the two items have the same {@link #type}</i>.
+     *
+     * @param i the item to be compared to this one. Both items must have the
+     *       same {@link #type}.
+     * @return <tt>true</tt> if the given item if equal to this one,
+     *         <tt>false</tt> otherwise.
+     */
+    boolean isEqualTo(final Item i) {
+        switch (type) {
+            case ClassWriter.UTF8:
+            case ClassWriter.STR:
+            case ClassWriter.CLASS:
+            case ClassWriter.MTYPE:
+            case ClassWriter.TYPE_NORMAL:
+                return i.strVal1.equals(strVal1);
+            case ClassWriter.TYPE_MERGED:
+            case ClassWriter.LONG:
+            case ClassWriter.DOUBLE:
+                return i.longVal == longVal;
+            case ClassWriter.INT:
+            case ClassWriter.FLOAT:
+                return i.intVal == intVal;
+            case ClassWriter.TYPE_UNINIT:
+                return i.intVal == intVal && i.strVal1.equals(strVal1);
+            case ClassWriter.NAME_TYPE:
+                return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2);
+            case ClassWriter.INDY:
+                return i.longVal == longVal && i.strVal1.equals(strVal1)
+                        && i.strVal2.equals(strVal2);
+
+            // case ClassWriter.FIELD:
+            // case ClassWriter.METH:
+            // case ClassWriter.IMETH:
+            // case ClassWriter.HANDLE_BASE + 1..9
+            default:
+                return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2)
+                        && i.strVal3.equals(strVal3);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Label.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,584 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A label represents a position in the bytecode of a method. Labels are used
+ * for jump, goto, and switch instructions, and for try catch blocks. A label
+ * designates the <i>instruction</i> that is just after. Note however that
+ * there can be other elements between a label and the instruction it
+ * designates (such as other labels, stack map frames, line numbers, etc.).
+ *
+ * @author Eric Bruneton
+ */
+public class Label {
+
+    /**
+     * Indicates if this label is only used for debug attributes. Such a label
+     * is not the start of a basic block, the target of a jump instruction, or
+     * an exception handler. It can be safely ignored in control flow graph
+     * analysis algorithms (for optimization purposes).
+     */
+    static final int DEBUG = 1;
+
+    /**
+     * Indicates if the position of this label is known.
+     */
+    static final int RESOLVED = 2;
+
+    /**
+     * Indicates if this label has been updated, after instruction resizing.
+     */
+    static final int RESIZED = 4;
+
+    /**
+     * Indicates if this basic block has been pushed in the basic block stack.
+     * See {@link MethodWriter#visitMaxs visitMaxs}.
+     */
+    static final int PUSHED = 8;
+
+    /**
+     * Indicates if this label is the target of a jump instruction, or the start
+     * of an exception handler.
+     */
+    static final int TARGET = 16;
+
+    /**
+     * Indicates if a stack map frame must be stored for this label.
+     */
+    static final int STORE = 32;
+
+    /**
+     * Indicates if this label corresponds to a reachable basic block.
+     */
+    static final int REACHABLE = 64;
+
+    /**
+     * Indicates if this basic block ends with a JSR instruction.
+     */
+    static final int JSR = 128;
+
+    /**
+     * Indicates if this basic block ends with a RET instruction.
+     */
+    static final int RET = 256;
+
+    /**
+     * Indicates if this basic block is the start of a subroutine.
+     */
+    static final int SUBROUTINE = 512;
+
+    /**
+     * Indicates if this subroutine basic block has been visited by a
+     * visitSubroutine(null, ...) call.
+     */
+    static final int VISITED = 1024;
+
+    /**
+     * Indicates if this subroutine basic block has been visited by a
+     * visitSubroutine(!null, ...) call.
+     */
+    static final int VISITED2 = 2048;
+
+    /**
+     * Field used to associate user information to a label. Warning: this field
+     * is used by the ASM tree package. In order to use it with the ASM tree
+     * package you must override the {@link
+     * jdk.internal.org.objectweb.asm.tree.MethodNode#getLabelNode} method.
+     */
+    public Object info;
+
+    /**
+     * Flags that indicate the status of this label.
+     *
+     * @see #DEBUG
+     * @see #RESOLVED
+     * @see #RESIZED
+     * @see #PUSHED
+     * @see #TARGET
+     * @see #STORE
+     * @see #REACHABLE
+     * @see #JSR
+     * @see #RET
+     */
+    int status;
+
+    /**
+     * The line number corresponding to this label, if known.
+     */
+    int line;
+
+    /**
+     * The position of this label in the code, if known.
+     */
+    int position;
+
+    /**
+     * Number of forward references to this label, times two.
+     */
+    private int referenceCount;
+
+    /**
+     * Informations about forward references. Each forward reference is
+     * described by two consecutive integers in this array: the first one is the
+     * position of the first byte of the bytecode instruction that contains the
+     * forward reference, while the second is the position of the first byte of
+     * the forward reference itself. In fact the sign of the first integer
+     * indicates if this reference uses 2 or 4 bytes, and its absolute value
+     * gives the position of the bytecode instruction. This array is also used
+     * as a bitset to store the subroutines to which a basic block belongs. This
+     * information is needed in {@linked  MethodWriter#visitMaxs}, after all
+     * forward references have been resolved. Hence the same array can be used
+     * for both purposes without problems.
+     */
+    private int[] srcAndRefPositions;
+
+    // ------------------------------------------------------------------------
+
+    /*
+     * Fields for the control flow and data flow graph analysis algorithms (used
+     * to compute the maximum stack size or the stack map frames). A control
+     * flow graph contains one node per "basic block", and one edge per "jump"
+     * from one basic block to another. Each node (i.e., each basic block) is
+     * represented by the Label object that corresponds to the first instruction
+     * of this basic block. Each node also stores the list of its successors in
+     * the graph, as a linked list of Edge objects.
+     *
+     * The control flow analysis algorithms used to compute the maximum stack
+     * size or the stack map frames are similar and use two steps. The first
+     * step, during the visit of each instruction, builds information about the
+     * state of the local variables and the operand stack at the end of each
+     * basic block, called the "output frame", <i>relatively</i> to the frame
+     * state at the beginning of the basic block, which is called the "input
+     * frame", and which is <i>unknown</i> during this step. The second step,
+     * in {@link MethodWriter#visitMaxs}, is a fix point algorithm that
+     * computes information about the input frame of each basic block, from the
+     * input state of the first basic block (known from the method signature),
+     * and by the using the previously computed relative output frames.
+     *
+     * The algorithm used to compute the maximum stack size only computes the
+     * relative output and absolute input stack heights, while the algorithm
+     * used to compute stack map frames computes relative output frames and
+     * absolute input frames.
+     */
+
+    /**
+     * Start of the output stack relatively to the input stack. The exact
+     * semantics of this field depends on the algorithm that is used.
+     *
+     * When only the maximum stack size is computed, this field is the number of
+     * elements in the input stack.
+     *
+     * When the stack map frames are completely computed, this field is the
+     * offset of the first output stack element relatively to the top of the
+     * input stack. This offset is always negative or null. A null offset means
+     * that the output stack must be appended to the input stack. A -n offset
+     * means that the first n output stack elements must replace the top n input
+     * stack elements, and that the other elements must be appended to the input
+     * stack.
+     */
+    int inputStackTop;
+
+    /**
+     * Maximum height reached by the output stack, relatively to the top of the
+     * input stack. This maximum is always positive or null.
+     */
+    int outputStackMax;
+
+    /**
+     * Information about the input and output stack map frames of this basic
+     * block. This field is only used when {@link ClassWriter#COMPUTE_FRAMES}
+     * option is used.
+     */
+    Frame frame;
+
+    /**
+     * The successor of this label, in the order they are visited. This linked
+     * list does not include labels used for debug info only. If
+     * {@link ClassWriter#COMPUTE_FRAMES} option is used then, in addition, it
+     * does not contain successive labels that denote the same bytecode position
+     * (in this case only the first label appears in this list).
+     */
+    Label successor;
+
+    /**
+     * The successors of this node in the control flow graph. These successors
+     * are stored in a linked list of {@link Edge Edge} objects, linked to each
+     * other by their {@link Edge#next} field.
+     */
+    Edge successors;
+
+    /**
+     * The next basic block in the basic block stack. This stack is used in the
+     * main loop of the fix point algorithm used in the second step of the
+     * control flow analysis algorithms. It is also used in
+     * {@link #visitSubroutine} to avoid using a recursive method.
+     *
+     * @see MethodWriter#visitMaxs
+     */
+    Label next;
+
+    // ------------------------------------------------------------------------
+    // Constructor
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a new label.
+     */
+    public Label() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Methods to compute offsets and to manage forward references
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the offset corresponding to this label. This offset is computed
+     * from the start of the method's bytecode. <i>This method is intended for
+     * {@link Attribute} sub classes, and is normally not needed by class
+     * generators or adapters.</i>
+     *
+     * @return the offset corresponding to this label.
+     * @throws IllegalStateException if this label is not resolved yet.
+     */
+    public int getOffset() {
+        if ((status & RESOLVED) == 0) {
+            throw new IllegalStateException("Label offset position has not been resolved yet");
+        }
+        return position;
+    }
+
+    /**
+     * Puts a reference to this label in the bytecode of a method. If the
+     * position of the label is known, the offset is computed and written
+     * directly. Otherwise, a null offset is written and a new forward reference
+     * is declared for this label.
+     *
+     * @param owner the code writer that calls this method.
+     * @param out the bytecode of the method.
+     * @param source the position of first byte of the bytecode instruction that
+     *        contains this label.
+     * @param wideOffset <tt>true</tt> if the reference must be stored in 4
+     *        bytes, or <tt>false</tt> if it must be stored with 2 bytes.
+     * @throws IllegalArgumentException if this label has not been created by
+     *         the given code writer.
+     */
+    void put(
+        final MethodWriter owner,
+        final ByteVector out,
+        final int source,
+        final boolean wideOffset)
+    {
+        if ((status & RESOLVED) == 0) {
+            if (wideOffset) {
+                addReference(-1 - source, out.length);
+                out.putInt(-1);
+            } else {
+                addReference(source, out.length);
+                out.putShort(-1);
+            }
+        } else {
+            if (wideOffset) {
+                out.putInt(position - source);
+            } else {
+                out.putShort(position - source);
+            }
+        }
+    }
+
+    /**
+     * Adds a forward reference to this label. This method must be called only
+     * for a true forward reference, i.e. only if this label is not resolved
+     * yet. For backward references, the offset of the reference can be, and
+     * must be, computed and stored directly.
+     *
+     * @param sourcePosition the position of the referencing instruction. This
+     *        position will be used to compute the offset of this forward
+     *        reference.
+     * @param referencePosition the position where the offset for this forward
+     *        reference must be stored.
+     */
+    private void addReference(
+        final int sourcePosition,
+        final int referencePosition)
+    {
+        if (srcAndRefPositions == null) {
+            srcAndRefPositions = new int[6];
+        }
+        if (referenceCount >= srcAndRefPositions.length) {
+            int[] a = new int[srcAndRefPositions.length + 6];
+            System.arraycopy(srcAndRefPositions,
+                    0,
+                    a,
+                    0,
+                    srcAndRefPositions.length);
+            srcAndRefPositions = a;
+        }
+        srcAndRefPositions[referenceCount++] = sourcePosition;
+        srcAndRefPositions[referenceCount++] = referencePosition;
+    }
+
+    /**
+     * Resolves all forward references to this label. This method must be called
+     * when this label is added to the bytecode of the method, i.e. when its
+     * position becomes known. This method fills in the blanks that where left
+     * in the bytecode by each forward reference previously added to this label.
+     *
+     * @param owner the code writer that calls this method.
+     * @param position the position of this label in the bytecode.
+     * @param data the bytecode of the method.
+     * @return <tt>true</tt> if a blank that was left for this label was to
+     *         small to store the offset. In such a case the corresponding jump
+     *         instruction is replaced with a pseudo instruction (using unused
+     *         opcodes) using an unsigned two bytes offset. These pseudo
+     *         instructions will need to be replaced with true instructions with
+     *         wider offsets (4 bytes instead of 2). This is done in
+     *         {@link MethodWriter#resizeInstructions}.
+     * @throws IllegalArgumentException if this label has already been resolved,
+     *         or if it has not been created by the given code writer.
+     */
+    boolean resolve(
+        final MethodWriter owner,
+        final int position,
+        final byte[] data)
+    {
+        boolean needUpdate = false;
+        this.status |= RESOLVED;
+        this.position = position;
+        int i = 0;
+        while (i < referenceCount) {
+            int source = srcAndRefPositions[i++];
+            int reference = srcAndRefPositions[i++];
+            int offset;
+            if (source >= 0) {
+                offset = position - source;
+                if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) {
+                    /*
+                     * changes the opcode of the jump instruction, in order to
+                     * be able to find it later (see resizeInstructions in
+                     * MethodWriter). These temporary opcodes are similar to
+                     * jump instruction opcodes, except that the 2 bytes offset
+                     * is unsigned (and can therefore represent values from 0 to
+                     * 65535, which is sufficient since the size of a method is
+                     * limited to 65535 bytes).
+                     */
+                    int opcode = data[reference - 1] & 0xFF;
+                    if (opcode <= Opcodes.JSR) {
+                        // changes IFEQ ... JSR to opcodes 202 to 217
+                        data[reference - 1] = (byte) (opcode + 49);
+                    } else {
+                        // changes IFNULL and IFNONNULL to opcodes 218 and 219
+                        data[reference - 1] = (byte) (opcode + 20);
+                    }
+                    needUpdate = true;
+                }
+                data[reference++] = (byte) (offset >>> 8);
+                data[reference] = (byte) offset;
+            } else {
+                offset = position + source + 1;
+                data[reference++] = (byte) (offset >>> 24);
+                data[reference++] = (byte) (offset >>> 16);
+                data[reference++] = (byte) (offset >>> 8);
+                data[reference] = (byte) offset;
+            }
+        }
+        return needUpdate;
+    }
+
+    /**
+     * Returns the first label of the series to which this label belongs. For an
+     * isolated label or for the first label in a series of successive labels,
+     * this method returns the label itself. For other labels it returns the
+     * first label of the series.
+     *
+     * @return the first label of the series to which this label belongs.
+     */
+    Label getFirst() {
+        return !ClassReader.FRAMES || frame == null ? this : frame.owner;
+    }
+
+    // ------------------------------------------------------------------------
+    // Methods related to subroutines
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns true is this basic block belongs to the given subroutine.
+     *
+     * @param id a subroutine id.
+     * @return true is this basic block belongs to the given subroutine.
+     */
+    boolean inSubroutine(final long id) {
+        if ((status & Label.VISITED) != 0) {
+            return (srcAndRefPositions[(int) (id >>> 32)] & (int) id) != 0;
+        }
+        return false;
+    }
+
+    /**
+     * Returns true if this basic block and the given one belong to a common
+     * subroutine.
+     *
+     * @param block another basic block.
+     * @return true if this basic block and the given one belong to a common
+     *         subroutine.
+     */
+    boolean inSameSubroutine(final Label block) {
+        if ((status & VISITED) == 0 || (block.status & VISITED) == 0) {
+            return false;
+        }
+        for (int i = 0; i < srcAndRefPositions.length; ++i) {
+            if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Marks this basic block as belonging to the given subroutine.
+     *
+     * @param id a subroutine id.
+     * @param nbSubroutines the total number of subroutines in the method.
+     */
+    void addToSubroutine(final long id, final int nbSubroutines) {
+        if ((status & VISITED) == 0) {
+            status |= VISITED;
+            srcAndRefPositions = new int[(nbSubroutines - 1) / 32 + 1];
+        }
+        srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
+    }
+
+    /**
+     * Finds the basic blocks that belong to a given subroutine, and marks these
+     * blocks as belonging to this subroutine. This method follows the control
+     * flow graph to find all the blocks that are reachable from the current
+     * block WITHOUT following any JSR target.
+     *
+     * @param JSR a JSR block that jumps to this subroutine. If this JSR is not
+     *        null it is added to the successor of the RET blocks found in the
+     *        subroutine.
+     * @param id the id of this subroutine.
+     * @param nbSubroutines the total number of subroutines in the method.
+     */
+    void visitSubroutine(final Label JSR, final long id, final int nbSubroutines)
+    {
+        // user managed stack of labels, to avoid using a recursive method
+        // (recursivity can lead to stack overflow with very large methods)
+        Label stack = this;
+        while (stack != null) {
+            // removes a label l from the stack
+            Label l = stack;
+            stack = l.next;
+            l.next = null;
+
+            if (JSR != null) {
+                if ((l.status & VISITED2) != 0) {
+                    continue;
+                }
+                l.status |= VISITED2;
+                // adds JSR to the successors of l, if it is a RET block
+                if ((l.status & RET) != 0) {
+                    if (!l.inSameSubroutine(JSR)) {
+                        Edge e = new Edge();
+                        e.info = l.inputStackTop;
+                        e.successor = JSR.successors.successor;
+                        e.next = l.successors;
+                        l.successors = e;
+                    }
+                }
+            } else {
+                // if the l block already belongs to subroutine 'id', continue
+                if (l.inSubroutine(id)) {
+                    continue;
+                }
+                // marks the l block as belonging to subroutine 'id'
+                l.addToSubroutine(id, nbSubroutines);
+            }
+            // pushes each successor of l on the stack, except JSR targets
+            Edge e = l.successors;
+            while (e != null) {
+                // if the l block is a JSR block, then 'l.successors.next' leads
+                // to the JSR target (see {@link #visitJumpInsn}) and must
+                // therefore not be followed
+                if ((l.status & Label.JSR) == 0 || e != l.successors.next) {
+                    // pushes e.successor on the stack if it not already added
+                    if (e.successor.next == null) {
+                        e.successor.next = stack;
+                        stack = e.successor;
+                    }
+                }
+                e = e.next;
+            }
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Overriden Object methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns a string representation of this label.
+     *
+     * @return a string representation of this label.
+     */
+    @Override
+    public String toString() {
+        return "L" + System.identityHashCode(this);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/MethodVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,617 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java method. The methods of this class must be
+ * called in the following order: [ <tt>visitAnnotationDefault</tt> ] (
+ * <tt>visitAnnotation</tt> | <tt>visitParameterAnnotation</tt> |
+ * <tt>visitAttribute</tt> )* [ <tt>visitCode</tt> ( <tt>visitFrame</tt> |
+ * <tt>visit</tt><i>X</i>Insn</tt> | <tt>visitLabel</tt> | <tt>visitTryCatchBlock</tt> |
+ * <tt>visitLocalVariable</tt> | <tt>visitLineNumber</tt> )* <tt>visitMaxs</tt> ]
+ * <tt>visitEnd</tt>. In addition, the <tt>visit</tt><i>X</i>Insn</tt>
+ * and <tt>visitLabel</tt> methods must be called in the sequential order of
+ * the bytecode instructions of the visited code, <tt>visitTryCatchBlock</tt>
+ * must be called <i>before</i> the labels passed as arguments have been
+ * visited, and the <tt>visitLocalVariable</tt> and <tt>visitLineNumber</tt>
+ * methods must be called <i>after</i> the labels passed as arguments have been
+ * visited.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class MethodVisitor {
+
+    /**
+     * The ASM API version implemented by this visitor. The value of this field
+     * must be one of {@link Opcodes#ASM4}.
+     */
+    protected final int api;
+
+    /**
+     * The method visitor to which this visitor must delegate method calls. May
+     * be null.
+     */
+    protected MethodVisitor mv;
+
+    /**
+     * Constructs a new {@link MethodVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public MethodVisitor(final int api) {
+        this(api, null);
+    }
+
+    /**
+     * Constructs a new {@link MethodVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param mv the method visitor to which this visitor must delegate method
+     *        calls. May be null.
+     */
+    public MethodVisitor(final int api, final MethodVisitor mv) {
+        /*if (api != Opcodes.ASM4) {
+            throw new IllegalArgumentException();
+        }*/
+        this.api = api;
+        this.mv = mv;
+    }
+
+    // -------------------------------------------------------------------------
+    // Annotations and non standard attributes
+    // -------------------------------------------------------------------------
+
+    /**
+     * Visits the default value of this annotation interface method.
+     *
+     * @return a visitor to the visit the actual default value of this
+     *         annotation interface method, or <tt>null</tt> if this visitor
+     *         is not interested in visiting this default value. The 'name'
+     *         parameters passed to the methods of this annotation visitor are
+     *         ignored. Moreover, exacly one visit method must be called on this
+     *         annotation visitor, followed by visitEnd.
+     */
+    public AnnotationVisitor visitAnnotationDefault() {
+        if (mv != null) {
+            return mv.visitAnnotationDefault();
+        }
+        return null;
+    }
+
+    /**
+     * Visits an annotation of this method.
+     *
+     * @param desc the class descriptor of the annotation class.
+     * @param visible <tt>true</tt> if the annotation is visible at runtime.
+     * @return a visitor to visit the annotation values, or <tt>null</tt> if
+     *         this visitor is not interested in visiting this annotation.
+     */
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        if (mv != null) {
+            return mv.visitAnnotation(desc, visible);
+        }
+        return null;
+    }
+
+    /**
+     * Visits an annotation of a parameter this method.
+     *
+     * @param parameter the parameter index.
+     * @param desc the class descriptor of the annotation class.
+     * @param visible <tt>true</tt> if the annotation is visible at runtime.
+     * @return a visitor to visit the annotation values, or <tt>null</tt> if
+     *         this visitor is not interested in visiting this annotation.
+     */
+    public AnnotationVisitor visitParameterAnnotation(
+        int parameter,
+        String desc,
+        boolean visible)
+    {
+        if (mv != null) {
+            return mv.visitParameterAnnotation(parameter, desc, visible);
+        }
+        return null;
+    }
+
+    /**
+     * Visits a non standard attribute of this method.
+     *
+     * @param attr an attribute.
+     */
+    public void visitAttribute(Attribute attr) {
+        if (mv != null) {
+            mv.visitAttribute(attr);
+        }
+    }
+
+    /**
+     * Starts the visit of the method's code, if any (i.e. non abstract method).
+     */
+    public void visitCode() {
+        if (mv != null) {
+            mv.visitCode();
+        }
+    }
+
+    /**
+     * Visits the current state of the local variables and operand stack
+     * elements. This method must(*) be called <i>just before</i> any
+     * instruction <b>i</b> that follows an unconditional branch instruction
+     * such as GOTO or THROW, that is the target of a jump instruction, or that
+     * starts an exception handler block. The visited types must describe the
+     * values of the local variables and of the operand stack elements <i>just
+     * before</i> <b>i</b> is executed. <br> <br> (*) this is mandatory only
+     * for classes whose version is greater than or equal to
+     * {@link Opcodes#V1_6 V1_6}. <br> <br> Packed frames are basically
+     * "deltas" from the state of the previous frame (very first frame is
+     * implicitly defined by the method's parameters and access flags): <ul>
+     * <li>{@link Opcodes#F_SAME} representing frame with exactly the same
+     * locals as the previous frame and with the empty stack.</li> <li>{@link Opcodes#F_SAME1}
+     * representing frame with exactly the same locals as the previous frame and
+     * with single value on the stack (<code>nStack</code> is 1 and
+     * <code>stack[0]</code> contains value for the type of the stack item).</li>
+     * <li>{@link Opcodes#F_APPEND} representing frame with current locals are
+     * the same as the locals in the previous frame, except that additional
+     * locals are defined (<code>nLocal</code> is 1, 2 or 3 and
+     * <code>local</code> elements contains values representing added types).</li>
+     * <li>{@link Opcodes#F_CHOP} representing frame with current locals are
+     * the same as the locals in the previous frame, except that the last 1-3
+     * locals are absent and with the empty stack (<code>nLocals</code> is 1,
+     * 2 or 3). </li> <li>{@link Opcodes#F_FULL} representing complete frame
+     * data.</li> </li> </ul>
+     *
+     * @param type the type of this stack map frame. Must be
+     *        {@link Opcodes#F_NEW} for expanded frames, or
+     *        {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
+     *        {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
+     *        {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for compressed
+     *        frames.
+     * @param nLocal the number of local variables in the visited frame.
+     * @param local the local variable types in this frame. This array must not
+     *        be modified. Primitive types are represented by
+     *        {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
+     *        {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
+     *        {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
+     *        {@link Opcodes#UNINITIALIZED_THIS} (long and double are
+     *        represented by a single element). Reference types are represented
+     *        by String objects (representing internal names), and uninitialized
+     *        types by Label objects (this label designates the NEW instruction
+     *        that created this uninitialized value).
+     * @param nStack the number of operand stack elements in the visited frame.
+     * @param stack the operand stack types in this frame. This array must not
+     *        be modified. Its content has the same format as the "local" array.
+     * @throws IllegalStateException if a frame is visited just after another
+     *        one, without any instruction between the two (unless this frame
+     *        is a Opcodes#F_SAME frame, in which case it is silently ignored).
+     */
+    public void visitFrame(
+        int type,
+        int nLocal,
+        Object[] local,
+        int nStack,
+        Object[] stack)
+    {
+        if (mv != null) {
+            mv.visitFrame(type, nLocal, local, nStack, stack);
+        }
+    }
+
+    // -------------------------------------------------------------------------
+    // Normal instructions
+    // -------------------------------------------------------------------------
+
+    /**
+     * Visits a zero operand instruction.
+     *
+     * @param opcode the opcode of the instruction to be visited. This opcode is
+     *        either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2,
+     *        ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0,
+     *        FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD,
+     *        DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE,
+     *        DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP,
+     *        DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD,
+     *        DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV,
+     *        FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL,
+     *        LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR,
+     *        I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B,
+     *        I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
+     *        FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
+     *        MONITORENTER, or MONITOREXIT.
+     */
+    public void visitInsn(int opcode) {
+        if (mv != null) {
+            mv.visitInsn(opcode);
+        }
+    }
+
+    /**
+     * Visits an instruction with a single int operand.
+     *
+     * @param opcode the opcode of the instruction to be visited. This opcode is
+     *        either BIPUSH, SIPUSH or NEWARRAY.
+     * @param operand the operand of the instruction to be visited.<br> When
+     *        opcode is BIPUSH, operand value should be between Byte.MIN_VALUE
+     *        and Byte.MAX_VALUE.<br> When opcode is SIPUSH, operand value
+     *        should be between Short.MIN_VALUE and Short.MAX_VALUE.<br> When
+     *        opcode is NEWARRAY, operand value should be one of
+     *        {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR},
+     *        {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE},
+     *        {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT},
+     *        {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
+     */
+    public void visitIntInsn(int opcode, int operand) {
+        if (mv != null) {
+            mv.visitIntInsn(opcode, operand);
+        }
+    }
+
+    /**
+     * Visits a local variable instruction. A local variable instruction is an
+     * instruction that loads or stores the value of a local variable.
+     *
+     * @param opcode the opcode of the local variable instruction to be visited.
+     *        This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE,
+     *        LSTORE, FSTORE, DSTORE, ASTORE or RET.
+     * @param var the operand of the instruction to be visited. This operand is
+     *        the index of a local variable.
+     */
+    public void visitVarInsn(int opcode, int var) {
+        if (mv != null) {
+            mv.visitVarInsn(opcode, var);
+        }
+    }
+
+    /**
+     * Visits a type instruction. A type instruction is an instruction that
+     * takes the internal name of a class as parameter.
+     *
+     * @param opcode the opcode of the type instruction to be visited. This
+     *        opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
+     * @param type the operand of the instruction to be visited. This operand
+     *        must be the internal name of an object or array class (see {@link
+     *        Type#getInternalName() getInternalName}).
+     */
+    public void visitTypeInsn(int opcode, String type) {
+        if (mv != null) {
+            mv.visitTypeInsn(opcode, type);
+        }
+    }
+
+    /**
+     * Visits a field instruction. A field instruction is an instruction that
+     * loads or stores the value of a field of an object.
+     *
+     * @param opcode the opcode of the type instruction to be visited. This
+     *        opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+     * @param owner the internal name of the field's owner class (see {@link
+     *        Type#getInternalName() getInternalName}).
+     * @param name the field's name.
+     * @param desc the field's descriptor (see {@link Type Type}).
+     */
+    public void visitFieldInsn(int opcode, String owner, String name, String desc) {
+        if (mv != null) {
+            mv.visitFieldInsn(opcode, owner, name, desc);
+        }
+    }
+
+    /**
+     * Visits a method instruction. A method instruction is an instruction that
+     * invokes a method.
+     *
+     * @param opcode the opcode of the type instruction to be visited. This
+     *        opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC
+     *        or INVOKEINTERFACE.
+     * @param owner the internal name of the method's owner class (see {@link
+     *        Type#getInternalName() getInternalName}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     */
+    public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+        if (mv != null) {
+            mv.visitMethodInsn(opcode, owner, name, desc);
+        }
+    }
+
+    /**
+     * Visits an invokedynamic instruction.
+     *
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param bsm the bootstrap method.
+     * @param bsmArgs the bootstrap method constant arguments. Each argument
+     *        must be an {@link Integer}, {@link Float}, {@link Long},
+     *        {@link Double}, {@link String}, {@link Type} or {@link Handle}
+     *        value. This method is allowed to modify the content of the array
+     *        so a caller should expect that this array may change.
+     */
+    public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
+        if (mv != null) {
+            mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+        }
+    }
+
+    /**
+     * Visits a jump instruction. A jump instruction is an instruction that may
+     * jump to another instruction.
+     *
+     * @param opcode the opcode of the type instruction to be visited. This
+     *        opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
+     *        IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
+     *        IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
+     * @param label the operand of the instruction to be visited. This operand
+     *        is a label that designates the instruction to which the jump
+     *        instruction may jump.
+     */
+    public void visitJumpInsn(int opcode, Label label) {
+        if (mv != null) {
+            mv.visitJumpInsn(opcode, label);
+        }
+    }
+
+    /**
+     * Visits a label. A label designates the instruction that will be visited
+     * just after it.
+     *
+     * @param label a {@link Label Label} object.
+     */
+    public void visitLabel(Label label) {
+        if (mv != null) {
+            mv.visitLabel(label);
+        }
+    }
+
+    // -------------------------------------------------------------------------
+    // Special instructions
+    // -------------------------------------------------------------------------
+
+    /**
+     * Visits a LDC instruction. Note that new constant types may be added in
+     * future versions of the Java Virtual Machine. To easily detect new
+     * constant types, implementations of this method should check for
+     * unexpected constant types, like this:
+     * <pre>
+     * if (cst instanceof Integer) {
+     *   // ...
+     * } else if (cst instanceof Float) {
+     *   // ...
+     * } else if (cst instanceof Long) {
+     *   // ...
+     * } else if (cst instanceof Double) {
+     *   // ...
+     * } else if (cst instanceof String) {
+     *   // ...
+     * } else if (cst instanceof Type) {
+     *   int sort = ((Type) cst).getSort();
+     *   if (sort == Type.OBJECT) {
+     *     // ...
+     *   } else if (sort == Type.ARRAY) {
+     *     // ...
+     *   } else if (sort == Type.METHOD) {
+     *     // ...
+     *   } else {
+     *     // throw an exception
+     *   }
+     * } else if (cst instanceof Handle) {
+     *   // ...
+     * } else {
+     *   // throw an exception
+     * }</pre>
+     *
+     * @param cst the constant to be loaded on the stack. This parameter must be
+     *        a non null {@link Integer}, a {@link Float}, a {@link Long}, a
+     *        {@link Double}, a {@link String}, a {@link Type} of OBJECT or ARRAY
+     *        sort for <tt>.class</tt> constants, for classes whose version is
+     *        49.0, a {@link Type} of METHOD sort or a {@link Handle} for
+     *        MethodType and MethodHandle constants, for classes whose version
+     *        is 51.0.
+     */
+    public void visitLdcInsn(Object cst) {
+        if (mv != null) {
+            mv.visitLdcInsn(cst);
+        }
+    }
+
+    /**
+     * Visits an IINC instruction.
+     *
+     * @param var index of the local variable to be incremented.
+     * @param increment amount to increment the local variable by.
+     */
+    public void visitIincInsn(int var, int increment) {
+        if (mv != null) {
+            mv.visitIincInsn(var, increment);
+        }
+    }
+
+    /**
+     * Visits a TABLESWITCH instruction.
+     *
+     * @param min the minimum key value.
+     * @param max the maximum key value.
+     * @param dflt beginning of the default handler block.
+     * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+     *        the beginning of the handler block for the <tt>min + i</tt> key.
+     */
+    public void visitTableSwitchInsn(int min, int max, Label dflt, Label... labels) {
+        if (mv != null) {
+            mv.visitTableSwitchInsn(min, max, dflt, labels);
+        }
+    }
+
+    /**
+     * Visits a LOOKUPSWITCH instruction.
+     *
+     * @param dflt beginning of the default handler block.
+     * @param keys the values of the keys.
+     * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+     *        the beginning of the handler block for the <tt>keys[i]</tt> key.
+     */
+    public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
+        if (mv != null) {
+            mv.visitLookupSwitchInsn(dflt, keys, labels);
+        }
+    }
+
+    /**
+     * Visits a MULTIANEWARRAY instruction.
+     *
+     * @param desc an array type descriptor (see {@link Type Type}).
+     * @param dims number of dimensions of the array to allocate.
+     */
+    public void visitMultiANewArrayInsn(String desc, int dims) {
+        if (mv != null) {
+            mv.visitMultiANewArrayInsn(desc, dims);
+        }
+    }
+
+    // -------------------------------------------------------------------------
+    // Exceptions table entries, debug information, max stack and max locals
+    // -------------------------------------------------------------------------
+
+    /**
+     * Visits a try catch block.
+     *
+     * @param start beginning of the exception handler's scope (inclusive).
+     * @param end end of the exception handler's scope (exclusive).
+     * @param handler beginning of the exception handler's code.
+     * @param type internal name of the type of exceptions handled by the
+     *        handler, or <tt>null</tt> to catch any exceptions (for "finally"
+     *        blocks).
+     * @throws IllegalArgumentException if one of the labels has already been
+     *         visited by this visitor (by the {@link #visitLabel visitLabel}
+     *         method).
+     */
+    public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
+        if (mv != null) {
+            mv.visitTryCatchBlock(start, end, handler, type);
+        }
+    }
+
+    /**
+     * Visits a local variable declaration.
+     *
+     * @param name the name of a local variable.
+     * @param desc the type descriptor of this local variable.
+     * @param signature the type signature of this local variable. May be
+     *        <tt>null</tt> if the local variable type does not use generic
+     *        types.
+     * @param start the first instruction corresponding to the scope of this
+     *        local variable (inclusive).
+     * @param end the last instruction corresponding to the scope of this local
+     *        variable (exclusive).
+     * @param index the local variable's index.
+     * @throws IllegalArgumentException if one of the labels has not already
+     *         been visited by this visitor (by the
+     *         {@link #visitLabel visitLabel} method).
+     */
+    public void visitLocalVariable(
+        String name,
+        String desc,
+        String signature,
+        Label start,
+        Label end,
+        int index)
+    {
+        if (mv != null) {
+            mv.visitLocalVariable(name, desc, signature, start, end, index);
+        }
+    }
+
+    /**
+     * Visits a line number declaration.
+     *
+     * @param line a line number. This number refers to the source file from
+     *        which the class was compiled.
+     * @param start the first instruction corresponding to this line number.
+     * @throws IllegalArgumentException if <tt>start</tt> has not already been
+     *         visited by this visitor (by the {@link #visitLabel visitLabel}
+     *         method).
+     */
+    public void visitLineNumber(int line, Label start) {
+        if (mv != null) {
+            mv.visitLineNumber(line, start);
+        }
+    }
+
+    /**
+     * Visits the maximum stack size and the maximum number of local variables
+     * of the method.
+     *
+     * @param maxStack maximum stack size of the method.
+     * @param maxLocals maximum number of local variables for the method.
+     */
+    public void visitMaxs(int maxStack, int maxLocals) {
+        if (mv != null) {
+            mv.visitMaxs(maxStack, maxLocals);
+        }
+    }
+
+    /**
+     * Visits the end of the method. This method, which is the last one to be
+     * called, is used to inform the visitor that all the annotations and
+     * attributes of the method have been visited.
+     */
+    public void visitEnd() {
+        if (mv != null) {
+            mv.visitEnd();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/MethodWriter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,2695 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * A {@link MethodVisitor} that generates methods in bytecode form. Each visit
+ * method of this class appends the bytecode corresponding to the visited
+ * instruction to a byte vector, in the order these methods are called.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+class MethodWriter extends MethodVisitor {
+
+    /**
+     * Pseudo access flag used to denote constructors.
+     */
+    static final int ACC_CONSTRUCTOR = 262144;
+
+    /**
+     * Frame has exactly the same locals as the previous stack map frame and
+     * number of stack items is zero.
+     */
+    static final int SAME_FRAME = 0; // to 63 (0-3f)
+
+    /**
+     * Frame has exactly the same locals as the previous stack map frame and
+     * number of stack items is 1
+     */
+    static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64; // to 127 (40-7f)
+
+    /**
+     * Reserved for future use
+     */
+    static final int RESERVED = 128;
+
+    /**
+     * Frame has exactly the same locals as the previous stack map frame and
+     * number of stack items is 1. Offset is bigger then 63;
+     */
+    static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247; // f7
+
+    /**
+     * Frame where current locals are the same as the locals in the previous
+     * frame, except that the k last locals are absent. The value of k is given
+     * by the formula 251-frame_type.
+     */
+    static final int CHOP_FRAME = 248; // to 250 (f8-fA)
+
+    /**
+     * Frame has exactly the same locals as the previous stack map frame and
+     * number of stack items is zero. Offset is bigger then 63;
+     */
+    static final int SAME_FRAME_EXTENDED = 251; // fb
+
+    /**
+     * Frame where current locals are the same as the locals in the previous
+     * frame, except that k additional locals are defined. The value of k is
+     * given by the formula frame_type-251.
+     */
+    static final int APPEND_FRAME = 252; // to 254 // fc-fe
+
+    /**
+     * Full frame
+     */
+    static final int FULL_FRAME = 255; // ff
+
+    /**
+     * Indicates that the stack map frames must be recomputed from scratch. In
+     * this case the maximum stack size and number of local variables is also
+     * recomputed from scratch.
+     *
+     * @see #compute
+     */
+    private static final int FRAMES = 0;
+
+    /**
+     * Indicates that the maximum stack size and number of local variables must
+     * be automatically computed.
+     *
+     * @see #compute
+     */
+    private static final int MAXS = 1;
+
+    /**
+     * Indicates that nothing must be automatically computed.
+     *
+     * @see #compute
+     */
+    private static final int NOTHING = 2;
+
+    /**
+     * The class writer to which this method must be added.
+     */
+    final ClassWriter cw;
+
+    /**
+     * Access flags of this method.
+     */
+    private int access;
+
+    /**
+     * The index of the constant pool item that contains the name of this
+     * method.
+     */
+    private final int name;
+
+    /**
+     * The index of the constant pool item that contains the descriptor of this
+     * method.
+     */
+    private final int desc;
+
+    /**
+     * The descriptor of this method.
+     */
+    private final String descriptor;
+
+    /**
+     * The signature of this method.
+     */
+    String signature;
+
+    /**
+     * If not zero, indicates that the code of this method must be copied from
+     * the ClassReader associated to this writer in <code>cw.cr</code>. More
+     * precisely, this field gives the index of the first byte to copied from
+     * <code>cw.cr.b</code>.
+     */
+    int classReaderOffset;
+
+    /**
+     * If not zero, indicates that the code of this method must be copied from
+     * the ClassReader associated to this writer in <code>cw.cr</code>. More
+     * precisely, this field gives the number of bytes to copied from
+     * <code>cw.cr.b</code>.
+     */
+    int classReaderLength;
+
+    /**
+     * Number of exceptions that can be thrown by this method.
+     */
+    int exceptionCount;
+
+    /**
+     * The exceptions that can be thrown by this method. More precisely, this
+     * array contains the indexes of the constant pool items that contain the
+     * internal names of these exception classes.
+     */
+    int[] exceptions;
+
+    /**
+     * The annotation default attribute of this method. May be <tt>null</tt>.
+     */
+    private ByteVector annd;
+
+    /**
+     * The runtime visible annotations of this method. May be <tt>null</tt>.
+     */
+    private AnnotationWriter anns;
+
+    /**
+     * The runtime invisible annotations of this method. May be <tt>null</tt>.
+     */
+    private AnnotationWriter ianns;
+
+    /**
+     * The runtime visible parameter annotations of this method. May be
+     * <tt>null</tt>.
+     */
+    private AnnotationWriter[] panns;
+
+    /**
+     * The runtime invisible parameter annotations of this method. May be
+     * <tt>null</tt>.
+     */
+    private AnnotationWriter[] ipanns;
+
+    /**
+     * The number of synthetic parameters of this method.
+     */
+    private int synthetics;
+
+    /**
+     * The non standard attributes of the method.
+     */
+    private Attribute attrs;
+
+    /**
+     * The bytecode of this method.
+     */
+    private ByteVector code = new ByteVector();
+
+    /**
+     * Maximum stack size of this method.
+     */
+    private int maxStack;
+
+    /**
+     * Maximum number of local variables for this method.
+     */
+    private int maxLocals;
+
+    /**
+     *  Number of local variables in the current stack map frame.
+     */
+    private int currentLocals;
+
+    /**
+     * Number of stack map frames in the StackMapTable attribute.
+     */
+    private int frameCount;
+
+    /**
+     * The StackMapTable attribute.
+     */
+    private ByteVector stackMap;
+
+    /**
+     * The offset of the last frame that was written in the StackMapTable
+     * attribute.
+     */
+    private int previousFrameOffset;
+
+    /**
+     * The last frame that was written in the StackMapTable attribute.
+     *
+     * @see #frame
+     */
+    private int[] previousFrame;
+
+    /**
+     * Index of the next element to be added in {@link #frame}.
+     */
+    private int frameIndex;
+
+    /**
+     * The current stack map frame. The first element contains the offset of the
+     * instruction to which the frame corresponds, the second element is the
+     * number of locals and the third one is the number of stack elements. The
+     * local variables start at index 3 and are followed by the operand stack
+     * values. In summary frame[0] = offset, frame[1] = nLocal, frame[2] =
+     * nStack, frame[3] = nLocal. All types are encoded as integers, with the
+     * same format as the one used in {@link Label}, but limited to BASE types.
+     */
+    private int[] frame;
+
+    /**
+     * Number of elements in the exception handler list.
+     */
+    private int handlerCount;
+
+    /**
+     * The first element in the exception handler list.
+     */
+    private Handler firstHandler;
+
+    /**
+     * The last element in the exception handler list.
+     */
+    private Handler lastHandler;
+
+    /**
+     * Number of entries in the LocalVariableTable attribute.
+     */
+    private int localVarCount;
+
+    /**
+     * The LocalVariableTable attribute.
+     */
+    private ByteVector localVar;
+
+    /**
+     * Number of entries in the LocalVariableTypeTable attribute.
+     */
+    private int localVarTypeCount;
+
+    /**
+     * The LocalVariableTypeTable attribute.
+     */
+    private ByteVector localVarType;
+
+    /**
+     * Number of entries in the LineNumberTable attribute.
+     */
+    private int lineNumberCount;
+
+    /**
+     * The LineNumberTable attribute.
+     */
+    private ByteVector lineNumber;
+
+    /**
+     * The non standard attributes of the method's code.
+     */
+    private Attribute cattrs;
+
+    /**
+     * Indicates if some jump instructions are too small and need to be resized.
+     */
+    private boolean resize;
+
+    /**
+     * The number of subroutines in this method.
+     */
+    private int subroutines;
+
+    // ------------------------------------------------------------------------
+
+    /*
+     * Fields for the control flow graph analysis algorithm (used to compute the
+     * maximum stack size). A control flow graph contains one node per "basic
+     * block", and one edge per "jump" from one basic block to another. Each
+     * node (i.e., each basic block) is represented by the Label object that
+     * corresponds to the first instruction of this basic block. Each node also
+     * stores the list of its successors in the graph, as a linked list of Edge
+     * objects.
+     */
+
+    /**
+     * Indicates what must be automatically computed.
+     *
+     * @see #FRAMES
+     * @see #MAXS
+     * @see #NOTHING
+     */
+    private final int compute;
+
+    /**
+     * A list of labels. This list is the list of basic blocks in the method,
+     * i.e. a list of Label objects linked to each other by their
+     * {@link Label#successor} field, in the order they are visited by
+     * {@link MethodVisitor#visitLabel}, and starting with the first basic block.
+     */
+    private Label labels;
+
+    /**
+     * The previous basic block.
+     */
+    private Label previousBlock;
+
+    /**
+     * The current basic block.
+     */
+    private Label currentBlock;
+
+    /**
+     * The (relative) stack size after the last visited instruction. This size
+     * is relative to the beginning of the current basic block, i.e., the true
+     * stack size after the last visited instruction is equal to the
+     * {@link Label#inputStackTop beginStackSize} of the current basic block
+     * plus <tt>stackSize</tt>.
+     */
+    private int stackSize;
+
+    /**
+     * The (relative) maximum stack size after the last visited instruction.
+     * This size is relative to the beginning of the current basic block, i.e.,
+     * the true maximum stack size after the last visited instruction is equal
+     * to the {@link Label#inputStackTop beginStackSize} of the current basic
+     * block plus <tt>stackSize</tt>.
+     */
+    private int maxStackSize;
+
+    // ------------------------------------------------------------------------
+    // Constructor
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a new {@link MethodWriter}.
+     *
+     * @param cw the class writer in which the method must be added.
+     * @param access the method's access flags (see {@link Opcodes}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type}).
+     * @param signature the method's signature. May be <tt>null</tt>.
+     * @param exceptions the internal names of the method's exceptions. May be
+     *        <tt>null</tt>.
+     * @param computeMaxs <tt>true</tt> if the maximum stack size and number
+     *        of local variables must be automatically computed.
+     * @param computeFrames <tt>true</tt> if the stack map tables must be
+     *        recomputed from scratch.
+     */
+    MethodWriter(
+        final ClassWriter cw,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions,
+        final boolean computeMaxs,
+        final boolean computeFrames)
+    {
+        super(Opcodes.ASM4);
+        if (cw.firstMethod == null) {
+            cw.firstMethod = this;
+        } else {
+            cw.lastMethod.mv = this;
+        }
+        cw.lastMethod = this;
+        this.cw = cw;
+        this.access = access;
+        this.name = cw.newUTF8(name);
+        this.desc = cw.newUTF8(desc);
+        this.descriptor = desc;
+        if (ClassReader.SIGNATURES) {
+            this.signature = signature;
+        }
+        if (exceptions != null && exceptions.length > 0) {
+            exceptionCount = exceptions.length;
+            this.exceptions = new int[exceptionCount];
+            for (int i = 0; i < exceptionCount; ++i) {
+                this.exceptions[i] = cw.newClass(exceptions[i]);
+            }
+        }
+        this.compute = computeFrames ? FRAMES : (computeMaxs ? MAXS : NOTHING);
+        if (computeMaxs || computeFrames) {
+            if (computeFrames && "<init>".equals(name)) {
+                this.access |= ACC_CONSTRUCTOR;
+            }
+            // updates maxLocals
+            int size = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
+            if ((access & Opcodes.ACC_STATIC) != 0) {
+                --size;
+            }
+            maxLocals = size;
+            currentLocals = size;
+            // creates and visits the label for the first basic block
+            labels = new Label();
+            labels.status |= Label.PUSHED;
+            visitLabel(labels);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the MethodVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public AnnotationVisitor visitAnnotationDefault() {
+        if (!ClassReader.ANNOTATIONS) {
+            return null;
+        }
+        annd = new ByteVector();
+        return new AnnotationWriter(cw, false, annd, null, 0);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        if (!ClassReader.ANNOTATIONS) {
+            return null;
+        }
+        ByteVector bv = new ByteVector();
+        // write type, and reserve space for values count
+        bv.putShort(cw.newUTF8(desc)).putShort(0);
+        AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
+        if (visible) {
+            aw.next = anns;
+            anns = aw;
+        } else {
+            aw.next = ianns;
+            ianns = aw;
+        }
+        return aw;
+    }
+
+    @Override
+    public AnnotationVisitor visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible)
+    {
+        if (!ClassReader.ANNOTATIONS) {
+            return null;
+        }
+        ByteVector bv = new ByteVector();
+        if ("Ljava/lang/Synthetic;".equals(desc)) {
+            // workaround for a bug in javac with synthetic parameters
+            // see ClassReader.readParameterAnnotations
+            synthetics = Math.max(synthetics, parameter + 1);
+            return new AnnotationWriter(cw, false, bv, null, 0);
+        }
+        // write type, and reserve space for values count
+        bv.putShort(cw.newUTF8(desc)).putShort(0);
+        AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
+        if (visible) {
+            if (panns == null) {
+                panns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
+            }
+            aw.next = panns[parameter];
+            panns[parameter] = aw;
+        } else {
+            if (ipanns == null) {
+                ipanns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
+            }
+            aw.next = ipanns[parameter];
+            ipanns[parameter] = aw;
+        }
+        return aw;
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        if (attr.isCodeAttribute()) {
+            attr.next = cattrs;
+            cattrs = attr;
+        } else {
+            attr.next = attrs;
+            attrs = attr;
+        }
+    }
+
+    @Override
+    public void visitCode() {
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        if (!ClassReader.FRAMES || compute == FRAMES) {
+            return;
+        }
+
+        if (type == Opcodes.F_NEW) {
+            currentLocals = nLocal;
+            startFrame(code.length, nLocal, nStack);
+            for (int i = 0; i < nLocal; ++i) {
+                if (local[i] instanceof String) {
+                    frame[frameIndex++] = Frame.OBJECT
+                            | cw.addType((String) local[i]);
+                } else if (local[i] instanceof Integer) {
+                    frame[frameIndex++] = ((Integer) local[i]).intValue();
+                } else {
+                    frame[frameIndex++] = Frame.UNINITIALIZED
+                            | cw.addUninitializedType("",
+                                    ((Label) local[i]).position);
+                }
+            }
+            for (int i = 0; i < nStack; ++i) {
+                if (stack[i] instanceof String) {
+                    frame[frameIndex++] = Frame.OBJECT
+                            | cw.addType((String) stack[i]);
+                } else if (stack[i] instanceof Integer) {
+                    frame[frameIndex++] = ((Integer) stack[i]).intValue();
+                } else {
+                    frame[frameIndex++] = Frame.UNINITIALIZED
+                            | cw.addUninitializedType("",
+                                    ((Label) stack[i]).position);
+                }
+            }
+            endFrame();
+        } else {
+            int delta;
+            if (stackMap == null) {
+                stackMap = new ByteVector();
+                delta = code.length;
+            } else {
+                delta = code.length - previousFrameOffset - 1;
+                if (delta < 0) {
+                    if (type == Opcodes.F_SAME) {
+                        return;
+                    } else {
+                        throw new IllegalStateException();
+                    }
+                }
+            }
+
+            switch (type) {
+                case Opcodes.F_FULL:
+                    currentLocals = nLocal;
+                    stackMap.putByte(FULL_FRAME)
+                            .putShort(delta)
+                            .putShort(nLocal);
+                    for (int i = 0; i < nLocal; ++i) {
+                        writeFrameType(local[i]);
+                    }
+                    stackMap.putShort(nStack);
+                    for (int i = 0; i < nStack; ++i) {
+                        writeFrameType(stack[i]);
+                    }
+                    break;
+                case Opcodes.F_APPEND:
+                    currentLocals += nLocal;
+                    stackMap.putByte(SAME_FRAME_EXTENDED + nLocal)
+                            .putShort(delta);
+                    for (int i = 0; i < nLocal; ++i) {
+                        writeFrameType(local[i]);
+                    }
+                    break;
+                case Opcodes.F_CHOP:
+                    currentLocals -= nLocal;
+                    stackMap.putByte(SAME_FRAME_EXTENDED - nLocal)
+                            .putShort(delta);
+                    break;
+                case Opcodes.F_SAME:
+                    if (delta < 64) {
+                        stackMap.putByte(delta);
+                    } else {
+                        stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
+                    }
+                    break;
+                case Opcodes.F_SAME1:
+                    if (delta < 64) {
+                        stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
+                    } else {
+                        stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
+                                .putShort(delta);
+                    }
+                    writeFrameType(stack[0]);
+                    break;
+            }
+
+            previousFrameOffset = code.length;
+            ++frameCount;
+        }
+
+        maxStack = Math.max(maxStack, nStack);
+        maxLocals = Math.max(maxLocals, currentLocals);
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        // adds the instruction to the bytecode of the method
+        code.putByte(opcode);
+        // update currentBlock
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, 0, null, null);
+            } else {
+                // updates current and max stack sizes
+                int size = stackSize + Frame.SIZE[opcode];
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+            // if opcode == ATHROW or xRETURN, ends current block (no successor)
+            if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
+                    || opcode == Opcodes.ATHROW)
+            {
+                noSuccessor();
+            }
+        }
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, operand, null, null);
+            } else if (opcode != Opcodes.NEWARRAY) {
+                // updates current and max stack sizes only for NEWARRAY
+                // (stack size variation = 0 for BIPUSH or SIPUSH)
+                int size = stackSize + 1;
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        if (opcode == Opcodes.SIPUSH) {
+            code.put12(opcode, operand);
+        } else { // BIPUSH or NEWARRAY
+            code.put11(opcode, operand);
+        }
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, var, null, null);
+            } else {
+                // updates current and max stack sizes
+                if (opcode == Opcodes.RET) {
+                    // no stack change, but end of current block (no successor)
+                    currentBlock.status |= Label.RET;
+                    // save 'stackSize' here for future use
+                    // (see {@link #findSubroutineSuccessors})
+                    currentBlock.inputStackTop = stackSize;
+                    noSuccessor();
+                } else { // xLOAD or xSTORE
+                    int size = stackSize + Frame.SIZE[opcode];
+                    if (size > maxStackSize) {
+                        maxStackSize = size;
+                    }
+                    stackSize = size;
+                }
+            }
+        }
+        if (compute != NOTHING) {
+            // updates max locals
+            int n;
+            if (opcode == Opcodes.LLOAD || opcode == Opcodes.DLOAD
+                    || opcode == Opcodes.LSTORE || opcode == Opcodes.DSTORE)
+            {
+                n = var + 2;
+            } else {
+                n = var + 1;
+            }
+            if (n > maxLocals) {
+                maxLocals = n;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        if (var < 4 && opcode != Opcodes.RET) {
+            int opt;
+            if (opcode < Opcodes.ISTORE) {
+                /* ILOAD_0 */
+                opt = 26 + ((opcode - Opcodes.ILOAD) << 2) + var;
+            } else {
+                /* ISTORE_0 */
+                opt = 59 + ((opcode - Opcodes.ISTORE) << 2) + var;
+            }
+            code.putByte(opt);
+        } else if (var >= 256) {
+            code.putByte(196 /* WIDE */).put12(opcode, var);
+        } else {
+            code.put11(opcode, var);
+        }
+        if (opcode >= Opcodes.ISTORE && compute == FRAMES && handlerCount > 0) {
+            visitLabel(new Label());
+        }
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        Item i = cw.newClassItem(type);
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, code.length, cw, i);
+            } else if (opcode == Opcodes.NEW) {
+                // updates current and max stack sizes only if opcode == NEW
+                // (no stack change for ANEWARRAY, CHECKCAST, INSTANCEOF)
+                int size = stackSize + 1;
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        code.put12(opcode, i.index);
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        Item i = cw.newFieldItem(owner, name, desc);
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, 0, cw, i);
+            } else {
+                int size;
+                // computes the stack size variation
+                char c = desc.charAt(0);
+                switch (opcode) {
+                    case Opcodes.GETSTATIC:
+                        size = stackSize + (c == 'D' || c == 'J' ? 2 : 1);
+                        break;
+                    case Opcodes.PUTSTATIC:
+                        size = stackSize + (c == 'D' || c == 'J' ? -2 : -1);
+                        break;
+                    case Opcodes.GETFIELD:
+                        size = stackSize + (c == 'D' || c == 'J' ? 1 : 0);
+                        break;
+                    // case Constants.PUTFIELD:
+                    default:
+                        size = stackSize + (c == 'D' || c == 'J' ? -3 : -2);
+                        break;
+                }
+                // updates current and max stack sizes
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        code.put12(opcode, i.index);
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        boolean itf = opcode == Opcodes.INVOKEINTERFACE;
+        Item i = cw.newMethodItem(owner, name, desc, itf);
+        int argSize = i.intVal;
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, 0, cw, i);
+            } else {
+                /*
+                 * computes the stack size variation. In order not to recompute
+                 * several times this variation for the same Item, we use the
+                 * intVal field of this item to store this variation, once it
+                 * has been computed. More precisely this intVal field stores
+                 * the sizes of the arguments and of the return value
+                 * corresponding to desc.
+                 */
+                if (argSize == 0) {
+                    // the above sizes have not been computed yet,
+                    // so we compute them...
+                    argSize = Type.getArgumentsAndReturnSizes(desc);
+                    // ... and we save them in order
+                    // not to recompute them in the future
+                    i.intVal = argSize;
+                }
+                int size;
+                if (opcode == Opcodes.INVOKESTATIC) {
+                    size = stackSize - (argSize >> 2) + (argSize & 0x03) + 1;
+                } else {
+                    size = stackSize - (argSize >> 2) + (argSize & 0x03);
+                }
+                // updates current and max stack sizes
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        if (itf) {
+            if (argSize == 0) {
+                argSize = Type.getArgumentsAndReturnSizes(desc);
+                i.intVal = argSize;
+            }
+            code.put12(Opcodes.INVOKEINTERFACE, i.index).put11(argSize >> 2, 0);
+        } else {
+            code.put12(opcode, i.index);
+        }
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        final String name,
+        final String desc,
+        final Handle bsm,
+        final Object... bsmArgs)
+    {
+        Item i = cw.newInvokeDynamicItem(name, desc, bsm, bsmArgs);
+        int argSize = i.intVal;
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(Opcodes.INVOKEDYNAMIC, 0, cw, i);
+            } else {
+                /*
+                 * computes the stack size variation. In order not to recompute
+                 * several times this variation for the same Item, we use the
+                 * intVal field of this item to store this variation, once it
+                 * has been computed. More precisely this intVal field stores
+                 * the sizes of the arguments and of the return value
+                 * corresponding to desc.
+                 */
+                if (argSize == 0) {
+                    // the above sizes have not been computed yet,
+                    // so we compute them...
+                    argSize = Type.getArgumentsAndReturnSizes(desc);
+                    // ... and we save them in order
+                    // not to recompute them in the future
+                    i.intVal = argSize;
+                }
+                int size = stackSize - (argSize >> 2) + (argSize & 0x03) + 1;
+
+                // updates current and max stack sizes
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        code.put12(Opcodes.INVOKEDYNAMIC, i.index);
+        code.putShort(0);
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        Label nextInsn = null;
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(opcode, 0, null, null);
+                // 'label' is the target of a jump instruction
+                label.getFirst().status |= Label.TARGET;
+                // adds 'label' as a successor of this basic block
+                addSuccessor(Edge.NORMAL, label);
+                if (opcode != Opcodes.GOTO) {
+                    // creates a Label for the next basic block
+                    nextInsn = new Label();
+                }
+            } else {
+                if (opcode == Opcodes.JSR) {
+                    if ((label.status & Label.SUBROUTINE) == 0) {
+                        label.status |= Label.SUBROUTINE;
+                        ++subroutines;
+                    }
+                    currentBlock.status |= Label.JSR;
+                    addSuccessor(stackSize + 1, label);
+                    // creates a Label for the next basic block
+                    nextInsn = new Label();
+                    /*
+                     * note that, by construction in this method, a JSR block
+                     * has at least two successors in the control flow graph:
+                     * the first one leads the next instruction after the JSR,
+                     * while the second one leads to the JSR target.
+                     */
+                } else {
+                    // updates current stack size (max stack size unchanged
+                    // because stack size variation always negative in this
+                    // case)
+                    stackSize += Frame.SIZE[opcode];
+                    addSuccessor(stackSize, label);
+                }
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        if ((label.status & Label.RESOLVED) != 0
+                && label.position - code.length < Short.MIN_VALUE)
+        {
+            /*
+             * case of a backward jump with an offset < -32768. In this case we
+             * automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx
+             * <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the
+             * "opposite" opcode of IFxxx (i.e., IFNE for IFEQ) and where <l'>
+             * designates the instruction just after the GOTO_W.
+             */
+            if (opcode == Opcodes.GOTO) {
+                code.putByte(200); // GOTO_W
+            } else if (opcode == Opcodes.JSR) {
+                code.putByte(201); // JSR_W
+            } else {
+                // if the IF instruction is transformed into IFNOT GOTO_W the
+                // next instruction becomes the target of the IFNOT instruction
+                if (nextInsn != null) {
+                    nextInsn.status |= Label.TARGET;
+                }
+                code.putByte(opcode <= 166
+                        ? ((opcode + 1) ^ 1) - 1
+                        : opcode ^ 1);
+                code.putShort(8); // jump offset
+                code.putByte(200); // GOTO_W
+            }
+            label.put(this, code, code.length - 1, true);
+        } else {
+            /*
+             * case of a backward jump with an offset >= -32768, or of a forward
+             * jump with, of course, an unknown offset. In these cases we store
+             * the offset in 2 bytes (which will be increased in
+             * resizeInstructions, if needed).
+             */
+            code.putByte(opcode);
+            label.put(this, code, code.length - 1, false);
+        }
+        if (currentBlock != null) {
+            if (nextInsn != null) {
+                // if the jump instruction is not a GOTO, the next instruction
+                // is also a successor of this instruction. Calling visitLabel
+                // adds the label of this next instruction as a successor of the
+                // current block, and starts a new basic block
+                visitLabel(nextInsn);
+            }
+            if (opcode == Opcodes.GOTO) {
+                noSuccessor();
+            }
+        }
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        // resolves previous forward references to label, if any
+        resize |= label.resolve(this, code.length, code.data);
+        // updates currentBlock
+        if ((label.status & Label.DEBUG) != 0) {
+            return;
+        }
+        if (compute == FRAMES) {
+            if (currentBlock != null) {
+                if (label.position == currentBlock.position) {
+                    // successive labels, do not start a new basic block
+                    currentBlock.status |= (label.status & Label.TARGET);
+                    label.frame = currentBlock.frame;
+                    return;
+                }
+                // ends current block (with one new successor)
+                addSuccessor(Edge.NORMAL, label);
+            }
+            // begins a new current block
+            currentBlock = label;
+            if (label.frame == null) {
+                label.frame = new Frame();
+                label.frame.owner = label;
+            }
+            // updates the basic block list
+            if (previousBlock != null) {
+                if (label.position == previousBlock.position) {
+                    previousBlock.status |= (label.status & Label.TARGET);
+                    label.frame = previousBlock.frame;
+                    currentBlock = previousBlock;
+                    return;
+                }
+                previousBlock.successor = label;
+            }
+            previousBlock = label;
+        } else if (compute == MAXS) {
+            if (currentBlock != null) {
+                // ends current block (with one new successor)
+                currentBlock.outputStackMax = maxStackSize;
+                addSuccessor(stackSize, label);
+            }
+            // begins a new current block
+            currentBlock = label;
+            // resets the relative current and max stack sizes
+            stackSize = 0;
+            maxStackSize = 0;
+            // updates the basic block list
+            if (previousBlock != null) {
+                previousBlock.successor = label;
+            }
+            previousBlock = label;
+        }
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        Item i = cw.newConstItem(cst);
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(Opcodes.LDC, 0, cw, i);
+            } else {
+                int size;
+                // computes the stack size variation
+                if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE)
+                {
+                    size = stackSize + 2;
+                } else {
+                    size = stackSize + 1;
+                }
+                // updates current and max stack sizes
+                if (size > maxStackSize) {
+                    maxStackSize = size;
+                }
+                stackSize = size;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        int index = i.index;
+        if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE) {
+            code.put12(20 /* LDC2_W */, index);
+        } else if (index >= 256) {
+            code.put12(19 /* LDC_W */, index);
+        } else {
+            code.put11(Opcodes.LDC, index);
+        }
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(Opcodes.IINC, var, null, null);
+            }
+        }
+        if (compute != NOTHING) {
+            // updates max locals
+            int n = var + 1;
+            if (n > maxLocals) {
+                maxLocals = n;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        if ((var > 255) || (increment > 127) || (increment < -128)) {
+            code.putByte(196 /* WIDE */)
+                    .put12(Opcodes.IINC, var)
+                    .putShort(increment);
+        } else {
+            code.putByte(Opcodes.IINC).put11(var, increment);
+        }
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        // adds the instruction to the bytecode of the method
+        int source = code.length;
+        code.putByte(Opcodes.TABLESWITCH);
+        code.putByteArray(null, 0, (4 - code.length % 4) % 4);
+        dflt.put(this, code, source, true);
+        code.putInt(min).putInt(max);
+        for (int i = 0; i < labels.length; ++i) {
+            labels[i].put(this, code, source, true);
+        }
+        // updates currentBlock
+        visitSwitchInsn(dflt, labels);
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        // adds the instruction to the bytecode of the method
+        int source = code.length;
+        code.putByte(Opcodes.LOOKUPSWITCH);
+        code.putByteArray(null, 0, (4 - code.length % 4) % 4);
+        dflt.put(this, code, source, true);
+        code.putInt(labels.length);
+        for (int i = 0; i < labels.length; ++i) {
+            code.putInt(keys[i]);
+            labels[i].put(this, code, source, true);
+        }
+        // updates currentBlock
+        visitSwitchInsn(dflt, labels);
+    }
+
+    private void visitSwitchInsn(final Label dflt, final Label[] labels) {
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(Opcodes.LOOKUPSWITCH, 0, null, null);
+                // adds current block successors
+                addSuccessor(Edge.NORMAL, dflt);
+                dflt.getFirst().status |= Label.TARGET;
+                for (int i = 0; i < labels.length; ++i) {
+                    addSuccessor(Edge.NORMAL, labels[i]);
+                    labels[i].getFirst().status |= Label.TARGET;
+                }
+            } else {
+                // updates current stack size (max stack size unchanged)
+                --stackSize;
+                // adds current block successors
+                addSuccessor(stackSize, dflt);
+                for (int i = 0; i < labels.length; ++i) {
+                    addSuccessor(stackSize, labels[i]);
+                }
+            }
+            // ends current block
+            noSuccessor();
+        }
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        Item i = cw.newClassItem(desc);
+        // Label currentBlock = this.currentBlock;
+        if (currentBlock != null) {
+            if (compute == FRAMES) {
+                currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
+            } else {
+                // updates current stack size (max stack size unchanged because
+                // stack size variation always negative or null)
+                stackSize += 1 - dims;
+            }
+        }
+        // adds the instruction to the bytecode of the method
+        code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type)
+    {
+        ++handlerCount;
+        Handler h = new Handler();
+        h.start = start;
+        h.end = end;
+        h.handler = handler;
+        h.desc = type;
+        h.type = type != null ? cw.newClass(type) : 0;
+        if (lastHandler == null) {
+            firstHandler = h;
+        } else {
+            lastHandler.next = h;
+        }
+        lastHandler = h;
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        if (signature != null) {
+            if (localVarType == null) {
+                localVarType = new ByteVector();
+            }
+            ++localVarTypeCount;
+            localVarType.putShort(start.position)
+                    .putShort(end.position - start.position)
+                    .putShort(cw.newUTF8(name))
+                    .putShort(cw.newUTF8(signature))
+                    .putShort(index);
+        }
+        if (localVar == null) {
+            localVar = new ByteVector();
+        }
+        ++localVarCount;
+        localVar.putShort(start.position)
+                .putShort(end.position - start.position)
+                .putShort(cw.newUTF8(name))
+                .putShort(cw.newUTF8(desc))
+                .putShort(index);
+        if (compute != NOTHING) {
+            // updates max locals
+            char c = desc.charAt(0);
+            int n = index + (c == 'J' || c == 'D' ? 2 : 1);
+            if (n > maxLocals) {
+                maxLocals = n;
+            }
+        }
+    }
+
+    @Override
+    public void visitLineNumber(final int line, final Label start) {
+        if (lineNumber == null) {
+            lineNumber = new ByteVector();
+        }
+        ++lineNumberCount;
+        lineNumber.putShort(start.position);
+        lineNumber.putShort(line);
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        if (ClassReader.FRAMES && compute == FRAMES) {
+            // completes the control flow graph with exception handler blocks
+            Handler handler = firstHandler;
+            while (handler != null) {
+                Label l = handler.start.getFirst();
+                Label h = handler.handler.getFirst();
+                Label e = handler.end.getFirst();
+                // computes the kind of the edges to 'h'
+                String t = handler.desc == null
+                        ? "java/lang/Throwable"
+                        : handler.desc;
+                int kind = Frame.OBJECT | cw.addType(t);
+                // h is an exception handler
+                h.status |= Label.TARGET;
+                // adds 'h' as a successor of labels between 'start' and 'end'
+                while (l != e) {
+                    // creates an edge to 'h'
+                    Edge b = new Edge();
+                    b.info = kind;
+                    b.successor = h;
+                    // adds it to the successors of 'l'
+                    b.next = l.successors;
+                    l.successors = b;
+                    // goes to the next label
+                    l = l.successor;
+                }
+                handler = handler.next;
+            }
+
+            // creates and visits the first (implicit) frame
+            Frame f = labels.frame;
+            Type[] args = Type.getArgumentTypes(descriptor);
+            f.initInputFrame(cw, access, args, this.maxLocals);
+            visitFrame(f);
+
+            /*
+             * fix point algorithm: mark the first basic block as 'changed'
+             * (i.e. put it in the 'changed' list) and, while there are changed
+             * basic blocks, choose one, mark it as unchanged, and update its
+             * successors (which can be changed in the process).
+             */
+            int max = 0;
+            Label changed = labels;
+            while (changed != null) {
+                // removes a basic block from the list of changed basic blocks
+                Label l = changed;
+                changed = changed.next;
+                l.next = null;
+                f = l.frame;
+                // a reachable jump target must be stored in the stack map
+                if ((l.status & Label.TARGET) != 0) {
+                    l.status |= Label.STORE;
+                }
+                // all visited labels are reachable, by definition
+                l.status |= Label.REACHABLE;
+                // updates the (absolute) maximum stack size
+                int blockMax = f.inputStack.length + l.outputStackMax;
+                if (blockMax > max) {
+                    max = blockMax;
+                }
+                // updates the successors of the current basic block
+                Edge e = l.successors;
+                while (e != null) {
+                    Label n = e.successor.getFirst();
+                    boolean change = f.merge(cw, n.frame, e.info);
+                    if (change && n.next == null) {
+                        // if n has changed and is not already in the 'changed'
+                        // list, adds it to this list
+                        n.next = changed;
+                        changed = n;
+                    }
+                    e = e.next;
+                }
+            }
+
+            // visits all the frames that must be stored in the stack map
+            Label l = labels;
+            while (l != null) {
+                f = l.frame;
+                if ((l.status & Label.STORE) != 0) {
+                    visitFrame(f);
+                }
+                if ((l.status & Label.REACHABLE) == 0) {
+                    // finds start and end of dead basic block
+                    Label k = l.successor;
+                    int start = l.position;
+                    int end = (k == null ? code.length : k.position) - 1;
+                    // if non empty basic block
+                    if (end >= start) {
+                        max = Math.max(max, 1);
+                        // replaces instructions with NOP ... NOP ATHROW
+                        for (int i = start; i < end; ++i) {
+                            code.data[i] = Opcodes.NOP;
+                        }
+                        code.data[end] = (byte) Opcodes.ATHROW;
+                        // emits a frame for this unreachable block
+                        startFrame(start, 0, 1);
+                        frame[frameIndex++] = Frame.OBJECT
+                                | cw.addType("java/lang/Throwable");
+                        endFrame();
+                        // removes the start-end range from the exception handlers
+                        firstHandler = Handler.remove(firstHandler, l, k);
+                    }
+                }
+                l = l.successor;
+            }
+
+            handler = firstHandler;
+            handlerCount = 0;
+            while (handler != null) {
+                handlerCount += 1;
+                handler = handler.next;
+            }
+
+            this.maxStack = max;
+        } else if (compute == MAXS) {
+            // completes the control flow graph with exception handler blocks
+            Handler handler = firstHandler;
+            while (handler != null) {
+                Label l = handler.start;
+                Label h = handler.handler;
+                Label e = handler.end;
+                // adds 'h' as a successor of labels between 'start' and 'end'
+                while (l != e) {
+                    // creates an edge to 'h'
+                    Edge b = new Edge();
+                    b.info = Edge.EXCEPTION;
+                    b.successor = h;
+                    // adds it to the successors of 'l'
+                    if ((l.status & Label.JSR) == 0) {
+                        b.next = l.successors;
+                        l.successors = b;
+                    } else {
+                        // if l is a JSR block, adds b after the first two edges
+                        // to preserve the hypothesis about JSR block successors
+                        // order (see {@link #visitJumpInsn})
+                        b.next = l.successors.next.next;
+                        l.successors.next.next = b;
+                    }
+                    // goes to the next label
+                    l = l.successor;
+                }
+                handler = handler.next;
+            }
+
+            if (subroutines > 0) {
+                // completes the control flow graph with the RET successors
+                /*
+                 * first step: finds the subroutines. This step determines, for
+                 * each basic block, to which subroutine(s) it belongs.
+                 */
+                // finds the basic blocks that belong to the "main" subroutine
+                int id = 0;
+                labels.visitSubroutine(null, 1, subroutines);
+                // finds the basic blocks that belong to the real subroutines
+                Label l = labels;
+                while (l != null) {
+                    if ((l.status & Label.JSR) != 0) {
+                        // the subroutine is defined by l's TARGET, not by l
+                        Label subroutine = l.successors.next.successor;
+                        // if this subroutine has not been visited yet...
+                        if ((subroutine.status & Label.VISITED) == 0) {
+                            // ...assigns it a new id and finds its basic blocks
+                            id += 1;
+                            subroutine.visitSubroutine(null, (id / 32L) << 32
+                                    | (1L << (id % 32)), subroutines);
+                        }
+                    }
+                    l = l.successor;
+                }
+                // second step: finds the successors of RET blocks
+                l = labels;
+                while (l != null) {
+                    if ((l.status & Label.JSR) != 0) {
+                        Label L = labels;
+                        while (L != null) {
+                            L.status &= ~Label.VISITED2;
+                            L = L.successor;
+                        }
+                        // the subroutine is defined by l's TARGET, not by l
+                        Label subroutine = l.successors.next.successor;
+                        subroutine.visitSubroutine(l, 0, subroutines);
+                    }
+                    l = l.successor;
+                }
+            }
+
+            /*
+             * control flow analysis algorithm: while the block stack is not
+             * empty, pop a block from this stack, update the max stack size,
+             * compute the true (non relative) begin stack size of the
+             * successors of this block, and push these successors onto the
+             * stack (unless they have already been pushed onto the stack).
+             * Note: by hypothesis, the {@link Label#inputStackTop} of the
+             * blocks in the block stack are the true (non relative) beginning
+             * stack sizes of these blocks.
+             */
+            int max = 0;
+            Label stack = labels;
+            while (stack != null) {
+                // pops a block from the stack
+                Label l = stack;
+                stack = stack.next;
+                // computes the true (non relative) max stack size of this block
+                int start = l.inputStackTop;
+                int blockMax = start + l.outputStackMax;
+                // updates the global max stack size
+                if (blockMax > max) {
+                    max = blockMax;
+                }
+                // analyzes the successors of the block
+                Edge b = l.successors;
+                if ((l.status & Label.JSR) != 0) {
+                    // ignores the first edge of JSR blocks (virtual successor)
+                    b = b.next;
+                }
+                while (b != null) {
+                    l = b.successor;
+                    // if this successor has not already been pushed...
+                    if ((l.status & Label.PUSHED) == 0) {
+                        // computes its true beginning stack size...
+                        l.inputStackTop = b.info == Edge.EXCEPTION ? 1 : start
+                                + b.info;
+                        // ...and pushes it onto the stack
+                        l.status |= Label.PUSHED;
+                        l.next = stack;
+                        stack = l;
+                    }
+                    b = b.next;
+                }
+            }
+            this.maxStack = Math.max(maxStack, max);
+        } else {
+            this.maxStack = maxStack;
+            this.maxLocals = maxLocals;
+        }
+    }
+
+    @Override
+    public void visitEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods: control flow analysis algorithm
+    // ------------------------------------------------------------------------
+
+    /**
+     * Adds a successor to the {@link #currentBlock currentBlock} block.
+     *
+     * @param info information about the control flow edge to be added.
+     * @param successor the successor block to be added to the current block.
+     */
+    private void addSuccessor(final int info, final Label successor) {
+        // creates and initializes an Edge object...
+        Edge b = new Edge();
+        b.info = info;
+        b.successor = successor;
+        // ...and adds it to the successor list of the currentBlock block
+        b.next = currentBlock.successors;
+        currentBlock.successors = b;
+    }
+
+    /**
+     * Ends the current basic block. This method must be used in the case where
+     * the current basic block does not have any successor.
+     */
+    private void noSuccessor() {
+        if (compute == FRAMES) {
+            Label l = new Label();
+            l.frame = new Frame();
+            l.frame.owner = l;
+            l.resolve(this, code.length, code.data);
+            previousBlock.successor = l;
+            previousBlock = l;
+        } else {
+            currentBlock.outputStackMax = maxStackSize;
+        }
+        currentBlock = null;
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods: stack map frames
+    // ------------------------------------------------------------------------
+
+    /**
+     * Visits a frame that has been computed from scratch.
+     *
+     * @param f the frame that must be visited.
+     */
+    private void visitFrame(final Frame f) {
+        int i, t;
+        int nTop = 0;
+        int nLocal = 0;
+        int nStack = 0;
+        int[] locals = f.inputLocals;
+        int[] stacks = f.inputStack;
+        // computes the number of locals (ignores TOP types that are just after
+        // a LONG or a DOUBLE, and all trailing TOP types)
+        for (i = 0; i < locals.length; ++i) {
+            t = locals[i];
+            if (t == Frame.TOP) {
+                ++nTop;
+            } else {
+                nLocal += nTop + 1;
+                nTop = 0;
+            }
+            if (t == Frame.LONG || t == Frame.DOUBLE) {
+                ++i;
+            }
+        }
+        // computes the stack size (ignores TOP types that are just after
+        // a LONG or a DOUBLE)
+        for (i = 0; i < stacks.length; ++i) {
+            t = stacks[i];
+            ++nStack;
+            if (t == Frame.LONG || t == Frame.DOUBLE) {
+                ++i;
+            }
+        }
+        // visits the frame and its content
+        startFrame(f.owner.position, nLocal, nStack);
+        for (i = 0; nLocal > 0; ++i, --nLocal) {
+            t = locals[i];
+            frame[frameIndex++] = t;
+            if (t == Frame.LONG || t == Frame.DOUBLE) {
+                ++i;
+            }
+        }
+        for (i = 0; i < stacks.length; ++i) {
+            t = stacks[i];
+            frame[frameIndex++] = t;
+            if (t == Frame.LONG || t == Frame.DOUBLE) {
+                ++i;
+            }
+        }
+        endFrame();
+    }
+
+    /**
+     * Starts the visit of a stack map frame.
+     *
+     * @param offset the offset of the instruction to which the frame
+     *        corresponds.
+     * @param nLocal the number of local variables in the frame.
+     * @param nStack the number of stack elements in the frame.
+     */
+    private void startFrame(final int offset, final int nLocal, final int nStack)
+    {
+        int n = 3 + nLocal + nStack;
+        if (frame == null || frame.length < n) {
+            frame = new int[n];
+        }
+        frame[0] = offset;
+        frame[1] = nLocal;
+        frame[2] = nStack;
+        frameIndex = 3;
+    }
+
+    /**
+     * Checks if the visit of the current frame {@link #frame} is finished, and
+     * if yes, write it in the StackMapTable attribute.
+     */
+    private void endFrame() {
+        if (previousFrame != null) { // do not write the first frame
+            if (stackMap == null) {
+                stackMap = new ByteVector();
+            }
+            writeFrame();
+            ++frameCount;
+        }
+        previousFrame = frame;
+        frame = null;
+    }
+
+    /**
+     * Compress and writes the current frame {@link #frame} in the StackMapTable
+     * attribute.
+     */
+    private void writeFrame() {
+        int clocalsSize = frame[1];
+        int cstackSize = frame[2];
+        if ((cw.version & 0xFFFF) < Opcodes.V1_6) {
+            stackMap.putShort(frame[0]).putShort(clocalsSize);
+            writeFrameTypes(3, 3 + clocalsSize);
+            stackMap.putShort(cstackSize);
+            writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
+            return;
+        }
+        int localsSize = previousFrame[1];
+        int type = FULL_FRAME;
+        int k = 0;
+        int delta;
+        if (frameCount == 0) {
+            delta = frame[0];
+        } else {
+            delta = frame[0] - previousFrame[0] - 1;
+        }
+        if (cstackSize == 0) {
+            k = clocalsSize - localsSize;
+            switch (k) {
+                case -3:
+                case -2:
+                case -1:
+                    type = CHOP_FRAME;
+                    localsSize = clocalsSize;
+                    break;
+                case 0:
+                    type = delta < 64 ? SAME_FRAME : SAME_FRAME_EXTENDED;
+                    break;
+                case 1:
+                case 2:
+                case 3:
+                    type = APPEND_FRAME;
+                    break;
+            }
+        } else if (clocalsSize == localsSize && cstackSize == 1) {
+            type = delta < 63
+                    ? SAME_LOCALS_1_STACK_ITEM_FRAME
+                    : SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
+        }
+        if (type != FULL_FRAME) {
+            // verify if locals are the same
+            int l = 3;
+            for (int j = 0; j < localsSize; j++) {
+                if (frame[l] != previousFrame[l]) {
+                    type = FULL_FRAME;
+                    break;
+                }
+                l++;
+            }
+        }
+        switch (type) {
+            case SAME_FRAME:
+                stackMap.putByte(delta);
+                break;
+            case SAME_LOCALS_1_STACK_ITEM_FRAME:
+                stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
+                writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
+                break;
+            case SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
+                stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
+                        .putShort(delta);
+                writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
+                break;
+            case SAME_FRAME_EXTENDED:
+                stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
+                break;
+            case CHOP_FRAME:
+                stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
+                break;
+            case APPEND_FRAME:
+                stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
+                writeFrameTypes(3 + localsSize, 3 + clocalsSize);
+                break;
+            // case FULL_FRAME:
+            default:
+                stackMap.putByte(FULL_FRAME)
+                        .putShort(delta)
+                        .putShort(clocalsSize);
+                writeFrameTypes(3, 3 + clocalsSize);
+                stackMap.putShort(cstackSize);
+                writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
+        }
+    }
+
+    /**
+     * Writes some types of the current frame {@link #frame} into the
+     * StackMapTableAttribute. This method converts types from the format used
+     * in {@link Label} to the format used in StackMapTable attributes. In
+     * particular, it converts type table indexes to constant pool indexes.
+     *
+     * @param start index of the first type in {@link #frame} to write.
+     * @param end index of last type in {@link #frame} to write (exclusive).
+     */
+    private void writeFrameTypes(final int start, final int end) {
+        for (int i = start; i < end; ++i) {
+            int t = frame[i];
+            int d = t & Frame.DIM;
+            if (d == 0) {
+                int v = t & Frame.BASE_VALUE;
+                switch (t & Frame.BASE_KIND) {
+                    case Frame.OBJECT:
+                        stackMap.putByte(7)
+                                .putShort(cw.newClass(cw.typeTable[v].strVal1));
+                        break;
+                    case Frame.UNINITIALIZED:
+                        stackMap.putByte(8).putShort(cw.typeTable[v].intVal);
+                        break;
+                    default:
+                        stackMap.putByte(v);
+                }
+            } else {
+                StringBuffer buf = new StringBuffer();
+                d >>= 28;
+                while (d-- > 0) {
+                    buf.append('[');
+                }
+                if ((t & Frame.BASE_KIND) == Frame.OBJECT) {
+                    buf.append('L');
+                    buf.append(cw.typeTable[t & Frame.BASE_VALUE].strVal1);
+                    buf.append(';');
+                } else {
+                    switch (t & 0xF) {
+                        case 1:
+                            buf.append('I');
+                            break;
+                        case 2:
+                            buf.append('F');
+                            break;
+                        case 3:
+                            buf.append('D');
+                            break;
+                        case 9:
+                            buf.append('Z');
+                            break;
+                        case 10:
+                            buf.append('B');
+                            break;
+                        case 11:
+                            buf.append('C');
+                            break;
+                        case 12:
+                            buf.append('S');
+                            break;
+                        default:
+                            buf.append('J');
+                    }
+                }
+                stackMap.putByte(7).putShort(cw.newClass(buf.toString()));
+            }
+        }
+    }
+
+    private void writeFrameType(final Object type) {
+        if (type instanceof String) {
+            stackMap.putByte(7).putShort(cw.newClass((String) type));
+        } else if (type instanceof Integer) {
+            stackMap.putByte(((Integer) type).intValue());
+        } else {
+            stackMap.putByte(8).putShort(((Label) type).position);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods: dump bytecode array
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the size of the bytecode of this method.
+     *
+     * @return the size of the bytecode of this method.
+     */
+    final int getSize() {
+        if (classReaderOffset != 0) {
+            return 6 + classReaderLength;
+        }
+        if (resize) {
+            // replaces the temporary jump opcodes introduced by Label.resolve.
+            if (ClassReader.RESIZE) {
+                resizeInstructions();
+            } else {
+                throw new RuntimeException("Method code too large!");
+            }
+        }
+        int size = 8;
+        if (code.length > 0) {
+            if (code.length > 65536) {
+                throw new RuntimeException("Method code too large!");
+            }
+            cw.newUTF8("Code");
+            size += 18 + code.length + 8 * handlerCount;
+            if (localVar != null) {
+                cw.newUTF8("LocalVariableTable");
+                size += 8 + localVar.length;
+            }
+            if (localVarType != null) {
+                cw.newUTF8("LocalVariableTypeTable");
+                size += 8 + localVarType.length;
+            }
+            if (lineNumber != null) {
+                cw.newUTF8("LineNumberTable");
+                size += 8 + lineNumber.length;
+            }
+            if (stackMap != null) {
+                boolean zip = (cw.version & 0xFFFF) >= Opcodes.V1_6;
+                cw.newUTF8(zip ? "StackMapTable" : "StackMap");
+                size += 8 + stackMap.length;
+            }
+            if (cattrs != null) {
+                size += cattrs.getSize(cw,
+                        code.data,
+                        code.length,
+                        maxStack,
+                        maxLocals);
+            }
+        }
+        if (exceptionCount > 0) {
+            cw.newUTF8("Exceptions");
+            size += 8 + 2 * exceptionCount;
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            cw.newUTF8("Synthetic");
+            size += 6;
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            cw.newUTF8("Deprecated");
+            size += 6;
+        }
+        if (ClassReader.SIGNATURES && signature != null) {
+            cw.newUTF8("Signature");
+            cw.newUTF8(signature);
+            size += 8;
+        }
+        if (ClassReader.ANNOTATIONS && annd != null) {
+            cw.newUTF8("AnnotationDefault");
+            size += 6 + annd.length;
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            cw.newUTF8("RuntimeVisibleAnnotations");
+            size += 8 + anns.getSize();
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            cw.newUTF8("RuntimeInvisibleAnnotations");
+            size += 8 + ianns.getSize();
+        }
+        if (ClassReader.ANNOTATIONS && panns != null) {
+            cw.newUTF8("RuntimeVisibleParameterAnnotations");
+            size += 7 + 2 * (panns.length - synthetics);
+            for (int i = panns.length - 1; i >= synthetics; --i) {
+                size += panns[i] == null ? 0 : panns[i].getSize();
+            }
+        }
+        if (ClassReader.ANNOTATIONS && ipanns != null) {
+            cw.newUTF8("RuntimeInvisibleParameterAnnotations");
+            size += 7 + 2 * (ipanns.length - synthetics);
+            for (int i = ipanns.length - 1; i >= synthetics; --i) {
+                size += ipanns[i] == null ? 0 : ipanns[i].getSize();
+            }
+        }
+        if (attrs != null) {
+            size += attrs.getSize(cw, null, 0, -1, -1);
+        }
+        return size;
+    }
+
+    /**
+     * Puts the bytecode of this method in the given byte vector.
+     *
+     * @param out the byte vector into which the bytecode of this method must be
+     *        copied.
+     */
+    final void put(final ByteVector out) {
+        int mask = Opcodes.ACC_DEPRECATED
+                | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+                | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / (ClassWriter.ACC_SYNTHETIC_ATTRIBUTE / Opcodes.ACC_SYNTHETIC));
+        out.putShort(access & ~mask).putShort(name).putShort(desc);
+        if (classReaderOffset != 0) {
+            out.putByteArray(cw.cr.b, classReaderOffset, classReaderLength);
+            return;
+        }
+        int attributeCount = 0;
+        if (code.length > 0) {
+            ++attributeCount;
+        }
+        if (exceptionCount > 0) {
+            ++attributeCount;
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            ++attributeCount;
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            ++attributeCount;
+        }
+        if (ClassReader.SIGNATURES && signature != null) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && annd != null) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && panns != null) {
+            ++attributeCount;
+        }
+        if (ClassReader.ANNOTATIONS && ipanns != null) {
+            ++attributeCount;
+        }
+        if (attrs != null) {
+            attributeCount += attrs.getCount();
+        }
+        out.putShort(attributeCount);
+        if (code.length > 0) {
+            int size = 12 + code.length + 8 * handlerCount;
+            if (localVar != null) {
+                size += 8 + localVar.length;
+            }
+            if (localVarType != null) {
+                size += 8 + localVarType.length;
+            }
+            if (lineNumber != null) {
+                size += 8 + lineNumber.length;
+            }
+            if (stackMap != null) {
+                size += 8 + stackMap.length;
+            }
+            if (cattrs != null) {
+                size += cattrs.getSize(cw,
+                        code.data,
+                        code.length,
+                        maxStack,
+                        maxLocals);
+            }
+            out.putShort(cw.newUTF8("Code")).putInt(size);
+            out.putShort(maxStack).putShort(maxLocals);
+            out.putInt(code.length).putByteArray(code.data, 0, code.length);
+            out.putShort(handlerCount);
+            if (handlerCount > 0) {
+                Handler h = firstHandler;
+                while (h != null) {
+                    out.putShort(h.start.position)
+                            .putShort(h.end.position)
+                            .putShort(h.handler.position)
+                            .putShort(h.type);
+                    h = h.next;
+                }
+            }
+            attributeCount = 0;
+            if (localVar != null) {
+                ++attributeCount;
+            }
+            if (localVarType != null) {
+                ++attributeCount;
+            }
+            if (lineNumber != null) {
+                ++attributeCount;
+            }
+            if (stackMap != null) {
+                ++attributeCount;
+            }
+            if (cattrs != null) {
+                attributeCount += cattrs.getCount();
+            }
+            out.putShort(attributeCount);
+            if (localVar != null) {
+                out.putShort(cw.newUTF8("LocalVariableTable"));
+                out.putInt(localVar.length + 2).putShort(localVarCount);
+                out.putByteArray(localVar.data, 0, localVar.length);
+            }
+            if (localVarType != null) {
+                out.putShort(cw.newUTF8("LocalVariableTypeTable"));
+                out.putInt(localVarType.length + 2).putShort(localVarTypeCount);
+                out.putByteArray(localVarType.data, 0, localVarType.length);
+            }
+            if (lineNumber != null) {
+                out.putShort(cw.newUTF8("LineNumberTable"));
+                out.putInt(lineNumber.length + 2).putShort(lineNumberCount);
+                out.putByteArray(lineNumber.data, 0, lineNumber.length);
+            }
+            if (stackMap != null) {
+                boolean zip = (cw.version & 0xFFFF) >= Opcodes.V1_6;
+                out.putShort(cw.newUTF8(zip ? "StackMapTable" : "StackMap"));
+                out.putInt(stackMap.length + 2).putShort(frameCount);
+                out.putByteArray(stackMap.data, 0, stackMap.length);
+            }
+            if (cattrs != null) {
+                cattrs.put(cw, code.data, code.length, maxLocals, maxStack, out);
+            }
+        }
+        if (exceptionCount > 0) {
+            out.putShort(cw.newUTF8("Exceptions"))
+                    .putInt(2 * exceptionCount + 2);
+            out.putShort(exceptionCount);
+            for (int i = 0; i < exceptionCount; ++i) {
+                out.putShort(exceptions[i]);
+            }
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0
+                && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
+        {
+            out.putShort(cw.newUTF8("Synthetic")).putInt(0);
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            out.putShort(cw.newUTF8("Deprecated")).putInt(0);
+        }
+        if (ClassReader.SIGNATURES && signature != null) {
+            out.putShort(cw.newUTF8("Signature"))
+                    .putInt(2)
+                    .putShort(cw.newUTF8(signature));
+        }
+        if (ClassReader.ANNOTATIONS && annd != null) {
+            out.putShort(cw.newUTF8("AnnotationDefault"));
+            out.putInt(annd.length);
+            out.putByteArray(annd.data, 0, annd.length);
+        }
+        if (ClassReader.ANNOTATIONS && anns != null) {
+            out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
+            anns.put(out);
+        }
+        if (ClassReader.ANNOTATIONS && ianns != null) {
+            out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
+            ianns.put(out);
+        }
+        if (ClassReader.ANNOTATIONS && panns != null) {
+            out.putShort(cw.newUTF8("RuntimeVisibleParameterAnnotations"));
+            AnnotationWriter.put(panns, synthetics, out);
+        }
+        if (ClassReader.ANNOTATIONS && ipanns != null) {
+            out.putShort(cw.newUTF8("RuntimeInvisibleParameterAnnotations"));
+            AnnotationWriter.put(ipanns, synthetics, out);
+        }
+        if (attrs != null) {
+            attrs.put(cw, null, 0, -1, -1, out);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods: instruction resizing (used to handle GOTO_W and JSR_W)
+    // ------------------------------------------------------------------------
+
+    /**
+     * Resizes and replaces the temporary instructions inserted by
+     * {@link Label#resolve} for wide forward jumps, while keeping jump offsets
+     * and instruction addresses consistent. This may require to resize other
+     * existing instructions, or even to introduce new instructions: for
+     * example, increasing the size of an instruction by 2 at the middle of a
+     * method can increases the offset of an IFEQ instruction from 32766 to
+     * 32768, in which case IFEQ 32766 must be replaced with IFNEQ 8 GOTO_W
+     * 32765. This, in turn, may require to increase the size of another jump
+     * instruction, and so on... All these operations are handled automatically
+     * by this method. <p> <i>This method must be called after all the method
+     * that is being built has been visited</i>. In particular, the
+     * {@link Label Label} objects used to construct the method are no longer
+     * valid after this method has been called.
+     */
+    private void resizeInstructions() {
+        byte[] b = code.data; // bytecode of the method
+        int u, v, label; // indexes in b
+        int i, j; // loop indexes
+        /*
+         * 1st step: As explained above, resizing an instruction may require to
+         * resize another one, which may require to resize yet another one, and
+         * so on. The first step of the algorithm consists in finding all the
+         * instructions that need to be resized, without modifying the code.
+         * This is done by the following "fix point" algorithm:
+         *
+         * Parse the code to find the jump instructions whose offset will need
+         * more than 2 bytes to be stored (the future offset is computed from
+         * the current offset and from the number of bytes that will be inserted
+         * or removed between the source and target instructions). For each such
+         * instruction, adds an entry in (a copy of) the indexes and sizes
+         * arrays (if this has not already been done in a previous iteration!).
+         *
+         * If at least one entry has been added during the previous step, go
+         * back to the beginning, otherwise stop.
+         *
+         * In fact the real algorithm is complicated by the fact that the size
+         * of TABLESWITCH and LOOKUPSWITCH instructions depends on their
+         * position in the bytecode (because of padding). In order to ensure the
+         * convergence of the algorithm, the number of bytes to be added or
+         * removed from these instructions is over estimated during the previous
+         * loop, and computed exactly only after the loop is finished (this
+         * requires another pass to parse the bytecode of the method).
+         */
+        int[] allIndexes = new int[0]; // copy of indexes
+        int[] allSizes = new int[0]; // copy of sizes
+        boolean[] resize; // instructions to be resized
+        int newOffset; // future offset of a jump instruction
+
+        resize = new boolean[code.length];
+
+        // 3 = loop again, 2 = loop ended, 1 = last pass, 0 = done
+        int state = 3;
+        do {
+            if (state == 3) {
+                state = 2;
+            }
+            u = 0;
+            while (u < b.length) {
+                int opcode = b[u] & 0xFF; // opcode of current instruction
+                int insert = 0; // bytes to be added after this instruction
+
+                switch (ClassWriter.TYPE[opcode]) {
+                    case ClassWriter.NOARG_INSN:
+                    case ClassWriter.IMPLVAR_INSN:
+                        u += 1;
+                        break;
+                    case ClassWriter.LABEL_INSN:
+                        if (opcode > 201) {
+                            // converts temporary opcodes 202 to 217, 218 and
+                            // 219 to IFEQ ... JSR (inclusive), IFNULL and
+                            // IFNONNULL
+                            opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+                            label = u + readUnsignedShort(b, u + 1);
+                        } else {
+                            label = u + readShort(b, u + 1);
+                        }
+                        newOffset = getNewOffset(allIndexes, allSizes, u, label);
+                        if (newOffset < Short.MIN_VALUE
+                                || newOffset > Short.MAX_VALUE)
+                        {
+                            if (!resize[u]) {
+                                if (opcode == Opcodes.GOTO
+                                        || opcode == Opcodes.JSR)
+                                {
+                                    // two additional bytes will be required to
+                                    // replace this GOTO or JSR instruction with
+                                    // a GOTO_W or a JSR_W
+                                    insert = 2;
+                                } else {
+                                    // five additional bytes will be required to
+                                    // replace this IFxxx <l> instruction with
+                                    // IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx
+                                    // is the "opposite" opcode of IFxxx (i.e.,
+                                    // IFNE for IFEQ) and where <l'> designates
+                                    // the instruction just after the GOTO_W.
+                                    insert = 5;
+                                }
+                                resize[u] = true;
+                            }
+                        }
+                        u += 3;
+                        break;
+                    case ClassWriter.LABELW_INSN:
+                        u += 5;
+                        break;
+                    case ClassWriter.TABL_INSN:
+                        if (state == 1) {
+                            // true number of bytes to be added (or removed)
+                            // from this instruction = (future number of padding
+                            // bytes - current number of padding byte) -
+                            // previously over estimated variation =
+                            // = ((3 - newOffset%4) - (3 - u%4)) - u%4
+                            // = (-newOffset%4 + u%4) - u%4
+                            // = -(newOffset & 3)
+                            newOffset = getNewOffset(allIndexes, allSizes, 0, u);
+                            insert = -(newOffset & 3);
+                        } else if (!resize[u]) {
+                            // over estimation of the number of bytes to be
+                            // added to this instruction = 3 - current number
+                            // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
+                            insert = u & 3;
+                            resize[u] = true;
+                        }
+                        // skips instruction
+                        u = u + 4 - (u & 3);
+                        u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
+                        break;
+                    case ClassWriter.LOOK_INSN:
+                        if (state == 1) {
+                            // like TABL_INSN
+                            newOffset = getNewOffset(allIndexes, allSizes, 0, u);
+                            insert = -(newOffset & 3);
+                        } else if (!resize[u]) {
+                            // like TABL_INSN
+                            insert = u & 3;
+                            resize[u] = true;
+                        }
+                        // skips instruction
+                        u = u + 4 - (u & 3);
+                        u += 8 * readInt(b, u + 4) + 8;
+                        break;
+                    case ClassWriter.WIDE_INSN:
+                        opcode = b[u + 1] & 0xFF;
+                        if (opcode == Opcodes.IINC) {
+                            u += 6;
+                        } else {
+                            u += 4;
+                        }
+                        break;
+                    case ClassWriter.VAR_INSN:
+                    case ClassWriter.SBYTE_INSN:
+                    case ClassWriter.LDC_INSN:
+                        u += 2;
+                        break;
+                    case ClassWriter.SHORT_INSN:
+                    case ClassWriter.LDCW_INSN:
+                    case ClassWriter.FIELDORMETH_INSN:
+                    case ClassWriter.TYPE_INSN:
+                    case ClassWriter.IINC_INSN:
+                        u += 3;
+                        break;
+                    case ClassWriter.ITFMETH_INSN:
+                    case ClassWriter.INDYMETH_INSN:
+                        u += 5;
+                        break;
+                    // case ClassWriter.MANA_INSN:
+                    default:
+                        u += 4;
+                        break;
+                }
+                if (insert != 0) {
+                    // adds a new (u, insert) entry in the allIndexes and
+                    // allSizes arrays
+                    int[] newIndexes = new int[allIndexes.length + 1];
+                    int[] newSizes = new int[allSizes.length + 1];
+                    System.arraycopy(allIndexes,
+                            0,
+                            newIndexes,
+                            0,
+                            allIndexes.length);
+                    System.arraycopy(allSizes, 0, newSizes, 0, allSizes.length);
+                    newIndexes[allIndexes.length] = u;
+                    newSizes[allSizes.length] = insert;
+                    allIndexes = newIndexes;
+                    allSizes = newSizes;
+                    if (insert > 0) {
+                        state = 3;
+                    }
+                }
+            }
+            if (state < 3) {
+                --state;
+            }
+        } while (state != 0);
+
+        // 2nd step:
+        // copies the bytecode of the method into a new bytevector, updates the
+        // offsets, and inserts (or removes) bytes as requested.
+
+        ByteVector newCode = new ByteVector(code.length);
+
+        u = 0;
+        while (u < code.length) {
+            int opcode = b[u] & 0xFF;
+            switch (ClassWriter.TYPE[opcode]) {
+                case ClassWriter.NOARG_INSN:
+                case ClassWriter.IMPLVAR_INSN:
+                    newCode.putByte(opcode);
+                    u += 1;
+                    break;
+                case ClassWriter.LABEL_INSN:
+                    if (opcode > 201) {
+                        // changes temporary opcodes 202 to 217 (inclusive), 218
+                        // and 219 to IFEQ ... JSR (inclusive), IFNULL and
+                        // IFNONNULL
+                        opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+                        label = u + readUnsignedShort(b, u + 1);
+                    } else {
+                        label = u + readShort(b, u + 1);
+                    }
+                    newOffset = getNewOffset(allIndexes, allSizes, u, label);
+                    if (resize[u]) {
+                        // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
+                        // <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is
+                        // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
+                        // and where <l'> designates the instruction just after
+                        // the GOTO_W.
+                        if (opcode == Opcodes.GOTO) {
+                            newCode.putByte(200); // GOTO_W
+                        } else if (opcode == Opcodes.JSR) {
+                            newCode.putByte(201); // JSR_W
+                        } else {
+                            newCode.putByte(opcode <= 166
+                                    ? ((opcode + 1) ^ 1) - 1
+                                    : opcode ^ 1);
+                            newCode.putShort(8); // jump offset
+                            newCode.putByte(200); // GOTO_W
+                            // newOffset now computed from start of GOTO_W
+                            newOffset -= 3;
+                        }
+                        newCode.putInt(newOffset);
+                    } else {
+                        newCode.putByte(opcode);
+                        newCode.putShort(newOffset);
+                    }
+                    u += 3;
+                    break;
+                case ClassWriter.LABELW_INSN:
+                    label = u + readInt(b, u + 1);
+                    newOffset = getNewOffset(allIndexes, allSizes, u, label);
+                    newCode.putByte(opcode);
+                    newCode.putInt(newOffset);
+                    u += 5;
+                    break;
+                case ClassWriter.TABL_INSN:
+                    // skips 0 to 3 padding bytes
+                    v = u;
+                    u = u + 4 - (v & 3);
+                    // reads and copies instruction
+                    newCode.putByte(Opcodes.TABLESWITCH);
+                    newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
+                    label = v + readInt(b, u);
+                    u += 4;
+                    newOffset = getNewOffset(allIndexes, allSizes, v, label);
+                    newCode.putInt(newOffset);
+                    j = readInt(b, u);
+                    u += 4;
+                    newCode.putInt(j);
+                    j = readInt(b, u) - j + 1;
+                    u += 4;
+                    newCode.putInt(readInt(b, u - 4));
+                    for (; j > 0; --j) {
+                        label = v + readInt(b, u);
+                        u += 4;
+                        newOffset = getNewOffset(allIndexes, allSizes, v, label);
+                        newCode.putInt(newOffset);
+                    }
+                    break;
+                case ClassWriter.LOOK_INSN:
+                    // skips 0 to 3 padding bytes
+                    v = u;
+                    u = u + 4 - (v & 3);
+                    // reads and copies instruction
+                    newCode.putByte(Opcodes.LOOKUPSWITCH);
+                    newCode.putByteArray(null, 0, (4 - newCode.length % 4) % 4);
+                    label = v + readInt(b, u);
+                    u += 4;
+                    newOffset = getNewOffset(allIndexes, allSizes, v, label);
+                    newCode.putInt(newOffset);
+                    j = readInt(b, u);
+                    u += 4;
+                    newCode.putInt(j);
+                    for (; j > 0; --j) {
+                        newCode.putInt(readInt(b, u));
+                        u += 4;
+                        label = v + readInt(b, u);
+                        u += 4;
+                        newOffset = getNewOffset(allIndexes, allSizes, v, label);
+                        newCode.putInt(newOffset);
+                    }
+                    break;
+                case ClassWriter.WIDE_INSN:
+                    opcode = b[u + 1] & 0xFF;
+                    if (opcode == Opcodes.IINC) {
+                        newCode.putByteArray(b, u, 6);
+                        u += 6;
+                    } else {
+                        newCode.putByteArray(b, u, 4);
+                        u += 4;
+                    }
+                    break;
+                case ClassWriter.VAR_INSN:
+                case ClassWriter.SBYTE_INSN:
+                case ClassWriter.LDC_INSN:
+                    newCode.putByteArray(b, u, 2);
+                    u += 2;
+                    break;
+                case ClassWriter.SHORT_INSN:
+                case ClassWriter.LDCW_INSN:
+                case ClassWriter.FIELDORMETH_INSN:
+                case ClassWriter.TYPE_INSN:
+                case ClassWriter.IINC_INSN:
+                    newCode.putByteArray(b, u, 3);
+                    u += 3;
+                    break;
+                case ClassWriter.ITFMETH_INSN:
+                case ClassWriter.INDYMETH_INSN:
+                    newCode.putByteArray(b, u, 5);
+                    u += 5;
+                    break;
+                // case MANA_INSN:
+                default:
+                    newCode.putByteArray(b, u, 4);
+                    u += 4;
+                    break;
+            }
+        }
+
+        // recomputes the stack map frames
+        if (frameCount > 0) {
+            if (compute == FRAMES) {
+                frameCount = 0;
+                stackMap = null;
+                previousFrame = null;
+                frame = null;
+                Frame f = new Frame();
+                f.owner = labels;
+                Type[] args = Type.getArgumentTypes(descriptor);
+                f.initInputFrame(cw, access, args, maxLocals);
+                visitFrame(f);
+                Label l = labels;
+                while (l != null) {
+                    /*
+                     * here we need the original label position. getNewOffset
+                     * must therefore never have been called for this label.
+                     */
+                    u = l.position - 3;
+                    if ((l.status & Label.STORE) != 0 || (u >= 0 && resize[u]))
+                    {
+                        getNewOffset(allIndexes, allSizes, l);
+                        // TODO update offsets in UNINITIALIZED values
+                        visitFrame(l.frame);
+                    }
+                    l = l.successor;
+                }
+            } else {
+                /*
+                 * Resizing an existing stack map frame table is really hard.
+                 * Not only the table must be parsed to update the offets, but
+                 * new frames may be needed for jump instructions that were
+                 * inserted by this method. And updating the offsets or
+                 * inserting frames can change the format of the following
+                 * frames, in case of packed frames. In practice the whole table
+                 * must be recomputed. For this the frames are marked as
+                 * potentially invalid. This will cause the whole class to be
+                 * reread and rewritten with the COMPUTE_FRAMES option (see the
+                 * ClassWriter.toByteArray method). This is not very efficient
+                 * but is much easier and requires much less code than any other
+                 * method I can think of.
+                 */
+                cw.invalidFrames = true;
+            }
+        }
+        // updates the exception handler block labels
+        Handler h = firstHandler;
+        while (h != null) {
+            getNewOffset(allIndexes, allSizes, h.start);
+            getNewOffset(allIndexes, allSizes, h.end);
+            getNewOffset(allIndexes, allSizes, h.handler);
+            h = h.next;
+        }
+        // updates the instructions addresses in the
+        // local var and line number tables
+        for (i = 0; i < 2; ++i) {
+            ByteVector bv = i == 0 ? localVar : localVarType;
+            if (bv != null) {
+                b = bv.data;
+                u = 0;
+                while (u < bv.length) {
+                    label = readUnsignedShort(b, u);
+                    newOffset = getNewOffset(allIndexes, allSizes, 0, label);
+                    writeShort(b, u, newOffset);
+                    label += readUnsignedShort(b, u + 2);
+                    newOffset = getNewOffset(allIndexes, allSizes, 0, label)
+                            - newOffset;
+                    writeShort(b, u + 2, newOffset);
+                    u += 10;
+                }
+            }
+        }
+        if (lineNumber != null) {
+            b = lineNumber.data;
+            u = 0;
+            while (u < lineNumber.length) {
+                writeShort(b, u, getNewOffset(allIndexes,
+                        allSizes,
+                        0,
+                        readUnsignedShort(b, u)));
+                u += 4;
+            }
+        }
+        // updates the labels of the other attributes
+        Attribute attr = cattrs;
+        while (attr != null) {
+            Label[] labels = attr.getLabels();
+            if (labels != null) {
+                for (i = labels.length - 1; i >= 0; --i) {
+                    getNewOffset(allIndexes, allSizes, labels[i]);
+                }
+            }
+            attr = attr.next;
+        }
+
+        // replaces old bytecodes with new ones
+        code = newCode;
+    }
+
+    /**
+     * Reads an unsigned short value in the given byte array.
+     *
+     * @param b a byte array.
+     * @param index the start index of the value to be read.
+     * @return the read value.
+     */
+    static int readUnsignedShort(final byte[] b, final int index) {
+        return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
+    }
+
+    /**
+     * Reads a signed short value in the given byte array.
+     *
+     * @param b a byte array.
+     * @param index the start index of the value to be read.
+     * @return the read value.
+     */
+    static short readShort(final byte[] b, final int index) {
+        return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
+    }
+
+    /**
+     * Reads a signed int value in the given byte array.
+     *
+     * @param b a byte array.
+     * @param index the start index of the value to be read.
+     * @return the read value.
+     */
+    static int readInt(final byte[] b, final int index) {
+        return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
+                | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
+    }
+
+    /**
+     * Writes a short value in the given byte array.
+     *
+     * @param b a byte array.
+     * @param index where the first byte of the short value must be written.
+     * @param s the value to be written in the given byte array.
+     */
+    static void writeShort(final byte[] b, final int index, final int s) {
+        b[index] = (byte) (s >>> 8);
+        b[index + 1] = (byte) s;
+    }
+
+    /**
+     * Computes the future value of a bytecode offset. <p> Note: it is possible
+     * to have several entries for the same instruction in the <tt>indexes</tt>
+     * and <tt>sizes</tt>: two entries (index=a,size=b) and (index=a,size=b')
+     * are equivalent to a single entry (index=a,size=b+b').
+     *
+     * @param indexes current positions of the instructions to be resized. Each
+     *        instruction must be designated by the index of its <i>last</i>
+     *        byte, plus one (or, in other words, by the index of the <i>first</i>
+     *        byte of the <i>next</i> instruction).
+     * @param sizes the number of bytes to be <i>added</i> to the above
+     *        instructions. More precisely, for each i < <tt>len</tt>,
+     *        <tt>sizes</tt>[i] bytes will be added at the end of the
+     *        instruction designated by <tt>indexes</tt>[i] or, if
+     *        <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
+     *        bytes of the instruction will be removed (the instruction size
+     *        <i>must not</i> become negative or null).
+     * @param begin index of the first byte of the source instruction.
+     * @param end index of the first byte of the target instruction.
+     * @return the future value of the given bytecode offset.
+     */
+    static int getNewOffset(
+        final int[] indexes,
+        final int[] sizes,
+        final int begin,
+        final int end)
+    {
+        int offset = end - begin;
+        for (int i = 0; i < indexes.length; ++i) {
+            if (begin < indexes[i] && indexes[i] <= end) {
+                // forward jump
+                offset += sizes[i];
+            } else if (end < indexes[i] && indexes[i] <= begin) {
+                // backward jump
+                offset -= sizes[i];
+            }
+        }
+        return offset;
+    }
+
+    /**
+     * Updates the offset of the given label.
+     *
+     * @param indexes current positions of the instructions to be resized. Each
+     *        instruction must be designated by the index of its <i>last</i>
+     *        byte, plus one (or, in other words, by the index of the <i>first</i>
+     *        byte of the <i>next</i> instruction).
+     * @param sizes the number of bytes to be <i>added</i> to the above
+     *        instructions. More precisely, for each i < <tt>len</tt>,
+     *        <tt>sizes</tt>[i] bytes will be added at the end of the
+     *        instruction designated by <tt>indexes</tt>[i] or, if
+     *        <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
+     *        bytes of the instruction will be removed (the instruction size
+     *        <i>must not</i> become negative or null).
+     * @param label the label whose offset must be updated.
+     */
+    static void getNewOffset(
+        final int[] indexes,
+        final int[] sizes,
+        final Label label)
+    {
+        if ((label.status & Label.RESIZED) == 0) {
+            label.position = getNewOffset(indexes, sizes, 0, label.position);
+            label.status |= Label.RESIZED;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,387 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+/**
+ * Defines the JVM opcodes, access flags and array type codes. This interface
+ * does not define all the JVM opcodes because some opcodes are automatically
+ * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
+ * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n
+ * opcodes are therefore not defined in this interface. Likewise for LDC,
+ * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and
+ * JSR_W.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public interface Opcodes {
+
+    // ASM API versions
+
+    int ASM4 = 4 << 16 | 0 << 8 | 0;
+
+    // versions
+
+    int V1_1 = 3 << 16 | 45;
+    int V1_2 = 0 << 16 | 46;
+    int V1_3 = 0 << 16 | 47;
+    int V1_4 = 0 << 16 | 48;
+    int V1_5 = 0 << 16 | 49;
+    int V1_6 = 0 << 16 | 50;
+    int V1_7 = 0 << 16 | 51;
+
+    // access flags
+
+    int ACC_PUBLIC = 0x0001; // class, field, method
+    int ACC_PRIVATE = 0x0002; // class, field, method
+    int ACC_PROTECTED = 0x0004; // class, field, method
+    int ACC_STATIC = 0x0008; // field, method
+    int ACC_FINAL = 0x0010; // class, field, method
+    int ACC_SUPER = 0x0020; // class
+    int ACC_SYNCHRONIZED = 0x0020; // method
+    int ACC_VOLATILE = 0x0040; // field
+    int ACC_BRIDGE = 0x0040; // method
+    int ACC_VARARGS = 0x0080; // method
+    int ACC_TRANSIENT = 0x0080; // field
+    int ACC_NATIVE = 0x0100; // method
+    int ACC_INTERFACE = 0x0200; // class
+    int ACC_ABSTRACT = 0x0400; // class, method
+    int ACC_STRICT = 0x0800; // method
+    int ACC_SYNTHETIC = 0x1000; // class, field, method
+    int ACC_ANNOTATION = 0x2000; // class
+    int ACC_ENUM = 0x4000; // class(?) field inner
+
+    // ASM specific pseudo access flags
+
+    int ACC_DEPRECATED = 0x20000; // class, field, method
+
+    // types for NEWARRAY
+
+    int T_BOOLEAN = 4;
+    int T_CHAR = 5;
+    int T_FLOAT = 6;
+    int T_DOUBLE = 7;
+    int T_BYTE = 8;
+    int T_SHORT = 9;
+    int T_INT = 10;
+    int T_LONG = 11;
+
+    // tags for Handle
+
+    int H_GETFIELD = 1;
+    int H_GETSTATIC = 2;
+    int H_PUTFIELD = 3;
+    int H_PUTSTATIC = 4;
+    int H_INVOKEVIRTUAL = 5;
+    int H_INVOKESTATIC = 6;
+    int H_INVOKESPECIAL = 7;
+    int H_NEWINVOKESPECIAL = 8;
+    int H_INVOKEINTERFACE = 9;
+
+    // stack map frame types
+
+    /**
+     * Represents an expanded frame. See {@link ClassReader#EXPAND_FRAMES}.
+     */
+    int F_NEW = -1;
+
+    /**
+     * Represents a compressed frame with complete frame data.
+     */
+    int F_FULL = 0;
+
+    /**
+     * Represents a compressed frame where locals are the same as the locals in
+     * the previous frame, except that additional 1-3 locals are defined, and
+     * with an empty stack.
+     */
+    int F_APPEND = 1;
+
+    /**
+     * Represents a compressed frame where locals are the same as the locals in
+     * the previous frame, except that the last 1-3 locals are absent and with
+     * an empty stack.
+     */
+    int F_CHOP = 2;
+
+    /**
+     * Represents a compressed frame with exactly the same locals as the
+     * previous frame and with an empty stack.
+     */
+    int F_SAME = 3;
+
+    /**
+     * Represents a compressed frame with exactly the same locals as the
+     * previous frame and with a single value on the stack.
+     */
+    int F_SAME1 = 4;
+
+    Integer TOP = new Integer(0);
+    Integer INTEGER = new Integer(1);
+    Integer FLOAT = new Integer(2);
+    Integer DOUBLE = new Integer(3);
+    Integer LONG = new Integer(4);
+    Integer NULL = new Integer(5);
+    Integer UNINITIALIZED_THIS = new Integer(6);
+
+    // opcodes // visit method (- = idem)
+
+    int NOP = 0; // visitInsn
+    int ACONST_NULL = 1; // -
+    int ICONST_M1 = 2; // -
+    int ICONST_0 = 3; // -
+    int ICONST_1 = 4; // -
+    int ICONST_2 = 5; // -
+    int ICONST_3 = 6; // -
+    int ICONST_4 = 7; // -
+    int ICONST_5 = 8; // -
+    int LCONST_0 = 9; // -
+    int LCONST_1 = 10; // -
+    int FCONST_0 = 11; // -
+    int FCONST_1 = 12; // -
+    int FCONST_2 = 13; // -
+    int DCONST_0 = 14; // -
+    int DCONST_1 = 15; // -
+    int BIPUSH = 16; // visitIntInsn
+    int SIPUSH = 17; // -
+    int LDC = 18; // visitLdcInsn
+    // int LDC_W = 19; // -
+    // int LDC2_W = 20; // -
+    int ILOAD = 21; // visitVarInsn
+    int LLOAD = 22; // -
+    int FLOAD = 23; // -
+    int DLOAD = 24; // -
+    int ALOAD = 25; // -
+    // int ILOAD_0 = 26; // -
+    // int ILOAD_1 = 27; // -
+    // int ILOAD_2 = 28; // -
+    // int ILOAD_3 = 29; // -
+    // int LLOAD_0 = 30; // -
+    // int LLOAD_1 = 31; // -
+    // int LLOAD_2 = 32; // -
+    // int LLOAD_3 = 33; // -
+    // int FLOAD_0 = 34; // -
+    // int FLOAD_1 = 35; // -
+    // int FLOAD_2 = 36; // -
+    // int FLOAD_3 = 37; // -
+    // int DLOAD_0 = 38; // -
+    // int DLOAD_1 = 39; // -
+    // int DLOAD_2 = 40; // -
+    // int DLOAD_3 = 41; // -
+    // int ALOAD_0 = 42; // -
+    // int ALOAD_1 = 43; // -
+    // int ALOAD_2 = 44; // -
+    // int ALOAD_3 = 45; // -
+    int IALOAD = 46; // visitInsn
+    int LALOAD = 47; // -
+    int FALOAD = 48; // -
+    int DALOAD = 49; // -
+    int AALOAD = 50; // -
+    int BALOAD = 51; // -
+    int CALOAD = 52; // -
+    int SALOAD = 53; // -
+    int ISTORE = 54; // visitVarInsn
+    int LSTORE = 55; // -
+    int FSTORE = 56; // -
+    int DSTORE = 57; // -
+    int ASTORE = 58; // -
+    // int ISTORE_0 = 59; // -
+    // int ISTORE_1 = 60; // -
+    // int ISTORE_2 = 61; // -
+    // int ISTORE_3 = 62; // -
+    // int LSTORE_0 = 63; // -
+    // int LSTORE_1 = 64; // -
+    // int LSTORE_2 = 65; // -
+    // int LSTORE_3 = 66; // -
+    // int FSTORE_0 = 67; // -
+    // int FSTORE_1 = 68; // -
+    // int FSTORE_2 = 69; // -
+    // int FSTORE_3 = 70; // -
+    // int DSTORE_0 = 71; // -
+    // int DSTORE_1 = 72; // -
+    // int DSTORE_2 = 73; // -
+    // int DSTORE_3 = 74; // -
+    // int ASTORE_0 = 75; // -
+    // int ASTORE_1 = 76; // -
+    // int ASTORE_2 = 77; // -
+    // int ASTORE_3 = 78; // -
+    int IASTORE = 79; // visitInsn
+    int LASTORE = 80; // -
+    int FASTORE = 81; // -
+    int DASTORE = 82; // -
+    int AASTORE = 83; // -
+    int BASTORE = 84; // -
+    int CASTORE = 85; // -
+    int SASTORE = 86; // -
+    int POP = 87; // -
+    int POP2 = 88; // -
+    int DUP = 89; // -
+    int DUP_X1 = 90; // -
+    int DUP_X2 = 91; // -
+    int DUP2 = 92; // -
+    int DUP2_X1 = 93; // -
+    int DUP2_X2 = 94; // -
+    int SWAP = 95; // -
+    int IADD = 96; // -
+    int LADD = 97; // -
+    int FADD = 98; // -
+    int DADD = 99; // -
+    int ISUB = 100; // -
+    int LSUB = 101; // -
+    int FSUB = 102; // -
+    int DSUB = 103; // -
+    int IMUL = 104; // -
+    int LMUL = 105; // -
+    int FMUL = 106; // -
+    int DMUL = 107; // -
+    int IDIV = 108; // -
+    int LDIV = 109; // -
+    int FDIV = 110; // -
+    int DDIV = 111; // -
+    int IREM = 112; // -
+    int LREM = 113; // -
+    int FREM = 114; // -
+    int DREM = 115; // -
+    int INEG = 116; // -
+    int LNEG = 117; // -
+    int FNEG = 118; // -
+    int DNEG = 119; // -
+    int ISHL = 120; // -
+    int LSHL = 121; // -
+    int ISHR = 122; // -
+    int LSHR = 123; // -
+    int IUSHR = 124; // -
+    int LUSHR = 125; // -
+    int IAND = 126; // -
+    int LAND = 127; // -
+    int IOR = 128; // -
+    int LOR = 129; // -
+    int IXOR = 130; // -
+    int LXOR = 131; // -
+    int IINC = 132; // visitIincInsn
+    int I2L = 133; // visitInsn
+    int I2F = 134; // -
+    int I2D = 135; // -
+    int L2I = 136; // -
+    int L2F = 137; // -
+    int L2D = 138; // -
+    int F2I = 139; // -
+    int F2L = 140; // -
+    int F2D = 141; // -
+    int D2I = 142; // -
+    int D2L = 143; // -
+    int D2F = 144; // -
+    int I2B = 145; // -
+    int I2C = 146; // -
+    int I2S = 147; // -
+    int LCMP = 148; // -
+    int FCMPL = 149; // -
+    int FCMPG = 150; // -
+    int DCMPL = 151; // -
+    int DCMPG = 152; // -
+    int IFEQ = 153; // visitJumpInsn
+    int IFNE = 154; // -
+    int IFLT = 155; // -
+    int IFGE = 156; // -
+    int IFGT = 157; // -
+    int IFLE = 158; // -
+    int IF_ICMPEQ = 159; // -
+    int IF_ICMPNE = 160; // -
+    int IF_ICMPLT = 161; // -
+    int IF_ICMPGE = 162; // -
+    int IF_ICMPGT = 163; // -
+    int IF_ICMPLE = 164; // -
+    int IF_ACMPEQ = 165; // -
+    int IF_ACMPNE = 166; // -
+    int GOTO = 167; // -
+    int JSR = 168; // -
+    int RET = 169; // visitVarInsn
+    int TABLESWITCH = 170; // visiTableSwitchInsn
+    int LOOKUPSWITCH = 171; // visitLookupSwitch
+    int IRETURN = 172; // visitInsn
+    int LRETURN = 173; // -
+    int FRETURN = 174; // -
+    int DRETURN = 175; // -
+    int ARETURN = 176; // -
+    int RETURN = 177; // -
+    int GETSTATIC = 178; // visitFieldInsn
+    int PUTSTATIC = 179; // -
+    int GETFIELD = 180; // -
+    int PUTFIELD = 181; // -
+    int INVOKEVIRTUAL = 182; // visitMethodInsn
+    int INVOKESPECIAL = 183; // -
+    int INVOKESTATIC = 184; // -
+    int INVOKEINTERFACE = 185; // -
+    int INVOKEDYNAMIC = 186; // visitInvokeDynamicInsn
+    int NEW = 187; // visitTypeInsn
+    int NEWARRAY = 188; // visitIntInsn
+    int ANEWARRAY = 189; // visitTypeInsn
+    int ARRAYLENGTH = 190; // visitInsn
+    int ATHROW = 191; // -
+    int CHECKCAST = 192; // visitTypeInsn
+    int INSTANCEOF = 193; // -
+    int MONITORENTER = 194; // visitInsn
+    int MONITOREXIT = 195; // -
+    // int WIDE = 196; // NOT VISITED
+    int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
+    int IFNULL = 198; // visitJumpInsn
+    int IFNONNULL = 199; // -
+    // int GOTO_W = 200; // -
+    // int JSR_W = 201; // -
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/Type.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,894 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * A Java field or method type. This class can be used to make it easier to
+ * manipulate type and method descriptors.
+ *
+ * @author Eric Bruneton
+ * @author Chris Nokleberg
+ */
+public class Type {
+
+    /**
+     * The sort of the <tt>void</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int VOID = 0;
+
+    /**
+     * The sort of the <tt>boolean</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int BOOLEAN = 1;
+
+    /**
+     * The sort of the <tt>char</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int CHAR = 2;
+
+    /**
+     * The sort of the <tt>byte</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int BYTE = 3;
+
+    /**
+     * The sort of the <tt>short</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int SHORT = 4;
+
+    /**
+     * The sort of the <tt>int</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int INT = 5;
+
+    /**
+     * The sort of the <tt>float</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int FLOAT = 6;
+
+    /**
+     * The sort of the <tt>long</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int LONG = 7;
+
+    /**
+     * The sort of the <tt>double</tt> type. See {@link #getSort getSort}.
+     */
+    public static final int DOUBLE = 8;
+
+    /**
+     * The sort of array reference types. See {@link #getSort getSort}.
+     */
+    public static final int ARRAY = 9;
+
+    /**
+     * The sort of object reference types. See {@link #getSort getSort}.
+     */
+    public static final int OBJECT = 10;
+
+    /**
+     * The sort of method types. See {@link #getSort getSort}.
+     */
+    public static final int METHOD = 11;
+
+    /**
+     * The <tt>void</tt> type.
+     */
+    public static final Type VOID_TYPE = new Type(VOID, null, ('V' << 24)
+            | (5 << 16) | (0 << 8) | 0, 1);
+
+    /**
+     * The <tt>boolean</tt> type.
+     */
+    public static final Type BOOLEAN_TYPE = new Type(BOOLEAN, null, ('Z' << 24)
+            | (0 << 16) | (5 << 8) | 1, 1);
+
+    /**
+     * The <tt>char</tt> type.
+     */
+    public static final Type CHAR_TYPE = new Type(CHAR, null, ('C' << 24)
+            | (0 << 16) | (6 << 8) | 1, 1);
+
+    /**
+     * The <tt>byte</tt> type.
+     */
+    public static final Type BYTE_TYPE = new Type(BYTE, null, ('B' << 24)
+            | (0 << 16) | (5 << 8) | 1, 1);
+
+    /**
+     * The <tt>short</tt> type.
+     */
+    public static final Type SHORT_TYPE = new Type(SHORT, null, ('S' << 24)
+            | (0 << 16) | (7 << 8) | 1, 1);
+
+    /**
+     * The <tt>int</tt> type.
+     */
+    public static final Type INT_TYPE = new Type(INT, null, ('I' << 24)
+            | (0 << 16) | (0 << 8) | 1, 1);
+
+    /**
+     * The <tt>float</tt> type.
+     */
+    public static final Type FLOAT_TYPE = new Type(FLOAT, null, ('F' << 24)
+            | (2 << 16) | (2 << 8) | 1, 1);
+
+    /**
+     * The <tt>long</tt> type.
+     */
+    public static final Type LONG_TYPE = new Type(LONG, null, ('J' << 24)
+            | (1 << 16) | (1 << 8) | 2, 1);
+
+    /**
+     * The <tt>double</tt> type.
+     */
+    public static final Type DOUBLE_TYPE = new Type(DOUBLE, null, ('D' << 24)
+            | (3 << 16) | (3 << 8) | 2, 1);
+
+    // ------------------------------------------------------------------------
+    // Fields
+    // ------------------------------------------------------------------------
+
+    /**
+     * The sort of this Java type.
+     */
+    private final int sort;
+
+    /**
+     * A buffer containing the internal name of this Java type. This field is
+     * only used for reference types.
+     */
+    private final char[] buf;
+
+    /**
+     * The offset of the internal name of this Java type in {@link #buf buf} or,
+     * for primitive types, the size, descriptor and getOpcode offsets for this
+     * type (byte 0 contains the size, byte 1 the descriptor, byte 2 the offset
+     * for IALOAD or IASTORE, byte 3 the offset for all other instructions).
+     */
+    private final int off;
+
+    /**
+     * The length of the internal name of this Java type.
+     */
+    private final int len;
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructs a reference type.
+     *
+     * @param sort the sort of the reference type to be constructed.
+     * @param buf a buffer containing the descriptor of the previous type.
+     * @param off the offset of this descriptor in the previous buffer.
+     * @param len the length of this descriptor.
+     */
+    private Type(final int sort, final char[] buf, final int off, final int len)
+    {
+        this.sort = sort;
+        this.buf = buf;
+        this.off = off;
+        this.len = len;
+    }
+
+    /**
+     * Returns the Java type corresponding to the given type descriptor.
+     *
+     * @param typeDescriptor a field or method type descriptor.
+     * @return the Java type corresponding to the given type descriptor.
+     */
+    public static Type getType(final String typeDescriptor) {
+        return getType(typeDescriptor.toCharArray(), 0);
+    }
+
+    /**
+     * Returns the Java type corresponding to the given internal name.
+     *
+     * @param internalName an internal name.
+     * @return the Java type corresponding to the given internal name.
+     */
+    public static Type getObjectType(final String internalName) {
+        char[] buf = internalName.toCharArray();
+        return new Type(buf[0] == '[' ? ARRAY : OBJECT, buf, 0, buf.length);
+    }
+
+    /**
+     * Returns the Java type corresponding to the given method descriptor.
+     * Equivalent to <code>Type.getType(methodDescriptor)</code>.
+     *
+     * @param methodDescriptor a method descriptor.
+     * @return the Java type corresponding to the given method descriptor.
+     */
+    public static Type getMethodType(final String methodDescriptor) {
+        return getType(methodDescriptor.toCharArray(), 0);
+    }
+
+    /**
+     * Returns the Java method type corresponding to the given argument and
+     * return types.
+     *
+     * @param returnType the return type of the method.
+     * @param argumentTypes the argument types of the method.
+     * @return the Java type corresponding to the given argument and return types.
+     */
+    public static Type getMethodType(final Type returnType, final Type... argumentTypes) {
+        return getType(getMethodDescriptor(returnType, argumentTypes));
+    }
+
+    /**
+     * Returns the Java type corresponding to the given class.
+     *
+     * @param c a class.
+     * @return the Java type corresponding to the given class.
+     */
+    public static Type getType(final Class<?> c) {
+        if (c.isPrimitive()) {
+            if (c == Integer.TYPE) {
+                return INT_TYPE;
+            } else if (c == Void.TYPE) {
+                return VOID_TYPE;
+            } else if (c == Boolean.TYPE) {
+                return BOOLEAN_TYPE;
+            } else if (c == Byte.TYPE) {
+                return BYTE_TYPE;
+            } else if (c == Character.TYPE) {
+                return CHAR_TYPE;
+            } else if (c == Short.TYPE) {
+                return SHORT_TYPE;
+            } else if (c == Double.TYPE) {
+                return DOUBLE_TYPE;
+            } else if (c == Float.TYPE) {
+                return FLOAT_TYPE;
+            } else /* if (c == Long.TYPE) */{
+                return LONG_TYPE;
+            }
+        } else {
+            return getType(getDescriptor(c));
+        }
+    }
+
+    /**
+     * Returns the Java method type corresponding to the given constructor.
+     *
+     * @param c a {@link Constructor Constructor} object.
+     * @return the Java method type corresponding to the given constructor.
+     */
+    public static Type getType(final Constructor<?> c) {
+        return getType(getConstructorDescriptor(c));
+    }
+
+    /**
+     * Returns the Java method type corresponding to the given method.
+     *
+     * @param m a {@link Method Method} object.
+     * @return the Java method type corresponding to the given method.
+     */
+    public static Type getType(final Method m) {
+        return getType(getMethodDescriptor(m));
+    }
+
+    /**
+     * Returns the Java types corresponding to the argument types of the given
+     * method descriptor.
+     *
+     * @param methodDescriptor a method descriptor.
+     * @return the Java types corresponding to the argument types of the given
+     *         method descriptor.
+     */
+    public static Type[] getArgumentTypes(final String methodDescriptor) {
+        char[] buf = methodDescriptor.toCharArray();
+        int off = 1;
+        int size = 0;
+        while (true) {
+            char car = buf[off++];
+            if (car == ')') {
+                break;
+            } else if (car == 'L') {
+                while (buf[off++] != ';') {
+                }
+                ++size;
+            } else if (car != '[') {
+                ++size;
+            }
+        }
+        Type[] args = new Type[size];
+        off = 1;
+        size = 0;
+        while (buf[off] != ')') {
+            args[size] = getType(buf, off);
+            off += args[size].len + (args[size].sort == OBJECT ? 2 : 0);
+            size += 1;
+        }
+        return args;
+    }
+
+    /**
+     * Returns the Java types corresponding to the argument types of the given
+     * method.
+     *
+     * @param method a method.
+     * @return the Java types corresponding to the argument types of the given
+     *         method.
+     */
+    public static Type[] getArgumentTypes(final Method method) {
+        Class<?>[] classes = method.getParameterTypes();
+        Type[] types = new Type[classes.length];
+        for (int i = classes.length - 1; i >= 0; --i) {
+            types[i] = getType(classes[i]);
+        }
+        return types;
+    }
+
+    /**
+     * Returns the Java type corresponding to the return type of the given
+     * method descriptor.
+     *
+     * @param methodDescriptor a method descriptor.
+     * @return the Java type corresponding to the return type of the given
+     *         method descriptor.
+     */
+    public static Type getReturnType(final String methodDescriptor) {
+        char[] buf = methodDescriptor.toCharArray();
+        return getType(buf, methodDescriptor.indexOf(')') + 1);
+    }
+
+    /**
+     * Returns the Java type corresponding to the return type of the given
+     * method.
+     *
+     * @param method a method.
+     * @return the Java type corresponding to the return type of the given
+     *         method.
+     */
+    public static Type getReturnType(final Method method) {
+        return getType(method.getReturnType());
+    }
+
+    /**
+     * Computes the size of the arguments and of the return value of a method.
+     *
+     * @param desc the descriptor of a method.
+     * @return the size of the arguments of the method (plus one for the
+     *         implicit this argument), argSize, and the size of its return
+     *         value, retSize, packed into a single int i =
+     *         <tt>(argSize << 2) | retSize</tt> (argSize is therefore equal
+     *         to <tt>i >> 2</tt>, and retSize to <tt>i & 0x03</tt>).
+     */
+    public static int getArgumentsAndReturnSizes(final String desc) {
+        int n = 1;
+        int c = 1;
+        while (true) {
+            char car = desc.charAt(c++);
+            if (car == ')') {
+                car = desc.charAt(c);
+                return n << 2
+                        | (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
+            } else if (car == 'L') {
+                while (desc.charAt(c++) != ';') {
+                }
+                n += 1;
+            } else if (car == '[') {
+                while ((car = desc.charAt(c)) == '[') {
+                    ++c;
+                }
+                if (car == 'D' || car == 'J') {
+                    n -= 1;
+                }
+            } else if (car == 'D' || car == 'J') {
+                n += 2;
+            } else {
+                n += 1;
+            }
+        }
+    }
+
+    /**
+     * Returns the Java type corresponding to the given type descriptor. For
+     * method descriptors, buf is supposed to contain nothing more than the
+     * descriptor itself.
+     *
+     * @param buf a buffer containing a type descriptor.
+     * @param off the offset of this descriptor in the previous buffer.
+     * @return the Java type corresponding to the given type descriptor.
+     */
+    private static Type getType(final char[] buf, final int off) {
+        int len;
+        switch (buf[off]) {
+            case 'V':
+                return VOID_TYPE;
+            case 'Z':
+                return BOOLEAN_TYPE;
+            case 'C':
+                return CHAR_TYPE;
+            case 'B':
+                return BYTE_TYPE;
+            case 'S':
+                return SHORT_TYPE;
+            case 'I':
+                return INT_TYPE;
+            case 'F':
+                return FLOAT_TYPE;
+            case 'J':
+                return LONG_TYPE;
+            case 'D':
+                return DOUBLE_TYPE;
+            case '[':
+                len = 1;
+                while (buf[off + len] == '[') {
+                    ++len;
+                }
+                if (buf[off + len] == 'L') {
+                    ++len;
+                    while (buf[off + len] != ';') {
+                        ++len;
+                    }
+                }
+                return new Type(ARRAY, buf, off, len + 1);
+            case 'L':
+                len = 1;
+                while (buf[off + len] != ';') {
+                    ++len;
+                }
+                return new Type(OBJECT, buf, off + 1, len - 1);
+            // case '(':
+            default:
+                return new Type(METHOD, buf, 0, buf.length);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Accessors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the sort of this Java type.
+     *
+     * @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN},
+     *         {@link #CHAR CHAR}, {@link #BYTE BYTE}, {@link #SHORT SHORT},
+     *         {@link #INT INT}, {@link #FLOAT FLOAT}, {@link #LONG LONG},
+     *         {@link #DOUBLE DOUBLE}, {@link #ARRAY ARRAY},
+     *         {@link #OBJECT OBJECT} or {@link #METHOD METHOD}.
+     */
+    public int getSort() {
+        return sort;
+    }
+
+    /**
+     * Returns the number of dimensions of this array type. This method should
+     * only be used for an array type.
+     *
+     * @return the number of dimensions of this array type.
+     */
+    public int getDimensions() {
+        int i = 1;
+        while (buf[off + i] == '[') {
+            ++i;
+        }
+        return i;
+    }
+
+    /**
+     * Returns the type of the elements of this array type. This method should
+     * only be used for an array type.
+     *
+     * @return Returns the type of the elements of this array type.
+     */
+    public Type getElementType() {
+        return getType(buf, off + getDimensions());
+    }
+
+    /**
+     * Returns the binary name of the class corresponding to this type. This
+     * method must not be used on method types.
+     *
+     * @return the binary name of the class corresponding to this type.
+     */
+    public String getClassName() {
+        switch (sort) {
+            case VOID:
+                return "void";
+            case BOOLEAN:
+                return "boolean";
+            case CHAR:
+                return "char";
+            case BYTE:
+                return "byte";
+            case SHORT:
+                return "short";
+            case INT:
+                return "int";
+            case FLOAT:
+                return "float";
+            case LONG:
+                return "long";
+            case DOUBLE:
+                return "double";
+            case ARRAY:
+                StringBuffer b = new StringBuffer(getElementType().getClassName());
+                for (int i = getDimensions(); i > 0; --i) {
+                    b.append("[]");
+                }
+                return b.toString();
+            case OBJECT:
+                return new String(buf, off, len).replace('/', '.');
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * Returns the internal name of the class corresponding to this object or
+     * array type. The internal name of a class is its fully qualified name (as
+     * returned by Class.getName(), where '.' are replaced by '/'. This method
+     * should only be used for an object or array type.
+     *
+     * @return the internal name of the class corresponding to this object type.
+     */
+    public String getInternalName() {
+        return new String(buf, off, len);
+    }
+
+    /**
+     * Returns the argument types of methods of this type. This method should
+     * only be used for method types.
+     *
+     * @return the argument types of methods of this type.
+     */
+    public Type[] getArgumentTypes() {
+        return getArgumentTypes(getDescriptor());
+    }
+
+    /**
+     * Returns the return type of methods of this type. This method should only
+     * be used for method types.
+     *
+     * @return the return type of methods of this type.
+     */
+    public Type getReturnType() {
+        return getReturnType(getDescriptor());
+    }
+
+    /**
+     * Returns the size of the arguments and of the return value of methods of
+     * this type. This method should only be used for method types.
+     *
+     * @return the size of the arguments (plus one for the implicit this
+     *         argument), argSize, and the size of the return value, retSize,
+     *         packed into a single int i = <tt>(argSize << 2) | retSize</tt>
+     *         (argSize is therefore equal to <tt>i >> 2</tt>, and retSize to
+     *         <tt>i & 0x03</tt>).
+     */
+    public int getArgumentsAndReturnSizes() {
+        return getArgumentsAndReturnSizes(getDescriptor());
+    }
+
+    // ------------------------------------------------------------------------
+    // Conversion to type descriptors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the descriptor corresponding to this Java type.
+     *
+     * @return the descriptor corresponding to this Java type.
+     */
+    public String getDescriptor() {
+        StringBuffer buf = new StringBuffer();
+        getDescriptor(buf);
+        return buf.toString();
+    }
+
+    /**
+     * Returns the descriptor corresponding to the given argument and return
+     * types.
+     *
+     * @param returnType the return type of the method.
+     * @param argumentTypes the argument types of the method.
+     * @return the descriptor corresponding to the given argument and return
+     *         types.
+     */
+    public static String getMethodDescriptor(
+        final Type returnType,
+        final Type... argumentTypes)
+    {
+        StringBuffer buf = new StringBuffer();
+        buf.append('(');
+        for (int i = 0; i < argumentTypes.length; ++i) {
+            argumentTypes[i].getDescriptor(buf);
+        }
+        buf.append(')');
+        returnType.getDescriptor(buf);
+        return buf.toString();
+    }
+
+    /**
+     * Appends the descriptor corresponding to this Java type to the given
+     * string buffer.
+     *
+     * @param buf the string buffer to which the descriptor must be appended.
+     */
+    private void getDescriptor(final StringBuffer buf) {
+        if (this.buf == null) {
+            // descriptor is in byte 3 of 'off' for primitive types (buf == null)
+            buf.append((char) ((off & 0xFF000000) >>> 24));
+        } else if (sort == OBJECT) {
+            buf.append('L');
+            buf.append(this.buf, off, len);
+            buf.append(';');
+        } else { // sort == ARRAY || sort == METHOD
+            buf.append(this.buf, off, len);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Direct conversion from classes to type descriptors,
+    // without intermediate Type objects
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the internal name of the given class. The internal name of a
+     * class is its fully qualified name, as returned by Class.getName(), where
+     * '.' are replaced by '/'.
+     *
+     * @param c an object or array class.
+     * @return the internal name of the given class.
+     */
+    public static String getInternalName(final Class<?> c) {
+        return c.getName().replace('.', '/');
+    }
+
+    /**
+     * Returns the descriptor corresponding to the given Java type.
+     *
+     * @param c an object class, a primitive class or an array class.
+     * @return the descriptor corresponding to the given class.
+     */
+    public static String getDescriptor(final Class<?> c) {
+        StringBuffer buf = new StringBuffer();
+        getDescriptor(buf, c);
+        return buf.toString();
+    }
+
+    /**
+     * Returns the descriptor corresponding to the given constructor.
+     *
+     * @param c a {@link Constructor Constructor} object.
+     * @return the descriptor of the given constructor.
+     */
+    public static String getConstructorDescriptor(final Constructor<?> c) {
+        Class<?>[] parameters = c.getParameterTypes();
+        StringBuffer buf = new StringBuffer();
+        buf.append('(');
+        for (int i = 0; i < parameters.length; ++i) {
+            getDescriptor(buf, parameters[i]);
+        }
+        return buf.append(")V").toString();
+    }
+
+    /**
+     * Returns the descriptor corresponding to the given method.
+     *
+     * @param m a {@link Method Method} object.
+     * @return the descriptor of the given method.
+     */
+    public static String getMethodDescriptor(final Method m) {
+        Class<?>[] parameters = m.getParameterTypes();
+        StringBuffer buf = new StringBuffer();
+        buf.append('(');
+        for (int i = 0; i < parameters.length; ++i) {
+            getDescriptor(buf, parameters[i]);
+        }
+        buf.append(')');
+        getDescriptor(buf, m.getReturnType());
+        return buf.toString();
+    }
+
+    /**
+     * Appends the descriptor of the given class to the given string buffer.
+     *
+     * @param buf the string buffer to which the descriptor must be appended.
+     * @param c the class whose descriptor must be computed.
+     */
+    private static void getDescriptor(final StringBuffer buf, final Class<?> c) {
+        Class<?> d = c;
+        while (true) {
+            if (d.isPrimitive()) {
+                char car;
+                if (d == Integer.TYPE) {
+                    car = 'I';
+                } else if (d == Void.TYPE) {
+                    car = 'V';
+                } else if (d == Boolean.TYPE) {
+                    car = 'Z';
+                } else if (d == Byte.TYPE) {
+                    car = 'B';
+                } else if (d == Character.TYPE) {
+                    car = 'C';
+                } else if (d == Short.TYPE) {
+                    car = 'S';
+                } else if (d == Double.TYPE) {
+                    car = 'D';
+                } else if (d == Float.TYPE) {
+                    car = 'F';
+                } else /* if (d == Long.TYPE) */{
+                    car = 'J';
+                }
+                buf.append(car);
+                return;
+            } else if (d.isArray()) {
+                buf.append('[');
+                d = d.getComponentType();
+            } else {
+                buf.append('L');
+                String name = d.getName();
+                int len = name.length();
+                for (int i = 0; i < len; ++i) {
+                    char car = name.charAt(i);
+                    buf.append(car == '.' ? '/' : car);
+                }
+                buf.append(';');
+                return;
+            }
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Corresponding size and opcodes
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the size of values of this type. This method must not be used for
+     * method types.
+     *
+     * @return the size of values of this type, i.e., 2 for <tt>long</tt> and
+     *         <tt>double</tt>, 0 for <tt>void</tt> and 1 otherwise.
+     */
+    public int getSize() {
+        // the size is in byte 0 of 'off' for primitive types (buf == null)
+        return buf == null ? (off & 0xFF) : 1;
+    }
+
+    /**
+     * Returns a JVM instruction opcode adapted to this Java type. This method
+     * must not be used for method types.
+     *
+     * @param opcode a JVM instruction opcode. This opcode must be one of ILOAD,
+     *        ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL,
+     *        ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
+     * @return an opcode that is similar to the given opcode, but adapted to
+     *         this Java type. For example, if this type is <tt>float</tt> and
+     *         <tt>opcode</tt> is IRETURN, this method returns FRETURN.
+     */
+    public int getOpcode(final int opcode) {
+        if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
+            // the offset for IALOAD or IASTORE is in byte 1 of 'off' for
+            // primitive types (buf == null)
+            return opcode + (buf == null ? (off & 0xFF00) >> 8 : 4);
+        } else {
+            // the offset for other instructions is in byte 2 of 'off' for
+            // primitive types (buf == null)
+            return opcode + (buf == null ? (off & 0xFF0000) >> 16 : 4);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Equals, hashCode and toString
+    // ------------------------------------------------------------------------
+
+    /**
+     * Tests if the given object is equal to this type.
+     *
+     * @param o the object to be compared to this type.
+     * @return <tt>true</tt> if the given object is equal to this type.
+     */
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof Type)) {
+            return false;
+        }
+        Type t = (Type) o;
+        if (sort != t.sort) {
+            return false;
+        }
+        if (sort >= ARRAY) {
+            if (len != t.len) {
+                return false;
+            }
+            for (int i = off, j = t.off, end = i + len; i < end; i++, j++) {
+                if (buf[i] != t.buf[j]) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Returns a hash code value for this type.
+     *
+     * @return a hash code value for this type.
+     */
+    @Override
+    public int hashCode() {
+        int hc = 13 * sort;
+        if (sort >= ARRAY) {
+            for (int i = off, end = i + len; i < end; i++) {
+                hc = 17 * (hc + buf[i]);
+            }
+        }
+        return hc;
+    }
+
+    /**
+     * Returns a string representation of this type.
+     *
+     * @return the descriptor of this type.
+     */
+    @Override
+    public String toString() {
+        return getDescriptor();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/AdviceAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,694 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link jdk.internal.org.objectweb.asm.MethodVisitor} to insert before, after and around
+ * advices in methods and constructors. <p> The behavior for constructors is
+ * like this: <ol>
+ *
+ * <li>as long as the INVOKESPECIAL for the object initialization has not been
+ * reached, every bytecode instruction is dispatched in the ctor code visitor</li>
+ *
+ * <li>when this one is reached, it is only added in the ctor code visitor and
+ * a JP invoke is added</li>
+ *
+ * <li>after that, only the other code visitor receives the instructions</li>
+ *
+ * </ol>
+ *
+ * @author Eugene Kuleshov
+ * @author Eric Bruneton
+ */
+public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
+{
+
+    private static final Object THIS = new Object();
+
+    private static final Object OTHER = new Object();
+
+    protected int methodAccess;
+
+    protected String methodDesc;
+
+    private boolean constructor;
+
+    private boolean superInitialized;
+
+    private List<Object> stackFrame;
+
+    private Map<Label, List<Object>> branches;
+
+    /**
+     * Creates a new {@link AdviceAdapter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param mv the method visitor to which this adapter delegates calls.
+     * @param access the method's access flags (see {@link Opcodes}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     */
+    protected AdviceAdapter(
+        final int api,
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc)
+    {
+        super(api, mv, access, name, desc);
+        methodAccess = access;
+        methodDesc = desc;
+        constructor = "<init>".equals(name);
+    }
+
+    @Override
+    public void visitCode() {
+        mv.visitCode();
+        if (constructor) {
+            stackFrame = new ArrayList<Object>();
+            branches = new HashMap<Label, List<Object>>();
+        } else {
+            superInitialized = true;
+            onMethodEnter();
+        }
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        mv.visitLabel(label);
+        if (constructor && branches != null) {
+            List<Object> frame = branches.get(label);
+            if (frame != null) {
+                stackFrame = frame;
+                branches.remove(label);
+            }
+        }
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        if (constructor) {
+            int s;
+            switch (opcode) {
+                case RETURN: // empty stack
+                    onMethodExit(opcode);
+                    break;
+
+                case IRETURN: // 1 before n/a after
+                case FRETURN: // 1 before n/a after
+                case ARETURN: // 1 before n/a after
+                case ATHROW: // 1 before n/a after
+                    popValue();
+                    onMethodExit(opcode);
+                    break;
+
+                case LRETURN: // 2 before n/a after
+                case DRETURN: // 2 before n/a after
+                    popValue();
+                    popValue();
+                    onMethodExit(opcode);
+                    break;
+
+                case NOP:
+                case LALOAD: // remove 2 add 2
+                case DALOAD: // remove 2 add 2
+                case LNEG:
+                case DNEG:
+                case FNEG:
+                case INEG:
+                case L2D:
+                case D2L:
+                case F2I:
+                case I2B:
+                case I2C:
+                case I2S:
+                case I2F:
+                case ARRAYLENGTH:
+                    break;
+
+                case ACONST_NULL:
+                case ICONST_M1:
+                case ICONST_0:
+                case ICONST_1:
+                case ICONST_2:
+                case ICONST_3:
+                case ICONST_4:
+                case ICONST_5:
+                case FCONST_0:
+                case FCONST_1:
+                case FCONST_2:
+                case F2L: // 1 before 2 after
+                case F2D:
+                case I2L:
+                case I2D:
+                    pushValue(OTHER);
+                    break;
+
+                case LCONST_0:
+                case LCONST_1:
+                case DCONST_0:
+                case DCONST_1:
+                    pushValue(OTHER);
+                    pushValue(OTHER);
+                    break;
+
+                case IALOAD: // remove 2 add 1
+                case FALOAD: // remove 2 add 1
+                case AALOAD: // remove 2 add 1
+                case BALOAD: // remove 2 add 1
+                case CALOAD: // remove 2 add 1
+                case SALOAD: // remove 2 add 1
+                case POP:
+                case IADD:
+                case FADD:
+                case ISUB:
+                case LSHL: // 3 before 2 after
+                case LSHR: // 3 before 2 after
+                case LUSHR: // 3 before 2 after
+                case L2I: // 2 before 1 after
+                case L2F: // 2 before 1 after
+                case D2I: // 2 before 1 after
+                case D2F: // 2 before 1 after
+                case FSUB:
+                case FMUL:
+                case FDIV:
+                case FREM:
+                case FCMPL: // 2 before 1 after
+                case FCMPG: // 2 before 1 after
+                case IMUL:
+                case IDIV:
+                case IREM:
+                case ISHL:
+                case ISHR:
+                case IUSHR:
+                case IAND:
+                case IOR:
+                case IXOR:
+                case MONITORENTER:
+                case MONITOREXIT:
+                    popValue();
+                    break;
+
+                case POP2:
+                case LSUB:
+                case LMUL:
+                case LDIV:
+                case LREM:
+                case LADD:
+                case LAND:
+                case LOR:
+                case LXOR:
+                case DADD:
+                case DMUL:
+                case DSUB:
+                case DDIV:
+                case DREM:
+                    popValue();
+                    popValue();
+                    break;
+
+                case IASTORE:
+                case FASTORE:
+                case AASTORE:
+                case BASTORE:
+                case CASTORE:
+                case SASTORE:
+                case LCMP: // 4 before 1 after
+                case DCMPL:
+                case DCMPG:
+                    popValue();
+                    popValue();
+                    popValue();
+                    break;
+
+                case LASTORE:
+                case DASTORE:
+                    popValue();
+                    popValue();
+                    popValue();
+                    popValue();
+                    break;
+
+                case DUP:
+                    pushValue(peekValue());
+                    break;
+
+                case DUP_X1:
+                    s = stackFrame.size();
+                    stackFrame.add(s - 2, stackFrame.get(s - 1));
+                    break;
+
+                case DUP_X2:
+                    s = stackFrame.size();
+                    stackFrame.add(s - 3, stackFrame.get(s - 1));
+                    break;
+
+                case DUP2:
+                    s = stackFrame.size();
+                    stackFrame.add(s - 2, stackFrame.get(s - 1));
+                    stackFrame.add(s - 2, stackFrame.get(s - 1));
+                    break;
+
+                case DUP2_X1:
+                    s = stackFrame.size();
+                    stackFrame.add(s - 3, stackFrame.get(s - 1));
+                    stackFrame.add(s - 3, stackFrame.get(s - 1));
+                    break;
+
+                case DUP2_X2:
+                    s = stackFrame.size();
+                    stackFrame.add(s - 4, stackFrame.get(s - 1));
+                    stackFrame.add(s - 4, stackFrame.get(s - 1));
+                    break;
+
+                case SWAP:
+                    s = stackFrame.size();
+                    stackFrame.add(s - 2, stackFrame.get(s - 1));
+                    stackFrame.remove(s);
+                    break;
+            }
+        } else {
+            switch (opcode) {
+                case RETURN:
+                case IRETURN:
+                case FRETURN:
+                case ARETURN:
+                case LRETURN:
+                case DRETURN:
+                case ATHROW:
+                    onMethodExit(opcode);
+                    break;
+            }
+        }
+        mv.visitInsn(opcode);
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        super.visitVarInsn(opcode, var);
+        if (constructor) {
+            switch (opcode) {
+                case ILOAD:
+                case FLOAD:
+                    pushValue(OTHER);
+                    break;
+                case LLOAD:
+                case DLOAD:
+                    pushValue(OTHER);
+                    pushValue(OTHER);
+                    break;
+                case ALOAD:
+                    pushValue(var == 0 ? THIS : OTHER);
+                    break;
+                case ASTORE:
+                case ISTORE:
+                case FSTORE:
+                    popValue();
+                    break;
+                case LSTORE:
+                case DSTORE:
+                    popValue();
+                    popValue();
+                    break;
+            }
+        }
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitFieldInsn(opcode, owner, name, desc);
+        if (constructor) {
+            char c = desc.charAt(0);
+            boolean longOrDouble = c == 'J' || c == 'D';
+            switch (opcode) {
+                case GETSTATIC:
+                    pushValue(OTHER);
+                    if (longOrDouble) {
+                        pushValue(OTHER);
+                    }
+                    break;
+                case PUTSTATIC:
+                    popValue();
+                    if (longOrDouble) {
+                        popValue();
+                    }
+                    break;
+                case PUTFIELD:
+                    popValue();
+                    if (longOrDouble) {
+                        popValue();
+                        popValue();
+                    }
+                    break;
+                // case GETFIELD:
+                default:
+                    if (longOrDouble) {
+                        pushValue(OTHER);
+                    }
+            }
+        }
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        mv.visitIntInsn(opcode, operand);
+        if (constructor && opcode != NEWARRAY) {
+            pushValue(OTHER);
+        }
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        mv.visitLdcInsn(cst);
+        if (constructor) {
+            pushValue(OTHER);
+            if (cst instanceof Double || cst instanceof Long) {
+                pushValue(OTHER);
+            }
+        }
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        mv.visitMultiANewArrayInsn(desc, dims);
+        if (constructor) {
+            for (int i = 0; i < dims; i++) {
+                popValue();
+            }
+            pushValue(OTHER);
+        }
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        mv.visitTypeInsn(opcode, type);
+        // ANEWARRAY, CHECKCAST or INSTANCEOF don't change stack
+        if (constructor && opcode == NEW) {
+            pushValue(OTHER);
+        }
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitMethodInsn(opcode, owner, name, desc);
+        if (constructor) {
+            Type[] types = Type.getArgumentTypes(desc);
+            for (int i = 0; i < types.length; i++) {
+                popValue();
+                if (types[i].getSize() == 2) {
+                    popValue();
+                }
+            }
+            switch (opcode) {
+                // case INVOKESTATIC:
+                // break;
+
+                case INVOKEINTERFACE:
+                case INVOKEVIRTUAL:
+                    popValue(); // objectref
+                    break;
+
+                case INVOKESPECIAL:
+                    Object type = popValue(); // objectref
+                    if (type == THIS && !superInitialized) {
+                        onMethodEnter();
+                        superInitialized = true;
+                        // once super has been initialized it is no longer
+                        // necessary to keep track of stack state
+                        constructor = false;
+                    }
+                    break;
+            }
+
+            Type returnType = Type.getReturnType(desc);
+            if (returnType != Type.VOID_TYPE) {
+                pushValue(OTHER);
+                if (returnType.getSize() == 2) {
+                    pushValue(OTHER);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+        if (constructor) {
+            Type[] types = Type.getArgumentTypes(desc);
+            for (int i = 0; i < types.length; i++) {
+                popValue();
+                if (types[i].getSize() == 2) {
+                    popValue();
+                }
+            }
+
+            Type returnType = Type.getReturnType(desc);
+            if (returnType != Type.VOID_TYPE) {
+                pushValue(OTHER);
+                if (returnType.getSize() == 2) {
+                    pushValue(OTHER);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        mv.visitJumpInsn(opcode, label);
+        if (constructor) {
+            switch (opcode) {
+                case IFEQ:
+                case IFNE:
+                case IFLT:
+                case IFGE:
+                case IFGT:
+                case IFLE:
+                case IFNULL:
+                case IFNONNULL:
+                    popValue();
+                    break;
+
+                case IF_ICMPEQ:
+                case IF_ICMPNE:
+                case IF_ICMPLT:
+                case IF_ICMPGE:
+                case IF_ICMPGT:
+                case IF_ICMPLE:
+                case IF_ACMPEQ:
+                case IF_ACMPNE:
+                    popValue();
+                    popValue();
+                    break;
+
+                case JSR:
+                    pushValue(OTHER);
+                    break;
+            }
+            addBranch(label);
+        }
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        mv.visitLookupSwitchInsn(dflt, keys, labels);
+        if (constructor) {
+            popValue();
+            addBranches(dflt, labels);
+        }
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        mv.visitTableSwitchInsn(min, max, dflt, labels);
+        if (constructor) {
+            popValue();
+            addBranches(dflt, labels);
+        }
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        Label start,
+        Label end,
+        Label handler,
+        String type)
+    {
+        super.visitTryCatchBlock(start, end, handler, type);
+        if (constructor && !branches.containsKey(handler)) {
+            List<Object> stackFrame = new ArrayList<Object>();
+            stackFrame.add(OTHER);
+            branches.put(handler, stackFrame);
+        }
+    }
+
+    private void addBranches(final Label dflt, final Label[] labels) {
+        addBranch(dflt);
+        for (int i = 0; i < labels.length; i++) {
+            addBranch(labels[i]);
+        }
+    }
+
+    private void addBranch(final Label label) {
+        if (branches.containsKey(label)) {
+            return;
+        }
+        branches.put(label, new ArrayList<Object>(stackFrame));
+    }
+
+    private Object popValue() {
+        return stackFrame.remove(stackFrame.size() - 1);
+    }
+
+    private Object peekValue() {
+        return stackFrame.get(stackFrame.size() - 1);
+    }
+
+    private void pushValue(final Object o) {
+        stackFrame.add(o);
+    }
+
+    /**
+     * Called at the beginning of the method or after super class class call in
+     * the constructor. <br><br>
+     *
+     * <i>Custom code can use or change all the local variables, but should not
+     * change state of the stack.</i>
+     */
+    protected void onMethodEnter() {
+    }
+
+    /**
+     * Called before explicit exit from the method using either return or throw.
+     * Top element on the stack contains the return value or exception instance.
+     * For example:
+     *
+     * <pre>
+     *   public void onMethodExit(int opcode) {
+     *     if(opcode==RETURN) {
+     *         visitInsn(ACONST_NULL);
+     *     } else if(opcode==ARETURN || opcode==ATHROW) {
+     *         dup();
+     *     } else {
+     *         if(opcode==LRETURN || opcode==DRETURN) {
+     *             dup2();
+     *         } else {
+     *             dup();
+     *         }
+     *         box(Type.getReturnType(this.methodDesc));
+     *     }
+     *     visitIntInsn(SIPUSH, opcode);
+     *     visitMethodInsn(INVOKESTATIC, owner, "onExit", "(Ljava/lang/Object;I)V");
+     *   }
+     *
+     *   // an actual call back method
+     *   public static void onExit(Object param, int opcode) {
+     *     ...
+     * </pre>
+     *
+     * <br><br>
+     *
+     * <i>Custom code can use or change all the local variables, but should not
+     * change state of the stack.</i>
+     *
+     * @param opcode one of the RETURN, IRETURN, FRETURN, ARETURN, LRETURN,
+     *        DRETURN or ATHROW
+     *
+     */
+    protected void onMethodExit(int opcode) {
+    }
+
+    // TODO onException, onMethodCall
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/AnalyzerAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,975 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link MethodVisitor} that keeps track of stack map frame changes between
+ * {@link #visitFrame(int, int, Object[], int, Object[]) visitFrame} calls. This
+ * adapter must be used with the
+ * {@link jdk.internal.org.objectweb.asm.ClassReader#EXPAND_FRAMES} option. Each visit<i>X</i>
+ * instruction delegates to the next visitor in the chain, if any, and then
+ * simulates the effect of this instruction on the stack map frame, represented
+ * by {@link #locals} and {@link #stack}. The next visitor in the chain can get
+ * the state of the stack map frame <i>before</i> each instruction by reading
+ * the value of these fields in its visit<i>X</i> methods (this requires a
+ * reference to the AnalyzerAdapter that is before it in the chain).
+ * If this adapter is used with a class that does not contain stack map table
+ * attributes (i.e., pre Java 6 classes) then this adapter may not be able to
+ * compute the stack map frame for each instruction. In this case no exception
+ * is thrown but the {@link #locals} and {@link #stack} fields will be null for
+ * these instructions.
+ *
+ * @author Eric Bruneton
+ */
+public class AnalyzerAdapter extends MethodVisitor {
+
+    /**
+     * <code>List</code> of the local variable slots for current execution
+     * frame. Primitive types are represented by {@link Opcodes#TOP},
+     * {@link Opcodes#INTEGER}, {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
+     * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
+     * {@link Opcodes#UNINITIALIZED_THIS} (long and double are represented by a
+     * two elements, the second one being TOP). Reference types are represented
+     * by String objects (representing internal names), and uninitialized types
+     * by Label objects (this label designates the NEW instruction that created
+     * this uninitialized value). This field is <tt>null</tt> for unreacheable
+     * instructions.
+     */
+    public List<Object> locals;
+
+    /**
+     * <code>List</code> of the operand stack slots for current execution
+     * frame. Primitive types are represented by {@link Opcodes#TOP},
+     * {@link Opcodes#INTEGER}, {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
+     * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
+     * {@link Opcodes#UNINITIALIZED_THIS} (long and double are represented by a
+     * two elements, the second one being TOP). Reference types are represented
+     * by String objects (representing internal names), and uninitialized types
+     * by Label objects (this label designates the NEW instruction that created
+     * this uninitialized value). This field is <tt>null</tt> for unreacheable
+     * instructions.
+     */
+    public List<Object> stack;
+
+    /**
+     * The labels that designate the next instruction to be visited. May be
+     * <tt>null</tt>.
+     */
+    private List<Label> labels;
+
+    /**
+     * Information about uninitialized types in the current execution frame.
+     * This map associates internal names to Label objects. Each label
+     * designates a NEW instruction that created the currently uninitialized
+     * types, and the associated internal name represents the NEW operand, i.e.
+     * the final, initialized type value.
+     */
+    public Map<Object,Object> uninitializedTypes;
+
+    /**
+     * The maximum stack size of this method.
+     */
+    private int maxStack;
+
+    /**
+     * The maximum number of local variables of this method.
+     */
+    private int maxLocals;
+
+    /**
+     * The owner's class name.
+     */
+    private String owner;
+
+    /**
+     * Creates a new {@link AnalyzerAdapter}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #AnalyzerAdapter(int, String, int, String, String, MethodVisitor)}
+     * version.
+     *
+     * @param owner the owner's class name.
+     * @param access the method's access flags (see {@link Opcodes}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param mv the method visitor to which this adapter delegates calls. May
+     *        be <tt>null</tt>.
+     */
+    public AnalyzerAdapter(
+        final String owner,
+        final int access,
+        final String name,
+        final String desc,
+        final MethodVisitor mv)
+    {
+        this(Opcodes.ASM4, owner, access, name, desc, mv);
+    }
+
+    /**
+     * Creates a new {@link AnalyzerAdapter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param owner the owner's class name.
+     * @param access the method's access flags (see {@link Opcodes}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param mv the method visitor to which this adapter delegates calls. May
+     *        be <tt>null</tt>.
+     */
+    protected AnalyzerAdapter(
+        final int api,
+        final String owner,
+        final int access,
+        final String name,
+        final String desc,
+        final MethodVisitor mv)
+    {
+        super(api, mv);
+        this.owner = owner;
+        locals = new ArrayList<Object>();
+        stack = new ArrayList<Object>();
+        uninitializedTypes = new HashMap<Object, Object>();
+
+        if ((access & Opcodes.ACC_STATIC) == 0) {
+            if ("<init>".equals(name)) {
+                locals.add(Opcodes.UNINITIALIZED_THIS);
+            } else {
+                locals.add(owner);
+            }
+        }
+        Type[] types = Type.getArgumentTypes(desc);
+        for (int i = 0; i < types.length; ++i) {
+            Type type = types[i];
+            switch (type.getSort()) {
+                case Type.BOOLEAN:
+                case Type.CHAR:
+                case Type.BYTE:
+                case Type.SHORT:
+                case Type.INT:
+                    locals.add(Opcodes.INTEGER);
+                    break;
+                case Type.FLOAT:
+                    locals.add(Opcodes.FLOAT);
+                    break;
+                case Type.LONG:
+                    locals.add(Opcodes.LONG);
+                    locals.add(Opcodes.TOP);
+                    break;
+                case Type.DOUBLE:
+                    locals.add(Opcodes.DOUBLE);
+                    locals.add(Opcodes.TOP);
+                    break;
+                case Type.ARRAY:
+                    locals.add(types[i].getDescriptor());
+                    break;
+                // case Type.OBJECT:
+                default:
+                    locals.add(types[i].getInternalName());
+            }
+        }
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        if (type != Opcodes.F_NEW) { // uncompressed frame
+            throw new IllegalStateException("ClassReader.accept() should be called with EXPAND_FRAMES flag");
+        }
+
+        if (mv != null) {
+            mv.visitFrame(type, nLocal, local, nStack, stack);
+        }
+
+        if (this.locals != null) {
+            this.locals.clear();
+            this.stack.clear();
+        } else {
+            this.locals = new ArrayList<Object>();
+            this.stack = new ArrayList<Object>();
+        }
+        visitFrameTypes(nLocal, local, this.locals);
+        visitFrameTypes(nStack, stack, this.stack);
+        maxStack = Math.max(maxStack, this.stack.size());
+    }
+
+    private static void visitFrameTypes(
+        final int n,
+        final Object[] types,
+        final List<Object> result)
+    {
+        for (int i = 0; i < n; ++i) {
+            Object type = types[i];
+            result.add(type);
+            if (type == Opcodes.LONG || type == Opcodes.DOUBLE) {
+                result.add(Opcodes.TOP);
+            }
+        }
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        if (mv != null) {
+            mv.visitInsn(opcode);
+        }
+        execute(opcode, 0, null);
+        if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
+                || opcode == Opcodes.ATHROW)
+        {
+            this.locals = null;
+            this.stack = null;
+        }
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        if (mv != null) {
+            mv.visitIntInsn(opcode, operand);
+        }
+        execute(opcode, operand, null);
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        if (mv != null) {
+            mv.visitVarInsn(opcode, var);
+        }
+        execute(opcode, var, null);
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        if (opcode == Opcodes.NEW) {
+            if (labels == null) {
+                Label l = new Label();
+                labels = new ArrayList<Label>(3);
+                labels.add(l);
+                if (mv != null) {
+                    mv.visitLabel(l);
+                }
+            }
+            for (int i = 0; i < labels.size(); ++i) {
+                uninitializedTypes.put(labels.get(i), type);
+            }
+        }
+        if (mv != null) {
+            mv.visitTypeInsn(opcode, type);
+        }
+        execute(opcode, 0, type);
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        if (mv != null) {
+            mv.visitFieldInsn(opcode, owner, name, desc);
+        }
+        execute(opcode, 0, desc);
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        if (mv != null) {
+            mv.visitMethodInsn(opcode, owner, name, desc);
+        }
+        if (this.locals == null) {
+            labels = null;
+            return;
+        }
+        pop(desc);
+        if (opcode != Opcodes.INVOKESTATIC) {
+            Object t = pop();
+            if (opcode == Opcodes.INVOKESPECIAL && name.charAt(0) == '<') {
+                Object u;
+                if (t == Opcodes.UNINITIALIZED_THIS) {
+                    u = this.owner;
+                } else {
+                    u = uninitializedTypes.get(t);
+                }
+                for (int i = 0; i < locals.size(); ++i) {
+                    if (locals.get(i) == t) {
+                        locals.set(i, u);
+                    }
+                }
+                for (int i = 0; i < stack.size(); ++i) {
+                    if (stack.get(i) == t) {
+                        stack.set(i, u);
+                    }
+                }
+            }
+        }
+        pushDesc(desc);
+        labels = null;
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        if (mv != null) {
+            mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+        }
+        if (this.locals == null) {
+            labels = null;
+            return;
+        }
+        pop(desc);
+        pushDesc(desc);
+        labels = null;
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        if (mv != null) {
+            mv.visitJumpInsn(opcode, label);
+        }
+        execute(opcode, 0, null);
+        if (opcode == Opcodes.GOTO) {
+            this.locals = null;
+            this.stack = null;
+        }
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        if (mv != null) {
+            mv.visitLabel(label);
+        }
+        if (labels == null) {
+            labels = new ArrayList<Label>(3);
+        }
+        labels.add(label);
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        if (mv != null) {
+            mv.visitLdcInsn(cst);
+        }
+        if (this.locals == null) {
+            labels = null;
+            return;
+        }
+        if (cst instanceof Integer) {
+            push(Opcodes.INTEGER);
+        } else if (cst instanceof Long) {
+            push(Opcodes.LONG);
+            push(Opcodes.TOP);
+        } else if (cst instanceof Float) {
+            push(Opcodes.FLOAT);
+        } else if (cst instanceof Double) {
+            push(Opcodes.DOUBLE);
+            push(Opcodes.TOP);
+        } else if (cst instanceof String) {
+            push("java/lang/String");
+        } else if (cst instanceof Type) {
+            int sort = ((Type) cst).getSort();
+            if (sort == Type.OBJECT || sort == Type.ARRAY) {
+                push("java/lang/Class");
+            } else if (sort == Type.METHOD) {
+                push("java/lang/invoke/MethodType");
+            } else {
+                throw new IllegalArgumentException();
+            }
+        } else if (cst instanceof Handle) {
+            push("java/lang/invoke/MethodHandle");
+        } else {
+            throw new IllegalArgumentException();
+        }
+        labels = null;
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        if (mv != null) {
+            mv.visitIincInsn(var, increment);
+        }
+        execute(Opcodes.IINC, var, null);
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        if (mv != null) {
+            mv.visitTableSwitchInsn(min, max, dflt, labels);
+        }
+        execute(Opcodes.TABLESWITCH, 0, null);
+        this.locals = null;
+        this.stack = null;
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        if (mv != null) {
+            mv.visitLookupSwitchInsn(dflt, keys, labels);
+        }
+        execute(Opcodes.LOOKUPSWITCH, 0, null);
+        this.locals = null;
+        this.stack = null;
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        if (mv != null) {
+            mv.visitMultiANewArrayInsn(desc, dims);
+        }
+        execute(Opcodes.MULTIANEWARRAY, dims, desc);
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        if (mv != null) {
+            this.maxStack = Math.max(this.maxStack, maxStack);
+            this.maxLocals = Math.max(this.maxLocals, maxLocals);
+            mv.visitMaxs(this.maxStack, this.maxLocals);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+
+    private Object get(final int local) {
+        maxLocals = Math.max(maxLocals, local);
+        return local < locals.size() ? locals.get(local) : Opcodes.TOP;
+    }
+
+    private void set(final int local, final Object type) {
+        maxLocals = Math.max(maxLocals, local);
+        while (local >= locals.size()) {
+            locals.add(Opcodes.TOP);
+        }
+        locals.set(local, type);
+    }
+
+    private void push(final Object type) {
+        stack.add(type);
+        maxStack = Math.max(maxStack, stack.size());
+    }
+
+    private void pushDesc(final String desc) {
+        int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
+        switch (desc.charAt(index)) {
+            case 'V':
+                return;
+            case 'Z':
+            case 'C':
+            case 'B':
+            case 'S':
+            case 'I':
+                push(Opcodes.INTEGER);
+                return;
+            case 'F':
+                push(Opcodes.FLOAT);
+                return;
+            case 'J':
+                push(Opcodes.LONG);
+                push(Opcodes.TOP);
+                return;
+            case 'D':
+                push(Opcodes.DOUBLE);
+                push(Opcodes.TOP);
+                return;
+            case '[':
+                if (index == 0) {
+                    push(desc);
+                } else {
+                    push(desc.substring(index, desc.length()));
+                }
+                break;
+            // case 'L':
+            default:
+                if (index == 0) {
+                    push(desc.substring(1, desc.length() - 1));
+                } else {
+                    push(desc.substring(index + 1, desc.length() - 1));
+                }
+        }
+    }
+
+    private Object pop() {
+        return stack.remove(stack.size() - 1);
+    }
+
+    private void pop(final int n) {
+        int size = stack.size();
+        int end = size - n;
+        for (int i = size - 1; i >= end; --i) {
+            stack.remove(i);
+        }
+    }
+
+    private void pop(final String desc) {
+        char c = desc.charAt(0);
+        if (c == '(') {
+            int n = 0;
+            Type[] types = Type.getArgumentTypes(desc);
+            for (int i = 0; i < types.length; ++i) {
+                n += types[i].getSize();
+            }
+            pop(n);
+        } else if (c == 'J' || c == 'D') {
+            pop(2);
+        } else {
+            pop(1);
+        }
+    }
+
+    private void execute(final int opcode, final int iarg, final String sarg) {
+        if (this.locals == null) {
+            labels = null;
+            return;
+        }
+        Object t1, t2, t3, t4;
+        switch (opcode) {
+            case Opcodes.NOP:
+            case Opcodes.INEG:
+            case Opcodes.LNEG:
+            case Opcodes.FNEG:
+            case Opcodes.DNEG:
+            case Opcodes.I2B:
+            case Opcodes.I2C:
+            case Opcodes.I2S:
+            case Opcodes.GOTO:
+            case Opcodes.RETURN:
+                break;
+            case Opcodes.ACONST_NULL:
+                push(Opcodes.NULL);
+                break;
+            case Opcodes.ICONST_M1:
+            case Opcodes.ICONST_0:
+            case Opcodes.ICONST_1:
+            case Opcodes.ICONST_2:
+            case Opcodes.ICONST_3:
+            case Opcodes.ICONST_4:
+            case Opcodes.ICONST_5:
+            case Opcodes.BIPUSH:
+            case Opcodes.SIPUSH:
+                push(Opcodes.INTEGER);
+                break;
+            case Opcodes.LCONST_0:
+            case Opcodes.LCONST_1:
+                push(Opcodes.LONG);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.FCONST_0:
+            case Opcodes.FCONST_1:
+            case Opcodes.FCONST_2:
+                push(Opcodes.FLOAT);
+                break;
+            case Opcodes.DCONST_0:
+            case Opcodes.DCONST_1:
+                push(Opcodes.DOUBLE);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.ILOAD:
+            case Opcodes.FLOAD:
+            case Opcodes.ALOAD:
+                push(get(iarg));
+                break;
+            case Opcodes.LLOAD:
+            case Opcodes.DLOAD:
+                push(get(iarg));
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.IALOAD:
+            case Opcodes.BALOAD:
+            case Opcodes.CALOAD:
+            case Opcodes.SALOAD:
+                pop(2);
+                push(Opcodes.INTEGER);
+                break;
+            case Opcodes.LALOAD:
+            case Opcodes.D2L:
+                pop(2);
+                push(Opcodes.LONG);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.FALOAD:
+                pop(2);
+                push(Opcodes.FLOAT);
+                break;
+            case Opcodes.DALOAD:
+            case Opcodes.L2D:
+                pop(2);
+                push(Opcodes.DOUBLE);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.AALOAD:
+                pop(1);
+                t1 = pop();
+                if (t1 instanceof String) {
+                    pushDesc(((String) t1).substring(1));
+                } else {
+                    push("java/lang/Object");
+                }
+                break;
+            case Opcodes.ISTORE:
+            case Opcodes.FSTORE:
+            case Opcodes.ASTORE:
+                t1 = pop();
+                set(iarg, t1);
+                if (iarg > 0) {
+                    t2 = get(iarg - 1);
+                    if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
+                        set(iarg - 1, Opcodes.TOP);
+                    }
+                }
+                break;
+            case Opcodes.LSTORE:
+            case Opcodes.DSTORE:
+                pop(1);
+                t1 = pop();
+                set(iarg, t1);
+                set(iarg + 1, Opcodes.TOP);
+                if (iarg > 0) {
+                    t2 = get(iarg - 1);
+                    if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
+                        set(iarg - 1, Opcodes.TOP);
+                    }
+                }
+                break;
+            case Opcodes.IASTORE:
+            case Opcodes.BASTORE:
+            case Opcodes.CASTORE:
+            case Opcodes.SASTORE:
+            case Opcodes.FASTORE:
+            case Opcodes.AASTORE:
+                pop(3);
+                break;
+            case Opcodes.LASTORE:
+            case Opcodes.DASTORE:
+                pop(4);
+                break;
+            case Opcodes.POP:
+            case Opcodes.IFEQ:
+            case Opcodes.IFNE:
+            case Opcodes.IFLT:
+            case Opcodes.IFGE:
+            case Opcodes.IFGT:
+            case Opcodes.IFLE:
+            case Opcodes.IRETURN:
+            case Opcodes.FRETURN:
+            case Opcodes.ARETURN:
+            case Opcodes.TABLESWITCH:
+            case Opcodes.LOOKUPSWITCH:
+            case Opcodes.ATHROW:
+            case Opcodes.MONITORENTER:
+            case Opcodes.MONITOREXIT:
+            case Opcodes.IFNULL:
+            case Opcodes.IFNONNULL:
+                pop(1);
+                break;
+            case Opcodes.POP2:
+            case Opcodes.IF_ICMPEQ:
+            case Opcodes.IF_ICMPNE:
+            case Opcodes.IF_ICMPLT:
+            case Opcodes.IF_ICMPGE:
+            case Opcodes.IF_ICMPGT:
+            case Opcodes.IF_ICMPLE:
+            case Opcodes.IF_ACMPEQ:
+            case Opcodes.IF_ACMPNE:
+            case Opcodes.LRETURN:
+            case Opcodes.DRETURN:
+                pop(2);
+                break;
+            case Opcodes.DUP:
+                t1 = pop();
+                push(t1);
+                push(t1);
+                break;
+            case Opcodes.DUP_X1:
+                t1 = pop();
+                t2 = pop();
+                push(t1);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP_X2:
+                t1 = pop();
+                t2 = pop();
+                t3 = pop();
+                push(t1);
+                push(t3);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP2:
+                t1 = pop();
+                t2 = pop();
+                push(t2);
+                push(t1);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP2_X1:
+                t1 = pop();
+                t2 = pop();
+                t3 = pop();
+                push(t2);
+                push(t1);
+                push(t3);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.DUP2_X2:
+                t1 = pop();
+                t2 = pop();
+                t3 = pop();
+                t4 = pop();
+                push(t2);
+                push(t1);
+                push(t4);
+                push(t3);
+                push(t2);
+                push(t1);
+                break;
+            case Opcodes.SWAP:
+                t1 = pop();
+                t2 = pop();
+                push(t1);
+                push(t2);
+                break;
+            case Opcodes.IADD:
+            case Opcodes.ISUB:
+            case Opcodes.IMUL:
+            case Opcodes.IDIV:
+            case Opcodes.IREM:
+            case Opcodes.IAND:
+            case Opcodes.IOR:
+            case Opcodes.IXOR:
+            case Opcodes.ISHL:
+            case Opcodes.ISHR:
+            case Opcodes.IUSHR:
+            case Opcodes.L2I:
+            case Opcodes.D2I:
+            case Opcodes.FCMPL:
+            case Opcodes.FCMPG:
+                pop(2);
+                push(Opcodes.INTEGER);
+                break;
+            case Opcodes.LADD:
+            case Opcodes.LSUB:
+            case Opcodes.LMUL:
+            case Opcodes.LDIV:
+            case Opcodes.LREM:
+            case Opcodes.LAND:
+            case Opcodes.LOR:
+            case Opcodes.LXOR:
+                pop(4);
+                push(Opcodes.LONG);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.FADD:
+            case Opcodes.FSUB:
+            case Opcodes.FMUL:
+            case Opcodes.FDIV:
+            case Opcodes.FREM:
+            case Opcodes.L2F:
+            case Opcodes.D2F:
+                pop(2);
+                push(Opcodes.FLOAT);
+                break;
+            case Opcodes.DADD:
+            case Opcodes.DSUB:
+            case Opcodes.DMUL:
+            case Opcodes.DDIV:
+            case Opcodes.DREM:
+                pop(4);
+                push(Opcodes.DOUBLE);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.LSHL:
+            case Opcodes.LSHR:
+            case Opcodes.LUSHR:
+                pop(3);
+                push(Opcodes.LONG);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.IINC:
+                set(iarg, Opcodes.INTEGER);
+                break;
+            case Opcodes.I2L:
+            case Opcodes.F2L:
+                pop(1);
+                push(Opcodes.LONG);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.I2F:
+                pop(1);
+                push(Opcodes.FLOAT);
+                break;
+            case Opcodes.I2D:
+            case Opcodes.F2D:
+                pop(1);
+                push(Opcodes.DOUBLE);
+                push(Opcodes.TOP);
+                break;
+            case Opcodes.F2I:
+            case Opcodes.ARRAYLENGTH:
+            case Opcodes.INSTANCEOF:
+                pop(1);
+                push(Opcodes.INTEGER);
+                break;
+            case Opcodes.LCMP:
+            case Opcodes.DCMPL:
+            case Opcodes.DCMPG:
+                pop(4);
+                push(Opcodes.INTEGER);
+                break;
+            case Opcodes.JSR:
+            case Opcodes.RET:
+                throw new RuntimeException("JSR/RET are not supported");
+            case Opcodes.GETSTATIC:
+                pushDesc(sarg);
+                break;
+            case Opcodes.PUTSTATIC:
+                pop(sarg);
+                break;
+            case Opcodes.GETFIELD:
+                pop(1);
+                pushDesc(sarg);
+                break;
+            case Opcodes.PUTFIELD:
+                pop(sarg);
+                pop();
+                break;
+            case Opcodes.NEW:
+                push(labels.get(0));
+                break;
+            case Opcodes.NEWARRAY:
+                pop();
+                switch (iarg) {
+                    case Opcodes.T_BOOLEAN:
+                        pushDesc("[Z");
+                        break;
+                    case Opcodes.T_CHAR:
+                        pushDesc("[C");
+                        break;
+                    case Opcodes.T_BYTE:
+                        pushDesc("[B");
+                        break;
+                    case Opcodes.T_SHORT:
+                        pushDesc("[S");
+                        break;
+                    case Opcodes.T_INT:
+                        pushDesc("[I");
+                        break;
+                    case Opcodes.T_FLOAT:
+                        pushDesc("[F");
+                        break;
+                    case Opcodes.T_DOUBLE:
+                        pushDesc("[D");
+                        break;
+                    // case Opcodes.T_LONG:
+                    default:
+                        pushDesc("[J");
+                        break;
+                }
+                break;
+            case Opcodes.ANEWARRAY:
+                pop();
+                pushDesc("[" + Type.getObjectType(sarg));
+                break;
+            case Opcodes.CHECKCAST:
+                pop();
+                pushDesc(Type.getObjectType(sarg).getDescriptor());
+                break;
+            // case Opcodes.MULTIANEWARRAY:
+            default:
+                pop(iarg);
+                pushDesc(sarg);
+                break;
+        }
+        labels = null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/CodeSizeEvaluator.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,265 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link MethodVisitor} that can be used to approximate method size.
+ *
+ * @author Eugene Kuleshov
+ */
+public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
+
+    private int minSize;
+
+    private int maxSize;
+
+    public CodeSizeEvaluator(final MethodVisitor mv) {
+        this(Opcodes.ASM4, mv);
+    }
+
+    protected CodeSizeEvaluator(final int api, final MethodVisitor mv) {
+        super(api, mv);
+    }
+
+    public int getMinSize() {
+        return this.minSize;
+    }
+
+    public int getMaxSize() {
+        return this.maxSize;
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        minSize += 1;
+        maxSize += 1;
+        if (mv != null) {
+            mv.visitInsn(opcode);
+        }
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        if (opcode == SIPUSH) {
+            minSize += 3;
+            maxSize += 3;
+        } else {
+            minSize += 2;
+            maxSize += 2;
+        }
+        if (mv != null) {
+            mv.visitIntInsn(opcode, operand);
+        }
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        if (var < 4 && opcode != RET) {
+            minSize += 1;
+            maxSize += 1;
+        } else if (var >= 256) {
+            minSize += 4;
+            maxSize += 4;
+        } else {
+            minSize += 2;
+            maxSize += 2;
+        }
+        if (mv != null) {
+            mv.visitVarInsn(opcode, var);
+        }
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        minSize += 3;
+        maxSize += 3;
+        if (mv != null) {
+            mv.visitTypeInsn(opcode, type);
+        }
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        minSize += 3;
+        maxSize += 3;
+        if (mv != null) {
+            mv.visitFieldInsn(opcode, owner, name, desc);
+        }
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        if (opcode == INVOKEINTERFACE) {
+            minSize += 5;
+            maxSize += 5;
+        } else {
+            minSize += 3;
+            maxSize += 3;
+        }
+        if (mv != null) {
+            mv.visitMethodInsn(opcode, owner, name, desc);
+        }
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        minSize += 5;
+        maxSize += 5;
+        if (mv != null) {
+            mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+        }
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        minSize += 3;
+        if (opcode == GOTO || opcode == JSR) {
+            maxSize += 5;
+        } else {
+            maxSize += 8;
+        }
+        if (mv != null) {
+            mv.visitJumpInsn(opcode, label);
+        }
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        if (cst instanceof Long || cst instanceof Double) {
+            minSize += 3;
+            maxSize += 3;
+        } else {
+            minSize += 2;
+            maxSize += 3;
+        }
+        if (mv != null) {
+            mv.visitLdcInsn(cst);
+        }
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        if (var > 255 || increment > 127 || increment < -128) {
+            minSize += 6;
+            maxSize += 6;
+        } else {
+            minSize += 3;
+            maxSize += 3;
+        }
+        if (mv != null) {
+            mv.visitIincInsn(var, increment);
+        }
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        minSize += 13 + labels.length * 4;
+        maxSize += 16 + labels.length * 4;
+        if (mv != null) {
+            mv.visitTableSwitchInsn(min, max, dflt, labels);
+        }
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        minSize += 9 + keys.length * 8;
+        maxSize += 12 + keys.length * 8;
+        if (mv != null) {
+            mv.visitLookupSwitchInsn(dflt, keys, labels);
+        }
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        minSize += 4;
+        maxSize += 4;
+        if (mv != null) {
+            mv.visitMultiANewArrayInsn(desc, dims);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/GeneratorAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1578 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link jdk.internal.org.objectweb.asm.MethodVisitor} with convenient methods to generate
+ * code. For example, using this adapter, the class below
+ *
+ * <pre>
+ * public class Example {
+ *     public static void main(String[] args) {
+ *         System.out.println(&quot;Hello world!&quot;);
+ *     }
+ * }
+ * </pre>
+ *
+ * can be generated as follows:
+ *
+ * <pre>
+ * ClassWriter cw = new ClassWriter(true);
+ * cw.visit(V1_1, ACC_PUBLIC, &quot;Example&quot;, null, &quot;java/lang/Object&quot;, null);
+ *
+ * Method m = Method.getMethod(&quot;void &lt;init&gt; ()&quot;);
+ * GeneratorAdapter mg = new GeneratorAdapter(ACC_PUBLIC, m, null, null, cw);
+ * mg.loadThis();
+ * mg.invokeConstructor(Type.getType(Object.class), m);
+ * mg.returnValue();
+ * mg.endMethod();
+ *
+ * m = Method.getMethod(&quot;void main (String[])&quot;);
+ * mg = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC, m, null, null, cw);
+ * mg.getStatic(Type.getType(System.class), &quot;out&quot;, Type.getType(PrintStream.class));
+ * mg.push(&quot;Hello world!&quot;);
+ * mg.invokeVirtual(Type.getType(PrintStream.class), Method.getMethod(&quot;void println (String)&quot;));
+ * mg.returnValue();
+ * mg.endMethod();
+ *
+ * cw.visitEnd();
+ * </pre>
+ *
+ * @author Juozas Baliuka
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ * @author Prashant Deva
+ */
+public class GeneratorAdapter extends LocalVariablesSorter {
+
+    private static final String CLDESC = "Ljava/lang/Class;";
+
+    private static final Type BYTE_TYPE = Type.getObjectType("java/lang/Byte");
+
+    private static final Type BOOLEAN_TYPE = Type.getObjectType("java/lang/Boolean");
+
+    private static final Type SHORT_TYPE = Type.getObjectType("java/lang/Short");
+
+    private static final Type CHARACTER_TYPE = Type.getObjectType("java/lang/Character");
+
+    private static final Type INTEGER_TYPE = Type.getObjectType("java/lang/Integer");
+
+    private static final Type FLOAT_TYPE = Type.getObjectType("java/lang/Float");
+
+    private static final Type LONG_TYPE = Type.getObjectType("java/lang/Long");
+
+    private static final Type DOUBLE_TYPE = Type.getObjectType("java/lang/Double");
+
+    private static final Type NUMBER_TYPE = Type.getObjectType("java/lang/Number");
+
+    private static final Type OBJECT_TYPE = Type.getObjectType("java/lang/Object");
+
+    private static final Method BOOLEAN_VALUE = Method.getMethod("boolean booleanValue()");
+
+    private static final Method CHAR_VALUE = Method.getMethod("char charValue()");
+
+    private static final Method INT_VALUE = Method.getMethod("int intValue()");
+
+    private static final Method FLOAT_VALUE = Method.getMethod("float floatValue()");
+
+    private static final Method LONG_VALUE = Method.getMethod("long longValue()");
+
+    private static final Method DOUBLE_VALUE = Method.getMethod("double doubleValue()");
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int ADD = Opcodes.IADD;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int SUB = Opcodes.ISUB;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int MUL = Opcodes.IMUL;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int DIV = Opcodes.IDIV;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int REM = Opcodes.IREM;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int NEG = Opcodes.INEG;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int SHL = Opcodes.ISHL;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int SHR = Opcodes.ISHR;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int USHR = Opcodes.IUSHR;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int AND = Opcodes.IAND;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int OR = Opcodes.IOR;
+
+    /**
+     * Constant for the {@link #math math} method.
+     */
+    public static final int XOR = Opcodes.IXOR;
+
+    /**
+     * Constant for the {@link #ifCmp ifCmp} method.
+     */
+    public static final int EQ = Opcodes.IFEQ;
+
+    /**
+     * Constant for the {@link #ifCmp ifCmp} method.
+     */
+    public static final int NE = Opcodes.IFNE;
+
+    /**
+     * Constant for the {@link #ifCmp ifCmp} method.
+     */
+    public static final int LT = Opcodes.IFLT;
+
+    /**
+     * Constant for the {@link #ifCmp ifCmp} method.
+     */
+    public static final int GE = Opcodes.IFGE;
+
+    /**
+     * Constant for the {@link #ifCmp ifCmp} method.
+     */
+    public static final int GT = Opcodes.IFGT;
+
+    /**
+     * Constant for the {@link #ifCmp ifCmp} method.
+     */
+    public static final int LE = Opcodes.IFLE;
+
+    /**
+     * Access flags of the method visited by this adapter.
+     */
+    private final int access;
+
+    /**
+     * Return type of the method visited by this adapter.
+     */
+    private final Type returnType;
+
+    /**
+     * Argument types of the method visited by this adapter.
+     */
+    private final Type[] argumentTypes;
+
+    /**
+     * Types of the local variables of the method visited by this adapter.
+     */
+    private final List<Type> localTypes = new ArrayList<Type>();
+
+    /**
+     * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
+     * version.
+     *
+     * @param mv the method visitor to which this adapter delegates calls.
+     * @param access the method's access flags (see {@link Opcodes}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     */
+    public GeneratorAdapter(
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc)
+    {
+        this(Opcodes.ASM4, mv, access, name, desc);
+    }
+
+    /**
+     * Creates a new {@link GeneratorAdapter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param mv the method visitor to which this adapter delegates calls.
+     * @param access the method's access flags (see {@link Opcodes}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     */
+    protected GeneratorAdapter(
+        final int api,
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc)
+    {
+        super(api, access, desc, mv);
+        this.access = access;
+        this.returnType = Type.getReturnType(desc);
+        this.argumentTypes = Type.getArgumentTypes(desc);
+    }
+
+    /**
+     * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
+     * version.
+     *
+     * @param access access flags of the adapted method.
+     * @param method the adapted method.
+     * @param mv the method visitor to which this adapter delegates calls.
+     */
+    public GeneratorAdapter(
+        final int access,
+        final Method method,
+        final MethodVisitor mv)
+    {
+        this(mv, access, null, method.getDescriptor());
+    }
+
+    /**
+     * Creates a new {@link GeneratorAdapter}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #GeneratorAdapter(int, MethodVisitor, int, String, String)}
+     * version.
+     *
+     * @param access access flags of the adapted method.
+     * @param method the adapted method.
+     * @param signature the signature of the adapted method (may be
+     *        <tt>null</tt>).
+     * @param exceptions the exceptions thrown by the adapted method (may be
+     *        <tt>null</tt>).
+     * @param cv the class visitor to which this adapter delegates calls.
+     */
+    public GeneratorAdapter(
+        final int access,
+        final Method method,
+        final String signature,
+        final Type[] exceptions,
+        final ClassVisitor cv)
+    {
+        this(access, method, cv.visitMethod(access,
+                method.getName(),
+                method.getDescriptor(),
+                signature,
+                getInternalNames(exceptions)));
+    }
+
+    /**
+     * Returns the internal names of the given types.
+     *
+     * @param types a set of types.
+     * @return the internal names of the given types.
+     */
+    private static String[] getInternalNames(final Type[] types) {
+        if (types == null) {
+            return null;
+        }
+        String[] names = new String[types.length];
+        for (int i = 0; i < names.length; ++i) {
+            names[i] = types[i].getInternalName();
+        }
+        return names;
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to push constants on the stack
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack.
+     */
+    public void push(final boolean value) {
+        push(value ? 1 : 0);
+    }
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack.
+     */
+    public void push(final int value) {
+        if (value >= -1 && value <= 5) {
+            mv.visitInsn(Opcodes.ICONST_0 + value);
+        } else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {
+            mv.visitIntInsn(Opcodes.BIPUSH, value);
+        } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
+            mv.visitIntInsn(Opcodes.SIPUSH, value);
+        } else {
+            mv.visitLdcInsn(new Integer(value));
+        }
+    }
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack.
+     */
+    public void push(final long value) {
+        if (value == 0L || value == 1L) {
+            mv.visitInsn(Opcodes.LCONST_0 + (int) value);
+        } else {
+            mv.visitLdcInsn(new Long(value));
+        }
+    }
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack.
+     */
+    public void push(final float value) {
+        int bits = Float.floatToIntBits(value);
+        if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
+            mv.visitInsn(Opcodes.FCONST_0 + (int) value);
+        } else {
+            mv.visitLdcInsn(new Float(value));
+        }
+    }
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack.
+     */
+    public void push(final double value) {
+        long bits = Double.doubleToLongBits(value);
+        if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
+            mv.visitInsn(Opcodes.DCONST_0 + (int) value);
+        } else {
+            mv.visitLdcInsn(new Double(value));
+        }
+    }
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack. May be <tt>null</tt>.
+     */
+    public void push(final String value) {
+        if (value == null) {
+            mv.visitInsn(Opcodes.ACONST_NULL);
+        } else {
+            mv.visitLdcInsn(value);
+        }
+    }
+
+    /**
+     * Generates the instruction to push the given value on the stack.
+     *
+     * @param value the value to be pushed on the stack.
+     */
+    public void push(final Type value) {
+        if (value == null) {
+            mv.visitInsn(Opcodes.ACONST_NULL);
+        } else {
+            switch (value.getSort()) {
+                case Type.BOOLEAN:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Boolean",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.CHAR:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Character",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.BYTE:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Byte",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.SHORT:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Short",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.INT:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Integer",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.FLOAT:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Float",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.LONG:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Long",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                case Type.DOUBLE:
+                    mv.visitFieldInsn(Opcodes.GETSTATIC,
+                            "java/lang/Double",
+                            "TYPE",
+                            CLDESC);
+                    break;
+                default:
+                    mv.visitLdcInsn(value);
+            }
+        }
+    }
+
+    /**
+     * Generates the instruction to push a handle on the stack.
+     *
+     * @param handle the handle to be pushed on the stack.
+     */
+    public void push(final Handle handle) {
+        mv.visitLdcInsn(handle);
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to load and store method arguments
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the index of the given method argument in the frame's local
+     * variables array.
+     *
+     * @param arg the index of a method argument.
+     * @return the index of the given method argument in the frame's local
+     *         variables array.
+     */
+    private int getArgIndex(final int arg) {
+        int index = (access & Opcodes.ACC_STATIC) == 0 ? 1 : 0;
+        for (int i = 0; i < arg; i++) {
+            index += argumentTypes[i].getSize();
+        }
+        return index;
+    }
+
+    /**
+     * Generates the instruction to push a local variable on the stack.
+     *
+     * @param type the type of the local variable to be loaded.
+     * @param index an index in the frame's local variables array.
+     */
+    private void loadInsn(final Type type, final int index) {
+        mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index);
+    }
+
+    /**
+     * Generates the instruction to store the top stack value in a local
+     * variable.
+     *
+     * @param type the type of the local variable to be stored.
+     * @param index an index in the frame's local variables array.
+     */
+    private void storeInsn(final Type type, final int index) {
+        mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), index);
+    }
+
+    /**
+     * Generates the instruction to load 'this' on the stack.
+     */
+    public void loadThis() {
+        if ((access & Opcodes.ACC_STATIC) != 0) {
+            throw new IllegalStateException("no 'this' pointer within static method");
+        }
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+    }
+
+    /**
+     * Generates the instruction to load the given method argument on the stack.
+     *
+     * @param arg the index of a method argument.
+     */
+    public void loadArg(final int arg) {
+        loadInsn(argumentTypes[arg], getArgIndex(arg));
+    }
+
+    /**
+     * Generates the instructions to load the given method arguments on the
+     * stack.
+     *
+     * @param arg the index of the first method argument to be loaded.
+     * @param count the number of method arguments to be loaded.
+     */
+    public void loadArgs(final int arg, final int count) {
+        int index = getArgIndex(arg);
+        for (int i = 0; i < count; ++i) {
+            Type t = argumentTypes[arg + i];
+            loadInsn(t, index);
+            index += t.getSize();
+        }
+    }
+
+    /**
+     * Generates the instructions to load all the method arguments on the stack.
+     */
+    public void loadArgs() {
+        loadArgs(0, argumentTypes.length);
+    }
+
+    /**
+     * Generates the instructions to load all the method arguments on the stack,
+     * as a single object array.
+     */
+    public void loadArgArray() {
+        push(argumentTypes.length);
+        newArray(OBJECT_TYPE);
+        for (int i = 0; i < argumentTypes.length; i++) {
+            dup();
+            push(i);
+            loadArg(i);
+            box(argumentTypes[i]);
+            arrayStore(OBJECT_TYPE);
+        }
+    }
+
+    /**
+     * Generates the instruction to store the top stack value in the given
+     * method argument.
+     *
+     * @param arg the index of a method argument.
+     */
+    public void storeArg(final int arg) {
+        storeInsn(argumentTypes[arg], getArgIndex(arg));
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to load and store local variables
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the type of the given local variable.
+     *
+     * @param local a local variable identifier, as returned by
+     *        {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+     * @return the type of the given local variable.
+     */
+    public Type getLocalType(final int local) {
+        return localTypes.get(local - firstLocal);
+    }
+
+    @Override
+    protected void setLocalType(final int local, final Type type) {
+        int index = local - firstLocal;
+        while (localTypes.size() < index + 1) {
+            localTypes.add(null);
+        }
+        localTypes.set(index, type);
+    }
+
+    /**
+     * Generates the instruction to load the given local variable on the stack.
+     *
+     * @param local a local variable identifier, as returned by
+     *        {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+     */
+    public void loadLocal(final int local) {
+        loadInsn(getLocalType(local), local);
+    }
+
+    /**
+     * Generates the instruction to load the given local variable on the stack.
+     *
+     * @param local a local variable identifier, as returned by
+     *        {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+     * @param type the type of this local variable.
+     */
+    public void loadLocal(final int local, final Type type) {
+        setLocalType(local, type);
+        loadInsn(type, local);
+    }
+
+    /**
+     * Generates the instruction to store the top stack value in the given local
+     * variable.
+     *
+     * @param local a local variable identifier, as returned by
+     *        {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+     */
+    public void storeLocal(final int local) {
+        storeInsn(getLocalType(local), local);
+    }
+
+    /**
+     * Generates the instruction to store the top stack value in the given local
+     * variable.
+     *
+     * @param local a local variable identifier, as returned by
+     *        {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+     * @param type the type of this local variable.
+     */
+    public void storeLocal(final int local, final Type type) {
+        setLocalType(local, type);
+        storeInsn(type, local);
+    }
+
+    /**
+     * Generates the instruction to load an element from an array.
+     *
+     * @param type the type of the array element to be loaded.
+     */
+    public void arrayLoad(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IALOAD));
+    }
+
+    /**
+     * Generates the instruction to store an element in an array.
+     *
+     * @param type the type of the array element to be stored.
+     */
+    public void arrayStore(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IASTORE));
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to manage the stack
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates a POP instruction.
+     */
+    public void pop() {
+        mv.visitInsn(Opcodes.POP);
+    }
+
+    /**
+     * Generates a POP2 instruction.
+     */
+    public void pop2() {
+        mv.visitInsn(Opcodes.POP2);
+    }
+
+    /**
+     * Generates a DUP instruction.
+     */
+    public void dup() {
+        mv.visitInsn(Opcodes.DUP);
+    }
+
+    /**
+     * Generates a DUP2 instruction.
+     */
+    public void dup2() {
+        mv.visitInsn(Opcodes.DUP2);
+    }
+
+    /**
+     * Generates a DUP_X1 instruction.
+     */
+    public void dupX1() {
+        mv.visitInsn(Opcodes.DUP_X1);
+    }
+
+    /**
+     * Generates a DUP_X2 instruction.
+     */
+    public void dupX2() {
+        mv.visitInsn(Opcodes.DUP_X2);
+    }
+
+    /**
+     * Generates a DUP2_X1 instruction.
+     */
+    public void dup2X1() {
+        mv.visitInsn(Opcodes.DUP2_X1);
+    }
+
+    /**
+     * Generates a DUP2_X2 instruction.
+     */
+    public void dup2X2() {
+        mv.visitInsn(Opcodes.DUP2_X2);
+    }
+
+    /**
+     * Generates a SWAP instruction.
+     */
+    public void swap() {
+        mv.visitInsn(Opcodes.SWAP);
+    }
+
+    /**
+     * Generates the instructions to swap the top two stack values.
+     *
+     * @param prev type of the top - 1 stack value.
+     * @param type type of the top stack value.
+     */
+    public void swap(final Type prev, final Type type) {
+        if (type.getSize() == 1) {
+            if (prev.getSize() == 1) {
+                swap(); // same as dupX1(), pop();
+            } else {
+                dupX2();
+                pop();
+            }
+        } else {
+            if (prev.getSize() == 1) {
+                dup2X1();
+                pop2();
+            } else {
+                dup2X2();
+                pop2();
+            }
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to do mathematical and logical operations
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates the instruction to do the specified mathematical or logical
+     * operation.
+     *
+     * @param op a mathematical or logical operation. Must be one of ADD, SUB,
+     *        MUL, DIV, REM, NEG, SHL, SHR, USHR, AND, OR, XOR.
+     * @param type the type of the operand(s) for this operation.
+     */
+    public void math(final int op, final Type type) {
+        mv.visitInsn(type.getOpcode(op));
+    }
+
+    /**
+     * Generates the instructions to compute the bitwise negation of the top
+     * stack value.
+     */
+    public void not() {
+        mv.visitInsn(Opcodes.ICONST_1);
+        mv.visitInsn(Opcodes.IXOR);
+    }
+
+    /**
+     * Generates the instruction to increment the given local variable.
+     *
+     * @param local the local variable to be incremented.
+     * @param amount the amount by which the local variable must be incremented.
+     */
+    public void iinc(final int local, final int amount) {
+        mv.visitIincInsn(local, amount);
+    }
+
+    /**
+     * Generates the instructions to cast a numerical value from one type to
+     * another.
+     *
+     * @param from the type of the top stack value
+     * @param to the type into which this value must be cast.
+     */
+    public void cast(final Type from, final Type to) {
+        if (from != to) {
+            if (from == Type.DOUBLE_TYPE) {
+                if (to == Type.FLOAT_TYPE) {
+                    mv.visitInsn(Opcodes.D2F);
+                } else if (to == Type.LONG_TYPE) {
+                    mv.visitInsn(Opcodes.D2L);
+                } else {
+                    mv.visitInsn(Opcodes.D2I);
+                    cast(Type.INT_TYPE, to);
+                }
+            } else if (from == Type.FLOAT_TYPE) {
+                if (to == Type.DOUBLE_TYPE) {
+                    mv.visitInsn(Opcodes.F2D);
+                } else if (to == Type.LONG_TYPE) {
+                    mv.visitInsn(Opcodes.F2L);
+                } else {
+                    mv.visitInsn(Opcodes.F2I);
+                    cast(Type.INT_TYPE, to);
+                }
+            } else if (from == Type.LONG_TYPE) {
+                if (to == Type.DOUBLE_TYPE) {
+                    mv.visitInsn(Opcodes.L2D);
+                } else if (to == Type.FLOAT_TYPE) {
+                    mv.visitInsn(Opcodes.L2F);
+                } else {
+                    mv.visitInsn(Opcodes.L2I);
+                    cast(Type.INT_TYPE, to);
+                }
+            } else {
+                if (to == Type.BYTE_TYPE) {
+                    mv.visitInsn(Opcodes.I2B);
+                } else if (to == Type.CHAR_TYPE) {
+                    mv.visitInsn(Opcodes.I2C);
+                } else if (to == Type.DOUBLE_TYPE) {
+                    mv.visitInsn(Opcodes.I2D);
+                } else if (to == Type.FLOAT_TYPE) {
+                    mv.visitInsn(Opcodes.I2F);
+                } else if (to == Type.LONG_TYPE) {
+                    mv.visitInsn(Opcodes.I2L);
+                } else if (to == Type.SHORT_TYPE) {
+                    mv.visitInsn(Opcodes.I2S);
+                }
+            }
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to do boxing and unboxing operations
+    // ------------------------------------------------------------------------
+
+    private static Type getBoxedType(final Type type) {
+        switch (type.getSort()) {
+            case Type.BYTE:
+                return BYTE_TYPE;
+            case Type.BOOLEAN:
+                return BOOLEAN_TYPE;
+            case Type.SHORT:
+                return SHORT_TYPE;
+            case Type.CHAR:
+                return CHARACTER_TYPE;
+            case Type.INT:
+                return INTEGER_TYPE;
+            case Type.FLOAT:
+                return FLOAT_TYPE;
+            case Type.LONG:
+                return LONG_TYPE;
+            case Type.DOUBLE:
+                return DOUBLE_TYPE;
+        }
+        return type;
+    }
+
+    /**
+     * Generates the instructions to box the top stack value. This value is
+     * replaced by its boxed equivalent on top of the stack.
+     *
+     * @param type the type of the top stack value.
+     */
+    public void box(final Type type) {
+        if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
+            return;
+        }
+        if (type == Type.VOID_TYPE) {
+            push((String) null);
+        } else {
+            Type boxed = getBoxedType(type);
+            newInstance(boxed);
+            if (type.getSize() == 2) {
+                // Pp -> Ppo -> oPpo -> ooPpo -> ooPp -> o
+                dupX2();
+                dupX2();
+                pop();
+            } else {
+                // p -> po -> opo -> oop -> o
+                dupX1();
+                swap();
+            }
+            invokeConstructor(boxed, new Method("<init>",
+                    Type.VOID_TYPE,
+                    new Type[] { type }));
+        }
+    }
+
+    /**
+     * Generates the instructions to box the top stack value using Java 5's
+     * valueOf() method. This value is replaced by its boxed equivalent on top
+     * of the stack.
+     *
+     * @param type the type of the top stack value.
+     */
+    public void valueOf(final Type type) {
+        if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
+            return;
+        }
+        if (type == Type.VOID_TYPE) {
+            push((String) null);
+        } else {
+            Type boxed = getBoxedType(type);
+            invokeStatic(boxed, new Method("valueOf",
+                    boxed,
+                    new Type[] { type }));
+        }
+    }
+
+    /**
+     * Generates the instructions to unbox the top stack value. This value is
+     * replaced by its unboxed equivalent on top of the stack.
+     *
+     * @param type the type of the top stack value.
+     */
+    public void unbox(final Type type) {
+        Type t = NUMBER_TYPE;
+        Method sig = null;
+        switch (type.getSort()) {
+            case Type.VOID:
+                return;
+            case Type.CHAR:
+                t = CHARACTER_TYPE;
+                sig = CHAR_VALUE;
+                break;
+            case Type.BOOLEAN:
+                t = BOOLEAN_TYPE;
+                sig = BOOLEAN_VALUE;
+                break;
+            case Type.DOUBLE:
+                sig = DOUBLE_VALUE;
+                break;
+            case Type.FLOAT:
+                sig = FLOAT_VALUE;
+                break;
+            case Type.LONG:
+                sig = LONG_VALUE;
+                break;
+            case Type.INT:
+            case Type.SHORT:
+            case Type.BYTE:
+                sig = INT_VALUE;
+        }
+        if (sig == null) {
+            checkCast(type);
+        } else {
+            checkCast(t);
+            invokeVirtual(t, sig);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to jump to other instructions
+    // ------------------------------------------------------------------------
+
+    /**
+     * Creates a new {@link Label}.
+     *
+     * @return a new {@link Label}.
+     */
+    public Label newLabel() {
+        return new Label();
+    }
+
+    /**
+     * Marks the current code position with the given label.
+     *
+     * @param label a label.
+     */
+    public void mark(final Label label) {
+        mv.visitLabel(label);
+    }
+
+    /**
+     * Marks the current code position with a new label.
+     *
+     * @return the label that was created to mark the current code position.
+     */
+    public Label mark() {
+        Label label = new Label();
+        mv.visitLabel(label);
+        return label;
+    }
+
+    /**
+     * Generates the instructions to jump to a label based on the comparison of
+     * the top two stack values.
+     *
+     * @param type the type of the top two stack values.
+     * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT,
+     *        LE.
+     * @param label where to jump if the comparison result is <tt>true</tt>.
+     */
+    public void ifCmp(final Type type, final int mode, final Label label) {
+        switch (type.getSort()) {
+            case Type.LONG:
+                mv.visitInsn(Opcodes.LCMP);
+                break;
+            case Type.DOUBLE:
+                mv.visitInsn(mode == GE || mode == GT ? Opcodes.DCMPG : Opcodes.DCMPL);
+                break;
+            case Type.FLOAT:
+                mv.visitInsn(mode == GE || mode == GT ? Opcodes.FCMPG : Opcodes.FCMPL);
+                break;
+            case Type.ARRAY:
+            case Type.OBJECT:
+                switch (mode) {
+                    case EQ:
+                        mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
+                        return;
+                    case NE:
+                        mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
+                        return;
+                }
+                throw new IllegalArgumentException("Bad comparison for type "
+                        + type);
+            default:
+                int intOp = -1;
+                switch (mode) {
+                    case EQ:
+                        intOp = Opcodes.IF_ICMPEQ;
+                        break;
+                    case NE:
+                        intOp = Opcodes.IF_ICMPNE;
+                        break;
+                    case GE:
+                        intOp = Opcodes.IF_ICMPGE;
+                        break;
+                    case LT:
+                        intOp = Opcodes.IF_ICMPLT;
+                        break;
+                    case LE:
+                        intOp = Opcodes.IF_ICMPLE;
+                        break;
+                    case GT:
+                        intOp = Opcodes.IF_ICMPGT;
+                        break;
+                }
+                mv.visitJumpInsn(intOp, label);
+                return;
+        }
+        mv.visitJumpInsn(mode, label);
+    }
+
+    /**
+     * Generates the instructions to jump to a label based on the comparison of
+     * the top two integer stack values.
+     *
+     * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT,
+     *        LE.
+     * @param label where to jump if the comparison result is <tt>true</tt>.
+     */
+    public void ifICmp(final int mode, final Label label) {
+        ifCmp(Type.INT_TYPE, mode, label);
+    }
+
+    /**
+     * Generates the instructions to jump to a label based on the comparison of
+     * the top integer stack value with zero.
+     *
+     * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT,
+     *        LE.
+     * @param label where to jump if the comparison result is <tt>true</tt>.
+     */
+    public void ifZCmp(final int mode, final Label label) {
+        mv.visitJumpInsn(mode, label);
+    }
+
+    /**
+     * Generates the instruction to jump to the given label if the top stack
+     * value is null.
+     *
+     * @param label where to jump if the condition is <tt>true</tt>.
+     */
+    public void ifNull(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFNULL, label);
+    }
+
+    /**
+     * Generates the instruction to jump to the given label if the top stack
+     * value is not null.
+     *
+     * @param label where to jump if the condition is <tt>true</tt>.
+     */
+    public void ifNonNull(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFNONNULL, label);
+    }
+
+    /**
+     * Generates the instruction to jump to the given label.
+     *
+     * @param label where to jump if the condition is <tt>true</tt>.
+     */
+    public void goTo(final Label label) {
+        mv.visitJumpInsn(Opcodes.GOTO, label);
+    }
+
+    /**
+     * Generates a RET instruction.
+     *
+     * @param local a local variable identifier, as returned by
+     *        {@link LocalVariablesSorter#newLocal(Type) newLocal()}.
+     */
+    public void ret(final int local) {
+        mv.visitVarInsn(Opcodes.RET, local);
+    }
+
+    /**
+     * Generates the instructions for a switch statement.
+     *
+     * @param keys the switch case keys.
+     * @param generator a generator to generate the code for the switch cases.
+     */
+    public void tableSwitch(
+        final int[] keys,
+        final TableSwitchGenerator generator)
+    {
+        float density;
+        if (keys.length == 0) {
+            density = 0;
+        } else {
+            density = (float) keys.length
+                    / (keys[keys.length - 1] - keys[0] + 1);
+        }
+        tableSwitch(keys, generator, density >= 0.5f);
+    }
+
+    /**
+     * Generates the instructions for a switch statement.
+     *
+     * @param keys the switch case keys.
+     * @param generator a generator to generate the code for the switch cases.
+     * @param useTable <tt>true</tt> to use a TABLESWITCH instruction, or
+     *        <tt>false</tt> to use a LOOKUPSWITCH instruction.
+     */
+    public void tableSwitch(
+        final int[] keys,
+        final TableSwitchGenerator generator,
+        final boolean useTable)
+    {
+        for (int i = 1; i < keys.length; ++i) {
+            if (keys[i] < keys[i - 1]) {
+                throw new IllegalArgumentException("keys must be sorted ascending");
+            }
+        }
+        Label def = newLabel();
+        Label end = newLabel();
+        if (keys.length > 0) {
+            int len = keys.length;
+            int min = keys[0];
+            int max = keys[len - 1];
+            int range = max - min + 1;
+            if (useTable) {
+                Label[] labels = new Label[range];
+                Arrays.fill(labels, def);
+                for (int i = 0; i < len; ++i) {
+                    labels[keys[i] - min] = newLabel();
+                }
+                mv.visitTableSwitchInsn(min, max, def, labels);
+                for (int i = 0; i < range; ++i) {
+                    Label label = labels[i];
+                    if (label != def) {
+                        mark(label);
+                        generator.generateCase(i + min, end);
+                    }
+                }
+            } else {
+                Label[] labels = new Label[len];
+                for (int i = 0; i < len; ++i) {
+                    labels[i] = newLabel();
+                }
+                mv.visitLookupSwitchInsn(def, keys, labels);
+                for (int i = 0; i < len; ++i) {
+                    mark(labels[i]);
+                    generator.generateCase(keys[i], end);
+                }
+            }
+        }
+        mark(def);
+        generator.generateDefault();
+        mark(end);
+    }
+
+    /**
+     * Generates the instruction to return the top stack value to the caller.
+     */
+    public void returnValue() {
+        mv.visitInsn(returnType.getOpcode(Opcodes.IRETURN));
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to load and store fields
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates a get field or set field instruction.
+     *
+     * @param opcode the instruction's opcode.
+     * @param ownerType the class in which the field is defined.
+     * @param name the name of the field.
+     * @param fieldType the type of the field.
+     */
+    private void fieldInsn(
+        final int opcode,
+        final Type ownerType,
+        final String name,
+        final Type fieldType)
+    {
+        mv.visitFieldInsn(opcode,
+                ownerType.getInternalName(),
+                name,
+                fieldType.getDescriptor());
+    }
+
+    /**
+     * Generates the instruction to push the value of a static field on the
+     * stack.
+     *
+     * @param owner the class in which the field is defined.
+     * @param name the name of the field.
+     * @param type the type of the field.
+     */
+    public void getStatic(final Type owner, final String name, final Type type)
+    {
+        fieldInsn(Opcodes.GETSTATIC, owner, name, type);
+    }
+
+    /**
+     * Generates the instruction to store the top stack value in a static field.
+     *
+     * @param owner the class in which the field is defined.
+     * @param name the name of the field.
+     * @param type the type of the field.
+     */
+    public void putStatic(final Type owner, final String name, final Type type)
+    {
+        fieldInsn(Opcodes.PUTSTATIC, owner, name, type);
+    }
+
+    /**
+     * Generates the instruction to push the value of a non static field on the
+     * stack.
+     *
+     * @param owner the class in which the field is defined.
+     * @param name the name of the field.
+     * @param type the type of the field.
+     */
+    public void getField(final Type owner, final String name, final Type type) {
+        fieldInsn(Opcodes.GETFIELD, owner, name, type);
+    }
+
+    /**
+     * Generates the instruction to store the top stack value in a non static
+     * field.
+     *
+     * @param owner the class in which the field is defined.
+     * @param name the name of the field.
+     * @param type the type of the field.
+     */
+    public void putField(final Type owner, final String name, final Type type) {
+        fieldInsn(Opcodes.PUTFIELD, owner, name, type);
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to invoke methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates an invoke method instruction.
+     *
+     * @param opcode the instruction's opcode.
+     * @param type the class in which the method is defined.
+     * @param method the method to be invoked.
+     */
+    private void invokeInsn(
+        final int opcode,
+        final Type type,
+        final Method method)
+    {
+        String owner = type.getSort() == Type.ARRAY
+                ? type.getDescriptor()
+                : type.getInternalName();
+        mv.visitMethodInsn(opcode,
+                owner,
+                method.getName(),
+                method.getDescriptor());
+    }
+
+    /**
+     * Generates the instruction to invoke a normal method.
+     *
+     * @param owner the class in which the method is defined.
+     * @param method the method to be invoked.
+     */
+    public void invokeVirtual(final Type owner, final Method method) {
+        invokeInsn(Opcodes.INVOKEVIRTUAL, owner, method);
+    }
+
+    /**
+     * Generates the instruction to invoke a constructor.
+     *
+     * @param type the class in which the constructor is defined.
+     * @param method the constructor to be invoked.
+     */
+    public void invokeConstructor(final Type type, final Method method) {
+        invokeInsn(Opcodes.INVOKESPECIAL, type, method);
+    }
+
+    /**
+     * Generates the instruction to invoke a static method.
+     *
+     * @param owner the class in which the method is defined.
+     * @param method the method to be invoked.
+     */
+    public void invokeStatic(final Type owner, final Method method) {
+        invokeInsn(Opcodes.INVOKESTATIC, owner, method);
+    }
+
+    /**
+     * Generates the instruction to invoke an interface method.
+     *
+     * @param owner the class in which the method is defined.
+     * @param method the method to be invoked.
+     */
+    public void invokeInterface(final Type owner, final Method method) {
+        invokeInsn(Opcodes.INVOKEINTERFACE, owner, method);
+    }
+
+    /**
+     * Generates an invokedynamic instruction.
+     *
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param bsm the bootstrap method.
+     * @param bsmArgs the bootstrap method constant arguments. Each argument
+     *        must be an {@link Integer}, {@link Float}, {@link Long},
+     *        {@link Double}, {@link String}, {@link Type} or {@link Handle}
+     *        value. This method is allowed to modify the content of the array
+     *        so a caller should expect that this array may change.
+     */
+    public void invokeDynamic(String name, String desc, Handle bsm, Object... bsmArgs) {
+        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+    }
+
+    // ------------------------------------------------------------------------
+    // Instructions to create objects and arrays
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates a type dependent instruction.
+     *
+     * @param opcode the instruction's opcode.
+     * @param type the instruction's operand.
+     */
+    private void typeInsn(final int opcode, final Type type) {
+        mv.visitTypeInsn(opcode, type.getInternalName());
+    }
+
+    /**
+     * Generates the instruction to create a new object.
+     *
+     * @param type the class of the object to be created.
+     */
+    public void newInstance(final Type type) {
+        typeInsn(Opcodes.NEW, type);
+    }
+
+    /**
+     * Generates the instruction to create a new array.
+     *
+     * @param type the type of the array elements.
+     */
+    public void newArray(final Type type) {
+        int typ;
+        switch (type.getSort()) {
+            case Type.BOOLEAN:
+                typ = Opcodes.T_BOOLEAN;
+                break;
+            case Type.CHAR:
+                typ = Opcodes.T_CHAR;
+                break;
+            case Type.BYTE:
+                typ = Opcodes.T_BYTE;
+                break;
+            case Type.SHORT:
+                typ = Opcodes.T_SHORT;
+                break;
+            case Type.INT:
+                typ = Opcodes.T_INT;
+                break;
+            case Type.FLOAT:
+                typ = Opcodes.T_FLOAT;
+                break;
+            case Type.LONG:
+                typ = Opcodes.T_LONG;
+                break;
+            case Type.DOUBLE:
+                typ = Opcodes.T_DOUBLE;
+                break;
+            default:
+                typeInsn(Opcodes.ANEWARRAY, type);
+                return;
+        }
+        mv.visitIntInsn(Opcodes.NEWARRAY, typ);
+    }
+
+    // ------------------------------------------------------------------------
+    // Miscelaneous instructions
+    // ------------------------------------------------------------------------
+
+    /**
+     * Generates the instruction to compute the length of an array.
+     */
+    public void arrayLength() {
+        mv.visitInsn(Opcodes.ARRAYLENGTH);
+    }
+
+    /**
+     * Generates the instruction to throw an exception.
+     */
+    public void throwException() {
+        mv.visitInsn(Opcodes.ATHROW);
+    }
+
+    /**
+     * Generates the instructions to create and throw an exception. The
+     * exception class must have a constructor with a single String argument.
+     *
+     * @param type the class of the exception to be thrown.
+     * @param msg the detailed message of the exception.
+     */
+    public void throwException(final Type type, final String msg) {
+        newInstance(type);
+        dup();
+        push(msg);
+        invokeConstructor(type, Method.getMethod("void <init> (String)"));
+        throwException();
+    }
+
+    /**
+     * Generates the instruction to check that the top stack value is of the
+     * given type.
+     *
+     * @param type a class or interface type.
+     */
+    public void checkCast(final Type type) {
+        if (!type.equals(OBJECT_TYPE)) {
+            typeInsn(Opcodes.CHECKCAST, type);
+        }
+    }
+
+    /**
+     * Generates the instruction to test if the top stack value is of the given
+     * type.
+     *
+     * @param type a class or interface type.
+     */
+    public void instanceOf(final Type type) {
+        typeInsn(Opcodes.INSTANCEOF, type);
+    }
+
+    /**
+     * Generates the instruction to get the monitor of the top stack value.
+     */
+    public void monitorEnter() {
+        mv.visitInsn(Opcodes.MONITORENTER);
+    }
+
+    /**
+     * Generates the instruction to release the monitor of the top stack value.
+     */
+    public void monitorExit() {
+        mv.visitInsn(Opcodes.MONITOREXIT);
+    }
+
+    // ------------------------------------------------------------------------
+    // Non instructions
+    // ------------------------------------------------------------------------
+
+    /**
+     * Marks the end of the visited method.
+     */
+    public void endMethod() {
+        if ((access & Opcodes.ACC_ABSTRACT) == 0) {
+            mv.visitMaxs(0, 0);
+        }
+        mv.visitEnd();
+    }
+
+    /**
+     * Marks the start of an exception handler.
+     *
+     * @param start beginning of the exception handler's scope (inclusive).
+     * @param end end of the exception handler's scope (exclusive).
+     * @param exception internal name of the type of exceptions handled by the
+     *        handler.
+     */
+    public void catchException(
+        final Label start,
+        final Label end,
+        final Type exception)
+    {
+        if (exception == null) {
+            mv.visitTryCatchBlock(start, end, mark(), null);
+        } else {
+            mv.visitTryCatchBlock(start, end, mark(), exception.getInternalName());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/InstructionAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1170 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link MethodVisitor} providing a more detailed API to generate and
+ * transform instructions.
+ *
+ * @author Eric Bruneton
+ */
+public class InstructionAdapter extends MethodVisitor {
+
+    public final static Type OBJECT_TYPE = Type.getType("Ljava/lang/Object;");
+
+    /**
+     * Creates a new {@link InstructionAdapter}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #InstructionAdapter(int, MethodVisitor)} version.
+     *
+     * @param mv the method visitor to which this adapter delegates calls.
+     */
+    public InstructionAdapter(final MethodVisitor mv) {
+        this(Opcodes.ASM4, mv);
+    }
+
+    /**
+     * Creates a new {@link InstructionAdapter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param mv the method visitor to which this adapter delegates calls.
+     */
+    protected InstructionAdapter(final int api, final MethodVisitor mv) {
+        super(api, mv);
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        switch (opcode) {
+            case Opcodes.NOP:
+                nop();
+                break;
+            case Opcodes.ACONST_NULL:
+                aconst(null);
+                break;
+            case Opcodes.ICONST_M1:
+            case Opcodes.ICONST_0:
+            case Opcodes.ICONST_1:
+            case Opcodes.ICONST_2:
+            case Opcodes.ICONST_3:
+            case Opcodes.ICONST_4:
+            case Opcodes.ICONST_5:
+                iconst(opcode - Opcodes.ICONST_0);
+                break;
+            case Opcodes.LCONST_0:
+            case Opcodes.LCONST_1:
+                lconst(opcode - Opcodes.LCONST_0);
+                break;
+            case Opcodes.FCONST_0:
+            case Opcodes.FCONST_1:
+            case Opcodes.FCONST_2:
+                fconst(opcode - Opcodes.FCONST_0);
+                break;
+            case Opcodes.DCONST_0:
+            case Opcodes.DCONST_1:
+                dconst(opcode - Opcodes.DCONST_0);
+                break;
+            case Opcodes.IALOAD:
+                aload(Type.INT_TYPE);
+                break;
+            case Opcodes.LALOAD:
+                aload(Type.LONG_TYPE);
+                break;
+            case Opcodes.FALOAD:
+                aload(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DALOAD:
+                aload(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.AALOAD:
+                aload(OBJECT_TYPE);
+                break;
+            case Opcodes.BALOAD:
+                aload(Type.BYTE_TYPE);
+                break;
+            case Opcodes.CALOAD:
+                aload(Type.CHAR_TYPE);
+                break;
+            case Opcodes.SALOAD:
+                aload(Type.SHORT_TYPE);
+                break;
+            case Opcodes.IASTORE:
+                astore(Type.INT_TYPE);
+                break;
+            case Opcodes.LASTORE:
+                astore(Type.LONG_TYPE);
+                break;
+            case Opcodes.FASTORE:
+                astore(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DASTORE:
+                astore(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.AASTORE:
+                astore(OBJECT_TYPE);
+                break;
+            case Opcodes.BASTORE:
+                astore(Type.BYTE_TYPE);
+                break;
+            case Opcodes.CASTORE:
+                astore(Type.CHAR_TYPE);
+                break;
+            case Opcodes.SASTORE:
+                astore(Type.SHORT_TYPE);
+                break;
+            case Opcodes.POP:
+                pop();
+                break;
+            case Opcodes.POP2:
+                pop2();
+                break;
+            case Opcodes.DUP:
+                dup();
+                break;
+            case Opcodes.DUP_X1:
+                dupX1();
+                break;
+            case Opcodes.DUP_X2:
+                dupX2();
+                break;
+            case Opcodes.DUP2:
+                dup2();
+                break;
+            case Opcodes.DUP2_X1:
+                dup2X1();
+                break;
+            case Opcodes.DUP2_X2:
+                dup2X2();
+                break;
+            case Opcodes.SWAP:
+                swap();
+                break;
+            case Opcodes.IADD:
+                add(Type.INT_TYPE);
+                break;
+            case Opcodes.LADD:
+                add(Type.LONG_TYPE);
+                break;
+            case Opcodes.FADD:
+                add(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DADD:
+                add(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.ISUB:
+                sub(Type.INT_TYPE);
+                break;
+            case Opcodes.LSUB:
+                sub(Type.LONG_TYPE);
+                break;
+            case Opcodes.FSUB:
+                sub(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DSUB:
+                sub(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.IMUL:
+                mul(Type.INT_TYPE);
+                break;
+            case Opcodes.LMUL:
+                mul(Type.LONG_TYPE);
+                break;
+            case Opcodes.FMUL:
+                mul(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DMUL:
+                mul(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.IDIV:
+                div(Type.INT_TYPE);
+                break;
+            case Opcodes.LDIV:
+                div(Type.LONG_TYPE);
+                break;
+            case Opcodes.FDIV:
+                div(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DDIV:
+                div(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.IREM:
+                rem(Type.INT_TYPE);
+                break;
+            case Opcodes.LREM:
+                rem(Type.LONG_TYPE);
+                break;
+            case Opcodes.FREM:
+                rem(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DREM:
+                rem(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.INEG:
+                neg(Type.INT_TYPE);
+                break;
+            case Opcodes.LNEG:
+                neg(Type.LONG_TYPE);
+                break;
+            case Opcodes.FNEG:
+                neg(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DNEG:
+                neg(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.ISHL:
+                shl(Type.INT_TYPE);
+                break;
+            case Opcodes.LSHL:
+                shl(Type.LONG_TYPE);
+                break;
+            case Opcodes.ISHR:
+                shr(Type.INT_TYPE);
+                break;
+            case Opcodes.LSHR:
+                shr(Type.LONG_TYPE);
+                break;
+            case Opcodes.IUSHR:
+                ushr(Type.INT_TYPE);
+                break;
+            case Opcodes.LUSHR:
+                ushr(Type.LONG_TYPE);
+                break;
+            case Opcodes.IAND:
+                and(Type.INT_TYPE);
+                break;
+            case Opcodes.LAND:
+                and(Type.LONG_TYPE);
+                break;
+            case Opcodes.IOR:
+                or(Type.INT_TYPE);
+                break;
+            case Opcodes.LOR:
+                or(Type.LONG_TYPE);
+                break;
+            case Opcodes.IXOR:
+                xor(Type.INT_TYPE);
+                break;
+            case Opcodes.LXOR:
+                xor(Type.LONG_TYPE);
+                break;
+            case Opcodes.I2L:
+                cast(Type.INT_TYPE, Type.LONG_TYPE);
+                break;
+            case Opcodes.I2F:
+                cast(Type.INT_TYPE, Type.FLOAT_TYPE);
+                break;
+            case Opcodes.I2D:
+                cast(Type.INT_TYPE, Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.L2I:
+                cast(Type.LONG_TYPE, Type.INT_TYPE);
+                break;
+            case Opcodes.L2F:
+                cast(Type.LONG_TYPE, Type.FLOAT_TYPE);
+                break;
+            case Opcodes.L2D:
+                cast(Type.LONG_TYPE, Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.F2I:
+                cast(Type.FLOAT_TYPE, Type.INT_TYPE);
+                break;
+            case Opcodes.F2L:
+                cast(Type.FLOAT_TYPE, Type.LONG_TYPE);
+                break;
+            case Opcodes.F2D:
+                cast(Type.FLOAT_TYPE, Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.D2I:
+                cast(Type.DOUBLE_TYPE, Type.INT_TYPE);
+                break;
+            case Opcodes.D2L:
+                cast(Type.DOUBLE_TYPE, Type.LONG_TYPE);
+                break;
+            case Opcodes.D2F:
+                cast(Type.DOUBLE_TYPE, Type.FLOAT_TYPE);
+                break;
+            case Opcodes.I2B:
+                cast(Type.INT_TYPE, Type.BYTE_TYPE);
+                break;
+            case Opcodes.I2C:
+                cast(Type.INT_TYPE, Type.CHAR_TYPE);
+                break;
+            case Opcodes.I2S:
+                cast(Type.INT_TYPE, Type.SHORT_TYPE);
+                break;
+            case Opcodes.LCMP:
+                lcmp();
+                break;
+            case Opcodes.FCMPL:
+                cmpl(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.FCMPG:
+                cmpg(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DCMPL:
+                cmpl(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.DCMPG:
+                cmpg(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.IRETURN:
+                areturn(Type.INT_TYPE);
+                break;
+            case Opcodes.LRETURN:
+                areturn(Type.LONG_TYPE);
+                break;
+            case Opcodes.FRETURN:
+                areturn(Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DRETURN:
+                areturn(Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.ARETURN:
+                areturn(OBJECT_TYPE);
+                break;
+            case Opcodes.RETURN:
+                areturn(Type.VOID_TYPE);
+                break;
+            case Opcodes.ARRAYLENGTH:
+                arraylength();
+                break;
+            case Opcodes.ATHROW:
+                athrow();
+                break;
+            case Opcodes.MONITORENTER:
+                monitorenter();
+                break;
+            case Opcodes.MONITOREXIT:
+                monitorexit();
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        switch (opcode) {
+            case Opcodes.BIPUSH:
+                iconst(operand);
+                break;
+            case Opcodes.SIPUSH:
+                iconst(operand);
+                break;
+            case Opcodes.NEWARRAY:
+                switch (operand) {
+                    case Opcodes.T_BOOLEAN:
+                        newarray(Type.BOOLEAN_TYPE);
+                        break;
+                    case Opcodes.T_CHAR:
+                        newarray(Type.CHAR_TYPE);
+                        break;
+                    case Opcodes.T_BYTE:
+                        newarray(Type.BYTE_TYPE);
+                        break;
+                    case Opcodes.T_SHORT:
+                        newarray(Type.SHORT_TYPE);
+                        break;
+                    case Opcodes.T_INT:
+                        newarray(Type.INT_TYPE);
+                        break;
+                    case Opcodes.T_FLOAT:
+                        newarray(Type.FLOAT_TYPE);
+                        break;
+                    case Opcodes.T_LONG:
+                        newarray(Type.LONG_TYPE);
+                        break;
+                    case Opcodes.T_DOUBLE:
+                        newarray(Type.DOUBLE_TYPE);
+                        break;
+                    default:
+                        throw new IllegalArgumentException();
+                }
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        switch (opcode) {
+            case Opcodes.ILOAD:
+                load(var, Type.INT_TYPE);
+                break;
+            case Opcodes.LLOAD:
+                load(var, Type.LONG_TYPE);
+                break;
+            case Opcodes.FLOAD:
+                load(var, Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DLOAD:
+                load(var, Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.ALOAD:
+                load(var, OBJECT_TYPE);
+                break;
+            case Opcodes.ISTORE:
+                store(var, Type.INT_TYPE);
+                break;
+            case Opcodes.LSTORE:
+                store(var, Type.LONG_TYPE);
+                break;
+            case Opcodes.FSTORE:
+                store(var, Type.FLOAT_TYPE);
+                break;
+            case Opcodes.DSTORE:
+                store(var, Type.DOUBLE_TYPE);
+                break;
+            case Opcodes.ASTORE:
+                store(var, OBJECT_TYPE);
+                break;
+            case Opcodes.RET:
+                ret(var);
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        Type t = Type.getObjectType(type);
+        switch (opcode) {
+            case Opcodes.NEW:
+                anew(t);
+                break;
+            case Opcodes.ANEWARRAY:
+                newarray(t);
+                break;
+            case Opcodes.CHECKCAST:
+                checkcast(t);
+                break;
+            case Opcodes.INSTANCEOF:
+                instanceOf(t);
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        switch (opcode) {
+            case Opcodes.GETSTATIC:
+                getstatic(owner, name, desc);
+                break;
+            case Opcodes.PUTSTATIC:
+                putstatic(owner, name, desc);
+                break;
+            case Opcodes.GETFIELD:
+                getfield(owner, name, desc);
+                break;
+            case Opcodes.PUTFIELD:
+                putfield(owner, name, desc);
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        switch (opcode) {
+            case Opcodes.INVOKESPECIAL:
+                invokespecial(owner, name, desc);
+                break;
+            case Opcodes.INVOKEVIRTUAL:
+                invokevirtual(owner, name, desc);
+                break;
+            case Opcodes.INVOKESTATIC:
+                invokestatic(owner, name, desc);
+                break;
+            case Opcodes.INVOKEINTERFACE:
+                invokeinterface(owner, name, desc);
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+       invokedynamic(name, desc, bsm, bsmArgs);
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        switch (opcode) {
+            case Opcodes.IFEQ:
+                ifeq(label);
+                break;
+            case Opcodes.IFNE:
+                ifne(label);
+                break;
+            case Opcodes.IFLT:
+                iflt(label);
+                break;
+            case Opcodes.IFGE:
+                ifge(label);
+                break;
+            case Opcodes.IFGT:
+                ifgt(label);
+                break;
+            case Opcodes.IFLE:
+                ifle(label);
+                break;
+            case Opcodes.IF_ICMPEQ:
+                ificmpeq(label);
+                break;
+            case Opcodes.IF_ICMPNE:
+                ificmpne(label);
+                break;
+            case Opcodes.IF_ICMPLT:
+                ificmplt(label);
+                break;
+            case Opcodes.IF_ICMPGE:
+                ificmpge(label);
+                break;
+            case Opcodes.IF_ICMPGT:
+                ificmpgt(label);
+                break;
+            case Opcodes.IF_ICMPLE:
+                ificmple(label);
+                break;
+            case Opcodes.IF_ACMPEQ:
+                ifacmpeq(label);
+                break;
+            case Opcodes.IF_ACMPNE:
+                ifacmpne(label);
+                break;
+            case Opcodes.GOTO:
+                goTo(label);
+                break;
+            case Opcodes.JSR:
+                jsr(label);
+                break;
+            case Opcodes.IFNULL:
+                ifnull(label);
+                break;
+            case Opcodes.IFNONNULL:
+                ifnonnull(label);
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        mark(label);
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        if (cst instanceof Integer) {
+            int val = ((Integer) cst).intValue();
+            iconst(val);
+        } else if (cst instanceof Byte) {
+            int val = ((Byte) cst).intValue();
+            iconst(val);
+        } else if (cst instanceof Character) {
+            int val = ((Character) cst).charValue();
+            iconst(val);
+        } else if (cst instanceof Short) {
+            int val = ((Short) cst).intValue();
+            iconst(val);
+        } else if (cst instanceof Boolean) {
+            int val = ((Boolean) cst).booleanValue() ? 1 : 0;
+            iconst(val);
+        } else if (cst instanceof Float) {
+            float val = ((Float) cst).floatValue();
+            fconst(val);
+        } else if (cst instanceof Long) {
+            long val = ((Long) cst).longValue();
+            lconst(val);
+        } else if (cst instanceof Double) {
+            double val = ((Double) cst).doubleValue();
+            dconst(val);
+        } else if (cst instanceof String) {
+            aconst(cst);
+        } else if (cst instanceof Type) {
+            tconst((Type) cst);
+        } else if (cst instanceof Handle) {
+            hconst((Handle) cst);
+        } else {
+            throw new IllegalArgumentException();
+        }
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        iinc(var, increment);
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        tableswitch(min, max, dflt, labels);
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        lookupswitch(dflt, keys, labels);
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        multianewarray(desc, dims);
+    }
+
+    // -----------------------------------------------------------------------
+
+    public void nop() {
+        mv.visitInsn(Opcodes.NOP);
+    }
+
+    public void aconst(final Object cst) {
+        if (cst == null) {
+            mv.visitInsn(Opcodes.ACONST_NULL);
+        } else {
+            mv.visitLdcInsn(cst);
+        }
+    }
+
+    public void iconst(final int cst) {
+        if (cst >= -1 && cst <= 5) {
+            mv.visitInsn(Opcodes.ICONST_0 + cst);
+        } else if (cst >= Byte.MIN_VALUE && cst <= Byte.MAX_VALUE) {
+            mv.visitIntInsn(Opcodes.BIPUSH, cst);
+        } else if (cst >= Short.MIN_VALUE && cst <= Short.MAX_VALUE) {
+            mv.visitIntInsn(Opcodes.SIPUSH, cst);
+        } else {
+            mv.visitLdcInsn(new Integer(cst));
+        }
+    }
+
+    public void lconst(final long cst) {
+        if (cst == 0L || cst == 1L) {
+            mv.visitInsn(Opcodes.LCONST_0 + (int) cst);
+        } else {
+            mv.visitLdcInsn(new Long(cst));
+        }
+    }
+
+    public void fconst(final float cst) {
+        int bits = Float.floatToIntBits(cst);
+        if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
+            mv.visitInsn(Opcodes.FCONST_0 + (int) cst);
+        } else {
+            mv.visitLdcInsn(new Float(cst));
+        }
+    }
+
+    public void dconst(final double cst) {
+        long bits = Double.doubleToLongBits(cst);
+        if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
+            mv.visitInsn(Opcodes.DCONST_0 + (int) cst);
+        } else {
+            mv.visitLdcInsn(new Double(cst));
+        }
+    }
+
+    public void tconst(final Type type) {
+        mv.visitLdcInsn(type);
+    }
+
+    public void hconst(final Handle handle) {
+        mv.visitLdcInsn(handle);
+    }
+
+    public void load(final int var, final Type type) {
+        mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), var);
+    }
+
+    public void aload(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IALOAD));
+    }
+
+    public void store(final int var, final Type type) {
+        mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), var);
+    }
+
+    public void astore(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IASTORE));
+    }
+
+    public void pop() {
+        mv.visitInsn(Opcodes.POP);
+    }
+
+    public void pop2() {
+        mv.visitInsn(Opcodes.POP2);
+    }
+
+    public void dup() {
+        mv.visitInsn(Opcodes.DUP);
+    }
+
+    public void dup2() {
+        mv.visitInsn(Opcodes.DUP2);
+    }
+
+    public void dupX1() {
+        mv.visitInsn(Opcodes.DUP_X1);
+    }
+
+    public void dupX2() {
+        mv.visitInsn(Opcodes.DUP_X2);
+    }
+
+    public void dup2X1() {
+        mv.visitInsn(Opcodes.DUP2_X1);
+    }
+
+    public void dup2X2() {
+        mv.visitInsn(Opcodes.DUP2_X2);
+    }
+
+    public void swap() {
+        mv.visitInsn(Opcodes.SWAP);
+    }
+
+    public void add(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IADD));
+    }
+
+    public void sub(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.ISUB));
+    }
+
+    public void mul(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IMUL));
+    }
+
+    public void div(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IDIV));
+    }
+
+    public void rem(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IREM));
+    }
+
+    public void neg(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.INEG));
+    }
+
+    public void shl(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.ISHL));
+    }
+
+    public void shr(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.ISHR));
+    }
+
+    public void ushr(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IUSHR));
+    }
+
+    public void and(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IAND));
+    }
+
+    public void or(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IOR));
+    }
+
+    public void xor(final Type type) {
+        mv.visitInsn(type.getOpcode(Opcodes.IXOR));
+    }
+
+    public void iinc(final int var, final int increment) {
+        mv.visitIincInsn(var, increment);
+    }
+
+    public void cast(final Type from, final Type to) {
+        if (from != to) {
+            if (from == Type.DOUBLE_TYPE) {
+                if (to == Type.FLOAT_TYPE) {
+                    mv.visitInsn(Opcodes.D2F);
+                } else if (to == Type.LONG_TYPE) {
+                    mv.visitInsn(Opcodes.D2L);
+                } else {
+                    mv.visitInsn(Opcodes.D2I);
+                    cast(Type.INT_TYPE, to);
+                }
+            } else if (from == Type.FLOAT_TYPE) {
+                if (to == Type.DOUBLE_TYPE) {
+                    mv.visitInsn(Opcodes.F2D);
+                } else if (to == Type.LONG_TYPE) {
+                    mv.visitInsn(Opcodes.F2L);
+                } else {
+                    mv.visitInsn(Opcodes.F2I);
+                    cast(Type.INT_TYPE, to);
+                }
+            } else if (from == Type.LONG_TYPE) {
+                if (to == Type.DOUBLE_TYPE) {
+                    mv.visitInsn(Opcodes.L2D);
+                } else if (to == Type.FLOAT_TYPE) {
+                    mv.visitInsn(Opcodes.L2F);
+                } else {
+                    mv.visitInsn(Opcodes.L2I);
+                    cast(Type.INT_TYPE, to);
+                }
+            } else {
+                if (to == Type.BYTE_TYPE) {
+                    mv.visitInsn(Opcodes.I2B);
+                } else if (to == Type.CHAR_TYPE) {
+                    mv.visitInsn(Opcodes.I2C);
+                } else if (to == Type.DOUBLE_TYPE) {
+                    mv.visitInsn(Opcodes.I2D);
+                } else if (to == Type.FLOAT_TYPE) {
+                    mv.visitInsn(Opcodes.I2F);
+                } else if (to == Type.LONG_TYPE) {
+                    mv.visitInsn(Opcodes.I2L);
+                } else if (to == Type.SHORT_TYPE) {
+                    mv.visitInsn(Opcodes.I2S);
+                }
+            }
+        }
+    }
+
+    public void lcmp() {
+        mv.visitInsn(Opcodes.LCMP);
+    }
+
+    public void cmpl(final Type type) {
+        mv.visitInsn(type == Type.FLOAT_TYPE ? Opcodes.FCMPL : Opcodes.DCMPL);
+    }
+
+    public void cmpg(final Type type) {
+        mv.visitInsn(type == Type.FLOAT_TYPE ? Opcodes.FCMPG : Opcodes.DCMPG);
+    }
+
+    public void ifeq(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFEQ, label);
+    }
+
+    public void ifne(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFNE, label);
+    }
+
+    public void iflt(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFLT, label);
+    }
+
+    public void ifge(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFGE, label);
+    }
+
+    public void ifgt(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFGT, label);
+    }
+
+    public void ifle(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFLE, label);
+    }
+
+    public void ificmpeq(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ICMPEQ, label);
+    }
+
+    public void ificmpne(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ICMPNE, label);
+    }
+
+    public void ificmplt(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ICMPLT, label);
+    }
+
+    public void ificmpge(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ICMPGE, label);
+    }
+
+    public void ificmpgt(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ICMPGT, label);
+    }
+
+    public void ificmple(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ICMPLE, label);
+    }
+
+    public void ifacmpeq(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
+    }
+
+    public void ifacmpne(final Label label) {
+        mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
+    }
+
+    public void goTo(final Label label) {
+        mv.visitJumpInsn(Opcodes.GOTO, label);
+    }
+
+    public void jsr(final Label label) {
+        mv.visitJumpInsn(Opcodes.JSR, label);
+    }
+
+    public void ret(final int var) {
+        mv.visitVarInsn(Opcodes.RET, var);
+    }
+
+    public void tableswitch(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        mv.visitTableSwitchInsn(min, max, dflt, labels);
+    }
+
+    public void lookupswitch(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        mv.visitLookupSwitchInsn(dflt, keys, labels);
+    }
+
+    public void areturn(final Type t) {
+        mv.visitInsn(t.getOpcode(Opcodes.IRETURN));
+    }
+
+    public void getstatic(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitFieldInsn(Opcodes.GETSTATIC, owner, name, desc);
+    }
+
+    public void putstatic(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitFieldInsn(Opcodes.PUTSTATIC, owner, name, desc);
+    }
+
+    public void getfield(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitFieldInsn(Opcodes.GETFIELD, owner, name, desc);
+    }
+
+    public void putfield(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitFieldInsn(Opcodes.PUTFIELD, owner, name, desc);
+    }
+
+    public void invokevirtual(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc);
+    }
+
+    public void invokespecial(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc);
+    }
+
+    public void invokestatic(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc);
+    }
+
+    public void invokeinterface(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, owner, name, desc);
+    }
+
+    public void invokedynamic(
+        String name,
+        String desc,
+        Handle bsm,
+        Object[] bsmArgs)
+    {
+        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+    }
+
+    public void anew(final Type type) {
+        mv.visitTypeInsn(Opcodes.NEW, type.getInternalName());
+    }
+
+    public void newarray(final Type type) {
+        int typ;
+        switch (type.getSort()) {
+            case Type.BOOLEAN:
+                typ = Opcodes.T_BOOLEAN;
+                break;
+            case Type.CHAR:
+                typ = Opcodes.T_CHAR;
+                break;
+            case Type.BYTE:
+                typ = Opcodes.T_BYTE;
+                break;
+            case Type.SHORT:
+                typ = Opcodes.T_SHORT;
+                break;
+            case Type.INT:
+                typ = Opcodes.T_INT;
+                break;
+            case Type.FLOAT:
+                typ = Opcodes.T_FLOAT;
+                break;
+            case Type.LONG:
+                typ = Opcodes.T_LONG;
+                break;
+            case Type.DOUBLE:
+                typ = Opcodes.T_DOUBLE;
+                break;
+            default:
+                mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName());
+                return;
+        }
+        mv.visitIntInsn(Opcodes.NEWARRAY, typ);
+    }
+
+    public void arraylength() {
+        mv.visitInsn(Opcodes.ARRAYLENGTH);
+    }
+
+    public void athrow() {
+        mv.visitInsn(Opcodes.ATHROW);
+    }
+
+    public void checkcast(final Type type) {
+        mv.visitTypeInsn(Opcodes.CHECKCAST, type.getInternalName());
+    }
+
+    public void instanceOf(final Type type) {
+        mv.visitTypeInsn(Opcodes.INSTANCEOF, type.getInternalName());
+    }
+
+    public void monitorenter() {
+        mv.visitInsn(Opcodes.MONITORENTER);
+    }
+
+    public void monitorexit() {
+        mv.visitInsn(Opcodes.MONITOREXIT);
+    }
+
+    public void multianewarray(final String desc, final int dims) {
+        mv.visitMultiANewArrayInsn(desc, dims);
+    }
+
+    public void ifnull(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFNULL, label);
+    }
+
+    public void ifnonnull(final Label label) {
+        mv.visitJumpInsn(Opcodes.IFNONNULL, label);
+    }
+
+    public void mark(final Label label) {
+        mv.visitLabel(label);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/JSRInlinerAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,770 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.InsnList;
+import jdk.internal.org.objectweb.asm.tree.InsnNode;
+import jdk.internal.org.objectweb.asm.tree.JumpInsnNode;
+import jdk.internal.org.objectweb.asm.tree.LabelNode;
+import jdk.internal.org.objectweb.asm.tree.LocalVariableNode;
+import jdk.internal.org.objectweb.asm.tree.LookupSwitchInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodNode;
+import jdk.internal.org.objectweb.asm.tree.TableSwitchInsnNode;
+import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
+
+/**
+ * A {@link jdk.internal.org.objectweb.asm.MethodVisitor} that removes JSR instructions and
+ * inlines the referenced subroutines.
+ *
+ * <b>Explanation of how it works</b> TODO
+ *
+ * @author Niko Matsakis
+ */
+public class JSRInlinerAdapter extends MethodNode implements Opcodes {
+
+    private static final boolean LOGGING = false;
+
+    /**
+     * For each label that is jumped to by a JSR, we create a BitSet
+     * instance.
+     */
+    private final Map<LabelNode,BitSet> subroutineHeads = new HashMap<LabelNode,BitSet>();
+
+    /**
+     * This subroutine instance denotes the line of execution that is not
+     * contained within any subroutine; i.e., the "subroutine" that is executing
+     * when a method first begins.
+     */
+    private final BitSet mainSubroutine = new BitSet();
+
+    /**
+     * This BitSet contains the index of every instruction that belongs to more
+     * than one subroutine. This should not happen often.
+     */
+    final BitSet dualCitizens = new BitSet();
+
+    /**
+     * Creates a new JSRInliner. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #JSRInlinerAdapter(int, MethodVisitor, int, String, String, String, String[])}
+     * version.
+     *
+     * @param mv the <code>MethodVisitor</code> to send the resulting inlined
+     *        method code to (use <code>null</code> for none).
+     * @param access the method's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the method is synthetic and/or
+     *        deprecated.
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type}).
+     * @param signature the method's signature. May be <tt>null</tt>.
+     * @param exceptions the internal names of the method's exception classes
+     *        (see {@link Type#getInternalName() getInternalName}). May be
+     *        <tt>null</tt>.
+     */
+    public JSRInlinerAdapter(
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        this(Opcodes.ASM4, mv, access, name, desc, signature, exceptions);
+    }
+
+    /**
+     * Creates a new JSRInliner.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param mv the <code>MethodVisitor</code> to send the resulting inlined
+     *        method code to (use <code>null</code> for none).
+     * @param access the method's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the method is synthetic and/or
+     *        deprecated.
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type}).
+     * @param signature the method's signature. May be <tt>null</tt>.
+     * @param exceptions the internal names of the method's exception classes
+     *        (see {@link Type#getInternalName() getInternalName}). May be
+     *        <tt>null</tt>.
+     */
+    protected JSRInlinerAdapter(
+        final int api,
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        super(api, access, name, desc, signature, exceptions);
+        this.mv = mv;
+    }
+
+    /**
+     * Detects a JSR instruction and sets a flag to indicate we will need to do
+     * inlining.
+     */
+    @Override
+    public void visitJumpInsn(final int opcode, final Label lbl) {
+        super.visitJumpInsn(opcode, lbl);
+        LabelNode ln = ((JumpInsnNode) instructions.getLast()).label;
+        if (opcode == JSR && !subroutineHeads.containsKey(ln)) {
+            subroutineHeads.put(ln, new BitSet());
+        }
+    }
+
+    /**
+     * If any JSRs were seen, triggers the inlining process. Otherwise, forwards
+     * the byte codes untouched.
+     */
+    @Override
+    public void visitEnd() {
+        if (!subroutineHeads.isEmpty()) {
+            markSubroutines();
+            if (LOGGING) {
+                log(mainSubroutine.toString());
+                Iterator<BitSet> it = subroutineHeads.values().iterator();
+                while (it.hasNext()) {
+                    BitSet sub = it.next();
+                    log(sub.toString());
+                }
+            }
+            emitCode();
+        }
+
+        // Forward the translate opcodes on if appropriate:
+        if (mv != null) {
+            accept(mv);
+        }
+    }
+
+    /**
+     * Walks the method and determines which internal subroutine(s), if any,
+     * each instruction is a method of.
+     */
+    private void markSubroutines() {
+        BitSet anyvisited = new BitSet();
+
+        // First walk the main subroutine and find all those instructions which
+        // can be reached without invoking any JSR at all
+        markSubroutineWalk(mainSubroutine, 0, anyvisited);
+
+        // Go through the head of each subroutine and find any nodes reachable
+        // to that subroutine without following any JSR links.
+        for (Iterator<Map.Entry<LabelNode,BitSet>> it = subroutineHeads.entrySet().iterator(); it.hasNext();)
+        {
+            Map.Entry<LabelNode,BitSet> entry = it.next();
+            LabelNode lab = entry.getKey();
+            BitSet sub = entry.getValue();
+            int index = instructions.indexOf(lab);
+            markSubroutineWalk(sub, index, anyvisited);
+        }
+    }
+
+    /**
+     * Performs a depth first search walking the normal byte code path starting
+     * at <code>index</code>, and adding each instruction encountered into
+     * the subroutine <code>sub</code>. After this walk is complete, iterates
+     * over the exception handlers to ensure that we also include those byte
+     * codes which are reachable through an exception that may be thrown during
+     * the execution of the subroutine. Invoked from
+     * <code>markSubroutines()</code>.
+     *
+     * @param sub the subroutine whose instructions must be computed.
+     * @param index an instruction of this subroutine.
+     * @param anyvisited indexes of the already visited instructions, i.e.
+     *        marked as part of this subroutine or any previously computed
+     *        subroutine.
+     */
+    private void markSubroutineWalk(
+        final BitSet sub,
+        final int index,
+        final BitSet anyvisited)
+    {
+        if (LOGGING) {
+            log("markSubroutineWalk: sub=" + sub + " index=" + index);
+        }
+
+        // First find those instructions reachable via normal execution
+        markSubroutineWalkDFS(sub, index, anyvisited);
+
+        // Now, make sure we also include any applicable exception handlers
+        boolean loop = true;
+        while (loop) {
+            loop = false;
+            for (Iterator<TryCatchBlockNode> it = tryCatchBlocks.iterator(); it.hasNext();) {
+                TryCatchBlockNode trycatch = it.next();
+
+                if (LOGGING) {
+                    // TODO use of default toString().
+                    log("Scanning try/catch " + trycatch);
+                }
+
+                // If the handler has already been processed, skip it.
+                int handlerindex = instructions.indexOf(trycatch.handler);
+                if (sub.get(handlerindex)) {
+                    continue;
+                }
+
+                int startindex = instructions.indexOf(trycatch.start);
+                int endindex = instructions.indexOf(trycatch.end);
+                int nextbit = sub.nextSetBit(startindex);
+                if (nextbit != -1 && nextbit < endindex) {
+                    if (LOGGING) {
+                        log("Adding exception handler: " + startindex + '-'
+                                + endindex + " due to " + nextbit + " handler "
+                                + handlerindex);
+                    }
+                    markSubroutineWalkDFS(sub, handlerindex, anyvisited);
+                    loop = true;
+                }
+            }
+        }
+    }
+
+    /**
+     * Performs a simple DFS of the instructions, assigning each to the
+     * subroutine <code>sub</code>. Starts from <code>index</code>.
+     * Invoked only by <code>markSubroutineWalk()</code>.
+     *
+     * @param sub the subroutine whose instructions must be computed.
+     * @param index an instruction of this subroutine.
+     * @param anyvisited indexes of the already visited instructions, i.e.
+     *        marked as part of this subroutine or any previously computed
+     *        subroutine.
+     */
+    private void markSubroutineWalkDFS(
+        final BitSet sub,
+        int index,
+        final BitSet anyvisited)
+    {
+        while (true) {
+            AbstractInsnNode node = instructions.get(index);
+
+            // don't visit a node twice
+            if (sub.get(index)) {
+                return;
+            }
+            sub.set(index);
+
+            // check for those nodes already visited by another subroutine
+            if (anyvisited.get(index)) {
+                dualCitizens.set(index);
+                if (LOGGING) {
+                    log("Instruction #" + index + " is dual citizen.");
+                }
+            }
+            anyvisited.set(index);
+
+            if (node.getType() == AbstractInsnNode.JUMP_INSN
+                    && node.getOpcode() != JSR)
+            {
+                // we do not follow recursively called subroutines here; but any
+                // other sort of branch we do follow
+                JumpInsnNode jnode = (JumpInsnNode) node;
+                int destidx = instructions.indexOf(jnode.label);
+                markSubroutineWalkDFS(sub, destidx, anyvisited);
+            }
+            if (node.getType() == AbstractInsnNode.TABLESWITCH_INSN) {
+                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
+                int destidx = instructions.indexOf(tsnode.dflt);
+                markSubroutineWalkDFS(sub, destidx, anyvisited);
+                for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
+                    LabelNode l = tsnode.labels.get(i);
+                    destidx = instructions.indexOf(l);
+                    markSubroutineWalkDFS(sub, destidx, anyvisited);
+                }
+            }
+            if (node.getType() == AbstractInsnNode.LOOKUPSWITCH_INSN) {
+                LookupSwitchInsnNode lsnode = (LookupSwitchInsnNode) node;
+                int destidx = instructions.indexOf(lsnode.dflt);
+                markSubroutineWalkDFS(sub, destidx, anyvisited);
+                for (int i = lsnode.labels.size() - 1; i >= 0; --i) {
+                    LabelNode l = lsnode.labels.get(i);
+                    destidx = instructions.indexOf(l);
+                    markSubroutineWalkDFS(sub, destidx, anyvisited);
+                }
+            }
+
+            // check to see if this opcode falls through to the next instruction
+            // or not; if not, return.
+            switch (instructions.get(index).getOpcode()) {
+                case GOTO:
+                case RET:
+                case TABLESWITCH:
+                case LOOKUPSWITCH:
+                case IRETURN:
+                case LRETURN:
+                case FRETURN:
+                case DRETURN:
+                case ARETURN:
+                case RETURN:
+                case ATHROW:
+                    /*
+                     * note: this either returns from this subroutine, or a
+                     * parent subroutine which invoked it
+                     */
+                    return;
+            }
+
+            // Use tail recursion here in the form of an outer while loop to
+            // avoid our stack growing needlessly:
+            index++;
+        }
+    }
+
+    /**
+     * Creates the new instructions, inlining each instantiation of each
+     * subroutine until the code is fully elaborated.
+     */
+    private void emitCode() {
+        LinkedList<Instantiation> worklist = new LinkedList<Instantiation>();
+        // Create an instantiation of the "root" subroutine, which is just the
+        // main routine
+        worklist.add(new Instantiation(null, mainSubroutine));
+
+        // Emit instantiations of each subroutine we encounter, including the
+        // main subroutine
+        InsnList newInstructions = new InsnList();
+        List<TryCatchBlockNode> newTryCatchBlocks = new ArrayList<TryCatchBlockNode>();
+        List<LocalVariableNode> newLocalVariables = new ArrayList<LocalVariableNode>();
+        while (!worklist.isEmpty()) {
+            Instantiation inst = worklist.removeFirst();
+            emitSubroutine(inst,
+                    worklist,
+                    newInstructions,
+                    newTryCatchBlocks,
+                    newLocalVariables);
+        }
+        instructions = newInstructions;
+        tryCatchBlocks = newTryCatchBlocks;
+        localVariables = newLocalVariables;
+    }
+
+    /**
+     * Emits one instantiation of one subroutine, specified by
+     * <code>instant</code>. May add new instantiations that are invoked by
+     * this one to the <code>worklist</code> parameter, and new try/catch
+     * blocks to <code>newTryCatchBlocks</code>.
+     *
+     * @param instant the instantiation that must be performed.
+     * @param worklist list of the instantiations that remain to be done.
+     * @param newInstructions the instruction list to which the instantiated
+     *        code must be appended.
+     * @param newTryCatchBlocks the exception handler list to which the
+     *        instantiated handlers must be appended.
+     */
+    private void emitSubroutine(
+        final Instantiation instant,
+        final List<Instantiation> worklist,
+        final InsnList newInstructions,
+        final List<TryCatchBlockNode> newTryCatchBlocks,
+        final List<LocalVariableNode> newLocalVariables)
+    {
+        LabelNode duplbl = null;
+
+        if (LOGGING) {
+            log("--------------------------------------------------------");
+            log("Emitting instantiation of subroutine " + instant.subroutine);
+        }
+
+        // Emit the relevant instructions for this instantiation, translating
+        // labels and jump targets as we go:
+        for (int i = 0, c = instructions.size(); i < c; i++) {
+            AbstractInsnNode insn = instructions.get(i);
+            Instantiation owner = instant.findOwner(i);
+
+            // Always remap labels:
+            if (insn.getType() == AbstractInsnNode.LABEL) {
+                // Translate labels into their renamed equivalents.
+                // Avoid adding the same label more than once. Note
+                // that because we own this instruction the gotoTable
+                // and the rangeTable will always agree.
+                LabelNode ilbl = (LabelNode) insn;
+                LabelNode remap = instant.rangeLabel(ilbl);
+                if (LOGGING) {
+                    // TODO use of default toString().
+                    log("Translating lbl #" + i + ':' + ilbl + " to " + remap);
+                }
+                if (remap != duplbl) {
+                    newInstructions.add(remap);
+                    duplbl = remap;
+                }
+                continue;
+            }
+
+            // We don't want to emit instructions that were already
+            // emitted by a subroutine higher on the stack. Note that
+            // it is still possible for a given instruction to be
+            // emitted twice because it may belong to two subroutines
+            // that do not invoke each other.
+            if (owner != instant) {
+                continue;
+            }
+
+            if (LOGGING) {
+                log("Emitting inst #" + i);
+            }
+
+            if (insn.getOpcode() == RET) {
+                // Translate RET instruction(s) to a jump to the return label
+                // for the appropriate instantiation. The problem is that the
+                // subroutine may "fall through" to the ret of a parent
+                // subroutine; therefore, to find the appropriate ret label we
+                // find the lowest subroutine on the stack that claims to own
+                // this instruction. See the class javadoc comment for an
+                // explanation on why this technique is safe (note: it is only
+                // safe if the input is verifiable).
+                LabelNode retlabel = null;
+                for (Instantiation p = instant; p != null; p = p.previous) {
+                    if (p.subroutine.get(i)) {
+                        retlabel = p.returnLabel;
+                    }
+                }
+                if (retlabel == null) {
+                    // This is only possible if the mainSubroutine owns a RET
+                    // instruction, which should never happen for verifiable
+                    // code.
+                    throw new RuntimeException("Instruction #" + i
+                            + " is a RET not owned by any subroutine");
+                }
+                newInstructions.add(new JumpInsnNode(GOTO, retlabel));
+            } else if (insn.getOpcode() == JSR) {
+                LabelNode lbl = ((JumpInsnNode) insn).label;
+                BitSet sub = subroutineHeads.get(lbl);
+                Instantiation newinst = new Instantiation(instant, sub);
+                LabelNode startlbl = newinst.gotoLabel(lbl);
+
+                if (LOGGING) {
+                    log(" Creating instantiation of subr " + sub);
+                }
+
+                // Rather than JSRing, we will jump to the inline version and
+                // push NULL for what was once the return value. This hack
+                // allows us to avoid doing any sort of data flow analysis to
+                // figure out which instructions manipulate the old return value
+                // pointer which is now known to be unneeded.
+                newInstructions.add(new InsnNode(ACONST_NULL));
+                newInstructions.add(new JumpInsnNode(GOTO, startlbl));
+                newInstructions.add(newinst.returnLabel);
+
+                // Insert this new instantiation into the queue to be emitted
+                // later.
+                worklist.add(newinst);
+            } else {
+                newInstructions.add(insn.clone(instant));
+            }
+        }
+
+        // Emit try/catch blocks that are relevant to this method.
+        for (Iterator<TryCatchBlockNode> it = tryCatchBlocks.iterator(); it.hasNext();) {
+            TryCatchBlockNode trycatch = it.next();
+
+            if (LOGGING) {
+                // TODO use of default toString().
+                log("try catch block original labels=" + trycatch.start + '-'
+                        + trycatch.end + "->" + trycatch.handler);
+            }
+
+            final LabelNode start = instant.rangeLabel(trycatch.start);
+            final LabelNode end = instant.rangeLabel(trycatch.end);
+
+            // Ignore empty try/catch regions
+            if (start == end) {
+                if (LOGGING) {
+                    log(" try catch block empty in this subroutine");
+                }
+                continue;
+            }
+
+            final LabelNode handler = instant.gotoLabel(trycatch.handler);
+
+            if (LOGGING) {
+                // TODO use of default toString().
+                log(" try catch block new labels=" + start + '-' + end + "->"
+                        + handler);
+            }
+
+            if (start == null || end == null || handler == null) {
+                throw new RuntimeException("Internal error!");
+            }
+
+            newTryCatchBlocks.add(new TryCatchBlockNode(start,
+                    end,
+                    handler,
+                    trycatch.type));
+        }
+
+        for (Iterator<LocalVariableNode> it = localVariables.iterator(); it.hasNext();) {
+            LocalVariableNode lvnode = it.next();
+            if (LOGGING) {
+                log("local var " + lvnode.name);
+            }
+            final LabelNode start = instant.rangeLabel(lvnode.start);
+            final LabelNode end = instant.rangeLabel(lvnode.end);
+            if (start == end) {
+                if (LOGGING) {
+                    log("  local variable empty in this sub");
+                }
+                continue;
+            }
+            newLocalVariables.add(new LocalVariableNode(lvnode.name,
+                    lvnode.desc,
+                    lvnode.signature,
+                    start,
+                    end,
+                    lvnode.index));
+        }
+    }
+
+    private static void log(final String str) {
+        System.err.println(str);
+    }
+
+    /**
+     * A class that represents an instantiation of a subroutine. Each
+     * instantiation has an associate "stack" --- which is a listing of those
+     * instantiations that were active when this particular instance of this
+     * subroutine was invoked. Each instantiation also has a map from the
+     * original labels of the program to the labels appropriate for this
+     * instantiation, and finally a label to return to.
+     */
+    private class Instantiation extends AbstractMap<LabelNode, LabelNode> {
+
+        /**
+         * Previous instantiations; the stack must be statically predictable to
+         * be inlinable.
+         */
+        final Instantiation previous;
+
+        /**
+         * The subroutine this is an instantiation of.
+         */
+        public final BitSet subroutine;
+
+        /**
+         * This table maps Labels from the original source to Labels pointing at
+         * code specific to this instantiation, for use in remapping try/catch
+         * blocks,as well as gotos.
+         *
+         * Note that in the presence of dual citizens instructions, that is,
+         * instructions which belong to more than one subroutine due to the
+         * merging of control flow without a RET instruction, we will map the
+         * target label of a GOTO to the label used by the instantiation lowest
+         * on the stack. This avoids code duplication during inlining in most
+         * cases.
+         *
+         * @see #findOwner(int)
+         */
+        public final Map<LabelNode, LabelNode> rangeTable = new HashMap<LabelNode, LabelNode>();
+
+        /**
+         * All returns for this instantiation will be mapped to this label
+         */
+        public final LabelNode returnLabel;
+
+        Instantiation(final Instantiation prev, final BitSet sub) {
+            previous = prev;
+            subroutine = sub;
+            for (Instantiation p = prev; p != null; p = p.previous) {
+                if (p.subroutine == sub) {
+                    throw new RuntimeException("Recursive invocation of " + sub);
+                }
+            }
+
+            // Determine the label to return to when this subroutine terminates
+            // via RET: note that the main subroutine never terminates via RET.
+            if (prev != null) {
+                returnLabel = new LabelNode();
+            } else {
+                returnLabel = null;
+            }
+
+            // Each instantiation will remap the labels from the code above to
+            // refer to its particular copy of its own instructions. Note that
+            // we collapse labels which point at the same instruction into one:
+            // this is fairly common as we are often ignoring large chunks of
+            // instructions, so what were previously distinct labels become
+            // duplicates.
+            LabelNode duplbl = null;
+            for (int i = 0, c = instructions.size(); i < c; i++) {
+                AbstractInsnNode insn = instructions.get(i);
+
+                if (insn.getType() == AbstractInsnNode.LABEL) {
+                    LabelNode ilbl = (LabelNode) insn;
+
+                    if (duplbl == null) {
+                        // if we already have a label pointing at this spot,
+                        // don't recreate it.
+                        duplbl = new LabelNode();
+                    }
+
+                    // Add an entry in the rangeTable for every label
+                    // in the original code which points at the next
+                    // instruction of our own to be emitted.
+                    rangeTable.put(ilbl, duplbl);
+                } else if (findOwner(i) == this) {
+                    // We will emit this instruction, so clear the 'duplbl' flag
+                    // since the next Label will refer to a distinct
+                    // instruction.
+                    duplbl = null;
+                }
+            }
+        }
+
+        /**
+         * Returns the "owner" of a particular instruction relative to this
+         * instantiation: the owner referes to the Instantiation which will emit
+         * the version of this instruction that we will execute.
+         *
+         * Typically, the return value is either <code>this</code> or
+         * <code>null</code>. <code>this</code> indicates that this
+         * instantiation will generate the version of this instruction that we
+         * will execute, and <code>null</code> indicates that this
+         * instantiation never executes the given instruction.
+         *
+         * Sometimes, however, an instruction can belong to multiple
+         * subroutines; this is called a "dual citizen" instruction (though it
+         * may belong to more than 2 subroutines), and occurs when multiple
+         * subroutines branch to common points of control. In this case, the
+         * owner is the subroutine that appears lowest on the stack, and which
+         * also owns the instruction in question.
+         *
+         * @param i the index of the instruction in the original code
+         * @return the "owner" of a particular instruction relative to this
+         *         instantiation.
+         */
+        public Instantiation findOwner(final int i) {
+            if (!subroutine.get(i)) {
+                return null;
+            }
+            if (!dualCitizens.get(i)) {
+                return this;
+            }
+            Instantiation own = this;
+            for (Instantiation p = previous; p != null; p = p.previous) {
+                if (p.subroutine.get(i)) {
+                    own = p;
+                }
+            }
+            return own;
+        }
+
+        /**
+         * Looks up the label <code>l</code> in the <code>gotoTable</code>,
+         * thus translating it from a Label in the original code, to a Label in
+         * the inlined code that is appropriate for use by an instruction that
+         * branched to the original label.
+         *
+         * @param l The label we will be translating
+         * @return a label for use by a branch instruction in the inlined code
+         * @see #rangeLabel
+         */
+        public LabelNode gotoLabel(final LabelNode l) {
+            // owner should never be null, because owner is only null
+            // if an instruction cannot be reached from this subroutine
+            Instantiation owner = findOwner(instructions.indexOf(l));
+            return owner.rangeTable.get(l);
+        }
+
+        /**
+         * Looks up the label <code>l</code> in the <code>rangeTable</code>,
+         * thus translating it from a Label in the original code, to a Label in
+         * the inlined code that is appropriate for use by an try/catch or
+         * variable use annotation.
+         *
+         * @param l The label we will be translating
+         * @return a label for use by a try/catch or variable annotation in the
+         *         original code
+         * @see #rangeTable
+         */
+        public LabelNode rangeLabel(final LabelNode l) {
+            return rangeTable.get(l);
+        }
+
+        // AbstractMap implementation
+
+        @Override
+        public Set<Map.Entry<LabelNode, LabelNode>> entrySet() {
+            return null;
+        }
+
+        @Override
+        public LabelNode get(final Object o) {
+            return gotoLabel((LabelNode) o);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/LocalVariablesSorter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,371 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link MethodVisitor} that renumbers local variables in their order of
+ * appearance. This adapter allows one to easily add new local variables to a
+ * method. It may be used by inheriting from this class, but the preferred way
+ * of using it is via delegation: the next visitor in the chain can indeed add
+ * new locals when needed by calling {@link #newLocal} on this adapter (this
+ * requires a reference back to this {@link LocalVariablesSorter}).
+ *
+ * @author Chris Nokleberg
+ * @author Eugene Kuleshov
+ * @author Eric Bruneton
+ */
+public class LocalVariablesSorter extends MethodVisitor {
+
+    private static final Type OBJECT_TYPE = Type.getObjectType("java/lang/Object");
+
+    /**
+     * Mapping from old to new local variable indexes. A local variable at index
+     * i of size 1 is remapped to 'mapping[2*i]', while a local variable at
+     * index i of size 2 is remapped to 'mapping[2*i+1]'.
+     */
+    private int[] mapping = new int[40];
+
+    /**
+     * Array used to store stack map local variable types after remapping.
+     */
+    private Object[] newLocals = new Object[20];
+
+    /**
+     * Index of the first local variable, after formal parameters.
+     */
+    protected final int firstLocal;
+
+    /**
+     * Index of the next local variable to be created by {@link #newLocal}.
+     */
+    protected int nextLocal;
+
+    /**
+     * Indicates if at least one local variable has moved due to remapping.
+     */
+    private boolean changed;
+
+    /**
+     * Creates a new {@link LocalVariablesSorter}. <i>Subclasses must not use
+     * this constructor</i>. Instead, they must use the
+     * {@link #LocalVariablesSorter(int, int, String, MethodVisitor)} version.
+     *
+     * @param access access flags of the adapted method.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param mv the method visitor to which this adapter delegates calls.
+     */
+    public LocalVariablesSorter(
+        final int access,
+        final String desc,
+        final MethodVisitor mv)
+    {
+        this(Opcodes.ASM4, access, desc, mv);
+    }
+
+    /**
+     * Creates a new {@link LocalVariablesSorter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param access access flags of the adapted method.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param mv the method visitor to which this adapter delegates calls.
+     */
+    protected LocalVariablesSorter(
+        final int api,
+        final int access,
+        final String desc,
+        final MethodVisitor mv)
+    {
+        super(api, mv);
+        Type[] args = Type.getArgumentTypes(desc);
+        nextLocal = (Opcodes.ACC_STATIC & access) == 0 ? 1 : 0;
+        for (int i = 0; i < args.length; i++) {
+            nextLocal += args[i].getSize();
+        }
+        firstLocal = nextLocal;
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        Type type;
+        switch (opcode) {
+            case Opcodes.LLOAD:
+            case Opcodes.LSTORE:
+                type = Type.LONG_TYPE;
+                break;
+
+            case Opcodes.DLOAD:
+            case Opcodes.DSTORE:
+                type = Type.DOUBLE_TYPE;
+                break;
+
+            case Opcodes.FLOAD:
+            case Opcodes.FSTORE:
+                type = Type.FLOAT_TYPE;
+                break;
+
+            case Opcodes.ILOAD:
+            case Opcodes.ISTORE:
+                type = Type.INT_TYPE;
+                break;
+
+            default:
+            // case Opcodes.ALOAD:
+            // case Opcodes.ASTORE:
+            // case RET:
+                type = OBJECT_TYPE;
+                break;
+        }
+        mv.visitVarInsn(opcode, remap(var, type));
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        mv.visitIincInsn(remap(var, Type.INT_TYPE), increment);
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        mv.visitMaxs(maxStack, nextLocal);
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        int newIndex = remap(index, Type.getType(desc));
+        mv.visitLocalVariable(name, desc, signature, start, end, newIndex);
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        if (type != Opcodes.F_NEW) { // uncompressed frame
+            throw new IllegalStateException("ClassReader.accept() should be called with EXPAND_FRAMES flag");
+        }
+
+        if (!changed) { // optimization for the case where mapping = identity
+            mv.visitFrame(type, nLocal, local, nStack, stack);
+            return;
+        }
+
+        // creates a copy of newLocals
+        Object[] oldLocals = new Object[newLocals.length];
+        System.arraycopy(newLocals, 0, oldLocals, 0, oldLocals.length);
+
+        // copies types from 'local' to 'newLocals'
+        // 'newLocals' already contains the variables added with 'newLocal'
+
+        int index = 0; // old local variable index
+        int number = 0; // old local variable number
+        for (; number < nLocal; ++number) {
+            Object t = local[number];
+            int size = t == Opcodes.LONG || t == Opcodes.DOUBLE ? 2 : 1;
+            if (t != Opcodes.TOP) {
+                Type typ = OBJECT_TYPE;
+                if (t == Opcodes.INTEGER) {
+                    typ = Type.INT_TYPE;
+                } else if (t == Opcodes.FLOAT) {
+                    typ = Type.FLOAT_TYPE;
+                } else if (t == Opcodes.LONG) {
+                    typ = Type.LONG_TYPE;
+                } else if (t == Opcodes.DOUBLE) {
+                    typ = Type.DOUBLE_TYPE;
+                } else if (t instanceof String) {
+                    typ = Type.getObjectType((String) t);
+                }
+                setFrameLocal(remap(index, typ), t);
+            }
+            index += size;
+        }
+
+        // removes TOP after long and double types as well as trailing TOPs
+
+        index = 0;
+        number = 0;
+        for (int i = 0; index < newLocals.length; ++i) {
+            Object t = newLocals[index++];
+            if (t != null && t != Opcodes.TOP) {
+                newLocals[i] = t;
+                number = i + 1;
+                if (t == Opcodes.LONG || t == Opcodes.DOUBLE) {
+                    index += 1;
+                }
+            } else {
+                newLocals[i] = Opcodes.TOP;
+            }
+        }
+
+        // visits remapped frame
+        mv.visitFrame(type, number, newLocals, nStack, stack);
+
+        // restores original value of 'newLocals'
+        newLocals = oldLocals;
+    }
+
+    // -------------
+
+    /**
+     * Creates a new local variable of the given type.
+     *
+     * @param type the type of the local variable to be created.
+     * @return the identifier of the newly created local variable.
+     */
+    public int newLocal(final Type type) {
+        Object t;
+        switch (type.getSort()) {
+            case Type.BOOLEAN:
+            case Type.CHAR:
+            case Type.BYTE:
+            case Type.SHORT:
+            case Type.INT:
+                t = Opcodes.INTEGER;
+                break;
+            case Type.FLOAT:
+                t = Opcodes.FLOAT;
+                break;
+            case Type.LONG:
+                t = Opcodes.LONG;
+                break;
+            case Type.DOUBLE:
+                t = Opcodes.DOUBLE;
+                break;
+            case Type.ARRAY:
+                t = type.getDescriptor();
+                break;
+            // case Type.OBJECT:
+            default:
+                t = type.getInternalName();
+                break;
+        }
+        int local = nextLocal;
+        nextLocal += type.getSize();
+        setLocalType(local, type);
+        setFrameLocal(local, t);
+        return local;
+    }
+
+    /**
+     * Sets the current type of the given local variable. The default
+     * implementation of this method does nothing.
+     *
+     * @param local a local variable identifier, as returned by {@link #newLocal
+     *        newLocal()}.
+     * @param type the type of the value being stored in the local variable
+     */
+    protected void setLocalType(final int local, final Type type) {
+    }
+
+    private void setFrameLocal(final int local, final Object type) {
+        int l = newLocals.length;
+        if (local >= l) {
+            Object[] a = new Object[Math.max(2 * l, local + 1)];
+            System.arraycopy(newLocals, 0, a, 0, l);
+            newLocals = a;
+        }
+        newLocals[local] = type;
+    }
+
+    private int remap(final int var, final Type type) {
+        if (var + type.getSize() <= firstLocal) {
+            return var;
+        }
+        int key = 2 * var + type.getSize() - 1;
+        int size = mapping.length;
+        if (key >= size) {
+            int[] newMapping = new int[Math.max(2 * size, key + 1)];
+            System.arraycopy(mapping, 0, newMapping, 0, size);
+            mapping = newMapping;
+        }
+        int value = mapping[key];
+        if (value == 0) {
+            value = newLocalMapping(type);
+            setLocalType(value, type);
+            mapping[key] = value + 1;
+        } else {
+            value--;
+        }
+        if (value != var) {
+            changed = true;
+        }
+        return value;
+    }
+
+    protected int newLocalMapping(final Type type) {
+        int local = nextLocal;
+        nextLocal += type.getSize();
+        return local;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/Method.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,307 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A named method descriptor.
+ *
+ * @author Juozas Baliuka
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ */
+public class Method {
+
+    /**
+     * The method name.
+     */
+    private final String name;
+
+    /**
+     * The method descriptor.
+     */
+    private final String desc;
+
+    /**
+     * Maps primitive Java type names to their descriptors.
+     */
+    private static final Map<String, String> DESCRIPTORS;
+
+    static {
+        DESCRIPTORS = new HashMap<String, String>();
+        DESCRIPTORS.put("void", "V");
+        DESCRIPTORS.put("byte", "B");
+        DESCRIPTORS.put("char", "C");
+        DESCRIPTORS.put("double", "D");
+        DESCRIPTORS.put("float", "F");
+        DESCRIPTORS.put("int", "I");
+        DESCRIPTORS.put("long", "J");
+        DESCRIPTORS.put("short", "S");
+        DESCRIPTORS.put("boolean", "Z");
+    }
+
+    /**
+     * Creates a new {@link Method}.
+     *
+     * @param name the method's name.
+     * @param desc the method's descriptor.
+     */
+    public Method(final String name, final String desc) {
+        this.name = name;
+        this.desc = desc;
+    }
+
+    /**
+     * Creates a new {@link Method}.
+     *
+     * @param name the method's name.
+     * @param returnType the method's return type.
+     * @param argumentTypes the method's argument types.
+     */
+    public Method(
+        final String name,
+        final Type returnType,
+        final Type[] argumentTypes)
+    {
+        this(name, Type.getMethodDescriptor(returnType, argumentTypes));
+    }
+
+    /**
+     * Creates a new {@link Method}.
+     *
+     * @param m a java.lang.reflect method descriptor
+     * @return a {@link Method} corresponding to the given Java method
+     *         declaration.
+     */
+    public static Method getMethod(java.lang.reflect.Method m) {
+        return new Method(m.getName(), Type.getMethodDescriptor(m));
+    }
+
+    /**
+     * Creates a new {@link Method}.
+     *
+     * @param c a java.lang.reflect constructor descriptor
+     * @return a {@link Method} corresponding to the given Java constructor
+     *         declaration.
+     */
+    public static Method getMethod(java.lang.reflect.Constructor<?> c) {
+        return new Method("<init>", Type.getConstructorDescriptor(c));
+    }
+
+    /**
+     * Returns a {@link Method} corresponding to the given Java method
+     * declaration.
+     *
+     * @param method a Java method declaration, without argument names, of the
+     *        form "returnType name (argumentType1, ... argumentTypeN)", where
+     *        the types are in plain Java (e.g. "int", "float",
+     *        "java.util.List", ...). Classes of the java.lang package can be
+     *        specified by their unqualified name; all other classes names must
+     *        be fully qualified.
+     * @return a {@link Method} corresponding to the given Java method
+     *         declaration.
+     * @throws IllegalArgumentException if <code>method</code> could not get
+     *         parsed.
+     */
+    public static Method getMethod(final String method)
+            throws IllegalArgumentException
+    {
+        return getMethod(method, false);
+    }
+
+    /**
+     * Returns a {@link Method} corresponding to the given Java method
+     * declaration.
+     *
+     * @param method a Java method declaration, without argument names, of the
+     *        form "returnType name (argumentType1, ... argumentTypeN)", where
+     *        the types are in plain Java (e.g. "int", "float",
+     *        "java.util.List", ...). Classes of the java.lang package may be
+     *        specified by their unqualified name, depending on the
+     *        defaultPackage argument; all other classes names must be fully
+     *        qualified.
+     * @param defaultPackage true if unqualified class names belong to the
+     *        default package, or false if they correspond to java.lang classes.
+     *        For instance "Object" means "Object" if this option is true, or
+     *        "java.lang.Object" otherwise.
+     * @return a {@link Method} corresponding to the given Java method
+     *         declaration.
+     * @throws IllegalArgumentException if <code>method</code> could not get
+     *         parsed.
+     */
+    public static Method getMethod(
+        final String method,
+        final boolean defaultPackage) throws IllegalArgumentException
+    {
+        int space = method.indexOf(' ');
+        int start = method.indexOf('(', space) + 1;
+        int end = method.indexOf(')', start);
+        if (space == -1 || start == -1 || end == -1) {
+            throw new IllegalArgumentException();
+        }
+        String returnType = method.substring(0, space);
+        String methodName = method.substring(space + 1, start - 1).trim();
+        StringBuffer sb = new StringBuffer();
+        sb.append('(');
+        int p;
+        do {
+            String s;
+            p = method.indexOf(',', start);
+            if (p == -1) {
+                s = map(method.substring(start, end).trim(), defaultPackage);
+            } else {
+                s = map(method.substring(start, p).trim(), defaultPackage);
+                start = p + 1;
+            }
+            sb.append(s);
+        } while (p != -1);
+        sb.append(')');
+        sb.append(map(returnType, defaultPackage));
+        return new Method(methodName, sb.toString());
+    }
+
+    private static String map(final String type, final boolean defaultPackage) {
+        if ("".equals(type)) {
+            return type;
+        }
+
+        StringBuffer sb = new StringBuffer();
+        int index = 0;
+        while ((index = type.indexOf("[]", index) + 1) > 0) {
+            sb.append('[');
+        }
+
+        String t = type.substring(0, type.length() - sb.length() * 2);
+        String desc = DESCRIPTORS.get(t);
+        if (desc != null) {
+            sb.append(desc);
+        } else {
+            sb.append('L');
+            if (t.indexOf('.') < 0) {
+                if (!defaultPackage) {
+                    sb.append("java/lang/");
+                }
+                sb.append(t);
+            } else {
+                sb.append(t.replace('.', '/'));
+            }
+            sb.append(';');
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Returns the name of the method described by this object.
+     *
+     * @return the name of the method described by this object.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Returns the descriptor of the method described by this object.
+     *
+     * @return the descriptor of the method described by this object.
+     */
+    public String getDescriptor() {
+        return desc;
+    }
+
+    /**
+     * Returns the return type of the method described by this object.
+     *
+     * @return the return type of the method described by this object.
+     */
+    public Type getReturnType() {
+        return Type.getReturnType(desc);
+    }
+
+    /**
+     * Returns the argument types of the method described by this object.
+     *
+     * @return the argument types of the method described by this object.
+     */
+    public Type[] getArgumentTypes() {
+        return Type.getArgumentTypes(desc);
+    }
+
+    @Override
+    public String toString() {
+        return name + desc;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if (!(o instanceof Method)) {
+            return false;
+        }
+        Method other = (Method) o;
+        return name.equals(other.name) && desc.equals(other.desc);
+    }
+
+    @Override
+    public int hashCode() {
+        return name.hashCode() ^ desc.hashCode();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/Remapper.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,250 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.signature.SignatureReader;
+import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
+import jdk.internal.org.objectweb.asm.signature.SignatureWriter;
+
+/**
+ * A class responsible for remapping types and names.
+ * Subclasses can override the following methods:
+ *
+ * <ul>
+ * <li>{@link #map(String)} - map type</li>
+ * <li>{@link #mapFieldName(String, String, String)} - map field name</li>
+ * <li>{@link #mapMethodName(String, String, String)} - map method name</li>
+ * </ul>
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class Remapper {
+
+    public String mapDesc(String desc) {
+        Type t = Type.getType(desc);
+        switch (t.getSort()) {
+            case Type.ARRAY:
+                String s = mapDesc(t.getElementType().getDescriptor());
+                for (int i = 0; i < t.getDimensions(); ++i) {
+                    s = '[' + s;
+                }
+                return s;
+            case Type.OBJECT:
+                String newType = map(t.getInternalName());
+                if (newType != null) {
+                    return 'L' + newType + ';';
+                }
+        }
+        return desc;
+    }
+
+    private Type mapType(Type t) {
+        switch (t.getSort()) {
+            case Type.ARRAY:
+                String s = mapDesc(t.getElementType().getDescriptor());
+                for (int i = 0; i < t.getDimensions(); ++i) {
+                    s = '[' + s;
+                }
+                return Type.getType(s);
+            case Type.OBJECT:
+                s = map(t.getInternalName());
+                return s != null ? Type.getObjectType(s) : t;
+            case Type.METHOD:
+                return Type.getMethodType(mapMethodDesc(t.getDescriptor()));
+        }
+        return t;
+    }
+
+    public String mapType(String type) {
+        if (type == null) {
+            return null;
+        }
+        return mapType(Type.getObjectType(type)).getInternalName();
+    }
+
+    public String[] mapTypes(String[] types) {
+        String[] newTypes = null;
+        boolean needMapping = false;
+        for (int i = 0; i < types.length; i++) {
+            String type = types[i];
+            String newType = map(type);
+            if (newType != null && newTypes == null) {
+                newTypes = new String[types.length];
+                if (i > 0) {
+                    System.arraycopy(types, 0, newTypes, 0, i);
+                }
+                needMapping = true;
+            }
+            if (needMapping) {
+                newTypes[i] = newType == null
+                    ? type
+                    : newType;
+            }
+        }
+        return needMapping
+           ? newTypes
+           : types;
+    }
+
+    public String mapMethodDesc(String desc) {
+        if("()V".equals(desc)) {
+            return desc;
+        }
+
+        Type[] args = Type.getArgumentTypes(desc);
+        StringBuffer s = new StringBuffer("(");
+        for (int i = 0; i < args.length; i++) {
+            s.append(mapDesc(args[i].getDescriptor()));
+        }
+        Type returnType = Type.getReturnType(desc);
+        if(returnType == Type.VOID_TYPE) {
+            s.append(")V");
+            return s.toString();
+        }
+        s.append(')').append(mapDesc(returnType.getDescriptor()));
+        return s.toString();
+    }
+
+    public Object mapValue(Object value) {
+        if (value instanceof Type) {
+            return mapType((Type) value);
+        }
+        if (value instanceof Handle) {
+            Handle h = (Handle) value;
+            return new Handle(h.getTag(),
+                    mapType(h.getOwner()),
+                    mapMethodName(h.getOwner(), h.getName(), h.getDesc()),
+                    mapMethodDesc(h.getDesc()));
+        }
+        return value;
+    }
+
+    /**
+     *
+     * @param typeSignature true if signature is a FieldTypeSignature, such as
+     *        the signature parameter of the ClassVisitor.visitField or
+     *        MethodVisitor.visitLocalVariable methods
+     */
+    public String mapSignature(String signature, boolean typeSignature) {
+        if (signature == null) {
+            return null;
+        }
+        SignatureReader r = new SignatureReader(signature);
+        SignatureWriter w = new SignatureWriter();
+        SignatureVisitor a = createRemappingSignatureAdapter(w);
+        if (typeSignature) {
+            r.acceptType(a);
+        } else {
+            r.accept(a);
+        }
+        return w.toString();
+    }
+
+    protected SignatureVisitor createRemappingSignatureAdapter(
+        SignatureVisitor v)
+    {
+        return new RemappingSignatureAdapter(v, this);
+    }
+
+    /**
+     * Map method name to the new name. Subclasses can override.
+     *
+     * @param owner owner of the method.
+     * @param name name of the method.
+     * @param desc descriptor of the method.
+     * @return new name of the method
+     */
+    public String mapMethodName(String owner, String name, String desc) {
+        return name;
+    }
+
+    /**
+     * Map invokedynamic method name to the new name. Subclasses can override.
+     *
+     * @param name name of the invokedynamic.
+     * @param desc descriptor of the invokedynamic.
+     * @return new invokdynamic name.
+     */
+    public String mapInvokeDynamicMethodName(String name, String desc) {
+        return name;
+    }
+
+    /**
+     * Map field name to the new name. Subclasses can override.
+     *
+     * @param owner owner of the field.
+     * @param name name of the field
+     * @param desc descriptor of the field
+     * @return new name of the field.
+     */
+    public String mapFieldName(String owner, String name, String desc) {
+        return name;
+    }
+
+    /**
+     * Map type name to the new name. Subclasses can override.
+     *
+     */
+    public String map(String typeName) {
+        return typeName;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/RemappingAnnotationAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,115 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * An {@link AnnotationVisitor} adapter for type remapping.
+ *
+ * @author Eugene Kuleshov
+ */
+public class RemappingAnnotationAdapter extends AnnotationVisitor {
+
+    protected final Remapper remapper;
+
+    public RemappingAnnotationAdapter(
+        final AnnotationVisitor av,
+        final Remapper remapper)
+    {
+        this(Opcodes.ASM4, av, remapper);
+    }
+
+    protected RemappingAnnotationAdapter(
+        final int api,
+        final AnnotationVisitor av,
+        final Remapper remapper)
+    {
+        super(api, av);
+        this.remapper = remapper;
+    }
+
+    @Override
+    public void visit(String name, Object value) {
+        av.visit(name, remapper.mapValue(value));
+    }
+
+    @Override
+    public void visitEnum(String name, String desc, String value) {
+        av.visitEnum(name, remapper.mapDesc(desc), value);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(String name, String desc) {
+        AnnotationVisitor v = av.visitAnnotation(name, remapper.mapDesc(desc));
+        return v == null ? null : (v == av
+                ? this
+                : new RemappingAnnotationAdapter(v, remapper));
+    }
+
+    @Override
+    public AnnotationVisitor visitArray(String name) {
+        AnnotationVisitor v = av.visitArray(name);
+        return v == null ? null : (v == av
+                ? this
+                : new RemappingAnnotationAdapter(v, remapper));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/RemappingClassAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,189 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassVisitor} for type remapping.
+ *
+ * @author Eugene Kuleshov
+ */
+public class RemappingClassAdapter extends ClassVisitor {
+
+    protected final Remapper remapper;
+
+    protected String className;
+
+    public RemappingClassAdapter(final ClassVisitor cv, final Remapper remapper)
+    {
+        this(Opcodes.ASM4, cv, remapper);
+    }
+
+    protected RemappingClassAdapter(
+        final int api,
+        final ClassVisitor cv,
+        final Remapper remapper)
+    {
+        super(api, cv);
+        this.remapper = remapper;
+    }
+
+    @Override
+    public void visit(
+        int version,
+        int access,
+        String name,
+        String signature,
+        String superName,
+        String[] interfaces)
+    {
+        this.className = name;
+        super.visit(version,
+                access,
+                remapper.mapType(name),
+                remapper.mapSignature(signature, false),
+                remapper.mapType(superName),
+                interfaces == null ? null
+                        : remapper.mapTypes(interfaces));
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        AnnotationVisitor av;
+        av = super.visitAnnotation(remapper.mapDesc(desc), visible);
+        return av == null ? null : createRemappingAnnotationAdapter(av);
+    }
+
+    @Override
+    public FieldVisitor visitField(
+        int access,
+        String name,
+        String desc,
+        String signature,
+        Object value)
+    {
+        FieldVisitor fv = super.visitField(access,
+                remapper.mapFieldName(className, name, desc),
+                remapper.mapDesc(desc),
+                remapper.mapSignature(signature, true),
+                remapper.mapValue(value));
+        return fv == null ? null : createRemappingFieldAdapter(fv);
+    }
+
+    @Override
+    public MethodVisitor visitMethod(
+        int access,
+        String name,
+        String desc,
+        String signature,
+        String[] exceptions)
+    {
+        String newDesc = remapper.mapMethodDesc(desc);
+        MethodVisitor mv = super.visitMethod(access,
+                remapper.mapMethodName(className, name, desc),
+                newDesc,
+                remapper.mapSignature(signature, false),
+                exceptions == null ? null : remapper.mapTypes(exceptions));
+        return mv == null ? null : createRemappingMethodAdapter(access, newDesc, mv);
+    }
+
+    @Override
+    public void visitInnerClass(
+        String name,
+        String outerName,
+        String innerName,
+        int access)
+    {
+        super.visitInnerClass(remapper.mapType(name),
+                outerName == null ? null : remapper.mapType(outerName),
+                innerName, // TODO should it be changed?
+                access);
+    }
+
+    @Override
+    public void visitOuterClass(String owner, String name, String desc) {
+        super.visitOuterClass(remapper.mapType(owner),
+                name == null ? null : remapper.mapMethodName(owner, name, desc),
+                desc == null ? null : remapper.mapMethodDesc(desc));
+    }
+
+    protected FieldVisitor createRemappingFieldAdapter(FieldVisitor fv) {
+        return new RemappingFieldAdapter(fv, remapper);
+    }
+
+    protected MethodVisitor createRemappingMethodAdapter(
+        int access,
+        String newDesc,
+        MethodVisitor mv)
+    {
+        return new RemappingMethodAdapter(access, newDesc, mv, remapper);
+    }
+
+    protected AnnotationVisitor createRemappingAnnotationAdapter(
+        AnnotationVisitor av)
+    {
+        return new RemappingAnnotationAdapter(av, remapper);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/RemappingFieldAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,94 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link FieldVisitor} adapter for type remapping.
+ *
+ * @author Eugene Kuleshov
+ */
+public class RemappingFieldAdapter extends FieldVisitor {
+
+    private final Remapper remapper;
+
+    public RemappingFieldAdapter(final FieldVisitor fv, final Remapper remapper)
+    {
+        this(Opcodes.ASM4, fv, remapper);
+    }
+
+    protected RemappingFieldAdapter(
+        final int api,
+        final FieldVisitor fv,
+        final Remapper remapper)
+    {
+        super(api, fv);
+        this.remapper = remapper;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        AnnotationVisitor av = fv.visitAnnotation(remapper.mapDesc(desc), visible);
+        return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/RemappingMethodAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,236 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link LocalVariablesSorter} for type mapping.
+ *
+ * @author Eugene Kuleshov
+ */
+public class RemappingMethodAdapter extends LocalVariablesSorter {
+
+    protected final Remapper remapper;
+
+    public RemappingMethodAdapter(
+        final int access,
+        final String desc,
+        final MethodVisitor mv,
+        final Remapper remapper)
+    {
+        this(Opcodes.ASM4, access, desc, mv, remapper);
+    }
+
+    protected RemappingMethodAdapter(
+        final int api,
+        final int access,
+        final String desc,
+        final MethodVisitor mv,
+        final Remapper remapper)
+    {
+        super(api, access, desc, mv);
+        this.remapper = remapper;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotationDefault() {
+        AnnotationVisitor av = mv.visitAnnotationDefault();
+        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        AnnotationVisitor av = mv.visitAnnotation(remapper.mapDesc(desc), visible);
+        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
+    }
+
+    @Override
+    public AnnotationVisitor visitParameterAnnotation(
+        int parameter,
+        String desc,
+        boolean visible)
+    {
+        AnnotationVisitor av = mv.visitParameterAnnotation(parameter,
+                remapper.mapDesc(desc),
+                visible);
+        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
+    }
+
+    @Override
+    public void visitFrame(
+        int type,
+        int nLocal,
+        Object[] local,
+        int nStack,
+        Object[] stack)
+    {
+        super.visitFrame(type, nLocal, remapEntries(nLocal, local), nStack, remapEntries(nStack, stack));
+    }
+
+    private Object[] remapEntries(int n, Object[] entries) {
+        for (int i = 0; i < n; i++) {
+            if (entries[i] instanceof String) {
+                Object[] newEntries = new Object[n];
+                if (i > 0) {
+                    System.arraycopy(entries, 0, newEntries, 0, i);
+                }
+                do {
+                    Object t = entries[i];
+                    newEntries[i++] = t instanceof String
+                            ? remapper.mapType((String) t)
+                            : t;
+                } while (i < n);
+                return newEntries;
+            }
+        }
+        return entries;
+    }
+
+    @Override
+    public void visitFieldInsn(
+        int opcode,
+        String owner,
+        String name,
+        String desc)
+    {
+        super.visitFieldInsn(opcode,
+                remapper.mapType(owner),
+                remapper.mapFieldName(owner, name, desc),
+                remapper.mapDesc(desc));
+    }
+
+    @Override
+    public void visitMethodInsn(
+        int opcode,
+        String owner,
+        String name,
+        String desc)
+    {
+        super.visitMethodInsn(opcode,
+                remapper.mapType(owner),
+                remapper.mapMethodName(owner, name, desc),
+                remapper.mapMethodDesc(desc));
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        for(int i=0; i<bsmArgs.length; i++) {
+            bsmArgs[i] = remapper.mapValue(bsmArgs[i]);
+        }
+        super.visitInvokeDynamicInsn(
+                remapper.mapInvokeDynamicMethodName(name, desc),
+                remapper.mapMethodDesc(desc),
+                (Handle)remapper.mapValue(bsm),
+                bsmArgs);
+    }
+
+    @Override
+    public void visitTypeInsn(int opcode, String type) {
+        super.visitTypeInsn(opcode, remapper.mapType(type));
+    }
+
+    @Override
+    public void visitLdcInsn(Object cst) {
+        super.visitLdcInsn(remapper.mapValue(cst));
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(String desc, int dims) {
+        super.visitMultiANewArrayInsn(remapper.mapDesc(desc), dims);
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        Label start,
+        Label end,
+        Label handler,
+        String type)
+    {
+        super.visitTryCatchBlock(start, end, handler,
+                type == null ? null : remapper.mapType(type));
+    }
+
+    @Override
+    public void visitLocalVariable(
+        String name,
+        String desc,
+        String signature,
+        Label start,
+        Label end,
+        int index)
+    {
+        super.visitLocalVariable(name,
+                remapper.mapDesc(desc),
+                remapper.mapSignature(signature, true),
+                start,
+                end,
+                index);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/RemappingSignatureAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,187 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
+
+/**
+ * A {@link SignatureVisitor} adapter for type mapping.
+ *
+ * @author Eugene Kuleshov
+ */
+public class RemappingSignatureAdapter extends SignatureVisitor {
+
+    private final SignatureVisitor v;
+
+    private final Remapper remapper;
+
+    private String className;
+
+    public RemappingSignatureAdapter(
+        final SignatureVisitor v,
+        final Remapper remapper)
+    {
+        this(Opcodes.ASM4, v, remapper);
+    }
+
+    protected RemappingSignatureAdapter(
+        final int api,
+        final SignatureVisitor v,
+        final Remapper remapper)
+    {
+        super(api);
+        this.v = v;
+        this.remapper = remapper;
+    }
+
+    @Override
+    public void visitClassType(String name) {
+        className = name;
+        v.visitClassType(remapper.mapType(name));
+    }
+
+    @Override
+    public void visitInnerClassType(String name) {
+        className = className + '$' + name;
+        String remappedName = remapper.mapType(className);
+        v.visitInnerClassType(remappedName.substring(remappedName.lastIndexOf('$') + 1));
+    }
+
+    @Override
+    public void visitFormalTypeParameter(String name) {
+        v.visitFormalTypeParameter(name);
+    }
+
+    @Override
+    public void visitTypeVariable(String name) {
+        v.visitTypeVariable(name);
+    }
+
+    @Override
+    public SignatureVisitor visitArrayType() {
+        v.visitArrayType();
+        return this;
+    }
+
+    @Override
+    public void visitBaseType(char descriptor) {
+        v.visitBaseType(descriptor);
+    }
+
+    @Override
+    public SignatureVisitor visitClassBound() {
+        v.visitClassBound();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitExceptionType() {
+        v.visitExceptionType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitInterface() {
+        v.visitInterface();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitInterfaceBound() {
+        v.visitInterfaceBound();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitParameterType() {
+        v.visitParameterType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitReturnType() {
+        v.visitReturnType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitSuperclass() {
+        v.visitSuperclass();
+        return this;
+    }
+
+    @Override
+    public void visitTypeArgument() {
+        v.visitTypeArgument();
+    }
+
+    @Override
+    public SignatureVisitor visitTypeArgument(char wildcard) {
+        v.visitTypeArgument(wildcard);
+        return this;
+    }
+
+    @Override
+    public void visitEnd() {
+        v.visitEnd();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/SerialVersionUIDAdder.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,559 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.security.MessageDigest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassVisitor} that adds a serial version unique identifier to a
+ * class if missing. Here is typical usage of this class:
+ *
+ * <pre>
+ *   ClassWriter cw = new ClassWriter(...);
+ *   ClassVisitor sv = new SerialVersionUIDAdder(cw);
+ *   ClassVisitor ca = new MyClassAdapter(sv);
+ *   new ClassReader(orginalClass).accept(ca, false);
+ * </pre>
+ *
+ * The SVUID algorithm can be found <a href=
+ * "http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/class.html"
+ * >http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/class.html</a>:
+ *
+ * <pre>
+ * The serialVersionUID is computed using the signature of a stream of bytes
+ * that reflect the class definition. The National Institute of Standards and
+ * Technology (NIST) Secure Hash Algorithm (SHA-1) is used to compute a
+ * signature for the stream. The first two 32-bit quantities are used to form a
+ * 64-bit hash. A java.lang.DataOutputStream is used to convert primitive data
+ * types to a sequence of bytes. The values input to the stream are defined by
+ * the Java Virtual Machine (VM) specification for classes.
+ *
+ * The sequence of items in the stream is as follows:
+ *
+ * 1. The class name written using UTF encoding.
+ * 2. The class modifiers written as a 32-bit integer.
+ * 3. The name of each interface sorted by name written using UTF encoding.
+ * 4. For each field of the class sorted by field name (except private static
+ * and private transient fields):
+ * 1. The name of the field in UTF encoding.
+ * 2. The modifiers of the field written as a 32-bit integer.
+ * 3. The descriptor of the field in UTF encoding
+ * 5. If a class initializer exists, write out the following:
+ * 1. The name of the method, &lt;clinit&gt;, in UTF encoding.
+ * 2. The modifier of the method, java.lang.reflect.Modifier.STATIC,
+ * written as a 32-bit integer.
+ * 3. The descriptor of the method, ()V, in UTF encoding.
+ * 6. For each non-private constructor sorted by method name and signature:
+ * 1. The name of the method, &lt;init&gt;, in UTF encoding.
+ * 2. The modifiers of the method written as a 32-bit integer.
+ * 3. The descriptor of the method in UTF encoding.
+ * 7. For each non-private method sorted by method name and signature:
+ * 1. The name of the method in UTF encoding.
+ * 2. The modifiers of the method written as a 32-bit integer.
+ * 3. The descriptor of the method in UTF encoding.
+ * 8. The SHA-1 algorithm is executed on the stream of bytes produced by
+ * DataOutputStream and produces five 32-bit values sha[0..4].
+ *
+ * 9. The hash value is assembled from the first and second 32-bit values of
+ * the SHA-1 message digest. If the result of the message digest, the five
+ * 32-bit words H0 H1 H2 H3 H4, is in an array of five int values named
+ * sha, the hash value would be computed as follows:
+ *
+ * long hash = ((sha[0] &gt;&gt;&gt; 24) &amp; 0xFF) |
+ * ((sha[0] &gt;&gt;&gt; 16) &amp; 0xFF) &lt;&lt; 8 |
+ * ((sha[0] &gt;&gt;&gt; 8) &amp; 0xFF) &lt;&lt; 16 |
+ * ((sha[0] &gt;&gt;&gt; 0) &amp; 0xFF) &lt;&lt; 24 |
+ * ((sha[1] &gt;&gt;&gt; 24) &amp; 0xFF) &lt;&lt; 32 |
+ * ((sha[1] &gt;&gt;&gt; 16) &amp; 0xFF) &lt;&lt; 40 |
+ * ((sha[1] &gt;&gt;&gt; 8) &amp; 0xFF) &lt;&lt; 48 |
+ * ((sha[1] &gt;&gt;&gt; 0) &amp; 0xFF) &lt;&lt; 56;
+ * </pre>
+ *
+ * @author Rajendra Inamdar, Vishal Vishnoi
+ */
+public class SerialVersionUIDAdder extends ClassVisitor {
+
+    /**
+     * Flag that indicates if we need to compute SVUID.
+     */
+    private boolean computeSVUID;
+
+    /**
+     * Set to true if the class already has SVUID.
+     */
+    private boolean hasSVUID;
+
+    /**
+     * Classes access flags.
+     */
+    private int access;
+
+    /**
+     * Internal name of the class
+     */
+    private String name;
+
+    /**
+     * Interfaces implemented by the class.
+     */
+    private String[] interfaces;
+
+    /**
+     * Collection of fields. (except private static and private transient
+     * fields)
+     */
+    private Collection<Item> svuidFields;
+
+    /**
+     * Set to true if the class has static initializer.
+     */
+    private boolean hasStaticInitializer;
+
+    /**
+     * Collection of non-private constructors.
+     */
+    private Collection<Item> svuidConstructors;
+
+    /**
+     * Collection of non-private methods.
+     */
+    private Collection<Item> svuidMethods;
+
+    /**
+     * Creates a new {@link SerialVersionUIDAdder}. <i>Subclasses must not use
+     * this constructor</i>. Instead, they must use the
+     * {@link #SerialVersionUIDAdder(int, ClassVisitor)} version.
+     *
+     * @param cv a {@link ClassVisitor} to which this visitor will delegate
+     *        calls.
+     */
+    public SerialVersionUIDAdder(final ClassVisitor cv) {
+        this(Opcodes.ASM4, cv);
+    }
+
+    /**
+     * Creates a new {@link SerialVersionUIDAdder}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param cv a {@link ClassVisitor} to which this visitor will delegate
+     *        calls.
+     */
+    protected SerialVersionUIDAdder(final int api, final ClassVisitor cv) {
+        super(api, cv);
+        svuidFields = new ArrayList<Item>();
+        svuidConstructors = new ArrayList<Item>();
+        svuidMethods = new ArrayList<Item>();
+    }
+
+    // ------------------------------------------------------------------------
+    // Overriden methods
+    // ------------------------------------------------------------------------
+
+    /*
+     * Visit class header and get class name, access , and interfaces
+     * information (step 1,2, and 3) for SVUID computation.
+     */
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        computeSVUID = (access & Opcodes.ACC_INTERFACE) == 0;
+
+        if (computeSVUID) {
+            this.name = name;
+            this.access = access;
+            this.interfaces = interfaces;
+        }
+
+        super.visit(version, access, name, signature, superName, interfaces);
+    }
+
+    /*
+     * Visit the methods and get constructor and method information (step 5 and
+     * 7). Also determine if there is a class initializer (step 6).
+     */
+    @Override
+    public MethodVisitor visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        if (computeSVUID) {
+            if ("<clinit>".equals(name)) {
+                hasStaticInitializer = true;
+            }
+            /*
+             * Remembers non private constructors and methods for SVUID
+             * computation For constructor and method modifiers, only the
+             * ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL,
+             * ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT and ACC_STRICT flags
+             * are used.
+             */
+            int mods = access
+                    & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
+                            | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
+                            | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED
+                            | Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_STRICT);
+
+            // all non private methods
+            if ((access & Opcodes.ACC_PRIVATE) == 0) {
+                if ("<init>".equals(name)) {
+                    svuidConstructors.add(new Item(name, mods, desc));
+                } else if (!"<clinit>".equals(name)) {
+                    svuidMethods.add(new Item(name, mods, desc));
+                }
+            }
+        }
+
+        return super.visitMethod(access, name, desc, signature, exceptions);
+    }
+
+    /*
+     * Gets class field information for step 4 of the algorithm. Also determines
+     * if the class already has a SVUID.
+     */
+    @Override
+    public FieldVisitor visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        if (computeSVUID) {
+            if ("serialVersionUID".equals(name)) {
+                // since the class already has SVUID, we won't be computing it.
+                computeSVUID = false;
+                hasSVUID = true;
+            }
+            /*
+             * Remember field for SVUID computation For field modifiers, only
+             * the ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC,
+             * ACC_FINAL, ACC_VOLATILE, and ACC_TRANSIENT flags are used when
+             * computing serialVersionUID values.
+             */
+            if ((access & Opcodes.ACC_PRIVATE) == 0
+                    || (access & (Opcodes.ACC_STATIC | Opcodes.ACC_TRANSIENT)) == 0)
+            {
+                int mods = access
+                & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
+                        | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
+                        | Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT);
+                svuidFields.add(new Item(name, mods, desc));
+            }
+        }
+
+        return super.visitField(access, name, desc, signature, value);
+    }
+
+    /**
+     * Handle a bizarre special case. Nested classes (static classes declared
+     * inside another class) that are protected have their access bit set to
+     * public in their class files to deal with some odd reflection situation.
+     * Our SVUID computation must do as the JVM does and ignore access bits in
+     * the class file in favor of the access bits InnerClass attribute.
+     */
+    @Override
+    public void visitInnerClass(final String aname, final String outerName, final String innerName, final int attr_access) {
+        if ((name != null) && name.equals(aname)) {
+            this.access = attr_access;
+        }
+        super.visitInnerClass(aname, outerName, innerName, attr_access);
+    }
+
+    /*
+     * Add the SVUID if class doesn't have one
+     */
+    @Override
+    public void visitEnd() {
+        // compute SVUID and add it to the class
+        if (computeSVUID && !hasSVUID) {
+            try {
+                super.visitField(Opcodes.ACC_FINAL + Opcodes.ACC_STATIC,
+                        "serialVersionUID",
+                        "J",
+                        null,
+                        new Long(computeSVUID()));
+            } catch (Throwable e) {
+                throw new RuntimeException("Error while computing SVUID for "
+                        + name, e);
+            }
+        }
+
+        super.visitEnd();
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the value of SVUID if the class doesn't have one already. Please
+     * note that 0 is returned if the class already has SVUID, thus use
+     * <code>isHasSVUID</code> to determine if the class already had an SVUID.
+     *
+     * @return Returns the serial version UID
+     * @throws IOException if an I/O error occurs
+     */
+    protected long computeSVUID() throws IOException {
+        ByteArrayOutputStream bos;
+        DataOutputStream dos = null;
+        long svuid = 0;
+
+        try {
+            bos = new ByteArrayOutputStream();
+            dos = new DataOutputStream(bos);
+
+            /*
+             * 1. The class name written using UTF encoding.
+             */
+            dos.writeUTF(name.replace('/', '.'));
+
+            /*
+             * 2. The class modifiers written as a 32-bit integer.
+             */
+            dos.writeInt(access
+                    & (Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL
+                            | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT));
+
+            /*
+             * 3. The name of each interface sorted by name written using UTF
+             * encoding.
+             */
+            Arrays.sort(interfaces);
+            for (int i = 0; i < interfaces.length; i++) {
+                dos.writeUTF(interfaces[i].replace('/', '.'));
+            }
+
+            /*
+             * 4. For each field of the class sorted by field name (except
+             * private static and private transient fields):
+             *
+             * 1. The name of the field in UTF encoding. 2. The modifiers of the
+             * field written as a 32-bit integer. 3. The descriptor of the field
+             * in UTF encoding
+             *
+             * Note that field signatures are not dot separated. Method and
+             * constructor signatures are dot separated. Go figure...
+             */
+            writeItems(svuidFields, dos, false);
+
+            /*
+             * 5. If a class initializer exists, write out the following: 1. The
+             * name of the method, <clinit>, in UTF encoding. 2. The modifier of
+             * the method, java.lang.reflect.Modifier.STATIC, written as a
+             * 32-bit integer. 3. The descriptor of the method, ()V, in UTF
+             * encoding.
+             */
+            if (hasStaticInitializer) {
+                dos.writeUTF("<clinit>");
+                dos.writeInt(Opcodes.ACC_STATIC);
+                dos.writeUTF("()V");
+            } // if..
+
+            /*
+             * 6. For each non-private constructor sorted by method name and
+             * signature: 1. The name of the method, <init>, in UTF encoding. 2.
+             * The modifiers of the method written as a 32-bit integer. 3. The
+             * descriptor of the method in UTF encoding.
+             */
+            writeItems(svuidConstructors, dos, true);
+
+            /*
+             * 7. For each non-private method sorted by method name and
+             * signature: 1. The name of the method in UTF encoding. 2. The
+             * modifiers of the method written as a 32-bit integer. 3. The
+             * descriptor of the method in UTF encoding.
+             */
+            writeItems(svuidMethods, dos, true);
+
+            dos.flush();
+
+            /*
+             * 8. The SHA-1 algorithm is executed on the stream of bytes
+             * produced by DataOutputStream and produces five 32-bit values
+             * sha[0..4].
+             */
+            byte[] hashBytes = computeSHAdigest(bos.toByteArray());
+
+            /*
+             * 9. The hash value is assembled from the first and second 32-bit
+             * values of the SHA-1 message digest. If the result of the message
+             * digest, the five 32-bit words H0 H1 H2 H3 H4, is in an array of
+             * five int values named sha, the hash value would be computed as
+             * follows:
+             *
+             * long hash = ((sha[0] >>> 24) & 0xFF) | ((sha[0] >>> 16) & 0xFF) <<
+             * 8 | ((sha[0] >>> 8) & 0xFF) << 16 | ((sha[0] >>> 0) & 0xFF) <<
+             * 24 | ((sha[1] >>> 24) & 0xFF) << 32 | ((sha[1] >>> 16) & 0xFF) <<
+             * 40 | ((sha[1] >>> 8) & 0xFF) << 48 | ((sha[1] >>> 0) & 0xFF) <<
+             * 56;
+             */
+            for (int i = Math.min(hashBytes.length, 8) - 1; i >= 0; i--) {
+                svuid = (svuid << 8) | (hashBytes[i] & 0xFF);
+            }
+        } finally {
+            // close the stream (if open)
+            if (dos != null) {
+                dos.close();
+            }
+        }
+
+        return svuid;
+    }
+
+    /**
+     * Returns the SHA-1 message digest of the given value.
+     *
+     * @param value the value whose SHA message digest must be computed.
+     * @return the SHA-1 message digest of the given value.
+     */
+    protected byte[] computeSHAdigest(final byte[] value) {
+        try {
+            return MessageDigest.getInstance("SHA").digest(value);
+        } catch (Exception e) {
+            throw new UnsupportedOperationException(e.toString());
+        }
+    }
+
+    /**
+     * Sorts the items in the collection and writes it to the data output stream
+     *
+     * @param itemCollection collection of items
+     * @param dos a <code>DataOutputStream</code> value
+     * @param dotted a <code>boolean</code> value
+     * @exception IOException if an error occurs
+     */
+    private static void writeItems(
+        final Collection<Item> itemCollection,
+        final DataOutput dos,
+        final boolean dotted) throws IOException
+    {
+        int size = itemCollection.size();
+        Item[] items = itemCollection.toArray(new Item[size]);
+        Arrays.sort(items);
+        for (int i = 0; i < size; i++) {
+            dos.writeUTF(items[i].name);
+            dos.writeInt(items[i].access);
+            dos.writeUTF(dotted
+                    ? items[i].desc.replace('/', '.')
+                    : items[i].desc);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Inner classes
+    // ------------------------------------------------------------------------
+
+    private static class Item implements Comparable<Item> {
+
+        final String name;
+
+        final int access;
+
+        final String desc;
+
+        Item(final String name, final int access, final String desc) {
+            this.name = name;
+            this.access = access;
+            this.desc = desc;
+        }
+
+        public int compareTo(final Item other) {
+            int retVal = name.compareTo(other.name);
+            if (retVal == 0) {
+                retVal = desc.compareTo(other.desc);
+            }
+            return retVal;
+        }
+
+        @Override
+        public boolean equals(final Object o) {
+            if (o instanceof Item) {
+                return compareTo((Item) o) == 0;
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            return (name + desc).hashCode();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/SimpleRemapper.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,98 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * A {@link Remapper} using a {@link Map} to define its mapping.
+ *
+ * @author Eugene Kuleshov
+ */
+public class SimpleRemapper extends Remapper {
+
+    private final Map<String, String> mapping;
+
+    public SimpleRemapper(Map<String, String> mapping) {
+        this.mapping = mapping;
+    }
+
+    public SimpleRemapper(String oldName, String newName) {
+        this.mapping = Collections.singletonMap(oldName, newName);
+    }
+
+    @Override
+    public String mapMethodName(String owner, String name, String desc) {
+        String s = map(owner + '.' + name + desc);
+        return s == null ? name : s;
+    }
+
+    @Override
+    public String mapFieldName(String owner, String name, String desc) {
+        String s = map(owner + '.' + name);
+        return s == null ? name : s;
+    }
+
+    @Override
+    public String map(String key) {
+        return mapping.get(key);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/StaticInitMerger.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,138 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassVisitor} that merges clinit methods into a single one.
+ *
+ * @author Eric Bruneton
+ */
+public class StaticInitMerger extends ClassVisitor {
+
+    private String name;
+
+    private MethodVisitor clinit;
+
+    private final String prefix;
+
+    private int counter;
+
+    public StaticInitMerger(final String prefix, final ClassVisitor cv) {
+        this(Opcodes.ASM4, prefix, cv);
+    }
+
+    protected StaticInitMerger(
+        final int api,
+        final String prefix,
+        final ClassVisitor cv)
+    {
+        super(api, cv);
+        this.prefix = prefix;
+    }
+
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        cv.visit(version, access, name, signature, superName, interfaces);
+        this.name = name;
+    }
+
+    @Override
+    public MethodVisitor visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        MethodVisitor mv;
+        if ("<clinit>".equals(name)) {
+            int a = Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC;
+            String n = prefix + counter++;
+            mv = cv.visitMethod(a, n, desc, signature, exceptions);
+
+            if (clinit == null) {
+                clinit = cv.visitMethod(a, name, desc, null, null);
+            }
+            clinit.visitMethodInsn(Opcodes.INVOKESTATIC, this.name, n, desc);
+        } else {
+            mv = cv.visitMethod(access, name, desc, signature, exceptions);
+        }
+        return mv;
+    }
+
+    @Override
+    public void visitEnd() {
+        if (clinit != null) {
+            clinit.visitInsn(Opcodes.RETURN);
+            clinit.visitMaxs(0, 0);
+        }
+        cv.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/TableSwitchGenerator.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,84 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.commons;
+
+import jdk.internal.org.objectweb.asm.Label;
+
+/**
+ * A code generator for switch statements.
+ *
+ * @author Juozas Baliuka
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ */
+public interface TableSwitchGenerator {
+
+    /**
+     * Generates the code for a switch case.
+     *
+     * @param key the switch case key.
+     * @param end a label that corresponds to the end of the switch statement.
+     */
+    void generateCase(int key, Label end);
+
+    /**
+     * Generates the code for the default switch case.
+     */
+    void generateDefault();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/commons/TryCatchBlockSorter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,132 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package jdk.internal.org.objectweb.asm.commons;
+
+import java.util.Collections;
+import java.util.Comparator;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.tree.MethodNode;
+import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
+
+/**
+ * A {@link MethodVisitor} adapter to sort the exception handlers. The handlers
+ * are sorted in a method innermost-to-outermost. This allows the programmer to
+ * add handlers without worrying about ordering them correctly with respect to
+ * existing, in-code handlers.
+ *
+ * Behavior is only defined for properly-nested handlers. If any "try" blocks
+ * overlap (something that isn't possible in Java code) then this may not do
+ * what you want. In fact, this adapter just sorts by the length of the "try"
+ * block, taking advantage of the fact that a given try block must be larger
+ * than any block it contains).
+ *
+ * @author Adrian Sampson
+ */
+public class TryCatchBlockSorter extends MethodNode {
+
+    public TryCatchBlockSorter(
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        this(Opcodes.ASM4, mv, access, name, desc, signature, exceptions);
+    }
+
+    protected TryCatchBlockSorter(
+        final int api,
+        final MethodVisitor mv,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        super(api, access, name, desc, signature, exceptions);
+        this.mv = mv;
+    }
+
+    @Override
+    public void visitEnd() {
+        // Compares TryCatchBlockNodes by the length of their "try" block.
+        Comparator<TryCatchBlockNode> comp = new Comparator<TryCatchBlockNode>() {
+
+            public int compare(TryCatchBlockNode t1, TryCatchBlockNode t2) {
+                int len1 = blockLength(t1);
+                int len2 = blockLength(t2);
+                return len1 - len2;
+            }
+
+            private int blockLength(TryCatchBlockNode block) {
+                int startidx = instructions.indexOf(block.start);
+                int endidx = instructions.indexOf(block.end);
+                return endidx - startidx;
+            }
+        };
+        Collections.sort(tryCatchBlocks, comp);
+        if (mv != null) {
+            accept(mv);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/signature/SignatureReader.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,258 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.signature;
+
+/**
+ * A type signature parser to make a signature visitor visit an existing
+ * signature.
+ *
+ * @author Thomas Hallgren
+ * @author Eric Bruneton
+ */
+public class SignatureReader {
+
+    /**
+     * The signature to be read.
+     */
+    private final String signature;
+
+    /**
+     * Constructs a {@link SignatureReader} for the given signature.
+     *
+     * @param signature A <i>ClassSignature</i>, <i>MethodTypeSignature</i>,
+     *        or <i>FieldTypeSignature</i>.
+     */
+    public SignatureReader(final String signature) {
+        this.signature = signature;
+    }
+
+    /**
+     * Makes the given visitor visit the signature of this
+     * {@link SignatureReader}. This signature is the one specified in the
+     * constructor (see {@link #SignatureReader(String) SignatureReader}). This
+     * method is intended to be called on a {@link SignatureReader} that was
+     * created using a <i>ClassSignature</i> (such as the
+     * <code>signature</code> parameter of the
+     * {@link jdk.internal.org.objectweb.asm.ClassVisitor#visit ClassVisitor.visit} method)
+     * or a <i>MethodTypeSignature</i> (such as the <code>signature</code>
+     * parameter of the
+     * {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitMethod ClassVisitor.visitMethod}
+     * method).
+     *
+     * @param v the visitor that must visit this signature.
+     */
+    public void accept(final SignatureVisitor v) {
+        String signature = this.signature;
+        int len = signature.length();
+        int pos;
+        char c;
+
+        if (signature.charAt(0) == '<') {
+            pos = 2;
+            do {
+                int end = signature.indexOf(':', pos);
+                v.visitFormalTypeParameter(signature.substring(pos - 1, end));
+                pos = end + 1;
+
+                c = signature.charAt(pos);
+                if (c == 'L' || c == '[' || c == 'T') {
+                    pos = parseType(signature, pos, v.visitClassBound());
+                }
+
+                while ((c = signature.charAt(pos++)) == ':') {
+                    pos = parseType(signature, pos, v.visitInterfaceBound());
+                }
+            } while (c != '>');
+        } else {
+            pos = 0;
+        }
+
+        if (signature.charAt(pos) == '(') {
+            pos++;
+            while (signature.charAt(pos) != ')') {
+                pos = parseType(signature, pos, v.visitParameterType());
+            }
+            pos = parseType(signature, pos + 1, v.visitReturnType());
+            while (pos < len) {
+                pos = parseType(signature, pos + 1, v.visitExceptionType());
+            }
+        } else {
+            pos = parseType(signature, pos, v.visitSuperclass());
+            while (pos < len) {
+                pos = parseType(signature, pos, v.visitInterface());
+            }
+        }
+    }
+
+    /**
+     * Makes the given visitor visit the signature of this
+     * {@link SignatureReader}. This signature is the one specified in the
+     * constructor (see {@link #SignatureReader(String) SignatureReader}). This
+     * method is intended to be called on a {@link SignatureReader} that was
+     * created using a <i>FieldTypeSignature</i>, such as the
+     * <code>signature</code> parameter of the
+     * {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitField
+     * ClassVisitor.visitField} or {@link
+     * jdk.internal.org.objectweb.asm.MethodVisitor#visitLocalVariable
+     * MethodVisitor.visitLocalVariable} methods.
+     *
+     * @param v the visitor that must visit this signature.
+     */
+    public void acceptType(final SignatureVisitor v) {
+        parseType(this.signature, 0, v);
+    }
+
+    /**
+     * Parses a field type signature and makes the given visitor visit it.
+     *
+     * @param signature a string containing the signature that must be parsed.
+     * @param pos index of the first character of the signature to parsed.
+     * @param v the visitor that must visit this signature.
+     * @return the index of the first character after the parsed signature.
+     */
+    private static int parseType(
+        final String signature,
+        int pos,
+        final SignatureVisitor v)
+    {
+        char c;
+        int start, end;
+        boolean visited, inner;
+        String name;
+
+        switch (c = signature.charAt(pos++)) {
+            case 'Z':
+            case 'C':
+            case 'B':
+            case 'S':
+            case 'I':
+            case 'F':
+            case 'J':
+            case 'D':
+            case 'V':
+                v.visitBaseType(c);
+                return pos;
+
+            case '[':
+                return parseType(signature, pos, v.visitArrayType());
+
+            case 'T':
+                end = signature.indexOf(';', pos);
+                v.visitTypeVariable(signature.substring(pos, end));
+                return end + 1;
+
+            default: // case 'L':
+                start = pos;
+                visited = false;
+                inner = false;
+                for (;;) {
+                    switch (c = signature.charAt(pos++)) {
+                        case '.':
+                        case ';':
+                            if (!visited) {
+                                name = signature.substring(start, pos - 1);
+                                if (inner) {
+                                    v.visitInnerClassType(name);
+                                } else {
+                                    v.visitClassType(name);
+                                }
+                            }
+                            if (c == ';') {
+                                v.visitEnd();
+                                return pos;
+                            }
+                            start = pos;
+                            visited = false;
+                            inner = true;
+                            break;
+
+                        case '<':
+                            name = signature.substring(start, pos - 1);
+                            if (inner) {
+                                v.visitInnerClassType(name);
+                            } else {
+                                v.visitClassType(name);
+                            }
+                            visited = true;
+                            top: for (;;) {
+                                switch (c = signature.charAt(pos)) {
+                                    case '>':
+                                        break top;
+                                    case '*':
+                                        ++pos;
+                                        v.visitTypeArgument();
+                                        break;
+                                    case '+':
+                                    case '-':
+                                        pos = parseType(signature,
+                                                pos + 1,
+                                                v.visitTypeArgument(c));
+                                        break;
+                                    default:
+                                        pos = parseType(signature,
+                                                pos,
+                                                v.visitTypeArgument('='));
+                                        break;
+                                }
+                            }
+                    }
+                }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/signature/SignatureVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,257 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.signature;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A visitor to visit a generic signature. The methods of this interface must be
+ * called in one of the three following orders (the last one is the only valid
+ * order for a {@link SignatureVisitor} that is returned by a method of this
+ * interface): <ul> <li><i>ClassSignature</i> = (
+ * <tt>visitFormalTypeParameter</tt>
+ *   <tt>visitClassBound</tt>?
+ * <tt>visitInterfaceBound</tt>* )* ( <tt>visitSuperClass</tt>
+ *   <tt>visitInterface</tt>* )</li>
+ * <li><i>MethodSignature</i> = ( <tt>visitFormalTypeParameter</tt>
+ *   <tt>visitClassBound</tt>?
+ * <tt>visitInterfaceBound</tt>* )* ( <tt>visitParameterType</tt>*
+ * <tt>visitReturnType</tt>
+ *   <tt>visitExceptionType</tt>* )</li> <li><i>TypeSignature</i> =
+ * <tt>visitBaseType</tt> | <tt>visitTypeVariable</tt> |
+ * <tt>visitArrayType</tt> | (
+ * <tt>visitClassType</tt> <tt>visitTypeArgument</tt>* (
+ * <tt>visitInnerClassType</tt> <tt>visitTypeArgument</tt>* )*
+ * <tt>visitEnd</tt> ) )</li> </ul>
+ *
+ * @author Thomas Hallgren
+ * @author Eric Bruneton
+ */
+public abstract class SignatureVisitor {
+
+    /**
+     * Wildcard for an "extends" type argument.
+     */
+    public final static char EXTENDS = '+';
+
+    /**
+     * Wildcard for a "super" type argument.
+     */
+    public final static char SUPER = '-';
+
+    /**
+     * Wildcard for a normal type argument.
+     */
+    public final static char INSTANCEOF = '=';
+
+    /**
+     * The ASM API version implemented by this visitor. The value of this field
+     * must be one of {@link Opcodes#ASM4}.
+     */
+    protected final int api;
+
+    /**
+     * Constructs a new {@link SignatureVisitor}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public SignatureVisitor(final int api) {
+        this.api = api;
+    }
+
+    /**
+     * Visits a formal type parameter.
+     *
+     * @param name the name of the formal parameter.
+     */
+    public void visitFormalTypeParameter(String name) {
+    }
+
+    /**
+     * Visits the class bound of the last visited formal type parameter.
+     *
+     * @return a non null visitor to visit the signature of the class bound.
+     */
+    public SignatureVisitor visitClassBound() {
+        return this;
+    }
+
+    /**
+     * Visits an interface bound of the last visited formal type parameter.
+     *
+     * @return a non null visitor to visit the signature of the interface bound.
+     */
+    public SignatureVisitor visitInterfaceBound() {
+        return this;
+    }
+
+    /**
+     * Visits the type of the super class.
+     *
+     * @return a non null visitor to visit the signature of the super class
+     *         type.
+     */
+    public SignatureVisitor visitSuperclass() {
+        return this;
+    }
+
+    /**
+     * Visits the type of an interface implemented by the class.
+     *
+     * @return a non null visitor to visit the signature of the interface type.
+     */
+    public SignatureVisitor visitInterface() {
+        return this;
+    }
+
+    /**
+     * Visits the type of a method parameter.
+     *
+     * @return a non null visitor to visit the signature of the parameter type.
+     */
+    public SignatureVisitor visitParameterType() {
+        return this;
+    }
+
+    /**
+     * Visits the return type of the method.
+     *
+     * @return a non null visitor to visit the signature of the return type.
+     */
+    public SignatureVisitor visitReturnType() {
+        return this;
+    }
+
+    /**
+     * Visits the type of a method exception.
+     *
+     * @return a non null visitor to visit the signature of the exception type.
+     */
+    public SignatureVisitor visitExceptionType() {
+        return this;
+    }
+
+    /**
+     * Visits a signature corresponding to a primitive type.
+     *
+     * @param descriptor the descriptor of the primitive type, or 'V' for
+     *        <tt>void</tt>.
+     */
+    public void visitBaseType(char descriptor) {
+    }
+
+    /**
+     * Visits a signature corresponding to a type variable.
+     *
+     * @param name the name of the type variable.
+     */
+    public void visitTypeVariable(String name) {
+    }
+
+    /**
+     * Visits a signature corresponding to an array type.
+     *
+     * @return a non null visitor to visit the signature of the array element
+     *         type.
+     */
+    public SignatureVisitor visitArrayType() {
+        return this;
+    }
+
+    /**
+     * Starts the visit of a signature corresponding to a class or interface
+     * type.
+     *
+     * @param name the internal name of the class or interface.
+     */
+    public void visitClassType(String name) {
+    }
+
+    /**
+     * Visits an inner class.
+     *
+     * @param name the local name of the inner class in its enclosing class.
+     */
+    public void visitInnerClassType(String name) {
+    }
+
+    /**
+     * Visits an unbounded type argument of the last visited class or inner
+     * class type.
+     */
+    public void visitTypeArgument() {
+    }
+
+    /**
+     * Visits a type argument of the last visited class or inner class type.
+     *
+     * @param wildcard '+', '-' or '='.
+     * @return a non null visitor to visit the signature of the type argument.
+     */
+    public SignatureVisitor visitTypeArgument(char wildcard) {
+        return this;
+    }
+
+    /**
+     * Ends the visit of a signature corresponding to a class or interface type.
+     */
+    public void visitEnd() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/signature/SignatureWriter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,256 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.signature;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A signature visitor that generates signatures in string format.
+ *
+ * @author Thomas Hallgren
+ * @author Eric Bruneton
+ */
+public class SignatureWriter extends SignatureVisitor {
+
+    /**
+     * Buffer used to construct the signature.
+     */
+    private final StringBuffer buf = new StringBuffer();
+
+    /**
+     * Indicates if the signature contains formal type parameters.
+     */
+    private boolean hasFormals;
+
+    /**
+     * Indicates if the signature contains method parameter types.
+     */
+    private boolean hasParameters;
+
+    /**
+     * Stack used to keep track of class types that have arguments. Each element
+     * of this stack is a boolean encoded in one bit. The top of the stack is
+     * the lowest order bit. Pushing false = *2, pushing true = *2+1, popping =
+     * /2.
+     */
+    private int argumentStack;
+
+    /**
+     * Constructs a new {@link SignatureWriter} object.
+     */
+    public SignatureWriter() {
+        super(Opcodes.ASM4);
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the SignatureVisitor interface
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visitFormalTypeParameter(final String name) {
+        if (!hasFormals) {
+            hasFormals = true;
+            buf.append('<');
+        }
+        buf.append(name);
+        buf.append(':');
+    }
+
+    @Override
+    public SignatureVisitor visitClassBound() {
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitInterfaceBound() {
+        buf.append(':');
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitSuperclass() {
+        endFormals();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitInterface() {
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitParameterType() {
+        endFormals();
+        if (!hasParameters) {
+            hasParameters = true;
+            buf.append('(');
+        }
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitReturnType() {
+        endFormals();
+        if (!hasParameters) {
+            buf.append('(');
+        }
+        buf.append(')');
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitExceptionType() {
+        buf.append('^');
+        return this;
+    }
+
+    @Override
+    public void visitBaseType(final char descriptor) {
+        buf.append(descriptor);
+    }
+
+    @Override
+    public void visitTypeVariable(final String name) {
+        buf.append('T');
+        buf.append(name);
+        buf.append(';');
+    }
+
+    @Override
+    public SignatureVisitor visitArrayType() {
+        buf.append('[');
+        return this;
+    }
+
+    @Override
+    public void visitClassType(final String name) {
+        buf.append('L');
+        buf.append(name);
+        argumentStack *= 2;
+    }
+
+    @Override
+    public void visitInnerClassType(final String name) {
+        endArguments();
+        buf.append('.');
+        buf.append(name);
+        argumentStack *= 2;
+    }
+
+    @Override
+    public void visitTypeArgument() {
+        if (argumentStack % 2 == 0) {
+            ++argumentStack;
+            buf.append('<');
+        }
+        buf.append('*');
+    }
+
+    @Override
+    public SignatureVisitor visitTypeArgument(final char wildcard) {
+        if (argumentStack % 2 == 0) {
+            ++argumentStack;
+            buf.append('<');
+        }
+        if (wildcard != '=') {
+            buf.append(wildcard);
+        }
+        return this;
+    }
+
+    @Override
+    public void visitEnd() {
+        endArguments();
+        buf.append(';');
+    }
+
+    /**
+     * Returns the signature that was built by this signature writer.
+     *
+     * @return the signature that was built by this signature writer.
+     */
+    @Override
+    public String toString() {
+        return buf.toString();
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Ends the formal type parameters section of the signature.
+     */
+    private void endFormals() {
+        if (hasFormals) {
+            hasFormals = false;
+            buf.append('>');
+        }
+    }
+
+    /**
+     * Ends the type arguments of a class or inner class type.
+     */
+    private void endArguments() {
+        if (argumentStack % 2 != 0) {
+            buf.append('>');
+        }
+        argumentStack /= 2;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/AbstractInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,267 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a bytecode instruction. <i>An instruction can appear
+ * at most once in at most one {@link InsnList} at a time</i>.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class AbstractInsnNode {
+
+    /**
+     * The type of {@link InsnNode} instructions.
+     */
+    public static final int INSN = 0;
+
+    /**
+     * The type of {@link IntInsnNode} instructions.
+     */
+    public static final int INT_INSN = 1;
+
+    /**
+     * The type of {@link VarInsnNode} instructions.
+     */
+    public static final int VAR_INSN = 2;
+
+    /**
+     * The type of {@link TypeInsnNode} instructions.
+     */
+    public static final int TYPE_INSN = 3;
+
+    /**
+     * The type of {@link FieldInsnNode} instructions.
+     */
+    public static final int FIELD_INSN = 4;
+
+    /**
+     * The type of {@link MethodInsnNode} instructions.
+     */
+    public static final int METHOD_INSN = 5;
+
+    /**
+     * The type of {@link InvokeDynamicInsnNode} instructions.
+     */
+    public static final int INVOKE_DYNAMIC_INSN = 6;
+
+    /**
+     * The type of {@link JumpInsnNode} instructions.
+     */
+    public static final int JUMP_INSN = 7;
+
+    /**
+     * The type of {@link LabelNode} "instructions".
+     */
+    public static final int LABEL = 8;
+
+    /**
+     * The type of {@link LdcInsnNode} instructions.
+     */
+    public static final int LDC_INSN = 9;
+
+    /**
+     * The type of {@link IincInsnNode} instructions.
+     */
+    public static final int IINC_INSN = 10;
+
+    /**
+     * The type of {@link TableSwitchInsnNode} instructions.
+     */
+    public static final int TABLESWITCH_INSN = 11;
+
+    /**
+     * The type of {@link LookupSwitchInsnNode} instructions.
+     */
+    public static final int LOOKUPSWITCH_INSN = 12;
+
+    /**
+     * The type of {@link MultiANewArrayInsnNode} instructions.
+     */
+    public static final int MULTIANEWARRAY_INSN = 13;
+
+    /**
+     * The type of {@link FrameNode} "instructions".
+     */
+    public static final int FRAME = 14;
+
+    /**
+     * The type of {@link LineNumberNode} "instructions".
+     */
+    public static final int LINE = 15;
+
+    /**
+     * The opcode of this instruction.
+     */
+    protected int opcode;
+
+    /**
+     * Previous instruction in the list to which this instruction belongs.
+     */
+    AbstractInsnNode prev;
+
+    /**
+     * Next instruction in the list to which this instruction belongs.
+     */
+    AbstractInsnNode next;
+
+    /**
+     * Index of this instruction in the list to which it belongs. The value of
+     * this field is correct only when {@link InsnList#cache} is not null. A
+     * value of -1 indicates that this instruction does not belong to any
+     * {@link InsnList}.
+     */
+    int index;
+
+    /**
+     * Constructs a new {@link AbstractInsnNode}.
+     *
+     * @param opcode the opcode of the instruction to be constructed.
+     */
+    protected AbstractInsnNode(final int opcode) {
+        this.opcode = opcode;
+        this.index = -1;
+    }
+
+    /**
+     * Returns the opcode of this instruction.
+     *
+     * @return the opcode of this instruction.
+     */
+    public int getOpcode() {
+        return opcode;
+    }
+
+    /**
+     * Returns the type of this instruction.
+     *
+     * @return the type of this instruction, i.e. one the constants defined in
+     *         this class.
+     */
+    public abstract int getType();
+
+    /**
+     * Returns the previous instruction in the list to which this instruction
+     * belongs, if any.
+     *
+     * @return the previous instruction in the list to which this instruction
+     *         belongs, if any. May be <tt>null</tt>.
+     */
+    public AbstractInsnNode getPrevious() {
+        return prev;
+    }
+
+    /**
+     * Returns the next instruction in the list to which this instruction
+     * belongs, if any.
+     *
+     * @return the next instruction in the list to which this instruction
+     *         belongs, if any. May be <tt>null</tt>.
+     */
+    public AbstractInsnNode getNext() {
+        return next;
+    }
+
+    /**
+     * Makes the given code visitor visit this instruction.
+     *
+     * @param cv a code visitor.
+     */
+    public abstract void accept(final MethodVisitor cv);
+
+    /**
+     * Returns a copy of this instruction.
+     *
+     * @param labels a map from LabelNodes to cloned LabelNodes.
+     * @return a copy of this instruction. The returned instruction does not
+     *         belong to any {@link InsnList}.
+     */
+    public abstract AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels);
+
+    /**
+     * Returns the clone of the given label.
+     *
+     * @param label a label.
+     * @param map a map from LabelNodes to cloned LabelNodes.
+     * @return the clone of the given label.
+     */
+    static LabelNode clone(final LabelNode label, final Map<LabelNode, LabelNode> map) {
+        return map.get(label);
+    }
+
+    /**
+     * Returns the clones of the given labels.
+     *
+     * @param labels a list of labels.
+     * @param map a map from LabelNodes to cloned LabelNodes.
+     * @return the clones of the given labels.
+     */
+    static LabelNode[] clone(final List<LabelNode> labels, final Map<LabelNode, LabelNode> map) {
+        LabelNode[] clones = new LabelNode[labels.size()];
+        for (int i = 0; i < clones.length; ++i) {
+            clones[i] = map.get(labels.get(i));
+        }
+        return clones;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/AnnotationNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,253 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents an annotationn.
+ *
+ * @author Eric Bruneton
+ */
+public class AnnotationNode extends AnnotationVisitor {
+
+    /**
+     * The class descriptor of the annotation class.
+     */
+    public String desc;
+
+    /**
+     * The name value pairs of this annotation. Each name value pair is stored
+     * as two consecutive elements in the list. The name is a {@link String},
+     * and the value may be a {@link Byte}, {@link Boolean}, {@link Character},
+     * {@link Short}, {@link Integer}, {@link Long}, {@link Float},
+     * {@link Double}, {@link String} or {@link jdk.internal.org.objectweb.asm.Type}, or an
+     * two elements String array (for enumeration values), a
+     * {@link AnnotationNode}, or a {@link List} of values of one of the
+     * preceding types. The list may be <tt>null</tt> if there is no name
+     * value pair.
+     */
+    public List<Object> values;
+
+    /**
+     * Constructs a new {@link AnnotationNode}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #AnnotationNode(int, String)} version.
+     *
+     * @param desc the class descriptor of the annotation class.
+     */
+    public AnnotationNode(final String desc) {
+        this(Opcodes.ASM4, desc);
+    }
+
+    /**
+     * Constructs a new {@link AnnotationNode}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param desc the class descriptor of the annotation class.
+     */
+    public AnnotationNode(final int api, final String desc) {
+        super(api);
+        this.desc = desc;
+    }
+
+    /**
+     * Constructs a new {@link AnnotationNode} to visit an array value.
+     *
+     * @param values where the visited values must be stored.
+     */
+    AnnotationNode(final List<Object> values) {
+        super(Opcodes.ASM4);
+        this.values = values;
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the AnnotationVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(final String name, final Object value) {
+        if (values == null) {
+            values = new ArrayList<Object>(this.desc != null ? 2 : 1);
+        }
+        if (this.desc != null) {
+            values.add(name);
+        }
+        values.add(value);
+    }
+
+    @Override
+    public void visitEnum(
+        final String name,
+        final String desc,
+        final String value)
+    {
+        if (values == null) {
+            values = new ArrayList<Object>(this.desc != null ? 2 : 1);
+        }
+        if (this.desc != null) {
+            values.add(name);
+        }
+        values.add(new String[] { desc, value });
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String name,
+        final String desc)
+    {
+        if (values == null) {
+            values = new ArrayList<Object>(this.desc != null ? 2 : 1);
+        }
+        if (this.desc != null) {
+            values.add(name);
+        }
+        AnnotationNode annotation = new AnnotationNode(desc);
+        values.add(annotation);
+        return annotation;
+    }
+
+    @Override
+    public AnnotationVisitor visitArray(final String name) {
+        if (values == null) {
+            values = new ArrayList<Object>(this.desc != null ? 2 : 1);
+        }
+        if (this.desc != null) {
+            values.add(name);
+        }
+        List<Object> array = new ArrayList<Object>();
+        values.add(array);
+        return new AnnotationNode(array);
+    }
+
+    @Override
+    public void visitEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Accept methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Checks that this annotation node is compatible with the given ASM API
+     * version. This methods checks that this node, and all its nodes
+     * recursively, do not contain elements that were introduced in more recent
+     * versions of the ASM API than the given version.
+     *
+     * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
+     */
+    public void check(final int api) {
+        // nothing to do
+    }
+
+    /**
+     * Makes the given visitor visit this annotation.
+     *
+     * @param av an annotation visitor. Maybe <tt>null</tt>.
+     */
+    public void accept(final AnnotationVisitor av) {
+        if (av != null) {
+            if (values != null) {
+                for (int i = 0; i < values.size(); i += 2) {
+                    String name = (String) values.get(i);
+                    Object value = values.get(i + 1);
+                    accept(av, name, value);
+                }
+            }
+            av.visitEnd();
+        }
+    }
+
+    /**
+     * Makes the given visitor visit a given annotation value.
+     *
+     * @param av an annotation visitor. Maybe <tt>null</tt>.
+     * @param name the value name.
+     * @param value the actual value.
+     */
+    static void accept(
+        final AnnotationVisitor av,
+        final String name,
+        final Object value)
+    {
+        if (av != null) {
+            if (value instanceof String[]) {
+                String[] typeconst = (String[]) value;
+                av.visitEnum(name, typeconst[0], typeconst[1]);
+            } else if (value instanceof AnnotationNode) {
+                AnnotationNode an = (AnnotationNode) value;
+                an.accept(av.visitAnnotation(name, an.desc));
+            } else if (value instanceof List) {
+                AnnotationVisitor v = av.visitArray(name);
+                List<?> array = (List<?>) value;
+                for (int j = 0; j < array.size(); ++j) {
+                    accept(v, null, array.get(j));
+                }
+                v.visitEnd();
+            } else {
+                av.visit(name, value);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/ClassNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,400 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents a class.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassNode extends ClassVisitor {
+
+    /**
+     * The class version.
+     */
+    public int version;
+
+    /**
+     * The class's access flags (see {@link jdk.internal.org.objectweb.asm.Opcodes}). This
+     * field also indicates if the class is deprecated.
+     */
+    public int access;
+
+    /**
+     * The internal name of the class (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     */
+    public String name;
+
+    /**
+     * The signature of the class. Mayt be <tt>null</tt>.
+     */
+    public String signature;
+
+    /**
+     * The internal of name of the super class (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}). For
+     * interfaces, the super class is {@link Object}. May be <tt>null</tt>,
+     * but only for the {@link Object} class.
+     */
+    public String superName;
+
+    /**
+     * The internal names of the class's interfaces (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}). This
+     * list is a list of {@link String} objects.
+     */
+    public List<String> interfaces;
+
+    /**
+     * The name of the source file from which this class was compiled. May be
+     * <tt>null</tt>.
+     */
+    public String sourceFile;
+
+    /**
+     * Debug information to compute the correspondance between source and
+     * compiled elements of the class. May be <tt>null</tt>.
+     */
+    public String sourceDebug;
+
+    /**
+     * The internal name of the enclosing class of the class. May be
+     * <tt>null</tt>.
+     */
+    public String outerClass;
+
+    /**
+     * The name of the method that contains the class, or <tt>null</tt> if the
+     * class is not enclosed in a method.
+     */
+    public String outerMethod;
+
+    /**
+     * The descriptor of the method that contains the class, or <tt>null</tt>
+     * if the class is not enclosed in a method.
+     */
+    public String outerMethodDesc;
+
+    /**
+     * The runtime visible annotations of this class. This list is a list of
+     * {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label visible
+     */
+    public List<AnnotationNode> visibleAnnotations;
+
+    /**
+     * The runtime invisible annotations of this class. This list is a list of
+     * {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label invisible
+     */
+    public List<AnnotationNode> invisibleAnnotations;
+
+    /**
+     * The non standard attributes of this class. This list is a list of
+     * {@link Attribute} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.Attribute
+     */
+    public List<Attribute> attrs;
+
+    /**
+     * Informations about the inner classes of this class. This list is a list
+     * of {@link InnerClassNode} objects.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.InnerClassNode
+     */
+    public List<InnerClassNode> innerClasses;
+
+    /**
+     * The fields of this class. This list is a list of {@link FieldNode}
+     * objects.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.FieldNode
+     */
+    public List<FieldNode> fields;
+
+    /**
+     * The methods of this class. This list is a list of {@link MethodNode}
+     * objects.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.MethodNode
+     */
+    public List<MethodNode> methods;
+
+    /**
+     * Constructs a new {@link ClassNode}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the {@link #ClassNode(int)}
+     * version.
+     */
+    public ClassNode() {
+        this(Opcodes.ASM4);
+    }
+
+    /**
+     * Constructs a new {@link ClassNode}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public ClassNode(final int api) {
+        super(api);
+        this.interfaces = new ArrayList<String>();
+        this.innerClasses = new ArrayList<InnerClassNode>();
+        this.fields = new ArrayList<FieldNode>();
+        this.methods = new ArrayList<MethodNode>();
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the ClassVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        this.version = version;
+        this.access = access;
+        this.name = name;
+        this.signature = signature;
+        this.superName = superName;
+        if (interfaces != null) {
+            this.interfaces.addAll(Arrays.asList(interfaces));
+        }
+    }
+
+    @Override
+    public void visitSource(final String file, final String debug) {
+        sourceFile = file;
+        sourceDebug = debug;
+    }
+
+    @Override
+    public void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        outerClass = owner;
+        outerMethod = name;
+        outerMethodDesc = desc;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        AnnotationNode an = new AnnotationNode(desc);
+        if (visible) {
+            if (visibleAnnotations == null) {
+                visibleAnnotations = new ArrayList<AnnotationNode>(1);
+            }
+            visibleAnnotations.add(an);
+        } else {
+            if (invisibleAnnotations == null) {
+                invisibleAnnotations = new ArrayList<AnnotationNode>(1);
+            }
+            invisibleAnnotations.add(an);
+        }
+        return an;
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        if (attrs == null) {
+            attrs = new ArrayList<Attribute>(1);
+        }
+        attrs.add(attr);
+    }
+
+    @Override
+    public void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        InnerClassNode icn = new InnerClassNode(name,
+                outerName,
+                innerName,
+                access);
+        innerClasses.add(icn);
+    }
+
+    @Override
+    public FieldVisitor visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        FieldNode fn = new FieldNode(access, name, desc, signature, value);
+        fields.add(fn);
+        return fn;
+    }
+
+    @Override
+    public MethodVisitor visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        MethodNode mn = new MethodNode(access,
+                name,
+                desc,
+                signature,
+                exceptions);
+        methods.add(mn);
+        return mn;
+    }
+
+    @Override
+    public void visitEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Accept method
+    // ------------------------------------------------------------------------
+
+    /**
+     * Checks that this class node is compatible with the given ASM API version.
+     * This methods checks that this node, and all its nodes recursively, do not
+     * contain elements that were introduced in more recent versions of the ASM
+     * API than the given version.
+     *
+     * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
+     */
+    public void check(final int api) {
+        // nothing to do
+    }
+
+    /**
+     * Makes the given class visitor visit this class.
+     *
+     * @param cv a class visitor.
+     */
+    public void accept(final ClassVisitor cv) {
+        // visits header
+        String[] interfaces = new String[this.interfaces.size()];
+        this.interfaces.toArray(interfaces);
+        cv.visit(version, access, name, signature, superName, interfaces);
+        // visits source
+        if (sourceFile != null || sourceDebug != null) {
+            cv.visitSource(sourceFile, sourceDebug);
+        }
+        // visits outer class
+        if (outerClass != null) {
+            cv.visitOuterClass(outerClass, outerMethod, outerMethodDesc);
+        }
+        // visits attributes
+        int i, n;
+        n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+        for (i = 0; i < n; ++i) {
+            AnnotationNode an = visibleAnnotations.get(i);
+            an.accept(cv.visitAnnotation(an.desc, true));
+        }
+        n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+        for (i = 0; i < n; ++i) {
+            AnnotationNode an = invisibleAnnotations.get(i);
+            an.accept(cv.visitAnnotation(an.desc, false));
+        }
+        n = attrs == null ? 0 : attrs.size();
+        for (i = 0; i < n; ++i) {
+            cv.visitAttribute(attrs.get(i));
+        }
+        // visits inner classes
+        for (i = 0; i < innerClasses.size(); ++i) {
+            innerClasses.get(i).accept(cv);
+        }
+        // visits fields
+        for (i = 0; i < fields.size(); ++i) {
+            fields.get(i).accept(cv);
+        }
+        // visits methods
+        for (i = 0; i < methods.size(); ++i) {
+            methods.get(i).accept(cv);
+        }
+        // visits end
+        cv.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/FieldInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,135 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a field instruction. A field instruction is an
+ * instruction that loads or stores the value of a field of an object.
+ *
+ * @author Eric Bruneton
+ */
+public class FieldInsnNode extends AbstractInsnNode {
+
+    /**
+     * The internal name of the field's owner class (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     */
+    public String owner;
+
+    /**
+     * The field's name.
+     */
+    public String name;
+
+    /**
+     * The field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public String desc;
+
+    /**
+     * Constructs a new {@link FieldInsnNode}.
+     *
+     * @param opcode the opcode of the type instruction to be constructed. This
+     *        opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+     * @param owner the internal name of the field's owner class (see
+     *        {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     * @param name the field's name.
+     * @param desc the field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public FieldInsnNode(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        super(opcode);
+        this.owner = owner;
+        this.name = name;
+        this.desc = desc;
+    }
+
+    /**
+     * Sets the opcode of this instruction.
+     *
+     * @param opcode the new instruction opcode. This opcode must be GETSTATIC,
+     *        PUTSTATIC, GETFIELD or PUTFIELD.
+     */
+    public void setOpcode(final int opcode) {
+        this.opcode = opcode;
+    }
+
+    @Override
+    public int getType() {
+        return FIELD_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor cv) {
+        cv.visitFieldInsn(opcode, owner, name, desc);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new FieldInsnNode(opcode, owner, name, desc);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/FieldNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,272 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents a field.
+ *
+ * @author Eric Bruneton
+ */
+public class FieldNode extends FieldVisitor {
+
+    /**
+     * The field's access flags (see {@link jdk.internal.org.objectweb.asm.Opcodes}). This
+     * field also indicates if the field is synthetic and/or deprecated.
+     */
+    public int access;
+
+    /**
+     * The field's name.
+     */
+    public String name;
+
+    /**
+     * The field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public String desc;
+
+    /**
+     * The field's signature. May be <tt>null</tt>.
+     */
+    public String signature;
+
+    /**
+     * The field's initial value. This field, which may be <tt>null</tt> if
+     * the field does not have an initial value, must be an {@link Integer}, a
+     * {@link Float}, a {@link Long}, a {@link Double} or a {@link String}.
+     */
+    public Object value;
+
+    /**
+     * The runtime visible annotations of this field. This list is a list of
+     * {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label visible
+     */
+    public List<AnnotationNode> visibleAnnotations;
+
+    /**
+     * The runtime invisible annotations of this field. This list is a list of
+     * {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label invisible
+     */
+    public List<AnnotationNode> invisibleAnnotations;
+
+    /**
+     * The non standard attributes of this field. This list is a list of
+     * {@link Attribute} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.Attribute
+     */
+    public List<Attribute> attrs;
+
+    /**
+     * Constructs a new {@link FieldNode}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #FieldNode(int, int, String, String, String, Object)} version.
+     *
+     * @param access the field's access flags (see
+     *        {@link jdk.internal.org.objectweb.asm.Opcodes}). This parameter also indicates
+     *        if the field is synthetic and/or deprecated.
+     * @param name the field's name.
+     * @param desc the field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type
+     *        Type}).
+     * @param signature the field's signature.
+     * @param value the field's initial value. This parameter, which may be
+     *        <tt>null</tt> if the field does not have an initial value, must be
+     *        an {@link Integer}, a {@link Float}, a {@link Long}, a
+     *        {@link Double} or a {@link String}.
+     */
+    public FieldNode(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        this(Opcodes.ASM4, access, name, desc, signature, value);
+    }
+
+    /**
+     * Constructs a new {@link FieldNode}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #FieldNode(int, int, String, String, String, Object)} version.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param access the field's access flags (see
+     *        {@link jdk.internal.org.objectweb.asm.Opcodes}). This parameter also indicates
+     *        if the field is synthetic and/or deprecated.
+     * @param name the field's name.
+     * @param desc the field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type
+     *        Type}).
+     * @param signature the field's signature.
+     * @param value the field's initial value. This parameter, which may be
+     *        <tt>null</tt> if the field does not have an initial value, must be
+     *        an {@link Integer}, a {@link Float}, a {@link Long}, a
+     *        {@link Double} or a {@link String}.
+     */
+    public FieldNode(
+        final int api,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        super(api);
+        this.access = access;
+        this.name = name;
+        this.desc = desc;
+        this.signature = signature;
+        this.value = value;
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the FieldVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        AnnotationNode an = new AnnotationNode(desc);
+        if (visible) {
+            if (visibleAnnotations == null) {
+                visibleAnnotations = new ArrayList<AnnotationNode>(1);
+            }
+            visibleAnnotations.add(an);
+        } else {
+            if (invisibleAnnotations == null) {
+                invisibleAnnotations = new ArrayList<AnnotationNode>(1);
+            }
+            invisibleAnnotations.add(an);
+        }
+        return an;
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        if (attrs == null) {
+            attrs = new ArrayList<Attribute>(1);
+        }
+        attrs.add(attr);
+    }
+
+    @Override
+    public void visitEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Accept methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Checks that this field node is compatible with the given ASM API version.
+     * This methods checks that this node, and all its nodes recursively, do not
+     * contain elements that were introduced in more recent versions of the ASM
+     * API than the given version.
+     *
+     * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
+     */
+    public void check(final int api) {
+        // nothing to do
+    }
+
+    /**
+     * Makes the given class visitor visit this field.
+     *
+     * @param cv a class visitor.
+     */
+    public void accept(final ClassVisitor cv) {
+        FieldVisitor fv = cv.visitField(access, name, desc, signature, value);
+        if (fv == null) {
+            return;
+        }
+        int i, n;
+        n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+        for (i = 0; i < n; ++i) {
+            AnnotationNode an = visibleAnnotations.get(i);
+            an.accept(fv.visitAnnotation(an.desc, true));
+        }
+        n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+        for (i = 0; i < n; ++i) {
+            AnnotationNode an = invisibleAnnotations.get(i);
+            an.accept(fv.visitAnnotation(an.desc, false));
+        }
+        n = attrs == null ? 0 : attrs.size();
+        for (i = 0; i < n; ++i) {
+            fv.visitAttribute(attrs.get(i));
+        }
+        fv.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/FrameNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,240 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents a stack map frame. These nodes are pseudo instruction
+ * nodes in order to be inserted in an instruction list. In fact these nodes
+ * must(*) be inserted <i>just before</i> any instruction node <b>i</b> that
+ * follows an unconditionnal branch instruction such as GOTO or THROW, that is
+ * the target of a jump instruction, or that starts an exception handler block.
+ * The stack map frame types must describe the values of the local variables and
+ * of the operand stack elements <i>just before</i> <b>i</b> is executed. <br>
+ * <br> (*) this is mandatory only for classes whose version is greater than or
+ * equal to {@link Opcodes#V1_6 V1_6}.
+ *
+ * @author Eric Bruneton
+ */
+public class FrameNode extends AbstractInsnNode {
+
+    /**
+     * The type of this frame. Must be {@link Opcodes#F_NEW} for expanded
+     * frames, or {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
+     * {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
+     * {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for compressed frames.
+     */
+    public int type;
+
+    /**
+     * The types of the local variables of this stack map frame. Elements of
+     * this list can be Integer, String or LabelNode objects (for primitive,
+     * reference and uninitialized types respectively - see
+     * {@link MethodVisitor}).
+     */
+    public List<Object> local;
+
+    /**
+     * The types of the operand stack elements of this stack map frame. Elements
+     * of this list can be Integer, String or LabelNode objects (for primitive,
+     * reference and uninitialized types respectively - see
+     * {@link MethodVisitor}).
+     */
+    public List<Object> stack;
+
+    private FrameNode() {
+        super(-1);
+    }
+
+    /**
+     * Constructs a new {@link FrameNode}.
+     *
+     * @param type the type of this frame. Must be {@link Opcodes#F_NEW} for
+     *        expanded frames, or {@link Opcodes#F_FULL},
+     *        {@link Opcodes#F_APPEND}, {@link Opcodes#F_CHOP},
+     *        {@link Opcodes#F_SAME} or {@link Opcodes#F_APPEND},
+     *        {@link Opcodes#F_SAME1} for compressed frames.
+     * @param nLocal number of local variables of this stack map frame.
+     * @param local the types of the local variables of this stack map frame.
+     *        Elements of this list can be Integer, String or LabelNode objects
+     *        (for primitive, reference and uninitialized types respectively -
+     *        see {@link MethodVisitor}).
+     * @param nStack number of operand stack elements of this stack map frame.
+     * @param stack the types of the operand stack elements of this stack map
+     *        frame. Elements of this list can be Integer, String or LabelNode
+     *        objects (for primitive, reference and uninitialized types
+     *        respectively - see {@link MethodVisitor}).
+     */
+    public FrameNode(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        super(-1);
+        this.type = type;
+        switch (type) {
+            case Opcodes.F_NEW:
+            case Opcodes.F_FULL:
+                this.local = asList(nLocal, local);
+                this.stack = asList(nStack, stack);
+                break;
+            case Opcodes.F_APPEND:
+                this.local = asList(nLocal, local);
+                break;
+            case Opcodes.F_CHOP:
+                this.local = Arrays.asList(new Object[nLocal]);
+                break;
+            case Opcodes.F_SAME:
+                break;
+            case Opcodes.F_SAME1:
+                this.stack = asList(1, stack);
+                break;
+        }
+    }
+
+    @Override
+    public int getType() {
+        return FRAME;
+    }
+
+    /**
+     * Makes the given visitor visit this stack map frame.
+     *
+     * @param mv a method visitor.
+     */
+    @Override
+    public void accept(final MethodVisitor mv) {
+        switch (type) {
+            case Opcodes.F_NEW:
+            case Opcodes.F_FULL:
+                mv.visitFrame(type,
+                        local.size(),
+                        asArray(local),
+                        stack.size(),
+                        asArray(stack));
+                break;
+            case Opcodes.F_APPEND:
+                mv.visitFrame(type, local.size(), asArray(local), 0, null);
+                break;
+            case Opcodes.F_CHOP:
+                mv.visitFrame(type, local.size(), null, 0, null);
+                break;
+            case Opcodes.F_SAME:
+                mv.visitFrame(type, 0, null, 0, null);
+                break;
+            case Opcodes.F_SAME1:
+                mv.visitFrame(type, 0, null, 1, asArray(stack));
+                break;
+        }
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        FrameNode clone = new FrameNode();
+        clone.type = type;
+        if (local != null) {
+            clone.local = new ArrayList<Object>();
+            for (int i = 0; i < local.size(); ++i) {
+                Object l = local.get(i);
+                if (l instanceof LabelNode) {
+                    l = labels.get(l);
+                }
+                clone.local.add(l);
+            }
+        }
+        if (stack != null) {
+            clone.stack = new ArrayList<Object>();
+            for (int i = 0; i < stack.size(); ++i) {
+                Object s = stack.get(i);
+                if (s instanceof LabelNode) {
+                    s = labels.get(s);
+                }
+                clone.stack.add(s);
+            }
+        }
+        return clone;
+    }
+
+    // ------------------------------------------------------------------------
+
+    private static List<Object> asList(final int n, final Object[] o) {
+        return Arrays.asList(o).subList(0, n);
+    }
+
+    private static Object[] asArray(final List<Object> l) {
+        Object[] objs = new Object[l.size()];
+        for (int i = 0; i < objs.length; ++i) {
+            Object o = l.get(i);
+            if (o instanceof LabelNode) {
+                o = ((LabelNode) o).getLabel();
+            }
+            objs[i] = o;
+        }
+        return objs;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/IincInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,109 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents an IINC instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class IincInsnNode extends AbstractInsnNode {
+
+    /**
+     * Index of the local variable to be incremented.
+     */
+    public int var;
+
+    /**
+     * Amount to increment the local variable by.
+     */
+    public int incr;
+
+    /**
+     * Constructs a new {@link IincInsnNode}.
+     *
+     * @param var index of the local variable to be incremented.
+     * @param incr increment amount to increment the local variable by.
+     */
+    public IincInsnNode(final int var, final int incr) {
+        super(Opcodes.IINC);
+        this.var = var;
+        this.incr = incr;
+    }
+
+    @Override
+    public int getType() {
+        return IINC_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitIincInsn(var, incr);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new IincInsnNode(var, incr);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/InnerClassNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,130 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+
+/**
+ * A node that represents an inner class.
+ *
+ * @author Eric Bruneton
+ */
+public class InnerClassNode {
+
+    /**
+     * The internal name of an inner class (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     */
+    public String name;
+
+    /**
+     * The internal name of the class to which the inner class belongs (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}). May
+     * be <tt>null</tt>.
+     */
+    public String outerName;
+
+    /**
+     * The (simple) name of the inner class inside its enclosing class. May be
+     * <tt>null</tt> for anonymous inner classes.
+     */
+    public String innerName;
+
+    /**
+     * The access flags of the inner class as originally declared in the
+     * enclosing class.
+     */
+    public int access;
+
+    /**
+     * Constructs a new {@link InnerClassNode}.
+     *
+     * @param name the internal name of an inner class (see
+     *        {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     * @param outerName the internal name of the class to which the inner class
+     *        belongs (see
+     *        {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     *        May be <tt>null</tt>.
+     * @param innerName the (simple) name of the inner class inside its
+     *        enclosing class. May be <tt>null</tt> for anonymous inner
+     *        classes.
+     * @param access the access flags of the inner class as originally declared
+     *        in the enclosing class.
+     */
+    public InnerClassNode(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        this.name = name;
+        this.outerName = outerName;
+        this.innerName = innerName;
+        this.access = access;
+    }
+
+    /**
+     * Makes the given class visitor visit this inner class.
+     *
+     * @param cv a class visitor.
+     */
+    public void accept(final ClassVisitor cv) {
+        cv.visitInnerClass(name, outerName, innerName, access);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/InsnList.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,607 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A doubly linked list of {@link AbstractInsnNode} objects. <i>This
+ * implementation is not thread safe</i>.
+ */
+public class InsnList {
+
+    /**
+     * The number of instructions in this list.
+     */
+    private int size;
+
+    /**
+     * The first instruction in this list. May be <tt>null</tt>.
+     */
+    private AbstractInsnNode first;
+
+    /**
+     * The last instruction in this list. May be <tt>null</tt>.
+     */
+    private AbstractInsnNode last;
+
+    /**
+     * A cache of the instructions of this list. This cache is used to improve
+     * the performance of the {@link #get} method.
+     */
+    AbstractInsnNode[] cache;
+
+    /**
+     * Returns the number of instructions in this list.
+     *
+     * @return the number of instructions in this list.
+     */
+    public int size() {
+        return size;
+    }
+
+    /**
+     * Returns the first instruction in this list.
+     *
+     * @return the first instruction in this list, or <tt>null</tt> if the
+     *         list is empty.
+     */
+    public AbstractInsnNode getFirst() {
+        return first;
+    }
+
+    /**
+     * Returns the last instruction in this list.
+     *
+     * @return the last instruction in this list, or <tt>null</tt> if the list
+     *         is empty.
+     */
+    public AbstractInsnNode getLast() {
+        return last;
+    }
+
+    /**
+     * Returns the instruction whose index is given. This method builds a cache
+     * of the instructions in this list to avoid scanning the whole list each
+     * time it is called. Once the cache is built, this method run in constant
+     * time. This cache is invalidated by all the methods that modify the list.
+     *
+     * @param index the index of the instruction that must be returned.
+     * @return the instruction whose index is given.
+     * @throws IndexOutOfBoundsException if (index < 0 || index >= size()).
+     */
+    public AbstractInsnNode get(final int index) {
+        if (index < 0 || index >= size) {
+            throw new IndexOutOfBoundsException();
+        }
+        if (cache == null) {
+            cache = toArray();
+        }
+        return cache[index];
+    }
+
+    /**
+     * Returns <tt>true</tt> if the given instruction belongs to this list.
+     * This method always scans the instructions of this list until it finds the
+     * given instruction or reaches the end of the list.
+     *
+     * @param insn an instruction.
+     * @return <tt>true</tt> if the given instruction belongs to this list.
+     */
+    public boolean contains(final AbstractInsnNode insn) {
+        AbstractInsnNode i = first;
+        while (i != null && i != insn) {
+            i = i.next;
+        }
+        return i != null;
+    }
+
+    /**
+     * Returns the index of the given instruction in this list. This method
+     * builds a cache of the instruction indexes to avoid scanning the whole
+     * list each time it is called. Once the cache is built, this method run in
+     * constant time. The cache is invalidated by all the methods that modify
+     * the list.
+     *
+     * @param insn an instruction <i>of this list</i>.
+     * @return the index of the given instruction in this list. <i>The result of
+     *         this method is undefined if the given instruction does not belong
+     *         to this list</i>. Use {@link #contains contains} to test if an
+     *         instruction belongs to an instruction list or not.
+     */
+    public int indexOf(final AbstractInsnNode insn) {
+        if (cache == null) {
+            cache = toArray();
+        }
+        return insn.index;
+    }
+
+    /**
+     * Makes the given visitor visit all of the instructions in this list.
+     *
+     * @param mv the method visitor that must visit the instructions.
+     */
+    public void accept(final MethodVisitor mv) {
+        AbstractInsnNode insn = first;
+        while (insn != null) {
+            insn.accept(mv);
+            insn = insn.next;
+        }
+    }
+
+    /**
+     * Returns an iterator over the instructions in this list.
+     *
+     * @return an iterator over the instructions in this list.
+     */
+    public ListIterator<AbstractInsnNode> iterator() {
+        return iterator(0);
+    }
+
+    /**
+     * Returns an iterator over the instructions in this list.
+     *
+     * @return an iterator over the instructions in this list.
+     */
+    @SuppressWarnings("unchecked")
+    public ListIterator<AbstractInsnNode> iterator(int index) {
+        return new InsnListIterator(index);
+    }
+
+    /**
+     * Returns an array containing all of the instructions in this list.
+     *
+     * @return an array containing all of the instructions in this list.
+     */
+    public AbstractInsnNode[] toArray() {
+        int i = 0;
+        AbstractInsnNode elem = first;
+        AbstractInsnNode[] insns = new AbstractInsnNode[size];
+        while (elem != null) {
+            insns[i] = elem;
+            elem.index = i++;
+            elem = elem.next;
+        }
+        return insns;
+    }
+
+    /**
+     * Replaces an instruction of this list with another instruction.
+     *
+     * @param location an instruction <i>of this list</i>.
+     * @param insn another instruction, <i>which must not belong to any
+     *        {@link InsnList}</i>.
+     */
+    public void set(final AbstractInsnNode location, final AbstractInsnNode insn) {
+        AbstractInsnNode next = location.next;
+        insn.next = next;
+        if (next != null) {
+            next.prev = insn;
+        } else {
+            last = insn;
+        }
+        AbstractInsnNode prev = location.prev;
+        insn.prev = prev;
+        if (prev != null) {
+            prev.next = insn;
+        } else {
+            first = insn;
+        }
+        if (cache != null) {
+            int index = location.index;
+            cache[index] = insn;
+            insn.index = index;
+        } else {
+            insn.index = 0; // insn now belongs to an InsnList
+        }
+        location.index = -1; // i no longer belongs to an InsnList
+        location.prev = null;
+        location.next = null;
+    }
+
+    /**
+     * Adds the given instruction to the end of this list.
+     *
+     * @param insn an instruction, <i>which must not belong to any
+     *        {@link InsnList}</i>.
+     */
+    public void add(final AbstractInsnNode insn) {
+        ++size;
+        if (last == null) {
+            first = insn;
+            last = insn;
+        } else {
+            last.next = insn;
+            insn.prev = last;
+        }
+        last = insn;
+        cache = null;
+        insn.index = 0; // insn now belongs to an InsnList
+    }
+
+    /**
+     * Adds the given instructions to the end of this list.
+     *
+     * @param insns an instruction list, which is cleared during the process.
+     *        This list must be different from 'this'.
+     */
+    public void add(final InsnList insns) {
+        if (insns.size == 0) {
+            return;
+        }
+        size += insns.size;
+        if (last == null) {
+            first = insns.first;
+            last = insns.last;
+        } else {
+            AbstractInsnNode elem = insns.first;
+            last.next = elem;
+            elem.prev = last;
+            last = insns.last;
+        }
+        cache = null;
+        insns.removeAll(false);
+    }
+
+    /**
+     * Inserts the given instruction at the begining of this list.
+     *
+     * @param insn an instruction, <i>which must not belong to any
+     *        {@link InsnList}</i>.
+     */
+    public void insert(final AbstractInsnNode insn) {
+        ++size;
+        if (first == null) {
+            first = insn;
+            last = insn;
+        } else {
+            first.prev = insn;
+            insn.next = first;
+        }
+        first = insn;
+        cache = null;
+        insn.index = 0; // insn now belongs to an InsnList
+    }
+
+    /**
+     * Inserts the given instructions at the begining of this list.
+     *
+     * @param insns an instruction list, which is cleared during the process.
+     *        This list must be different from 'this'.
+     */
+    public void insert(final InsnList insns) {
+        if (insns.size == 0) {
+            return;
+        }
+        size += insns.size;
+        if (first == null) {
+            first = insns.first;
+            last = insns.last;
+        } else {
+            AbstractInsnNode elem = insns.last;
+            first.prev = elem;
+            elem.next = first;
+            first = insns.first;
+        }
+        cache = null;
+        insns.removeAll(false);
+    }
+
+    /**
+     * Inserts the given instruction after the specified instruction.
+     *
+     * @param location an instruction <i>of this list</i> after which insn must be
+     *        inserted.
+     * @param insn the instruction to be inserted, <i>which must not belong to
+     *        any {@link InsnList}</i>.
+     */
+    public void insert(final AbstractInsnNode location, final AbstractInsnNode insn) {
+        ++size;
+        AbstractInsnNode next = location.next;
+        if (next == null) {
+            last = insn;
+        } else {
+            next.prev = insn;
+        }
+        location.next = insn;
+        insn.next = next;
+        insn.prev = location;
+        cache = null;
+        insn.index = 0; // insn now belongs to an InsnList
+    }
+
+    /**
+     * Inserts the given instructions after the specified instruction.
+     *
+     * @param location an instruction <i>of this list</i> after which the
+     *        instructions must be inserted.
+     * @param insns the instruction list to be inserted, which is cleared during
+     *        the process. This list must be different from 'this'.
+     */
+    public void insert(final AbstractInsnNode location, final InsnList insns) {
+        if (insns.size == 0) {
+            return;
+        }
+        size += insns.size;
+        AbstractInsnNode ifirst = insns.first;
+        AbstractInsnNode ilast = insns.last;
+        AbstractInsnNode next = location.next;
+        if (next == null) {
+            last = ilast;
+        } else {
+            next.prev = ilast;
+        }
+        location.next = ifirst;
+        ilast.next = next;
+        ifirst.prev = location;
+        cache = null;
+        insns.removeAll(false);
+    }
+
+    /**
+     * Inserts the given instruction before the specified instruction.
+     *
+     * @param location an instruction <i>of this list</i> before which insn must be
+     *        inserted.
+     * @param insn the instruction to be inserted, <i>which must not belong to
+     *        any {@link InsnList}</i>.
+     */
+    public void insertBefore(final AbstractInsnNode location, final AbstractInsnNode insn) {
+        ++size;
+        AbstractInsnNode prev = location.prev;
+        if (prev == null) {
+            first = insn;
+        } else {
+            prev.next = insn;
+        }
+        location.prev = insn;
+        insn.next = location;
+        insn.prev = prev;
+        cache = null;
+        insn.index = 0; // insn now belongs to an InsnList
+    }
+
+    /**
+     * Inserts the given instructions before the specified instruction.
+     *
+     * @param location  an instruction <i>of this list</i> before which the instructions
+     *        must be inserted.
+     * @param insns the instruction list to be inserted, which is cleared during
+     *        the process. This list must be different from 'this'.
+     */
+    public void insertBefore(final AbstractInsnNode location, final InsnList insns) {
+        if (insns.size == 0) {
+            return;
+        }
+        size += insns.size;
+        AbstractInsnNode ifirst = insns.first;
+        AbstractInsnNode ilast = insns.last;
+        AbstractInsnNode prev = location .prev;
+        if (prev == null) {
+            first = ifirst;
+        } else {
+            prev.next = ifirst;
+        }
+        location .prev = ilast;
+        ilast.next = location ;
+        ifirst.prev = prev;
+        cache = null;
+        insns.removeAll(false);
+    }
+
+
+
+    /**
+     * Removes the given instruction from this list.
+     *
+     * @param insn the instruction <i>of this list</i> that must be removed.
+     */
+    public void remove(final AbstractInsnNode insn) {
+        --size;
+        AbstractInsnNode next = insn.next;
+        AbstractInsnNode prev = insn.prev;
+        if (next == null) {
+            if (prev == null) {
+                first = null;
+                last = null;
+            } else {
+                prev.next = null;
+                last = prev;
+            }
+        } else {
+            if (prev == null) {
+                first = next;
+                next.prev = null;
+            } else {
+                prev.next = next;
+                next.prev = prev;
+            }
+        }
+        cache = null;
+        insn.index = -1; // insn no longer belongs to an InsnList
+        insn.prev = null;
+        insn.next = null;
+    }
+
+    /**
+     * Removes all of the instructions of this list.
+     *
+     * @param mark if the instructions must be marked as no longer belonging to
+     *        any {@link InsnList}.
+     */
+    void removeAll(final boolean mark) {
+        if (mark) {
+            AbstractInsnNode insn = first;
+            while (insn != null) {
+                AbstractInsnNode next = insn.next;
+                insn.index = -1; // insn no longer belongs to an InsnList
+                insn.prev = null;
+                insn.next = null;
+                insn = next;
+            }
+        }
+        size = 0;
+        first = null;
+        last = null;
+        cache = null;
+    }
+
+    /**
+     * Removes all of the instructions of this list.
+     */
+    public void clear() {
+        removeAll(false);
+    }
+
+    /**
+     * Reset all labels in the instruction list. This method should be called
+     * before reusing same instructions list between several
+     * <code>ClassWriter</code>s.
+     */
+    public void resetLabels() {
+        AbstractInsnNode insn = first;
+        while (insn != null) {
+            if (insn instanceof LabelNode) {
+                ((LabelNode) insn).resetLabel();
+            }
+            insn = insn.next;
+        }
+    }
+
+    // this class is not generified because it will create bridges
+    private final class InsnListIterator implements ListIterator/*<AbstractInsnNode>*/ {
+
+        AbstractInsnNode next;
+
+        AbstractInsnNode prev;
+
+        InsnListIterator(int index) {
+            if(index==size()) {
+                next = null;
+                prev = getLast();
+            } else {
+                next = get(index);
+                prev = next.prev;
+            }
+        }
+
+        public boolean hasNext() {
+            return next != null;
+        }
+
+        public Object next() {
+            if (next == null) {
+                throw new NoSuchElementException();
+            }
+            AbstractInsnNode result = next;
+            prev = result;
+            next = result.next;
+            return result;
+        }
+
+        public void remove() {
+            InsnList.this.remove(prev);
+            prev = prev.prev;
+        }
+
+        public boolean hasPrevious() {
+            return prev != null;
+        }
+
+        public Object previous() {
+            AbstractInsnNode result = prev;
+            next = result;
+            prev = result.prev;
+            return result;
+        }
+
+        public int nextIndex() {
+            if (next == null) {
+                return size();
+            }
+            if (cache == null) {
+                cache = toArray();
+            }
+            return next.index;
+        }
+
+        public int previousIndex() {
+            if (prev == null) {
+                return -1;
+            }
+            if (cache == null) {
+                cache = toArray();
+            }
+            return prev.index;
+        }
+
+        public void add(Object o) {
+            InsnList.this.insertBefore(next, (AbstractInsnNode) o);
+            prev = (AbstractInsnNode) o;
+        }
+
+        public void set(Object o) {
+            InsnList.this.set(next.prev, (AbstractInsnNode) o);
+            prev = (AbstractInsnNode) o;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/InsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,113 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a zero operand instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class InsnNode extends AbstractInsnNode {
+
+    /**
+     * Constructs a new {@link InsnNode}.
+     *
+     * @param opcode the opcode of the instruction to be constructed. This
+     *        opcode must be NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1,
+     *        ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1,
+     *        FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD,
+     *        FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE,
+     *        FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2,
+     *        DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD,
+     *        FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV,
+     *        LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG,
+     *        ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR,
+     *        LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F,
+     *        I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
+     *        FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
+     *        MONITORENTER, or MONITOREXIT.
+     */
+    public InsnNode(final int opcode) {
+        super(opcode);
+    }
+
+    @Override
+    public int getType() {
+        return INSN;
+    }
+
+    /**
+     * Makes the given visitor visit this instruction.
+     *
+     * @param mv a method visitor.
+     */
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitInsn(opcode);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new InsnNode(opcode);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/IntInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,113 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents an instruction with a single int operand.
+ *
+ * @author Eric Bruneton
+ */
+public class IntInsnNode extends AbstractInsnNode {
+
+    /**
+     * The operand of this instruction.
+     */
+    public int operand;
+
+    /**
+     * Constructs a new {@link IntInsnNode}.
+     *
+     * @param opcode the opcode of the instruction to be constructed. This
+     *        opcode must be BIPUSH, SIPUSH or NEWARRAY.
+     * @param operand the operand of the instruction to be constructed.
+     */
+    public IntInsnNode(final int opcode, final int operand) {
+        super(opcode);
+        this.operand = operand;
+    }
+
+    /**
+     * Sets the opcode of this instruction.
+     *
+     * @param opcode the new instruction opcode. This opcode must be BIPUSH,
+     *        SIPUSH or NEWARRAY.
+     */
+    public void setOpcode(final int opcode) {
+        this.opcode = opcode;
+    }
+
+    @Override
+    public int getType() {
+        return INT_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitIntInsn(opcode, operand);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new IntInsnNode(opcode, operand);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/InvokeDynamicInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,129 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents an invokedynamic instruction.
+ *
+ * @author Remi Forax
+ */
+public class InvokeDynamicInsnNode extends AbstractInsnNode {
+
+    /**
+     * Invokedynamic name.
+     */
+    public String name;
+
+    /**
+     * Invokedynamic descriptor.
+     */
+    public String desc;
+
+    /**
+     * Bootstrap method
+     */
+    public Handle bsm;
+
+    /**
+     * Bootstrap constant arguments
+     */
+    public Object[] bsmArgs;
+
+    /**
+     * Constructs a new {@link InvokeDynamicInsnNode}.
+     *
+     * @param name invokedynamic name.
+     * @param desc invokedynamic descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     * @param bsm the bootstrap method.
+     * @param bsmArgs the boostrap constant arguments.
+     */
+    public InvokeDynamicInsnNode(
+        final String name,
+        final String desc,
+        final Handle bsm,
+        final Object... bsmArgs)
+    {
+        super(Opcodes.INVOKEDYNAMIC);
+        this.name = name;
+        this.desc = desc;
+        this.bsm = bsm;
+        this.bsmArgs = bsmArgs;
+    }
+
+    @Override
+    public int getType() {
+        return INVOKE_DYNAMIC_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/JumpInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,121 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a jump instruction. A jump instruction is an
+ * instruction that may jump to another instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class JumpInsnNode extends AbstractInsnNode {
+
+    /**
+     * The operand of this instruction. This operand is a label that designates
+     * the instruction to which this instruction may jump.
+     */
+    public LabelNode label;
+
+    /**
+     * Constructs a new {@link JumpInsnNode}.
+     *
+     * @param opcode the opcode of the type instruction to be constructed. This
+     *        opcode must be IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
+     *        IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
+     *        IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
+     * @param label the operand of the instruction to be constructed. This
+     *        operand is a label that designates the instruction to which the
+     *        jump instruction may jump.
+     */
+    public JumpInsnNode(final int opcode, final LabelNode label) {
+        super(opcode);
+        this.label = label;
+    }
+
+    /**
+     * Sets the opcode of this instruction.
+     *
+     * @param opcode the new instruction opcode. This opcode must be IFEQ, IFNE,
+     *        IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT,
+     *        IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR,
+     *        IFNULL or IFNONNULL.
+     */
+    public void setOpcode(final int opcode) {
+        this.opcode = opcode;
+    }
+
+    @Override
+    public int getType() {
+        return JUMP_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitJumpInsn(opcode, label.getLabel());
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new JumpInsnNode(opcode, clone(label, labels));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/LabelNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,107 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * An {@link AbstractInsnNode} that encapsulates a {@link Label}.
+ */
+public class LabelNode extends AbstractInsnNode {
+
+    private Label label;
+
+    public LabelNode() {
+        super(-1);
+    }
+
+    public LabelNode(final Label label) {
+        super(-1);
+        this.label = label;
+    }
+
+    @Override
+    public int getType() {
+        return LABEL;
+    }
+
+    public Label getLabel() {
+        if (label == null) {
+            label = new Label();
+        }
+        return label;
+    }
+
+    @Override
+    public void accept(final MethodVisitor cv) {
+        cv.visitLabel(getLabel());
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return labels.get(this);
+    }
+
+    public void resetLabel() {
+        label = null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/LdcInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,106 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents an LDC instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class LdcInsnNode extends AbstractInsnNode {
+
+    /**
+     * The constant to be loaded on the stack. This parameter must be a non null
+     * {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a
+     * {@link String} or a {@link jdk.internal.org.objectweb.asm.Type}.
+     */
+    public Object cst;
+
+    /**
+     * Constructs a new {@link LdcInsnNode}.
+     *
+     * @param cst the constant to be loaded on the stack. This parameter must be
+     *        a non null {@link Integer}, a {@link Float}, a {@link Long}, a
+     *        {@link Double} or a {@link String}.
+     */
+    public LdcInsnNode(final Object cst) {
+        super(Opcodes.LDC);
+        this.cst = cst;
+    }
+
+    @Override
+    public int getType() {
+        return LDC_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitLdcInsn(cst);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new LdcInsnNode(cst);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/LineNumberNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,111 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a line number declaration. These nodes are pseudo
+ * instruction nodes in order to be inserted in an instruction list.
+ *
+ * @author Eric Bruneton
+ */
+public class LineNumberNode extends AbstractInsnNode {
+
+    /**
+     * A line number. This number refers to the source file from which the class
+     * was compiled.
+     */
+    public int line;
+
+    /**
+     * The first instruction corresponding to this line number.
+     */
+    public LabelNode start;
+
+    /**
+     * Constructs a new {@link LineNumberNode}.
+     *
+     * @param line a line number. This number refers to the source file from
+     *        which the class was compiled.
+     * @param start the first instruction corresponding to this line number.
+     */
+    public LineNumberNode(final int line, final LabelNode start) {
+        super(-1);
+        this.line = line;
+        this.start = start;
+    }
+
+    @Override
+    public int getType() {
+        return LINE;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitLineNumber(line, start.getLabel());
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new LineNumberNode(line, clone(start, labels));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/LocalVariableNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,144 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a local variable declaration.
+ *
+ * @author Eric Bruneton
+ */
+public class LocalVariableNode {
+
+    /**
+     * The name of a local variable.
+     */
+    public String name;
+
+    /**
+     * The type descriptor of this local variable.
+     */
+    public String desc;
+
+    /**
+     * The signature of this local variable. May be <tt>null</tt>.
+     */
+    public String signature;
+
+    /**
+     * The first instruction corresponding to the scope of this local variable
+     * (inclusive).
+     */
+    public LabelNode start;
+
+    /**
+     * The last instruction corresponding to the scope of this local variable
+     * (exclusive).
+     */
+    public LabelNode end;
+
+    /**
+     * The local variable's index.
+     */
+    public int index;
+
+    /**
+     * Constructs a new {@link LocalVariableNode}.
+     *
+     * @param name the name of a local variable.
+     * @param desc the type descriptor of this local variable.
+     * @param signature the signature of this local variable. May be
+     *        <tt>null</tt>.
+     * @param start the first instruction corresponding to the scope of this
+     *        local variable (inclusive).
+     * @param end the last instruction corresponding to the scope of this local
+     *        variable (exclusive).
+     * @param index the local variable's index.
+     */
+    public LocalVariableNode(
+        final String name,
+        final String desc,
+        final String signature,
+        final LabelNode start,
+        final LabelNode end,
+        final int index)
+    {
+        this.name = name;
+        this.desc = desc;
+        this.signature = signature;
+        this.start = start;
+        this.end = end;
+        this.index = index;
+    }
+
+    /**
+     * Makes the given visitor visit this local variable declaration.
+     *
+     * @param mv a method visitor.
+     */
+    public void accept(final MethodVisitor mv) {
+        mv.visitLocalVariable(name,
+                desc,
+                signature,
+                start.getLabel(),
+                end.getLabel(),
+                index);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/LookupSwitchInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,145 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents a LOOKUPSWITCH instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class LookupSwitchInsnNode extends AbstractInsnNode {
+
+    /**
+     * Beginning of the default handler block.
+     */
+    public LabelNode dflt;
+
+    /**
+     * The values of the keys. This list is a list of {@link Integer} objects.
+     */
+    public List<Integer> keys;
+
+    /**
+     * Beginnings of the handler blocks. This list is a list of
+     * {@link LabelNode} objects.
+     */
+    public List<LabelNode> labels;
+
+    /**
+     * Constructs a new {@link LookupSwitchInsnNode}.
+     *
+     * @param dflt beginning of the default handler block.
+     * @param keys the values of the keys.
+     * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+     *        the beginning of the handler block for the <tt>keys[i]</tt> key.
+     */
+    public LookupSwitchInsnNode(
+        final LabelNode dflt,
+        final int[] keys,
+        final LabelNode[] labels)
+    {
+        super(Opcodes.LOOKUPSWITCH);
+        this.dflt = dflt;
+        this.keys = new ArrayList<Integer>(keys == null ? 0 : keys.length);
+        this.labels = new ArrayList<LabelNode>(labels == null ? 0 : labels.length);
+        if (keys != null) {
+            for (int i = 0; i < keys.length; ++i) {
+                this.keys.add(new Integer(keys[i]));
+            }
+        }
+        if (labels != null) {
+            this.labels.addAll(Arrays.asList(labels));
+        }
+    }
+
+    @Override
+    public int getType() {
+        return LOOKUPSWITCH_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        int[] keys = new int[this.keys.size()];
+        for (int i = 0; i < keys.length; ++i) {
+            keys[i] = this.keys.get(i).intValue();
+        }
+        Label[] labels = new Label[this.labels.size()];
+        for (int i = 0; i < labels.length; ++i) {
+            labels[i] = this.labels.get(i).getLabel();
+        }
+        mv.visitLookupSwitchInsn(dflt.getLabel(), keys, labels);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        LookupSwitchInsnNode clone = new LookupSwitchInsnNode(clone(dflt,
+                labels), null, clone(this.labels, labels));
+        clone.keys.addAll(keys);
+        return clone;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/MethodInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,136 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a method instruction. A method instruction is an
+ * instruction that invokes a method.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodInsnNode extends AbstractInsnNode {
+
+    /**
+     * The internal name of the method's owner class (see
+     * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     */
+    public String owner;
+
+    /**
+     * The method's name.
+     */
+    public String name;
+
+    /**
+     * The method's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public String desc;
+
+    /**
+     * Constructs a new {@link MethodInsnNode}.
+     *
+     * @param opcode the opcode of the type instruction to be constructed. This
+     *        opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
+     *        INVOKEINTERFACE.
+     * @param owner the internal name of the method's owner class (see
+     *        {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}).
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public MethodInsnNode(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        super(opcode);
+        this.owner = owner;
+        this.name = name;
+        this.desc = desc;
+    }
+
+    /**
+     * Sets the opcode of this instruction.
+     *
+     * @param opcode the new instruction opcode. This opcode must be
+     *        INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
+     */
+    public void setOpcode(final int opcode) {
+        this.opcode = opcode;
+    }
+
+    @Override
+    public int getType() {
+        return METHOD_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitMethodInsn(opcode, owner, name, desc);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new MethodInsnNode(opcode, owner, name, desc);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/MethodNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,675 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A node that represents a method.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodNode extends MethodVisitor {
+
+    /**
+     * The method's access flags (see {@link Opcodes}). This field also
+     * indicates if the method is synthetic and/or deprecated.
+     */
+    public int access;
+
+    /**
+     * The method's name.
+     */
+    public String name;
+
+    /**
+     * The method's descriptor (see {@link Type}).
+     */
+    public String desc;
+
+    /**
+     * The method's signature. May be <tt>null</tt>.
+     */
+    public String signature;
+
+    /**
+     * The internal names of the method's exception classes (see
+     * {@link Type#getInternalName() getInternalName}). This list is a list of
+     * {@link String} objects.
+     */
+    public List<String> exceptions;
+
+    /**
+     * The runtime visible annotations of this method. This list is a list of
+     * {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label visible
+     */
+    public List<AnnotationNode> visibleAnnotations;
+
+    /**
+     * The runtime invisible annotations of this method. This list is a list of
+     * {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label invisible
+     */
+    public List<AnnotationNode> invisibleAnnotations;
+
+    /**
+     * The non standard attributes of this method. This list is a list of
+     * {@link Attribute} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.Attribute
+     */
+    public List<Attribute> attrs;
+
+    /**
+     * The default value of this annotation interface method. This field must be
+     * a {@link Byte}, {@link Boolean}, {@link Character}, {@link Short},
+     * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
+     * {@link String} or {@link Type}, or an two elements String array (for
+     * enumeration values), a {@link AnnotationNode}, or a {@link List} of
+     * values of one of the preceding types. May be <tt>null</tt>.
+     */
+    public Object annotationDefault;
+
+    /**
+     * The runtime visible parameter annotations of this method. These lists are
+     * lists of {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label invisible parameters
+     */
+    public List<AnnotationNode>[] visibleParameterAnnotations;
+
+    /**
+     * The runtime invisible parameter annotations of this method. These lists
+     * are lists of {@link AnnotationNode} objects. May be <tt>null</tt>.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AnnotationNode
+     * @label visible parameters
+     */
+    public List<AnnotationNode>[] invisibleParameterAnnotations;
+
+    /**
+     * The instructions of this method. This list is a list of
+     * {@link AbstractInsnNode} objects.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.AbstractInsnNode
+     * @label instructions
+     */
+    public InsnList instructions;
+
+    /**
+     * The try catch blocks of this method. This list is a list of
+     * {@link TryCatchBlockNode} objects.
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode
+     */
+    public List<TryCatchBlockNode> tryCatchBlocks;
+
+    /**
+     * The maximum stack size of this method.
+     */
+    public int maxStack;
+
+    /**
+     * The maximum number of local variables of this method.
+     */
+    public int maxLocals;
+
+    /**
+     * The local variables of this method. This list is a list of
+     * {@link LocalVariableNode} objects. May be <tt>null</tt>
+     *
+     * @associates jdk.internal.org.objectweb.asm.tree.LocalVariableNode
+     */
+    public List<LocalVariableNode> localVariables;
+
+    /**
+     * If the accept method has been called on this object.
+     */
+    private boolean visited;
+
+    /**
+     * Constructs an uninitialized {@link MethodNode}. <i>Subclasses must not
+     * use this constructor</i>. Instead, they must use the
+     * {@link #MethodNode(int)} version.
+     */
+    public MethodNode() {
+        this(Opcodes.ASM4);
+    }
+
+    /**
+     * Constructs an uninitialized {@link MethodNode}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    public MethodNode(final int api) {
+        super(api);
+        this.instructions = new InsnList();
+    }
+
+    /**
+     * Constructs a new {@link MethodNode}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #MethodNode(int, int, String, String, String, String[])} version.
+     *
+     * @param access the method's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the method is synthetic and/or
+     *        deprecated.
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type}).
+     * @param signature the method's signature. May be <tt>null</tt>.
+     * @param exceptions the internal names of the method's exception classes
+     *        (see {@link Type#getInternalName() getInternalName}). May be
+     *        <tt>null</tt>.
+     */
+    public MethodNode(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        this(Opcodes.ASM4, access, name, desc, signature, exceptions);
+    }
+
+    /**
+     * Constructs a new {@link MethodNode}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param access the method's access flags (see {@link Opcodes}). This
+     *        parameter also indicates if the method is synthetic and/or
+     *        deprecated.
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type}).
+     * @param signature the method's signature. May be <tt>null</tt>.
+     * @param exceptions the internal names of the method's exception classes
+     *        (see {@link Type#getInternalName() getInternalName}). May be
+     *        <tt>null</tt>.
+     */
+    public MethodNode(
+        final int api,
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        super(api);
+        this.access = access;
+        this.name = name;
+        this.desc = desc;
+        this.signature = signature;
+        this.exceptions = new ArrayList<String>(exceptions == null
+                ? 0
+                : exceptions.length);
+        boolean isAbstract = (access & Opcodes.ACC_ABSTRACT) != 0;
+        if (!isAbstract) {
+            this.localVariables = new ArrayList<LocalVariableNode>(5);
+        }
+        this.tryCatchBlocks = new ArrayList<TryCatchBlockNode>();
+        if (exceptions != null) {
+            this.exceptions.addAll(Arrays.asList(exceptions));
+        }
+        this.instructions = new InsnList();
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the MethodVisitor abstract class
+    // ------------------------------------------------------------------------
+
+    @Override
+    public AnnotationVisitor visitAnnotationDefault() {
+        return new AnnotationNode(new ArrayList<Object>(0) {
+            @Override
+            public boolean add(final Object o) {
+                annotationDefault = o;
+                return super.add(o);
+            }
+        });
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        AnnotationNode an = new AnnotationNode(desc);
+        if (visible) {
+            if (visibleAnnotations == null) {
+                visibleAnnotations = new ArrayList<AnnotationNode>(1);
+            }
+            visibleAnnotations.add(an);
+        } else {
+            if (invisibleAnnotations == null) {
+                invisibleAnnotations = new ArrayList<AnnotationNode>(1);
+            }
+            invisibleAnnotations.add(an);
+        }
+        return an;
+    }
+
+    @Override
+    public AnnotationVisitor visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible)
+    {
+        AnnotationNode an = new AnnotationNode(desc);
+        if (visible) {
+            if (visibleParameterAnnotations == null) {
+                int params = Type.getArgumentTypes(this.desc).length;
+                visibleParameterAnnotations = (List<AnnotationNode>[])new List<?>[params];
+            }
+            if (visibleParameterAnnotations[parameter] == null) {
+                visibleParameterAnnotations[parameter] = new ArrayList<AnnotationNode>(1);
+            }
+            visibleParameterAnnotations[parameter].add(an);
+        } else {
+            if (invisibleParameterAnnotations == null) {
+                int params = Type.getArgumentTypes(this.desc).length;
+                invisibleParameterAnnotations = (List<AnnotationNode>[])new List<?>[params];
+            }
+            if (invisibleParameterAnnotations[parameter] == null) {
+                invisibleParameterAnnotations[parameter] = new ArrayList<AnnotationNode>(1);
+            }
+            invisibleParameterAnnotations[parameter].add(an);
+        }
+        return an;
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        if (attrs == null) {
+            attrs = new ArrayList<Attribute>(1);
+        }
+        attrs.add(attr);
+    }
+
+    @Override
+    public void visitCode() {
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        instructions.add(new FrameNode(type, nLocal, local == null
+                ? null
+                : getLabelNodes(local), nStack, stack == null
+                ? null
+                : getLabelNodes(stack)));
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        instructions.add(new InsnNode(opcode));
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        instructions.add(new IntInsnNode(opcode, operand));
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        instructions.add(new VarInsnNode(opcode, var));
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        instructions.add(new TypeInsnNode(opcode, type));
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        instructions.add(new FieldInsnNode(opcode, owner, name, desc));
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        instructions.add(new MethodInsnNode(opcode, owner, name, desc));
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        instructions.add(new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs));
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        instructions.add(new JumpInsnNode(opcode, getLabelNode(label)));
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        instructions.add(getLabelNode(label));
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        instructions.add(new LdcInsnNode(cst));
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        instructions.add(new IincInsnNode(var, increment));
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        instructions.add(new TableSwitchInsnNode(min,
+                max,
+                getLabelNode(dflt),
+                getLabelNodes(labels)));
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        instructions.add(new LookupSwitchInsnNode(getLabelNode(dflt),
+                keys,
+                getLabelNodes(labels)));
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        instructions.add(new MultiANewArrayInsnNode(desc, dims));
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type)
+    {
+        tryCatchBlocks.add(new TryCatchBlockNode(getLabelNode(start),
+                getLabelNode(end),
+                getLabelNode(handler),
+                type));
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        localVariables.add(new LocalVariableNode(name,
+                desc,
+                signature,
+                getLabelNode(start),
+                getLabelNode(end),
+                index));
+    }
+
+    @Override
+    public void visitLineNumber(final int line, final Label start) {
+        instructions.add(new LineNumberNode(line, getLabelNode(start)));
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        this.maxStack = maxStack;
+        this.maxLocals = maxLocals;
+    }
+
+    @Override
+    public void visitEnd() {
+    }
+
+    /**
+     * Returns the LabelNode corresponding to the given Label. Creates a new
+     * LabelNode if necessary. The default implementation of this method uses
+     * the {@link Label#info} field to store associations between labels and
+     * label nodes.
+     *
+     * @param l a Label.
+     * @return the LabelNode corresponding to l.
+     */
+    protected LabelNode getLabelNode(final Label l) {
+        if (!(l.info instanceof LabelNode)) {
+            l.info = new LabelNode(l);
+        }
+        return (LabelNode) l.info;
+    }
+
+    private LabelNode[] getLabelNodes(final Label[] l) {
+        LabelNode[] nodes = new LabelNode[l.length];
+        for (int i = 0; i < l.length; ++i) {
+            nodes[i] = getLabelNode(l[i]);
+        }
+        return nodes;
+    }
+
+    private Object[] getLabelNodes(final Object[] objs) {
+        Object[] nodes = new Object[objs.length];
+        for (int i = 0; i < objs.length; ++i) {
+            Object o = objs[i];
+            if (o instanceof Label) {
+                o = getLabelNode((Label) o);
+            }
+            nodes[i] = o;
+        }
+        return nodes;
+    }
+
+    // ------------------------------------------------------------------------
+    // Accept method
+    // ------------------------------------------------------------------------
+
+    /**
+     * Checks that this method node is compatible with the given ASM API
+     * version. This methods checks that this node, and all its nodes
+     * recursively, do not contain elements that were introduced in more recent
+     * versions of the ASM API than the given version.
+     *
+     * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
+     */
+    public void check(final int api) {
+        // nothing to do
+    }
+
+    /**
+     * Makes the given class visitor visit this method.
+     *
+     * @param cv a class visitor.
+     */
+    public void accept(final ClassVisitor cv) {
+        String[] exceptions = new String[this.exceptions.size()];
+        this.exceptions.toArray(exceptions);
+        MethodVisitor mv = cv.visitMethod(access,
+                name,
+                desc,
+                signature,
+                exceptions);
+        if (mv != null) {
+            accept(mv);
+        }
+    }
+
+    /**
+     * Makes the given method visitor visit this method.
+     *
+     * @param mv a method visitor.
+     */
+    public void accept(final MethodVisitor mv) {
+        // visits the method attributes
+        int i, j, n;
+        if (annotationDefault != null) {
+            AnnotationVisitor av = mv.visitAnnotationDefault();
+            AnnotationNode.accept(av, null, annotationDefault);
+            if (av != null) {
+                av.visitEnd();
+            }
+        }
+        n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+        for (i = 0; i < n; ++i) {
+            AnnotationNode an = visibleAnnotations.get(i);
+            an.accept(mv.visitAnnotation(an.desc, true));
+        }
+        n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+        for (i = 0; i < n; ++i) {
+            AnnotationNode an = invisibleAnnotations.get(i);
+            an.accept(mv.visitAnnotation(an.desc, false));
+        }
+        n = visibleParameterAnnotations == null
+                ? 0
+                : visibleParameterAnnotations.length;
+        for (i = 0; i < n; ++i) {
+            List<?> l = visibleParameterAnnotations[i];
+            if (l == null) {
+                continue;
+            }
+            for (j = 0; j < l.size(); ++j) {
+                AnnotationNode an = (AnnotationNode) l.get(j);
+                an.accept(mv.visitParameterAnnotation(i, an.desc, true));
+            }
+        }
+        n = invisibleParameterAnnotations == null
+                ? 0
+                : invisibleParameterAnnotations.length;
+        for (i = 0; i < n; ++i) {
+            List<?> l = invisibleParameterAnnotations[i];
+            if (l == null) {
+                continue;
+            }
+            for (j = 0; j < l.size(); ++j) {
+                AnnotationNode an = (AnnotationNode) l.get(j);
+                an.accept(mv.visitParameterAnnotation(i, an.desc, false));
+            }
+        }
+        if (visited) {
+            instructions.resetLabels();
+        }
+        n = attrs == null ? 0 : attrs.size();
+        for (i = 0; i < n; ++i) {
+            mv.visitAttribute(attrs.get(i));
+        }
+        // visits the method's code
+        if (instructions.size() > 0) {
+            mv.visitCode();
+            // visits try catch blocks
+            n = tryCatchBlocks == null ? 0 : tryCatchBlocks.size();
+            for (i = 0; i < n; ++i) {
+                tryCatchBlocks.get(i).accept(mv);
+            }
+            // visits instructions
+            instructions.accept(mv);
+            // visits local variables
+            n = localVariables == null ? 0 : localVariables.size();
+            for (i = 0; i < n; ++i) {
+                localVariables.get(i).accept(mv);
+            }
+            // visits maxs
+            mv.visitMaxs(maxStack, maxLocals);
+            visited = true;
+        }
+        mv.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/MultiANewArrayInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,110 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents a MULTIANEWARRAY instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class MultiANewArrayInsnNode extends AbstractInsnNode {
+
+    /**
+     * An array type descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public String desc;
+
+    /**
+     * Number of dimensions of the array to allocate.
+     */
+    public int dims;
+
+    /**
+     * Constructs a new {@link MultiANewArrayInsnNode}.
+     *
+     * @param desc an array type descriptor (see {@link jdk.internal.org.objectweb.asm.Type}).
+     * @param dims number of dimensions of the array to allocate.
+     */
+    public MultiANewArrayInsnNode(final String desc, final int dims) {
+        super(Opcodes.MULTIANEWARRAY);
+        this.desc = desc;
+        this.dims = dims;
+    }
+
+    @Override
+    public int getType() {
+        return MULTIANEWARRAY_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitMultiANewArrayInsn(desc, dims);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new MultiANewArrayInsnNode(desc, dims);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/TableSwitchInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,144 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents a TABLESWITCH instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class TableSwitchInsnNode extends AbstractInsnNode {
+
+    /**
+     * The minimum key value.
+     */
+    public int min;
+
+    /**
+     * The maximum key value.
+     */
+    public int max;
+
+    /**
+     * Beginning of the default handler block.
+     */
+    public LabelNode dflt;
+
+    /**
+     * Beginnings of the handler blocks. This list is a list of
+     * {@link LabelNode} objects.
+     */
+    public List<LabelNode> labels;
+
+    /**
+     * Constructs a new {@link TableSwitchInsnNode}.
+     *
+     * @param min the minimum key value.
+     * @param max the maximum key value.
+     * @param dflt beginning of the default handler block.
+     * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+     *        the beginning of the handler block for the <tt>min + i</tt> key.
+     */
+    public TableSwitchInsnNode(
+        final int min,
+        final int max,
+        final LabelNode dflt,
+        final LabelNode... labels)
+    {
+        super(Opcodes.TABLESWITCH);
+        this.min = min;
+        this.max = max;
+        this.dflt = dflt;
+        this.labels = new ArrayList<LabelNode>();
+        if (labels != null) {
+            this.labels.addAll(Arrays.asList(labels));
+        }
+    }
+
+    @Override
+    public int getType() {
+        return TABLESWITCH_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        Label[] labels = new Label[this.labels.size()];
+        for (int i = 0; i < labels.length; ++i) {
+            labels[i] = this.labels.get(i).getLabel();
+        }
+        mv.visitTableSwitchInsn(min, max, dflt.getLabel(), labels);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new TableSwitchInsnNode(min,
+                max,
+                clone(dflt, labels),
+                clone(this.labels, labels));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/TryCatchBlockNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,123 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a try catch block.
+ *
+ * @author Eric Bruneton
+ */
+public class TryCatchBlockNode {
+
+    /**
+     * Beginning of the exception handler's scope (inclusive).
+     */
+    public LabelNode start;
+
+    /**
+     * End of the exception handler's scope (exclusive).
+     */
+    public LabelNode end;
+
+    /**
+     * Beginning of the exception handler's code.
+     */
+    public LabelNode handler;
+
+    /**
+     * Internal name of the type of exceptions handled by the handler. May be
+     * <tt>null</tt> to catch any exceptions (for "finally" blocks).
+     */
+    public String type;
+
+    /**
+     * Constructs a new {@link TryCatchBlockNode}.
+     *
+     * @param start beginning of the exception handler's scope (inclusive).
+     * @param end end of the exception handler's scope (exclusive).
+     * @param handler beginning of the exception handler's code.
+     * @param type internal name of the type of exceptions handled by the
+     *        handler, or <tt>null</tt> to catch any exceptions (for "finally"
+     *        blocks).
+     */
+    public TryCatchBlockNode(
+        final LabelNode start,
+        final LabelNode end,
+        final LabelNode handler,
+        final String type)
+    {
+        this.start = start;
+        this.end = end;
+        this.handler = handler;
+        this.type = type;
+    }
+
+    /**
+     * Makes the given visitor visit this try catch block.
+     *
+     * @param mv a method visitor.
+     */
+    public void accept(final MethodVisitor mv) {
+        mv.visitTryCatchBlock(start.getLabel(), end.getLabel(), handler == null
+                ? null
+                : handler.getLabel(), type);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/TypeInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,116 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a type instruction. A type instruction is an
+ * instruction that takes a type descriptor as parameter.
+ *
+ * @author Eric Bruneton
+ */
+public class TypeInsnNode extends AbstractInsnNode {
+
+    /**
+     * The operand of this instruction. This operand is an internal name (see
+     * {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public String desc;
+
+    /**
+     * Constructs a new {@link TypeInsnNode}.
+     *
+     * @param opcode the opcode of the type instruction to be constructed. This
+     *        opcode must be NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
+     * @param desc the operand of the instruction to be constructed. This
+     *        operand is an internal name (see {@link jdk.internal.org.objectweb.asm.Type}).
+     */
+    public TypeInsnNode(final int opcode, final String desc) {
+        super(opcode);
+        this.desc = desc;
+    }
+
+    /**
+     * Sets the opcode of this instruction.
+     *
+     * @param opcode the new instruction opcode. This opcode must be NEW,
+     *        ANEWARRAY, CHECKCAST or INSTANCEOF.
+     */
+    public void setOpcode(final int opcode) {
+        this.opcode = opcode;
+    }
+
+    @Override
+    public int getType() {
+        return TYPE_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitTypeInsn(opcode, desc);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new TypeInsnNode(opcode, desc);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/VarInsnNode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,119 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a local variable instruction. A local variable
+ * instruction is an instruction that loads or stores the value of a local
+ * variable.
+ *
+ * @author Eric Bruneton
+ */
+public class VarInsnNode extends AbstractInsnNode {
+
+    /**
+     * The operand of this instruction. This operand is the index of a local
+     * variable.
+     */
+    public int var;
+
+    /**
+     * Constructs a new {@link VarInsnNode}.
+     *
+     * @param opcode the opcode of the local variable instruction to be
+     *        constructed. This opcode must be ILOAD, LLOAD, FLOAD, DLOAD,
+     *        ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
+     * @param var the operand of the instruction to be constructed. This operand
+     *        is the index of a local variable.
+     */
+    public VarInsnNode(final int opcode, final int var) {
+        super(opcode);
+        this.var = var;
+    }
+
+    /**
+     * Sets the opcode of this instruction.
+     *
+     * @param opcode the new instruction opcode. This opcode must be ILOAD,
+     *        LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE
+     *        or RET.
+     */
+    public void setOpcode(final int opcode) {
+        this.opcode = opcode;
+    }
+
+    @Override
+    public int getType() {
+        return VAR_INSN;
+    }
+
+    @Override
+    public void accept(final MethodVisitor mv) {
+        mv.visitVarInsn(opcode, var);
+    }
+
+    @Override
+    public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+        return new VarInsnNode(opcode, var);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Analyzer.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,579 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.IincInsnNode;
+import jdk.internal.org.objectweb.asm.tree.InsnList;
+import jdk.internal.org.objectweb.asm.tree.JumpInsnNode;
+import jdk.internal.org.objectweb.asm.tree.LabelNode;
+import jdk.internal.org.objectweb.asm.tree.LookupSwitchInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodNode;
+import jdk.internal.org.objectweb.asm.tree.TableSwitchInsnNode;
+import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
+import jdk.internal.org.objectweb.asm.tree.VarInsnNode;
+
+/**
+ * A semantic bytecode analyzer. <i>This class does not fully check that JSR and
+ * RET instructions are valid.</i>
+ *
+ * @param <V> type of the Value used for the analysis.
+ *
+ *  @author Eric Bruneton
+ */
+public class Analyzer<V extends Value> implements Opcodes {
+
+    private final Interpreter<V> interpreter;
+
+    private int n;
+
+    private InsnList insns;
+
+    private List<TryCatchBlockNode>[] handlers;
+
+    private Frame<V>[] frames;
+
+    private Subroutine[] subroutines;
+
+    private boolean[] queued;
+
+    private int[] queue;
+
+    private int top;
+
+    /**
+     * Constructs a new {@link Analyzer}.
+     *
+     * @param interpreter the interpreter to be used to symbolically interpret
+     *        the bytecode instructions.
+     */
+    public Analyzer(final Interpreter<V> interpreter) {
+        this.interpreter = interpreter;
+    }
+
+    /**
+     * Analyzes the given method.
+     *
+     * @param owner the internal name of the class to which the method belongs.
+     * @param m the method to be analyzed.
+     * @return the symbolic state of the execution stack frame at each bytecode
+     *         instruction of the method. The size of the returned array is
+     *         equal to the number of instructions (and labels) of the method. A
+     *         given frame is <tt>null</tt> if and only if the corresponding
+     *         instruction cannot be reached (dead code).
+     * @throws AnalyzerException if a problem occurs during the analysis.
+     */
+    public Frame<V>[] analyze(final String owner, final MethodNode m)
+            throws AnalyzerException
+    {
+        if ((m.access & (ACC_ABSTRACT | ACC_NATIVE)) != 0) {
+            frames = (Frame<V>[])new Frame<?>[0];
+            return frames;
+        }
+        n = m.instructions.size();
+        insns = m.instructions;
+        handlers = (List<TryCatchBlockNode>[])new List<?>[n];
+        frames = (Frame<V>[])new Frame<?>[n];
+        subroutines = new Subroutine[n];
+        queued = new boolean[n];
+        queue = new int[n];
+        top = 0;
+
+        // computes exception handlers for each instruction
+        for (int i = 0; i < m.tryCatchBlocks.size(); ++i) {
+            TryCatchBlockNode tcb = m.tryCatchBlocks.get(i);
+            int begin = insns.indexOf(tcb.start);
+            int end = insns.indexOf(tcb.end);
+            for (int j = begin; j < end; ++j) {
+                List<TryCatchBlockNode> insnHandlers = handlers[j];
+                if (insnHandlers == null) {
+                    insnHandlers = new ArrayList<TryCatchBlockNode>();
+                    handlers[j] = insnHandlers;
+                }
+                insnHandlers.add(tcb);
+            }
+        }
+
+        // computes the subroutine for each instruction:
+        Subroutine main = new Subroutine(null, m.maxLocals, null);
+        List<AbstractInsnNode> subroutineCalls = new ArrayList<AbstractInsnNode>();
+        Map<LabelNode, Subroutine> subroutineHeads = new HashMap<LabelNode, Subroutine>();
+        findSubroutine(0, main, subroutineCalls);
+        while (!subroutineCalls.isEmpty()) {
+            JumpInsnNode jsr = (JumpInsnNode) subroutineCalls.remove(0);
+            Subroutine sub = subroutineHeads.get(jsr.label);
+            if (sub == null) {
+                sub = new Subroutine(jsr.label, m.maxLocals, jsr);
+                subroutineHeads.put(jsr.label, sub);
+                findSubroutine(insns.indexOf(jsr.label), sub, subroutineCalls);
+            } else {
+                sub.callers.add(jsr);
+            }
+        }
+        for (int i = 0; i < n; ++i) {
+            if (subroutines[i] != null && subroutines[i].start == null) {
+                subroutines[i] = null;
+            }
+        }
+
+        // initializes the data structures for the control flow analysis
+        Frame<V> current = newFrame(m.maxLocals, m.maxStack);
+        Frame<V> handler = newFrame(m.maxLocals, m.maxStack);
+        current.setReturn(interpreter.newValue(Type.getReturnType(m.desc)));
+        Type[] args = Type.getArgumentTypes(m.desc);
+        int local = 0;
+        if ((m.access & ACC_STATIC) == 0) {
+            Type ctype = Type.getObjectType(owner);
+            current.setLocal(local++, interpreter.newValue(ctype));
+        }
+        for (int i = 0; i < args.length; ++i) {
+            current.setLocal(local++, interpreter.newValue(args[i]));
+            if (args[i].getSize() == 2) {
+                current.setLocal(local++, interpreter.newValue(null));
+            }
+        }
+        while (local < m.maxLocals) {
+            current.setLocal(local++, interpreter.newValue(null));
+        }
+        merge(0, current, null);
+
+        init(owner, m);
+
+        // control flow analysis
+        while (top > 0) {
+            int insn = queue[--top];
+            Frame<V> f = frames[insn];
+            Subroutine subroutine = subroutines[insn];
+            queued[insn] = false;
+
+            AbstractInsnNode insnNode = null;
+            try {
+                insnNode = m.instructions.get(insn);
+                int insnOpcode = insnNode.getOpcode();
+                int insnType = insnNode.getType();
+
+                if (insnType == AbstractInsnNode.LABEL
+                        || insnType == AbstractInsnNode.LINE
+                        || insnType == AbstractInsnNode.FRAME)
+                {
+                    merge(insn + 1, f, subroutine);
+                    newControlFlowEdge(insn, insn + 1);
+                } else {
+                    current.init(f).execute(insnNode, interpreter);
+                    subroutine = subroutine == null ? null : subroutine.copy();
+
+                    if (insnNode instanceof JumpInsnNode) {
+                        JumpInsnNode j = (JumpInsnNode) insnNode;
+                        if (insnOpcode != GOTO && insnOpcode != JSR) {
+                            merge(insn + 1, current, subroutine);
+                            newControlFlowEdge(insn, insn + 1);
+                        }
+                        int jump = insns.indexOf(j.label);
+                        if (insnOpcode == JSR) {
+                            merge(jump, current, new Subroutine(j.label,
+                                    m.maxLocals,
+                                    j));
+                        } else {
+                            merge(jump, current, subroutine);
+                        }
+                        newControlFlowEdge(insn, jump);
+                    } else if (insnNode instanceof LookupSwitchInsnNode) {
+                        LookupSwitchInsnNode lsi = (LookupSwitchInsnNode) insnNode;
+                        int jump = insns.indexOf(lsi.dflt);
+                        merge(jump, current, subroutine);
+                        newControlFlowEdge(insn, jump);
+                        for (int j = 0; j < lsi.labels.size(); ++j) {
+                            LabelNode label = lsi.labels.get(j);
+                            jump = insns.indexOf(label);
+                            merge(jump, current, subroutine);
+                            newControlFlowEdge(insn, jump);
+                        }
+                    } else if (insnNode instanceof TableSwitchInsnNode) {
+                        TableSwitchInsnNode tsi = (TableSwitchInsnNode) insnNode;
+                        int jump = insns.indexOf(tsi.dflt);
+                        merge(jump, current, subroutine);
+                        newControlFlowEdge(insn, jump);
+                        for (int j = 0; j < tsi.labels.size(); ++j) {
+                            LabelNode label = tsi.labels.get(j);
+                            jump = insns.indexOf(label);
+                            merge(jump, current, subroutine);
+                            newControlFlowEdge(insn, jump);
+                        }
+                    } else if (insnOpcode == RET) {
+                        if (subroutine == null) {
+                            throw new AnalyzerException(insnNode, "RET instruction outside of a sub routine");
+                        }
+                        for (int i = 0; i < subroutine.callers.size(); ++i) {
+                            JumpInsnNode caller = subroutine.callers.get(i);
+                            int call = insns.indexOf(caller);
+                            if (frames[call] != null) {
+                                merge(call + 1,
+                                        frames[call],
+                                        current,
+                                        subroutines[call],
+                                        subroutine.access);
+                                newControlFlowEdge(insn, call + 1);
+                            }
+                        }
+                    } else if (insnOpcode != ATHROW
+                            && (insnOpcode < IRETURN || insnOpcode > RETURN))
+                    {
+                        if (subroutine != null) {
+                            if (insnNode instanceof VarInsnNode) {
+                                int var = ((VarInsnNode) insnNode).var;
+                                subroutine.access[var] = true;
+                                if (insnOpcode == LLOAD || insnOpcode == DLOAD
+                                        || insnOpcode == LSTORE
+                                        || insnOpcode == DSTORE)
+                                {
+                                    subroutine.access[var + 1] = true;
+                                }
+                            } else if (insnNode instanceof IincInsnNode) {
+                                int var = ((IincInsnNode) insnNode).var;
+                                subroutine.access[var] = true;
+                            }
+                        }
+                        merge(insn + 1, current, subroutine);
+                        newControlFlowEdge(insn, insn + 1);
+                    }
+                }
+
+                List<TryCatchBlockNode> insnHandlers = handlers[insn];
+                if (insnHandlers != null) {
+                    for (int i = 0; i < insnHandlers.size(); ++i) {
+                        TryCatchBlockNode tcb = insnHandlers.get(i);
+                        Type type;
+                        if (tcb.type == null) {
+                            type = Type.getObjectType("java/lang/Throwable");
+                        } else {
+                            type = Type.getObjectType(tcb.type);
+                        }
+                        int jump = insns.indexOf(tcb.handler);
+                        if (newControlFlowExceptionEdge(insn, tcb)) {
+                            handler.init(f);
+                            handler.clearStack();
+                            handler.push(interpreter.newValue(type));
+                            merge(jump, handler, subroutine);
+                        }
+                    }
+                }
+            } catch (AnalyzerException e) {
+                throw new AnalyzerException(e.node, "Error at instruction " + insn
+                        + ": " + e.getMessage(), e);
+            } catch (Exception e) {
+                throw new AnalyzerException(insnNode, "Error at instruction " + insn
+                        + ": " + e.getMessage(), e);
+            }
+        }
+
+        return frames;
+    }
+
+    private void findSubroutine(int insn, final Subroutine sub, final List<AbstractInsnNode> calls)
+            throws AnalyzerException
+    {
+        while (true) {
+            if (insn < 0 || insn >= n) {
+                throw new AnalyzerException(null, "Execution can fall off end of the code");
+            }
+            if (subroutines[insn] != null) {
+                return;
+            }
+            subroutines[insn] = sub.copy();
+            AbstractInsnNode node = insns.get(insn);
+
+            // calls findSubroutine recursively on normal successors
+            if (node instanceof JumpInsnNode) {
+                if (node.getOpcode() == JSR) {
+                    // do not follow a JSR, it leads to another subroutine!
+                    calls.add(node);
+                } else {
+                    JumpInsnNode jnode = (JumpInsnNode) node;
+                    findSubroutine(insns.indexOf(jnode.label), sub, calls);
+                }
+            } else if (node instanceof TableSwitchInsnNode) {
+                TableSwitchInsnNode tsnode = (TableSwitchInsnNode) node;
+                findSubroutine(insns.indexOf(tsnode.dflt), sub, calls);
+                for (int i = tsnode.labels.size() - 1; i >= 0; --i) {
+                    LabelNode l = tsnode.labels.get(i);
+                    findSubroutine(insns.indexOf(l), sub, calls);
+                }
+            } else if (node instanceof LookupSwitchInsnNode) {
+                LookupSwitchInsnNode lsnode = (LookupSwitchInsnNode) node;
+                findSubroutine(insns.indexOf(lsnode.dflt), sub, calls);
+                for (int i = lsnode.labels.size() - 1; i >= 0; --i) {
+                    LabelNode l = lsnode.labels.get(i);
+                    findSubroutine(insns.indexOf(l), sub, calls);
+                }
+            }
+
+            // calls findSubroutine recursively on exception handler successors
+            List<TryCatchBlockNode> insnHandlers = handlers[insn];
+            if (insnHandlers != null) {
+                for (int i = 0; i < insnHandlers.size(); ++i) {
+                    TryCatchBlockNode tcb = insnHandlers.get(i);
+                    findSubroutine(insns.indexOf(tcb.handler), sub, calls);
+                }
+            }
+
+            // if insn does not falls through to the next instruction, return.
+            switch (node.getOpcode()) {
+                case GOTO:
+                case RET:
+                case TABLESWITCH:
+                case LOOKUPSWITCH:
+                case IRETURN:
+                case LRETURN:
+                case FRETURN:
+                case DRETURN:
+                case ARETURN:
+                case RETURN:
+                case ATHROW:
+                    return;
+            }
+            insn++;
+        }
+    }
+
+    /**
+     * Returns the symbolic stack frame for each instruction of the last
+     * recently analyzed method.
+     *
+     * @return the symbolic state of the execution stack frame at each bytecode
+     *         instruction of the method. The size of the returned array is
+     *         equal to the number of instructions (and labels) of the method. A
+     *         given frame is <tt>null</tt> if the corresponding instruction
+     *         cannot be reached, or if an error occured during the analysis of
+     *         the method.
+     */
+    public Frame<V>[] getFrames() {
+        return frames;
+    }
+
+    /**
+     * Returns the exception handlers for the given instruction.
+     *
+     * @param insn the index of an instruction of the last recently analyzed
+     *        method.
+     * @return a list of {@link TryCatchBlockNode} objects.
+     */
+    public List<TryCatchBlockNode> getHandlers(final int insn) {
+        return handlers[insn];
+    }
+
+    /**
+     * Initializes this analyzer. This method is called just before the
+     * execution of control flow analysis loop in #analyze. The default
+     * implementation of this method does nothing.
+     *
+     * @param owner the internal name of the class to which the method belongs.
+     * @param m the method to be analyzed.
+     * @throws AnalyzerException if a problem occurs.
+     */
+    protected void init(String owner, MethodNode m) throws AnalyzerException {
+    }
+
+    /**
+     * Constructs a new frame with the given size.
+     *
+     * @param nLocals the maximum number of local variables of the frame.
+     * @param nStack the maximum stack size of the frame.
+     * @return the created frame.
+     */
+    protected Frame<V> newFrame(final int nLocals, final int nStack) {
+        return new Frame<V>(nLocals, nStack);
+    }
+
+    /**
+     * Constructs a new frame that is identical to the given frame.
+     *
+     * @param src a frame.
+     * @return the created frame.
+     */
+    protected Frame<V> newFrame(final Frame<? extends V> src) {
+        return new Frame<V>(src);
+    }
+
+    /**
+     * Creates a control flow graph edge. The default implementation of this
+     * method does nothing. It can be overriden in order to construct the
+     * control flow graph of a method (this method is called by the
+     * {@link #analyze analyze} method during its visit of the method's code).
+     *
+     * @param insn an instruction index.
+     * @param successor index of a successor instruction.
+     */
+    protected void newControlFlowEdge(final int insn, final int successor) {
+    }
+
+    /**
+     * Creates a control flow graph edge corresponding to an exception handler.
+     * The default implementation of this method does nothing. It can be
+     * overridden in order to construct the control flow graph of a method (this
+     * method is called by the {@link #analyze analyze} method during its visit
+     * of the method's code).
+     *
+     * @param insn an instruction index.
+     * @param successor index of a successor instruction.
+     * @return true if this edge must be considered in the data flow analysis
+     *         performed by this analyzer, or false otherwise. The default
+     *         implementation of this method always returns true.
+     */
+    protected boolean newControlFlowExceptionEdge(
+        final int insn,
+        final int successor)
+    {
+        return true;
+    }
+
+    /**
+     * Creates a control flow graph edge corresponding to an exception handler.
+     * The default implementation of this method delegates to
+     * {@link #newControlFlowExceptionEdge(int, int)
+     * newControlFlowExceptionEdge(int, int)}. It can be overridden in order to
+     * construct the control flow graph of a method (this method is called by
+     * the {@link #analyze analyze} method during its visit of the method's
+     * code).
+     *
+     * @param insn an instruction index.
+     * @param tcb TryCatchBlockNode corresponding to this edge.
+     * @return true if this edge must be considered in the data flow analysis
+     *         performed by this analyzer, or false otherwise. The default
+     *         implementation of this method delegates to
+     *         {@link #newControlFlowExceptionEdge(int, int)
+     *         newControlFlowExceptionEdge(int, int)}.
+     */
+    protected boolean newControlFlowExceptionEdge(
+        final int insn,
+        final TryCatchBlockNode tcb)
+    {
+        return newControlFlowExceptionEdge(insn, insns.indexOf(tcb.handler));
+    }
+
+    // -------------------------------------------------------------------------
+
+    private void merge(
+        final int insn,
+        final Frame<V> frame,
+        final Subroutine subroutine) throws AnalyzerException
+    {
+        Frame<V> oldFrame = frames[insn];
+        Subroutine oldSubroutine = subroutines[insn];
+        boolean changes;
+
+        if (oldFrame == null) {
+            frames[insn] = newFrame(frame);
+            changes = true;
+        } else {
+            changes = oldFrame.merge(frame, interpreter);
+        }
+
+        if (oldSubroutine == null) {
+            if (subroutine != null) {
+                subroutines[insn] = subroutine.copy();
+                changes = true;
+            }
+        } else {
+            if (subroutine != null) {
+                changes |= oldSubroutine.merge(subroutine);
+            }
+        }
+        if (changes && !queued[insn]) {
+            queued[insn] = true;
+            queue[top++] = insn;
+        }
+    }
+
+    private void merge(
+        final int insn,
+        final Frame<V> beforeJSR,
+        final Frame<V> afterRET,
+        final Subroutine subroutineBeforeJSR,
+        final boolean[] access) throws AnalyzerException
+    {
+        Frame<V> oldFrame = frames[insn];
+        Subroutine oldSubroutine = subroutines[insn];
+        boolean changes;
+
+        afterRET.merge(beforeJSR, access);
+
+        if (oldFrame == null) {
+            frames[insn] = newFrame(afterRET);
+            changes = true;
+        } else {
+            changes = oldFrame.merge(afterRET, interpreter);
+        }
+
+        if (oldSubroutine != null && subroutineBeforeJSR != null) {
+            changes |= oldSubroutine.merge(subroutineBeforeJSR);
+        }
+        if (changes && !queued[insn]) {
+            queued[insn] = true;
+            queue[top++] = insn;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/AnalyzerException.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,93 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+
+/**
+ * Thrown if a problem occurs during the analysis of a method.
+ *
+ * @author Bing Ran
+ * @author Eric Bruneton
+ */
+public class AnalyzerException extends Exception {
+
+    public final AbstractInsnNode node;
+
+    public AnalyzerException(final AbstractInsnNode node, final String msg) {
+        super(msg);
+        this.node = node;
+    }
+
+    public AnalyzerException(final AbstractInsnNode node, final String msg, final Throwable exception) {
+        super(msg, exception);
+        this.node = node;
+    }
+
+    public AnalyzerException(
+        final AbstractInsnNode node,
+        final String msg,
+        final Object expected,
+        final Value encountered)
+    {
+        super((msg == null ? "Expected " : msg + ": expected ") + expected
+                + ", but found " + encountered);
+        this.node = node;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/BasicInterpreter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,394 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
+import jdk.internal.org.objectweb.asm.tree.IntInsnNode;
+import jdk.internal.org.objectweb.asm.tree.InvokeDynamicInsnNode;
+import jdk.internal.org.objectweb.asm.tree.LdcInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MultiANewArrayInsnNode;
+import jdk.internal.org.objectweb.asm.tree.TypeInsnNode;
+
+/**
+ * An {@link Interpreter} for {@link BasicValue} values.
+ *
+ * @author Eric Bruneton
+ * @author Bing Ran
+ */
+public class BasicInterpreter extends Interpreter<BasicValue> implements
+        Opcodes
+{
+
+    public BasicInterpreter() {
+        super(ASM4);
+    }
+
+    protected BasicInterpreter(final int api) {
+        super(api);
+    }
+
+    @Override
+    public BasicValue newValue(final Type type) {
+        if (type == null) {
+            return BasicValue.UNINITIALIZED_VALUE;
+        }
+        switch (type.getSort()) {
+            case Type.VOID:
+                return null;
+            case Type.BOOLEAN:
+            case Type.CHAR:
+            case Type.BYTE:
+            case Type.SHORT:
+            case Type.INT:
+                return BasicValue.INT_VALUE;
+            case Type.FLOAT:
+                return BasicValue.FLOAT_VALUE;
+            case Type.LONG:
+                return BasicValue.LONG_VALUE;
+            case Type.DOUBLE:
+                return BasicValue.DOUBLE_VALUE;
+            case Type.ARRAY:
+            case Type.OBJECT:
+                return BasicValue.REFERENCE_VALUE;
+            default:
+                throw new Error("Internal error");
+        }
+    }
+
+    @Override
+    public BasicValue newOperation(final AbstractInsnNode insn)
+            throws AnalyzerException
+    {
+        switch (insn.getOpcode()) {
+            case ACONST_NULL:
+                return newValue(Type.getObjectType("null"));
+            case ICONST_M1:
+            case ICONST_0:
+            case ICONST_1:
+            case ICONST_2:
+            case ICONST_3:
+            case ICONST_4:
+            case ICONST_5:
+                return BasicValue.INT_VALUE;
+            case LCONST_0:
+            case LCONST_1:
+                return BasicValue.LONG_VALUE;
+            case FCONST_0:
+            case FCONST_1:
+            case FCONST_2:
+                return BasicValue.FLOAT_VALUE;
+            case DCONST_0:
+            case DCONST_1:
+                return BasicValue.DOUBLE_VALUE;
+            case BIPUSH:
+            case SIPUSH:
+                return BasicValue.INT_VALUE;
+            case LDC:
+                Object cst = ((LdcInsnNode) insn).cst;
+                if (cst instanceof Integer) {
+                    return BasicValue.INT_VALUE;
+                } else if (cst instanceof Float) {
+                    return BasicValue.FLOAT_VALUE;
+                } else if (cst instanceof Long) {
+                    return BasicValue.LONG_VALUE;
+                } else if (cst instanceof Double) {
+                    return BasicValue.DOUBLE_VALUE;
+                } else if (cst instanceof String) {
+                    return newValue(Type.getObjectType("java/lang/String"));
+                } else if (cst instanceof Type) {
+                    int sort = ((Type) cst).getSort();
+                    if (sort == Type.OBJECT || sort == Type.ARRAY) {
+                        return newValue(Type.getObjectType("java/lang/Class"));
+                    } else if (sort == Type.METHOD) {
+                        return newValue(Type.getObjectType("java/lang/invoke/MethodType"));
+                    } else {
+                        throw new IllegalArgumentException("Illegal LDC constant " + cst);
+                    }
+                } else if (cst instanceof Handle) {
+                    return newValue(Type.getObjectType("java/lang/invoke/MethodHandle"));
+                } else {
+                    throw new IllegalArgumentException("Illegal LDC constant " + cst);
+                }
+            case JSR:
+                return BasicValue.RETURNADDRESS_VALUE;
+            case GETSTATIC:
+                return newValue(Type.getType(((FieldInsnNode) insn).desc));
+            case NEW:
+                return newValue(Type.getObjectType(((TypeInsnNode) insn).desc));
+            default:
+                throw new Error("Internal error.");
+        }
+    }
+
+    @Override
+    public BasicValue copyOperation(final AbstractInsnNode insn, final BasicValue value)
+            throws AnalyzerException
+    {
+        return value;
+    }
+
+    @Override
+    public BasicValue unaryOperation(final AbstractInsnNode insn, final BasicValue value)
+            throws AnalyzerException
+    {
+        switch (insn.getOpcode()) {
+            case INEG:
+            case IINC:
+            case L2I:
+            case F2I:
+            case D2I:
+            case I2B:
+            case I2C:
+            case I2S:
+                return BasicValue.INT_VALUE;
+            case FNEG:
+            case I2F:
+            case L2F:
+            case D2F:
+                return BasicValue.FLOAT_VALUE;
+            case LNEG:
+            case I2L:
+            case F2L:
+            case D2L:
+                return BasicValue.LONG_VALUE;
+            case DNEG:
+            case I2D:
+            case L2D:
+            case F2D:
+                return BasicValue.DOUBLE_VALUE;
+            case IFEQ:
+            case IFNE:
+            case IFLT:
+            case IFGE:
+            case IFGT:
+            case IFLE:
+            case TABLESWITCH:
+            case LOOKUPSWITCH:
+            case IRETURN:
+            case LRETURN:
+            case FRETURN:
+            case DRETURN:
+            case ARETURN:
+            case PUTSTATIC:
+                return null;
+            case GETFIELD:
+                return newValue(Type.getType(((FieldInsnNode) insn).desc));
+            case NEWARRAY:
+                switch (((IntInsnNode) insn).operand) {
+                    case T_BOOLEAN:
+                        return newValue(Type.getType("[Z"));
+                    case T_CHAR:
+                        return newValue(Type.getType("[C"));
+                    case T_BYTE:
+                        return newValue(Type.getType("[B"));
+                    case T_SHORT:
+                        return newValue(Type.getType("[S"));
+                    case T_INT:
+                        return newValue(Type.getType("[I"));
+                    case T_FLOAT:
+                        return newValue(Type.getType("[F"));
+                    case T_DOUBLE:
+                        return newValue(Type.getType("[D"));
+                    case T_LONG:
+                        return newValue(Type.getType("[J"));
+                    default:
+                        throw new AnalyzerException(insn, "Invalid array type");
+                }
+            case ANEWARRAY:
+                String desc = ((TypeInsnNode) insn).desc;
+                return newValue(Type.getType("[" + Type.getObjectType(desc)));
+            case ARRAYLENGTH:
+                return BasicValue.INT_VALUE;
+            case ATHROW:
+                return null;
+            case CHECKCAST:
+                desc = ((TypeInsnNode) insn).desc;
+                return newValue(Type.getObjectType(desc));
+            case INSTANCEOF:
+                return BasicValue.INT_VALUE;
+            case MONITORENTER:
+            case MONITOREXIT:
+            case IFNULL:
+            case IFNONNULL:
+                return null;
+            default:
+                throw new Error("Internal error.");
+        }
+    }
+
+    @Override
+    public BasicValue binaryOperation(
+        final AbstractInsnNode insn,
+        final BasicValue value1,
+        final BasicValue value2) throws AnalyzerException
+    {
+        switch (insn.getOpcode()) {
+            case IALOAD:
+            case BALOAD:
+            case CALOAD:
+            case SALOAD:
+            case IADD:
+            case ISUB:
+            case IMUL:
+            case IDIV:
+            case IREM:
+            case ISHL:
+            case ISHR:
+            case IUSHR:
+            case IAND:
+            case IOR:
+            case IXOR:
+                return BasicValue.INT_VALUE;
+            case FALOAD:
+            case FADD:
+            case FSUB:
+            case FMUL:
+            case FDIV:
+            case FREM:
+                return BasicValue.FLOAT_VALUE;
+            case LALOAD:
+            case LADD:
+            case LSUB:
+            case LMUL:
+            case LDIV:
+            case LREM:
+            case LSHL:
+            case LSHR:
+            case LUSHR:
+            case LAND:
+            case LOR:
+            case LXOR:
+                return BasicValue.LONG_VALUE;
+            case DALOAD:
+            case DADD:
+            case DSUB:
+            case DMUL:
+            case DDIV:
+            case DREM:
+                return BasicValue.DOUBLE_VALUE;
+            case AALOAD:
+                return BasicValue.REFERENCE_VALUE;
+            case LCMP:
+            case FCMPL:
+            case FCMPG:
+            case DCMPL:
+            case DCMPG:
+                return BasicValue.INT_VALUE;
+            case IF_ICMPEQ:
+            case IF_ICMPNE:
+            case IF_ICMPLT:
+            case IF_ICMPGE:
+            case IF_ICMPGT:
+            case IF_ICMPLE:
+            case IF_ACMPEQ:
+            case IF_ACMPNE:
+            case PUTFIELD:
+                return null;
+            default:
+                throw new Error("Internal error.");
+        }
+    }
+
+    @Override
+    public BasicValue ternaryOperation(
+        final AbstractInsnNode insn,
+        final BasicValue value1,
+        final BasicValue value2,
+        final BasicValue value3) throws AnalyzerException
+    {
+        return null;
+    }
+
+    @Override
+    public BasicValue naryOperation(final AbstractInsnNode insn, final List<? extends BasicValue> values)
+            throws AnalyzerException
+    {
+        int opcode = insn.getOpcode();
+        if (opcode == MULTIANEWARRAY) {
+            return newValue(Type.getType(((MultiANewArrayInsnNode) insn).desc));
+        } else if (opcode == INVOKEDYNAMIC){
+            return newValue(Type.getReturnType(((InvokeDynamicInsnNode) insn).desc));
+        } else {
+            return newValue(Type.getReturnType(((MethodInsnNode) insn).desc));
+        }
+    }
+
+    @Override
+    public void returnOperation(
+        final AbstractInsnNode insn,
+        final BasicValue value,
+        final BasicValue expected) throws AnalyzerException
+    {
+    }
+
+    @Override
+    public BasicValue merge(final BasicValue v, final BasicValue w) {
+        if (!v.equals(w)) {
+            return BasicValue.UNINITIALIZED_VALUE;
+        }
+        return v;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/BasicValue.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,137 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link Value} that is represented by its type in a seven types type system.
+ * This type system distinguishes the UNINITIALZED, INT, FLOAT, LONG, DOUBLE,
+ * REFERENCE and RETURNADDRESS types.
+ *
+ * @author Eric Bruneton
+ */
+public class BasicValue implements Value {
+
+    public static final BasicValue UNINITIALIZED_VALUE = new BasicValue(null);
+
+    public static final BasicValue INT_VALUE = new BasicValue(Type.INT_TYPE);
+
+    public static final BasicValue FLOAT_VALUE = new BasicValue(Type.FLOAT_TYPE);
+
+    public static final BasicValue LONG_VALUE = new BasicValue(Type.LONG_TYPE);
+
+    public static final BasicValue DOUBLE_VALUE = new BasicValue(Type.DOUBLE_TYPE);
+
+    public static final BasicValue REFERENCE_VALUE = new BasicValue(Type.getObjectType("java/lang/Object"));
+
+    public static final BasicValue RETURNADDRESS_VALUE = new BasicValue(Type.VOID_TYPE);
+
+    private final Type type;
+
+    public BasicValue(final Type type) {
+        this.type = type;
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public int getSize() {
+        return type == Type.LONG_TYPE || type == Type.DOUBLE_TYPE ? 2 : 1;
+    }
+
+    public boolean isReference() {
+        return type != null
+                && (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY);
+    }
+
+    @Override
+    public boolean equals(final Object value) {
+        if (value == this) {
+            return true;
+        } else if (value instanceof BasicValue) {
+            if (type == null) {
+                return ((BasicValue) value).type == null;
+            } else {
+                return type.equals(((BasicValue) value).type);
+            }
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        return type == null ? 0 : type.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        if (this == UNINITIALIZED_VALUE) {
+            return ".";
+        } else if (this == RETURNADDRESS_VALUE) {
+            return "A";
+        } else if (this == REFERENCE_VALUE) {
+            return "R";
+        } else {
+            return type.getDescriptor();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/BasicVerifier.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,488 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
+import jdk.internal.org.objectweb.asm.tree.InvokeDynamicInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
+
+/**
+ * An extended {@link BasicInterpreter} that checks that bytecode instructions
+ * are correctly used.
+ *
+ * @author Eric Bruneton
+ * @author Bing Ran
+ */
+public class BasicVerifier extends BasicInterpreter {
+
+    public BasicVerifier() {
+        super(ASM4);
+    }
+
+    protected BasicVerifier(final int api) {
+        super(api);
+    }
+
+    @Override
+    public BasicValue copyOperation(final AbstractInsnNode insn, final BasicValue value)
+            throws AnalyzerException
+    {
+        Value expected;
+        switch (insn.getOpcode()) {
+            case ILOAD:
+            case ISTORE:
+                expected = BasicValue.INT_VALUE;
+                break;
+            case FLOAD:
+            case FSTORE:
+                expected = BasicValue.FLOAT_VALUE;
+                break;
+            case LLOAD:
+            case LSTORE:
+                expected = BasicValue.LONG_VALUE;
+                break;
+            case DLOAD:
+            case DSTORE:
+                expected = BasicValue.DOUBLE_VALUE;
+                break;
+            case ALOAD:
+                if (!value.isReference()) {
+                    throw new AnalyzerException(insn,
+                            null,
+                            "an object reference",
+                            value);
+                }
+                return value;
+            case ASTORE:
+                if (!value.isReference()
+                        && !BasicValue.RETURNADDRESS_VALUE.equals(value))
+                {
+                    throw new AnalyzerException(insn,
+                            null,
+                            "an object reference or a return address",
+                            value);
+                }
+                return value;
+            default:
+                return value;
+        }
+        if (!expected.equals(value)) {
+            throw new AnalyzerException(insn, null, expected, value);
+        }
+        return value;
+    }
+
+    @Override
+    public BasicValue unaryOperation(final AbstractInsnNode insn, final BasicValue value)
+            throws AnalyzerException
+    {
+        BasicValue expected;
+        switch (insn.getOpcode()) {
+            case INEG:
+            case IINC:
+            case I2F:
+            case I2L:
+            case I2D:
+            case I2B:
+            case I2C:
+            case I2S:
+            case IFEQ:
+            case IFNE:
+            case IFLT:
+            case IFGE:
+            case IFGT:
+            case IFLE:
+            case TABLESWITCH:
+            case LOOKUPSWITCH:
+            case IRETURN:
+            case NEWARRAY:
+            case ANEWARRAY:
+                expected = BasicValue.INT_VALUE;
+                break;
+            case FNEG:
+            case F2I:
+            case F2L:
+            case F2D:
+            case FRETURN:
+                expected = BasicValue.FLOAT_VALUE;
+                break;
+            case LNEG:
+            case L2I:
+            case L2F:
+            case L2D:
+            case LRETURN:
+                expected = BasicValue.LONG_VALUE;
+                break;
+            case DNEG:
+            case D2I:
+            case D2F:
+            case D2L:
+            case DRETURN:
+                expected = BasicValue.DOUBLE_VALUE;
+                break;
+            case GETFIELD:
+                expected = newValue(Type.getObjectType(((FieldInsnNode) insn).owner));
+                break;
+            case CHECKCAST:
+                if (!value.isReference()) {
+                    throw new AnalyzerException(insn,
+                            null,
+                            "an object reference",
+                            value);
+                }
+                return super.unaryOperation(insn, value);
+            case ARRAYLENGTH:
+                if (!isArrayValue(value)) {
+                    throw new AnalyzerException(insn,
+                            null,
+                            "an array reference",
+                            value);
+                }
+                return super.unaryOperation(insn, value);
+            case ARETURN:
+            case ATHROW:
+            case INSTANCEOF:
+            case MONITORENTER:
+            case MONITOREXIT:
+            case IFNULL:
+            case IFNONNULL:
+                if (!value.isReference()) {
+                    throw new AnalyzerException(insn,
+                            null,
+                            "an object reference",
+                            value);
+                }
+                return super.unaryOperation(insn, value);
+            case PUTSTATIC:
+                expected = newValue(Type.getType(((FieldInsnNode) insn).desc));
+                break;
+            default:
+                throw new Error("Internal error.");
+        }
+        if (!isSubTypeOf(value, expected)) {
+            throw new AnalyzerException(insn, null, expected, value);
+        }
+        return super.unaryOperation(insn, value);
+    }
+
+    @Override
+    public BasicValue binaryOperation(
+        final AbstractInsnNode insn,
+        final BasicValue value1,
+        final BasicValue value2) throws AnalyzerException
+    {
+        BasicValue expected1;
+        BasicValue expected2;
+        switch (insn.getOpcode()) {
+            case IALOAD:
+                expected1 = newValue(Type.getType("[I"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case BALOAD:
+                if (isSubTypeOf(value1, newValue(Type.getType("[Z")))) {
+                    expected1 = newValue(Type.getType("[Z"));
+                } else {
+                    expected1 = newValue(Type.getType("[B"));
+                }
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case CALOAD:
+                expected1 = newValue(Type.getType("[C"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case SALOAD:
+                expected1 = newValue(Type.getType("[S"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case LALOAD:
+                expected1 = newValue(Type.getType("[J"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case FALOAD:
+                expected1 = newValue(Type.getType("[F"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case DALOAD:
+                expected1 = newValue(Type.getType("[D"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case AALOAD:
+                expected1 = newValue(Type.getType("[Ljava/lang/Object;"));
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case IADD:
+            case ISUB:
+            case IMUL:
+            case IDIV:
+            case IREM:
+            case ISHL:
+            case ISHR:
+            case IUSHR:
+            case IAND:
+            case IOR:
+            case IXOR:
+            case IF_ICMPEQ:
+            case IF_ICMPNE:
+            case IF_ICMPLT:
+            case IF_ICMPGE:
+            case IF_ICMPGT:
+            case IF_ICMPLE:
+                expected1 = BasicValue.INT_VALUE;
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case FADD:
+            case FSUB:
+            case FMUL:
+            case FDIV:
+            case FREM:
+            case FCMPL:
+            case FCMPG:
+                expected1 = BasicValue.FLOAT_VALUE;
+                expected2 = BasicValue.FLOAT_VALUE;
+                break;
+            case LADD:
+            case LSUB:
+            case LMUL:
+            case LDIV:
+            case LREM:
+            case LAND:
+            case LOR:
+            case LXOR:
+            case LCMP:
+                expected1 = BasicValue.LONG_VALUE;
+                expected2 = BasicValue.LONG_VALUE;
+                break;
+            case LSHL:
+            case LSHR:
+            case LUSHR:
+                expected1 = BasicValue.LONG_VALUE;
+                expected2 = BasicValue.INT_VALUE;
+                break;
+            case DADD:
+            case DSUB:
+            case DMUL:
+            case DDIV:
+            case DREM:
+            case DCMPL:
+            case DCMPG:
+                expected1 = BasicValue.DOUBLE_VALUE;
+                expected2 = BasicValue.DOUBLE_VALUE;
+                break;
+            case IF_ACMPEQ:
+            case IF_ACMPNE:
+                expected1 = BasicValue.REFERENCE_VALUE;
+                expected2 = BasicValue.REFERENCE_VALUE;
+                break;
+            case PUTFIELD:
+                FieldInsnNode fin = (FieldInsnNode) insn;
+                expected1 = newValue(Type.getObjectType(fin.owner));
+                expected2 = newValue(Type.getType(fin.desc));
+                break;
+            default:
+                throw new Error("Internal error.");
+        }
+        if (!isSubTypeOf(value1, expected1)) {
+            throw new AnalyzerException(insn, "First argument", expected1, value1);
+        } else if (!isSubTypeOf(value2, expected2)) {
+            throw new AnalyzerException(insn, "Second argument", expected2, value2);
+        }
+        if (insn.getOpcode() == AALOAD) {
+            return getElementValue(value1);
+        } else {
+            return super.binaryOperation(insn, value1, value2);
+        }
+    }
+
+    @Override
+    public BasicValue ternaryOperation(
+        final AbstractInsnNode insn,
+        final BasicValue value1,
+        final BasicValue value2,
+        final BasicValue value3) throws AnalyzerException
+    {
+        BasicValue expected1;
+        BasicValue expected3;
+        switch (insn.getOpcode()) {
+            case IASTORE:
+                expected1 = newValue(Type.getType("[I"));
+                expected3 = BasicValue.INT_VALUE;
+                break;
+            case BASTORE:
+                if (isSubTypeOf(value1, newValue(Type.getType("[Z")))) {
+                    expected1 = newValue(Type.getType("[Z"));
+                } else {
+                    expected1 = newValue(Type.getType("[B"));
+                }
+                expected3 = BasicValue.INT_VALUE;
+                break;
+            case CASTORE:
+                expected1 = newValue(Type.getType("[C"));
+                expected3 = BasicValue.INT_VALUE;
+                break;
+            case SASTORE:
+                expected1 = newValue(Type.getType("[S"));
+                expected3 = BasicValue.INT_VALUE;
+                break;
+            case LASTORE:
+                expected1 = newValue(Type.getType("[J"));
+                expected3 = BasicValue.LONG_VALUE;
+                break;
+            case FASTORE:
+                expected1 = newValue(Type.getType("[F"));
+                expected3 = BasicValue.FLOAT_VALUE;
+                break;
+            case DASTORE:
+                expected1 = newValue(Type.getType("[D"));
+                expected3 = BasicValue.DOUBLE_VALUE;
+                break;
+            case AASTORE:
+                expected1 = value1;
+                expected3 = BasicValue.REFERENCE_VALUE;
+                break;
+            default:
+                throw new Error("Internal error.");
+        }
+        if (!isSubTypeOf(value1, expected1)) {
+            throw new AnalyzerException(insn, "First argument", "a " + expected1
+                    + " array reference", value1);
+        } else if (!BasicValue.INT_VALUE.equals(value2)) {
+            throw new AnalyzerException(insn, "Second argument",
+                    BasicValue.INT_VALUE,
+                    value2);
+        } else if (!isSubTypeOf(value3, expected3)) {
+            throw new AnalyzerException(insn, "Third argument", expected3, value3);
+        }
+        return null;
+    }
+
+    @Override
+    public BasicValue naryOperation(final AbstractInsnNode insn, final List<? extends BasicValue> values)
+            throws AnalyzerException
+    {
+        int opcode = insn.getOpcode();
+        if (opcode == MULTIANEWARRAY) {
+            for (int i = 0; i < values.size(); ++i) {
+                if (!BasicValue.INT_VALUE.equals(values.get(i))) {
+                    throw new AnalyzerException(insn,
+                            null,
+                            BasicValue.INT_VALUE,
+                            values.get(i));
+                }
+            }
+        } else {
+            int i = 0;
+            int j = 0;
+            if (opcode != INVOKESTATIC && opcode != INVOKEDYNAMIC) {
+                Type owner = Type.getObjectType(((MethodInsnNode) insn).owner);
+                if (!isSubTypeOf(values.get(i++), newValue(owner))) {
+                    throw new AnalyzerException(insn, "Method owner",
+                            newValue(owner),
+                            values.get(0));
+                }
+            }
+            String desc = (opcode == INVOKEDYNAMIC)?
+                    ((InvokeDynamicInsnNode) insn).desc:
+                        ((MethodInsnNode) insn).desc;
+            Type[] args = Type.getArgumentTypes(desc);
+            while (i < values.size()) {
+                BasicValue expected = newValue(args[j++]);
+                BasicValue encountered = values.get(i++);
+                if (!isSubTypeOf(encountered, expected)) {
+                    throw new AnalyzerException(insn,
+                            "Argument " + j,
+                            expected,
+                            encountered);
+                }
+            }
+        }
+        return super.naryOperation(insn, values);
+    }
+
+    @Override
+    public void returnOperation(
+        final AbstractInsnNode insn,
+        final BasicValue value,
+        final BasicValue expected) throws AnalyzerException
+    {
+        if (!isSubTypeOf(value, expected)) {
+            throw new AnalyzerException(insn,
+                    "Incompatible return type",
+                    expected,
+                    value);
+        }
+    }
+
+    protected boolean isArrayValue(final BasicValue value) {
+        return value.isReference();
+    }
+
+    protected BasicValue getElementValue(final BasicValue objectArrayValue)
+            throws AnalyzerException
+    {
+        return BasicValue.REFERENCE_VALUE;
+    }
+
+    protected boolean isSubTypeOf(final BasicValue value, final BasicValue expected) {
+        return value.equals(expected);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Frame.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,738 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.IincInsnNode;
+import jdk.internal.org.objectweb.asm.tree.InvokeDynamicInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MultiANewArrayInsnNode;
+import jdk.internal.org.objectweb.asm.tree.VarInsnNode;
+
+/**
+ * A symbolic execution stack frame. A stack frame contains a set of local
+ * variable slots, and an operand stack. Warning: long and double values are
+ * represented by <i>two</i> slots in local variables, and by <i>one</i> slot
+ * in the operand stack.
+ *
+ * @param <V> type of the Value used for the analysis.
+ *
+ * @author Eric Bruneton
+ */
+public class Frame<V extends Value> {
+
+    /**
+     * The expected return type of the analyzed method, or <tt>null</tt> if the
+     * method returns void.
+     */
+    private V returnValue;
+
+    /**
+     * The local variables and operand stack of this frame.
+     */
+    private V[] values;
+
+    /**
+     * The number of local variables of this frame.
+     */
+    private int locals;
+
+    /**
+     * The number of elements in the operand stack.
+     */
+    private int top;
+
+    /**
+     * Constructs a new frame with the given size.
+     *
+     * @param nLocals the maximum number of local variables of the frame.
+     * @param nStack the maximum stack size of the frame.
+     */
+    public Frame(final int nLocals, final int nStack) {
+        this.values = (V[]) new Value[nLocals + nStack];
+        this.locals = nLocals;
+    }
+
+    /**
+     * Constructs a new frame that is identical to the given frame.
+     *
+     * @param src a frame.
+     */
+    public Frame(final Frame<? extends V> src) {
+        this(src.locals, src.values.length - src.locals);
+        init(src);
+    }
+
+    /**
+     * Copies the state of the given frame into this frame.
+     *
+     * @param src a frame.
+     * @return this frame.
+     */
+    public Frame<V> init(final Frame<? extends V> src) {
+        returnValue = src.returnValue;
+        System.arraycopy(src.values, 0, values, 0, values.length);
+        top = src.top;
+        return this;
+    }
+
+    /**
+     * Sets the expected return type of the analyzed method.
+     *
+     * @param v the expected return type of the analyzed method, or
+     *        <tt>null</tt> if the method returns void.
+     */
+    public void setReturn(final V v) {
+        returnValue = v;
+    }
+
+    /**
+     * Returns the maximum number of local variables of this frame.
+     *
+     * @return the maximum number of local variables of this frame.
+     */
+    public int getLocals() {
+        return locals;
+    }
+
+    /**
+     * Returns the value of the given local variable.
+     *
+     * @param i a local variable index.
+     * @return the value of the given local variable.
+     * @throws IndexOutOfBoundsException if the variable does not exist.
+     */
+    public V getLocal(final int i) throws IndexOutOfBoundsException {
+        if (i >= locals) {
+            throw new IndexOutOfBoundsException("Trying to access an inexistant local variable");
+        }
+        return values[i];
+    }
+
+    /**
+     * Sets the value of the given local variable.
+     *
+     * @param i a local variable index.
+     * @param value the new value of this local variable.
+     * @throws IndexOutOfBoundsException if the variable does not exist.
+     */
+    public void setLocal(final int i, final V value)
+            throws IndexOutOfBoundsException
+    {
+        if (i >= locals) {
+            throw new IndexOutOfBoundsException("Trying to access an inexistant local variable "+i);
+        }
+        values[i] = value;
+    }
+
+    /**
+     * Returns the number of values in the operand stack of this frame. Long and
+     * double values are treated as single values.
+     *
+     * @return the number of values in the operand stack of this frame.
+     */
+    public int getStackSize() {
+        return top;
+    }
+
+    /**
+     * Returns the value of the given operand stack slot.
+     *
+     * @param i the index of an operand stack slot.
+     * @return the value of the given operand stack slot.
+     * @throws IndexOutOfBoundsException if the operand stack slot does not
+     *         exist.
+     */
+    public V getStack(final int i) throws IndexOutOfBoundsException {
+        return values[i + locals];
+    }
+
+    /**
+     * Clears the operand stack of this frame.
+     */
+    public void clearStack() {
+        top = 0;
+    }
+
+    /**
+     * Pops a value from the operand stack of this frame.
+     *
+     * @return the value that has been popped from the stack.
+     * @throws IndexOutOfBoundsException if the operand stack is empty.
+     */
+    public V pop() throws IndexOutOfBoundsException {
+        if (top == 0) {
+            throw new IndexOutOfBoundsException("Cannot pop operand off an empty stack.");
+        }
+        return values[--top + locals];
+    }
+
+    /**
+     * Pushes a value into the operand stack of this frame.
+     *
+     * @param value the value that must be pushed into the stack.
+     * @throws IndexOutOfBoundsException if the operand stack is full.
+     */
+    public void push(final V value) throws IndexOutOfBoundsException {
+        if (top + locals >= values.length) {
+            throw new IndexOutOfBoundsException("Insufficient maximum stack size.");
+        }
+        values[top++ + locals] = value;
+    }
+
+    public void execute(
+        final AbstractInsnNode insn,
+        final Interpreter<V> interpreter) throws AnalyzerException
+    {
+        V value1, value2, value3, value4;
+        List<V> values;
+        int var;
+
+        switch (insn.getOpcode()) {
+            case Opcodes.NOP:
+                break;
+            case Opcodes.ACONST_NULL:
+            case Opcodes.ICONST_M1:
+            case Opcodes.ICONST_0:
+            case Opcodes.ICONST_1:
+            case Opcodes.ICONST_2:
+            case Opcodes.ICONST_3:
+            case Opcodes.ICONST_4:
+            case Opcodes.ICONST_5:
+            case Opcodes.LCONST_0:
+            case Opcodes.LCONST_1:
+            case Opcodes.FCONST_0:
+            case Opcodes.FCONST_1:
+            case Opcodes.FCONST_2:
+            case Opcodes.DCONST_0:
+            case Opcodes.DCONST_1:
+            case Opcodes.BIPUSH:
+            case Opcodes.SIPUSH:
+            case Opcodes.LDC:
+                push(interpreter.newOperation(insn));
+                break;
+            case Opcodes.ILOAD:
+            case Opcodes.LLOAD:
+            case Opcodes.FLOAD:
+            case Opcodes.DLOAD:
+            case Opcodes.ALOAD:
+                push(interpreter.copyOperation(insn,
+                        getLocal(((VarInsnNode) insn).var)));
+                break;
+            case Opcodes.IALOAD:
+            case Opcodes.LALOAD:
+            case Opcodes.FALOAD:
+            case Opcodes.DALOAD:
+            case Opcodes.AALOAD:
+            case Opcodes.BALOAD:
+            case Opcodes.CALOAD:
+            case Opcodes.SALOAD:
+                value2 = pop();
+                value1 = pop();
+                push(interpreter.binaryOperation(insn, value1, value2));
+                break;
+            case Opcodes.ISTORE:
+            case Opcodes.LSTORE:
+            case Opcodes.FSTORE:
+            case Opcodes.DSTORE:
+            case Opcodes.ASTORE:
+                value1 = interpreter.copyOperation(insn, pop());
+                var = ((VarInsnNode) insn).var;
+                setLocal(var, value1);
+                if (value1.getSize() == 2) {
+                    setLocal(var + 1, interpreter.newValue(null));
+                }
+                if (var > 0) {
+                    Value local = getLocal(var - 1);
+                    if (local != null && local.getSize() == 2) {
+                        setLocal(var - 1, interpreter.newValue(null));
+                    }
+                }
+                break;
+            case Opcodes.IASTORE:
+            case Opcodes.LASTORE:
+            case Opcodes.FASTORE:
+            case Opcodes.DASTORE:
+            case Opcodes.AASTORE:
+            case Opcodes.BASTORE:
+            case Opcodes.CASTORE:
+            case Opcodes.SASTORE:
+                value3 = pop();
+                value2 = pop();
+                value1 = pop();
+                interpreter.ternaryOperation(insn, value1, value2, value3);
+                break;
+            case Opcodes.POP:
+                if (pop().getSize() == 2) {
+                    throw new AnalyzerException(insn, "Illegal use of POP");
+                }
+                break;
+            case Opcodes.POP2:
+                if (pop().getSize() == 1) {
+                    if (pop().getSize() != 1) {
+                        throw new AnalyzerException(insn, "Illegal use of POP2");
+                    }
+                }
+                break;
+            case Opcodes.DUP:
+                value1 = pop();
+                if (value1.getSize() != 1) {
+                    throw new AnalyzerException(insn, "Illegal use of DUP");
+                }
+                push(value1);
+                push(interpreter.copyOperation(insn, value1));
+                break;
+            case Opcodes.DUP_X1:
+                value1 = pop();
+                value2 = pop();
+                if (value1.getSize() != 1 || value2.getSize() != 1) {
+                    throw new AnalyzerException(insn, "Illegal use of DUP_X1");
+                }
+                push(interpreter.copyOperation(insn, value1));
+                push(value2);
+                push(value1);
+                break;
+            case Opcodes.DUP_X2:
+                value1 = pop();
+                if (value1.getSize() == 1) {
+                    value2 = pop();
+                    if (value2.getSize() == 1) {
+                        value3 = pop();
+                        if (value3.getSize() == 1) {
+                            push(interpreter.copyOperation(insn, value1));
+                            push(value3);
+                            push(value2);
+                            push(value1);
+                            break;
+                        }
+                    } else {
+                        push(interpreter.copyOperation(insn, value1));
+                        push(value2);
+                        push(value1);
+                        break;
+                    }
+                }
+                throw new AnalyzerException(insn, "Illegal use of DUP_X2");
+            case Opcodes.DUP2:
+                value1 = pop();
+                if (value1.getSize() == 1) {
+                    value2 = pop();
+                    if (value2.getSize() == 1) {
+                        push(value2);
+                        push(value1);
+                        push(interpreter.copyOperation(insn, value2));
+                        push(interpreter.copyOperation(insn, value1));
+                        break;
+                    }
+                } else {
+                    push(value1);
+                    push(interpreter.copyOperation(insn, value1));
+                    break;
+                }
+                throw new AnalyzerException(insn, "Illegal use of DUP2");
+            case Opcodes.DUP2_X1:
+                value1 = pop();
+                if (value1.getSize() == 1) {
+                    value2 = pop();
+                    if (value2.getSize() == 1) {
+                        value3 = pop();
+                        if (value3.getSize() == 1) {
+                            push(interpreter.copyOperation(insn, value2));
+                            push(interpreter.copyOperation(insn, value1));
+                            push(value3);
+                            push(value2);
+                            push(value1);
+                            break;
+                        }
+                    }
+                } else {
+                    value2 = pop();
+                    if (value2.getSize() == 1) {
+                        push(interpreter.copyOperation(insn, value1));
+                        push(value2);
+                        push(value1);
+                        break;
+                    }
+                }
+                throw new AnalyzerException(insn, "Illegal use of DUP2_X1");
+            case Opcodes.DUP2_X2:
+                value1 = pop();
+                if (value1.getSize() == 1) {
+                    value2 = pop();
+                    if (value2.getSize() == 1) {
+                        value3 = pop();
+                        if (value3.getSize() == 1) {
+                            value4 = pop();
+                            if (value4.getSize() == 1) {
+                                push(interpreter.copyOperation(insn, value2));
+                                push(interpreter.copyOperation(insn, value1));
+                                push(value4);
+                                push(value3);
+                                push(value2);
+                                push(value1);
+                                break;
+                            }
+                        } else {
+                            push(interpreter.copyOperation(insn, value2));
+                            push(interpreter.copyOperation(insn, value1));
+                            push(value3);
+                            push(value2);
+                            push(value1);
+                            break;
+                        }
+                    }
+                } else {
+                    value2 = pop();
+                    if (value2.getSize() == 1) {
+                        value3 = pop();
+                        if (value3.getSize() == 1) {
+                            push(interpreter.copyOperation(insn, value1));
+                            push(value3);
+                            push(value2);
+                            push(value1);
+                            break;
+                        }
+                    } else {
+                        push(interpreter.copyOperation(insn, value1));
+                        push(value2);
+                        push(value1);
+                        break;
+                    }
+                }
+                throw new AnalyzerException(insn, "Illegal use of DUP2_X2");
+            case Opcodes.SWAP:
+                value2 = pop();
+                value1 = pop();
+                if (value1.getSize() != 1 || value2.getSize() != 1) {
+                    throw new AnalyzerException(insn, "Illegal use of SWAP");
+                }
+                push(interpreter.copyOperation(insn, value2));
+                push(interpreter.copyOperation(insn, value1));
+                break;
+            case Opcodes.IADD:
+            case Opcodes.LADD:
+            case Opcodes.FADD:
+            case Opcodes.DADD:
+            case Opcodes.ISUB:
+            case Opcodes.LSUB:
+            case Opcodes.FSUB:
+            case Opcodes.DSUB:
+            case Opcodes.IMUL:
+            case Opcodes.LMUL:
+            case Opcodes.FMUL:
+            case Opcodes.DMUL:
+            case Opcodes.IDIV:
+            case Opcodes.LDIV:
+            case Opcodes.FDIV:
+            case Opcodes.DDIV:
+            case Opcodes.IREM:
+            case Opcodes.LREM:
+            case Opcodes.FREM:
+            case Opcodes.DREM:
+                value2 = pop();
+                value1 = pop();
+                push(interpreter.binaryOperation(insn, value1, value2));
+                break;
+            case Opcodes.INEG:
+            case Opcodes.LNEG:
+            case Opcodes.FNEG:
+            case Opcodes.DNEG:
+                push(interpreter.unaryOperation(insn, pop()));
+                break;
+            case Opcodes.ISHL:
+            case Opcodes.LSHL:
+            case Opcodes.ISHR:
+            case Opcodes.LSHR:
+            case Opcodes.IUSHR:
+            case Opcodes.LUSHR:
+            case Opcodes.IAND:
+            case Opcodes.LAND:
+            case Opcodes.IOR:
+            case Opcodes.LOR:
+            case Opcodes.IXOR:
+            case Opcodes.LXOR:
+                value2 = pop();
+                value1 = pop();
+                push(interpreter.binaryOperation(insn, value1, value2));
+                break;
+            case Opcodes.IINC:
+                var = ((IincInsnNode) insn).var;
+                setLocal(var, interpreter.unaryOperation(insn, getLocal(var)));
+                break;
+            case Opcodes.I2L:
+            case Opcodes.I2F:
+            case Opcodes.I2D:
+            case Opcodes.L2I:
+            case Opcodes.L2F:
+            case Opcodes.L2D:
+            case Opcodes.F2I:
+            case Opcodes.F2L:
+            case Opcodes.F2D:
+            case Opcodes.D2I:
+            case Opcodes.D2L:
+            case Opcodes.D2F:
+            case Opcodes.I2B:
+            case Opcodes.I2C:
+            case Opcodes.I2S:
+                push(interpreter.unaryOperation(insn, pop()));
+                break;
+            case Opcodes.LCMP:
+            case Opcodes.FCMPL:
+            case Opcodes.FCMPG:
+            case Opcodes.DCMPL:
+            case Opcodes.DCMPG:
+                value2 = pop();
+                value1 = pop();
+                push(interpreter.binaryOperation(insn, value1, value2));
+                break;
+            case Opcodes.IFEQ:
+            case Opcodes.IFNE:
+            case Opcodes.IFLT:
+            case Opcodes.IFGE:
+            case Opcodes.IFGT:
+            case Opcodes.IFLE:
+                interpreter.unaryOperation(insn, pop());
+                break;
+            case Opcodes.IF_ICMPEQ:
+            case Opcodes.IF_ICMPNE:
+            case Opcodes.IF_ICMPLT:
+            case Opcodes.IF_ICMPGE:
+            case Opcodes.IF_ICMPGT:
+            case Opcodes.IF_ICMPLE:
+            case Opcodes.IF_ACMPEQ:
+            case Opcodes.IF_ACMPNE:
+                value2 = pop();
+                value1 = pop();
+                interpreter.binaryOperation(insn, value1, value2);
+                break;
+            case Opcodes.GOTO:
+                break;
+            case Opcodes.JSR:
+                push(interpreter.newOperation(insn));
+                break;
+            case Opcodes.RET:
+                break;
+            case Opcodes.TABLESWITCH:
+            case Opcodes.LOOKUPSWITCH:
+                interpreter.unaryOperation(insn, pop());
+                break;
+            case Opcodes.IRETURN:
+            case Opcodes.LRETURN:
+            case Opcodes.FRETURN:
+            case Opcodes.DRETURN:
+            case Opcodes.ARETURN:
+                value1 = pop();
+                interpreter.unaryOperation(insn, value1);
+                interpreter.returnOperation(insn, value1, returnValue);
+                break;
+            case Opcodes.RETURN:
+                if (returnValue != null) {
+                    throw new AnalyzerException(insn, "Incompatible return type");
+                }
+                break;
+            case Opcodes.GETSTATIC:
+                push(interpreter.newOperation(insn));
+                break;
+            case Opcodes.PUTSTATIC:
+                interpreter.unaryOperation(insn, pop());
+                break;
+            case Opcodes.GETFIELD:
+                push(interpreter.unaryOperation(insn, pop()));
+                break;
+            case Opcodes.PUTFIELD:
+                value2 = pop();
+                value1 = pop();
+                interpreter.binaryOperation(insn, value1, value2);
+                break;
+            case Opcodes.INVOKEVIRTUAL:
+            case Opcodes.INVOKESPECIAL:
+            case Opcodes.INVOKESTATIC:
+            case Opcodes.INVOKEINTERFACE: {
+                values = new ArrayList<V>();
+                String desc = ((MethodInsnNode) insn).desc;
+                for (int i = Type.getArgumentTypes(desc).length; i > 0; --i) {
+                    values.add(0, pop());
+                }
+                if (insn.getOpcode() != Opcodes.INVOKESTATIC) {
+                    values.add(0, pop());
+                }
+                if (Type.getReturnType(desc) == Type.VOID_TYPE) {
+                    interpreter.naryOperation(insn, values);
+                } else {
+                    push(interpreter.naryOperation(insn, values));
+                }
+                break;
+            }
+            case Opcodes.INVOKEDYNAMIC: {
+                values = new ArrayList<V>();
+                String desc = ((InvokeDynamicInsnNode) insn).desc;
+                for (int i = Type.getArgumentTypes(desc).length; i > 0; --i) {
+                    values.add(0, pop());
+                }
+                if (Type.getReturnType(desc) == Type.VOID_TYPE) {
+                    interpreter.naryOperation(insn, values);
+                } else {
+                    push(interpreter.naryOperation(insn, values));
+                }
+                break;
+            }
+            case Opcodes.NEW:
+                push(interpreter.newOperation(insn));
+                break;
+            case Opcodes.NEWARRAY:
+            case Opcodes.ANEWARRAY:
+            case Opcodes.ARRAYLENGTH:
+                push(interpreter.unaryOperation(insn, pop()));
+                break;
+            case Opcodes.ATHROW:
+                interpreter.unaryOperation(insn, pop());
+                break;
+            case Opcodes.CHECKCAST:
+            case Opcodes.INSTANCEOF:
+                push(interpreter.unaryOperation(insn, pop()));
+                break;
+            case Opcodes.MONITORENTER:
+            case Opcodes.MONITOREXIT:
+                interpreter.unaryOperation(insn, pop());
+                break;
+            case Opcodes.MULTIANEWARRAY:
+                values = new ArrayList<V>();
+                for (int i = ((MultiANewArrayInsnNode) insn).dims; i > 0; --i) {
+                    values.add(0, pop());
+                }
+                push(interpreter.naryOperation(insn, values));
+                break;
+            case Opcodes.IFNULL:
+            case Opcodes.IFNONNULL:
+                interpreter.unaryOperation(insn, pop());
+                break;
+            default:
+                throw new RuntimeException("Illegal opcode "+insn.getOpcode());
+        }
+    }
+
+    /**
+     * Merges this frame with the given frame.
+     *
+     * @param frame a frame.
+     * @param interpreter the interpreter used to merge values.
+     * @return <tt>true</tt> if this frame has been changed as a result of the
+     *         merge operation, or <tt>false</tt> otherwise.
+     * @throws AnalyzerException if the frames have incompatible sizes.
+     */
+    public boolean merge(final Frame<? extends V> frame, final Interpreter<V> interpreter)
+            throws AnalyzerException
+    {
+        if (top != frame.top) {
+            throw new AnalyzerException(null, "Incompatible stack heights");
+        }
+        boolean changes = false;
+        for (int i = 0; i < locals + top; ++i) {
+            V v = interpreter.merge(values[i], frame.values[i]);
+            if (v != values[i]) {
+                values[i] = v;
+                changes |= true;
+            }
+        }
+        return changes;
+    }
+
+    /**
+     * Merges this frame with the given frame (case of a RET instruction).
+     *
+     * @param frame a frame
+     * @param access the local variables that have been accessed by the
+     *        subroutine to which the RET instruction corresponds.
+     * @return <tt>true</tt> if this frame has been changed as a result of the
+     *         merge operation, or <tt>false</tt> otherwise.
+     */
+    public boolean merge(final Frame<? extends V> frame, final boolean[] access) {
+        boolean changes = false;
+        for (int i = 0; i < locals; ++i) {
+            if (!access[i] && !values[i].equals(frame.values[i])) {
+                values[i] = frame.values[i];
+                changes = true;
+            }
+        }
+        return changes;
+    }
+
+    /**
+     * Returns a string representation of this frame.
+     *
+     * @return a string representation of this frame.
+     */
+    @Override
+    public String toString() {
+        StringBuffer b = new StringBuffer();
+        for (int i = 0; i < getLocals(); ++i) {
+            b.append(getLocal(i));
+        }
+        b.append(' ');
+        for (int i = 0; i < getStackSize(); ++i) {
+            b.append(getStack(i).toString());
+        }
+        return b.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Interpreter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,233 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+
+/**
+ * A semantic bytecode interpreter. More precisely, this interpreter only
+ * manages the computation of values from other values: it does not manage the
+ * transfer of values to or from the stack, and to or from the local variables.
+ * This separation allows a generic bytecode {@link Analyzer} to work with
+ * various semantic interpreters, without needing to duplicate the code to
+ * simulate the transfer of values.
+ *
+ * @param <V> type of the Value used for the analysis.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class Interpreter<V extends Value> {
+
+    protected final int api;
+
+    protected Interpreter(final int api) {
+        this.api = api;
+    }
+
+    /**
+     * Creates a new value that represents the given type.
+     *
+     * Called for method parameters (including <code>this</code>),
+     * exception handler variable and with <code>null</code> type
+     * for variables reserved by long and double types.
+     *
+     * @param type a primitive or reference type, or <tt>null</tt> to
+     *        represent an uninitialized value.
+     * @return a value that represents the given type. The size of the returned
+     *         value must be equal to the size of the given type.
+     */
+    public abstract V newValue(Type type);
+
+    /**
+     * Interprets a bytecode instruction without arguments. This method is
+     * called for the following opcodes:
+     *
+     * ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4,
+     * ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0,
+     * DCONST_1, BIPUSH, SIPUSH, LDC, JSR, GETSTATIC, NEW
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @return the result of the interpretation of the given instruction.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract V newOperation(AbstractInsnNode insn)
+            throws AnalyzerException;
+
+    /**
+     * Interprets a bytecode instruction that moves a value on the stack or to
+     * or from local variables. This method is called for the following opcodes:
+     *
+     * ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE,
+     * ASTORE, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @param value the value that must be moved by the instruction.
+     * @return the result of the interpretation of the given instruction. The
+     *         returned value must be <tt>equal</tt> to the given value.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract V copyOperation(AbstractInsnNode insn, V value)
+            throws AnalyzerException;
+
+    /**
+     * Interprets a bytecode instruction with a single argument. This method is
+     * called for the following opcodes:
+     *
+     * INEG, LNEG, FNEG, DNEG, IINC, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L,
+     * F2D, D2I, D2L, D2F, I2B, I2C, I2S, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE,
+     * TABLESWITCH, LOOKUPSWITCH, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN,
+     * PUTSTATIC, GETFIELD, NEWARRAY, ANEWARRAY, ARRAYLENGTH, ATHROW, CHECKCAST,
+     * INSTANCEOF, MONITORENTER, MONITOREXIT, IFNULL, IFNONNULL
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @param value the argument of the instruction to be interpreted.
+     * @return the result of the interpretation of the given instruction.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract V unaryOperation(AbstractInsnNode insn, V value)
+            throws AnalyzerException;
+
+    /**
+     * Interprets a bytecode instruction with two arguments. This method is
+     * called for the following opcodes:
+     *
+     * IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IADD,
+     * LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV,
+     * LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, ISHL, LSHL, ISHR, LSHR, IUSHR,
+     * LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, LCMP, FCMPL, FCMPG, DCMPL,
+     * DCMPG, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE,
+     * IF_ACMPEQ, IF_ACMPNE, PUTFIELD
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @param value1 the first argument of the instruction to be interpreted.
+     * @param value2 the second argument of the instruction to be interpreted.
+     * @return the result of the interpretation of the given instruction.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract V binaryOperation(AbstractInsnNode insn, V value1, V value2)
+            throws AnalyzerException;
+
+    /**
+     * Interprets a bytecode instruction with three arguments. This method is
+     * called for the following opcodes:
+     *
+     * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @param value1 the first argument of the instruction to be interpreted.
+     * @param value2 the second argument of the instruction to be interpreted.
+     * @param value3 the third argument of the instruction to be interpreted.
+     * @return the result of the interpretation of the given instruction.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract V ternaryOperation(
+        AbstractInsnNode insn,
+        V value1,
+        V value2,
+        V value3) throws AnalyzerException;
+
+    /**
+     * Interprets a bytecode instruction with a variable number of arguments.
+     * This method is called for the following opcodes:
+     *
+     * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC, INVOKEINTERFACE,
+     * MULTIANEWARRAY and INVOKEDYNAMIC
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @param values the arguments of the instruction to be interpreted.
+     * @return the result of the interpretation of the given instruction.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract V naryOperation(
+        AbstractInsnNode insn,
+        List< ? extends V> values) throws AnalyzerException;
+
+    /**
+     * Interprets a bytecode return instruction. This method is called for the
+     * following opcodes:
+     *
+     * IRETURN, LRETURN, FRETURN, DRETURN, ARETURN
+     *
+     * @param insn the bytecode instruction to be interpreted.
+     * @param value the argument of the instruction to be interpreted.
+     * @param expected the expected return type of the analyzed method.
+     * @throws AnalyzerException if an error occured during the interpretation.
+     */
+    public abstract void returnOperation(
+        AbstractInsnNode insn,
+        V value,
+        V expected) throws AnalyzerException;
+
+    /**
+     * Merges two values. The merge operation must return a value that
+     * represents both values (for instance, if the two values are two types,
+     * the merged value must be a common super type of the two types. If the two
+     * values are integer intervals, the merged value must be an interval that
+     * contains the previous ones. Likewise for other types of values).
+     *
+     * @param v a value.
+     * @param w another value.
+     * @return the merged value. If the merged value is equal to <tt>v</tt>,
+     *         this method <i>must</i> return <tt>v</tt>.
+     */
+    public abstract V merge(V v, V w);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/SimpleVerifier.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,358 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * An extended {@link BasicVerifier} that performs more precise verifications.
+ * This verifier computes exact class types, instead of using a single "object
+ * reference" type (as done in the {@link BasicVerifier}).
+ *
+ * @author Eric Bruneton
+ * @author Bing Ran
+ */
+public class SimpleVerifier extends BasicVerifier {
+
+    /**
+     * The class that is verified.
+     */
+    private final Type currentClass;
+
+    /**
+     * The super class of the class that is verified.
+     */
+    private final Type currentSuperClass;
+
+    /**
+     * The interfaces implemented by the class that is verified.
+     */
+    private final List<Type> currentClassInterfaces;
+
+    /**
+     * If the class that is verified is an interface.
+     */
+    private final boolean isInterface;
+
+    /**
+     * The loader to use for referenced classes.
+     */
+    private ClassLoader loader = getClass().getClassLoader();
+
+    /**
+     * Constructs a new {@link SimpleVerifier}.
+     */
+    public SimpleVerifier() {
+        this(null, null, false);
+    }
+
+    /**
+     * Constructs a new {@link SimpleVerifier} to verify a specific class. This
+     * class will not be loaded into the JVM since it may be incorrect.
+     *
+     * @param currentClass the class that is verified.
+     * @param currentSuperClass the super class of the class that is verified.
+     * @param isInterface if the class that is verified is an interface.
+     */
+    public SimpleVerifier(
+        final Type currentClass,
+        final Type currentSuperClass,
+        final boolean isInterface)
+    {
+        this(currentClass, currentSuperClass, null, isInterface);
+    }
+
+    /**
+     * Constructs a new {@link SimpleVerifier} to verify a specific class. This
+     * class will not be loaded into the JVM since it may be incorrect.
+     *
+     * @param currentClass the class that is verified.
+     * @param currentSuperClass the super class of the class that is verified.
+     * @param currentClassInterfaces the interfaces implemented by the class
+     *        that is verified.
+     * @param isInterface if the class that is verified is an interface.
+     */
+    public SimpleVerifier(
+        final Type currentClass,
+        final Type currentSuperClass,
+        final List<Type> currentClassInterfaces,
+        final boolean isInterface)
+    {
+        this(ASM4,
+                currentClass,
+                currentSuperClass,
+                currentClassInterfaces,
+                isInterface);
+    }
+
+    protected SimpleVerifier(
+        final int api,
+        final Type currentClass,
+        final Type currentSuperClass,
+        final List<Type> currentClassInterfaces,
+        final boolean isInterface)
+    {
+        super(api);
+        this.currentClass = currentClass;
+        this.currentSuperClass = currentSuperClass;
+        this.currentClassInterfaces = currentClassInterfaces;
+        this.isInterface = isInterface;
+    }
+
+    /**
+     * Set the <code>ClassLoader</code> which will be used to load referenced
+     * classes. This is useful if you are verifying multiple interdependent
+     * classes.
+     *
+     * @param loader a <code>ClassLoader</code> to use
+     */
+    public void setClassLoader(final ClassLoader loader) {
+        this.loader = loader;
+    }
+
+    @Override
+    public BasicValue newValue(final Type type) {
+        if (type == null) {
+            return BasicValue.UNINITIALIZED_VALUE;
+        }
+
+        boolean isArray = type.getSort() == Type.ARRAY;
+        if (isArray) {
+            switch (type.getElementType().getSort()) {
+                case Type.BOOLEAN:
+                case Type.CHAR:
+                case Type.BYTE:
+                case Type.SHORT:
+                    return new BasicValue(type);
+            }
+        }
+
+        BasicValue v = super.newValue(type);
+        if (BasicValue.REFERENCE_VALUE.equals(v)) {
+            if (isArray) {
+                v = newValue(type.getElementType());
+                String desc = v.getType().getDescriptor();
+                for (int i = 0; i < type.getDimensions(); ++i) {
+                    desc = '[' + desc;
+                }
+                v = new BasicValue(Type.getType(desc));
+            } else {
+                v = new BasicValue(type);
+            }
+        }
+        return v;
+    }
+
+    @Override
+    protected boolean isArrayValue(final BasicValue value) {
+        Type t = value.getType();
+        return t != null
+                && ("Lnull;".equals(t.getDescriptor()) || t.getSort() == Type.ARRAY);
+    }
+
+    @Override
+    protected BasicValue getElementValue(final BasicValue objectArrayValue)
+            throws AnalyzerException
+    {
+        Type arrayType = objectArrayValue.getType();
+        if (arrayType != null) {
+            if (arrayType.getSort() == Type.ARRAY) {
+                return newValue(Type.getType(arrayType.getDescriptor()
+                        .substring(1)));
+            } else if ("Lnull;".equals(arrayType.getDescriptor())) {
+                return objectArrayValue;
+            }
+        }
+        throw new Error("Internal error");
+    }
+
+    @Override
+    protected boolean isSubTypeOf(final BasicValue value, final BasicValue expected) {
+        Type expectedType = expected.getType();
+        Type type = value.getType();
+        switch (expectedType.getSort()) {
+            case Type.INT:
+            case Type.FLOAT:
+            case Type.LONG:
+            case Type.DOUBLE:
+                return type.equals(expectedType);
+            case Type.ARRAY:
+            case Type.OBJECT:
+                if ("Lnull;".equals(type.getDescriptor())) {
+                    return true;
+                } else if (type.getSort() == Type.OBJECT
+                        || type.getSort() == Type.ARRAY)
+                {
+                    return isAssignableFrom(expectedType, type);
+                } else {
+                    return false;
+                }
+            default:
+                throw new Error("Internal error");
+        }
+    }
+
+    @Override
+    public BasicValue merge(final BasicValue v, final BasicValue w) {
+        if (!v.equals(w)) {
+            Type t = v.getType();
+            Type u = w.getType();
+            if (t != null
+                    && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY))
+            {
+                if (u != null
+                        && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY))
+                {
+                    if ("Lnull;".equals(t.getDescriptor())) {
+                        return w;
+                    }
+                    if ("Lnull;".equals(u.getDescriptor())) {
+                        return v;
+                    }
+                    if (isAssignableFrom(t, u)) {
+                        return v;
+                    }
+                    if (isAssignableFrom(u, t)) {
+                        return w;
+                    }
+                    // TODO case of array classes of the same dimension
+                    // TODO should we look also for a common super interface?
+                    // problem: there may be several possible common super
+                    // interfaces
+                    do {
+                        if (t == null || isInterface(t)) {
+                            return BasicValue.REFERENCE_VALUE;
+                        }
+                        t = getSuperClass(t);
+                        if (isAssignableFrom(t, u)) {
+                            return newValue(t);
+                        }
+                    } while (true);
+                }
+            }
+            return BasicValue.UNINITIALIZED_VALUE;
+        }
+        return v;
+    }
+
+    protected boolean isInterface(final Type t) {
+        if (currentClass != null && t.equals(currentClass)) {
+            return isInterface;
+        }
+        return getClass(t).isInterface();
+    }
+
+    protected Type getSuperClass(final Type t) {
+        if (currentClass != null && t.equals(currentClass)) {
+            return currentSuperClass;
+        }
+        Class<?> c = getClass(t).getSuperclass();
+        return c == null ? null : Type.getType(c);
+    }
+
+    protected boolean isAssignableFrom(final Type t, final Type u) {
+        if (t.equals(u)) {
+            return true;
+        }
+        if (currentClass != null && t.equals(currentClass)) {
+            if (getSuperClass(u) == null) {
+                return false;
+            } else {
+                if (isInterface) {
+                    return u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY;
+                }
+                return isAssignableFrom(t, getSuperClass(u));
+            }
+        }
+        if (currentClass != null && u.equals(currentClass)) {
+            if (isAssignableFrom(t, currentSuperClass)) {
+                return true;
+            }
+            if (currentClassInterfaces != null) {
+                for (int i = 0; i < currentClassInterfaces.size(); ++i) {
+                    Type v = currentClassInterfaces.get(i);
+                    if (isAssignableFrom(t, v)) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+        Class<?> tc = getClass(t);
+        if (tc.isInterface()) {
+            tc = Object.class;
+        }
+        return tc.isAssignableFrom(getClass(u));
+    }
+
+    protected Class<?> getClass(final Type t) {
+        try {
+            if (t.getSort() == Type.ARRAY) {
+                return Class.forName(t.getDescriptor().replace('/', '.'),
+                        false,
+                        loader);
+            }
+            return Class.forName(t.getClassName(), false, loader);
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException(e.toString());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/SmallSet.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,163 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.AbstractSet;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+/**
+ * A set of at most two elements.
+ *
+ * @author Eric Bruneton
+ */
+class SmallSet<E> extends AbstractSet<E> implements Iterator<E> {
+
+    // if e1 is null, e2 must be null; otherwise e2 must be different from e1
+
+    E e1, e2;
+
+    static final <T> Set<T> emptySet() {
+        return new SmallSet<T>(null, null);
+    }
+
+    SmallSet(final E e1, final E e2) {
+        this.e1 = e1;
+        this.e2 = e2;
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation of inherited abstract methods
+    // -------------------------------------------------------------------------
+
+    @Override
+    public Iterator<E> iterator() {
+        return new SmallSet<E>(e1, e2);
+    }
+
+    @Override
+    public int size() {
+        return e1 == null ? 0 : (e2 == null ? 1 : 2);
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation of the Iterator interface
+    // -------------------------------------------------------------------------
+
+    public boolean hasNext() {
+        return e1 != null;
+    }
+
+    public E next() {
+        if (e1 == null) {
+            throw new NoSuchElementException();
+        }
+        E e = e1;
+        e1 = e2;
+        e2 = null;
+        return e;
+    }
+
+    public void remove() {
+    }
+
+    // -------------------------------------------------------------------------
+    // Utility methods
+    // -------------------------------------------------------------------------
+
+    Set<E> union(final SmallSet<E> s) {
+        if ((s.e1 == e1 && s.e2 == e2) || (s.e1 == e2 && s.e2 == e1)) {
+            return this; // if the two sets are equal, return this
+        }
+        if (s.e1 == null) {
+            return this; // if s is empty, return this
+        }
+        if (e1 == null) {
+            return s; // if this is empty, return s
+        }
+        if (s.e2 == null) { // s contains exactly one element
+            if (e2 == null) {
+                return new SmallSet<E>(e1, s.e1); // necessarily e1 != s.e1
+            } else if (s.e1 == e1 || s.e1 == e2) { // s is included in this
+                return this;
+            }
+        }
+        if (e2 == null) { // this contains exactly one element
+            // if (s.e2 == null) { // cannot happen
+            // return new SmallSet(e1, s.e1); // necessarily e1 != s.e1
+            // } else
+            if (e1 == s.e1 || e1 == s.e2) { // this in included in s
+                return s;
+            }
+        }
+        // here we know that there are at least 3 distinct elements
+        HashSet<E> r = new HashSet<E>(4);
+        r.add(e1);
+        if (e2 != null) {
+            r.add(e2);
+        }
+        r.add(s.e1);
+        if (s.e2 != null) {
+            r.add(s.e2);
+        }
+        return r;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/SourceInterpreter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,235 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.FieldInsnNode;
+import jdk.internal.org.objectweb.asm.tree.InvokeDynamicInsnNode;
+import jdk.internal.org.objectweb.asm.tree.LdcInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
+
+/**
+ * An {@link Interpreter} for {@link SourceValue} values.
+ *
+ * @author Eric Bruneton
+ */
+public class SourceInterpreter extends Interpreter<SourceValue> implements
+        Opcodes
+{
+
+    public SourceInterpreter() {
+        super(ASM4);
+    }
+
+    protected SourceInterpreter(final int api) {
+        super(api);
+    }
+
+    @Override
+    public SourceValue newValue(final Type type) {
+        if (type == Type.VOID_TYPE) {
+            return null;
+        }
+        return new SourceValue(type == null ? 1 : type.getSize());
+    }
+
+    @Override
+    public SourceValue newOperation(final AbstractInsnNode insn) {
+        int size;
+        switch (insn.getOpcode()) {
+            case LCONST_0:
+            case LCONST_1:
+            case DCONST_0:
+            case DCONST_1:
+                size = 2;
+                break;
+            case LDC:
+                Object cst = ((LdcInsnNode) insn).cst;
+                size = cst instanceof Long || cst instanceof Double ? 2 : 1;
+                break;
+            case GETSTATIC:
+                size = Type.getType(((FieldInsnNode) insn).desc).getSize();
+                break;
+            default:
+                size = 1;
+        }
+        return new SourceValue(size, insn);
+    }
+
+    @Override
+    public SourceValue copyOperation(final AbstractInsnNode insn, final SourceValue value) {
+        return new SourceValue(value.getSize(), insn);
+    }
+
+    @Override
+    public SourceValue unaryOperation(final AbstractInsnNode insn, final SourceValue value)
+    {
+        int size;
+        switch (insn.getOpcode()) {
+            case LNEG:
+            case DNEG:
+            case I2L:
+            case I2D:
+            case L2D:
+            case F2L:
+            case F2D:
+            case D2L:
+                size = 2;
+                break;
+            case GETFIELD:
+                size = Type.getType(((FieldInsnNode) insn).desc).getSize();
+                break;
+            default:
+                size = 1;
+        }
+        return new SourceValue(size, insn);
+    }
+
+    @Override
+    public SourceValue binaryOperation(
+        final AbstractInsnNode insn,
+        final SourceValue value1,
+        final SourceValue value2)
+    {
+        int size;
+        switch (insn.getOpcode()) {
+            case LALOAD:
+            case DALOAD:
+            case LADD:
+            case DADD:
+            case LSUB:
+            case DSUB:
+            case LMUL:
+            case DMUL:
+            case LDIV:
+            case DDIV:
+            case LREM:
+            case DREM:
+            case LSHL:
+            case LSHR:
+            case LUSHR:
+            case LAND:
+            case LOR:
+            case LXOR:
+                size = 2;
+                break;
+            default:
+                size = 1;
+        }
+        return new SourceValue(size, insn);
+    }
+
+    @Override
+    public SourceValue ternaryOperation(
+        final AbstractInsnNode insn,
+        final SourceValue value1,
+        final SourceValue value2,
+        final SourceValue value3)
+    {
+        return new SourceValue(1, insn);
+    }
+
+    @Override
+    public SourceValue naryOperation(final AbstractInsnNode insn, final List<? extends SourceValue> values) {
+        int size;
+        int opcode = insn.getOpcode();
+        if (opcode == MULTIANEWARRAY) {
+            size = 1;
+        } else {
+            String desc = (opcode == INVOKEDYNAMIC)?
+                    ((InvokeDynamicInsnNode) insn).desc:
+                    ((MethodInsnNode) insn).desc;
+            size = Type.getReturnType(desc).getSize();
+        }
+        return new SourceValue(size, insn);
+    }
+
+    @Override
+    public void returnOperation(
+        final AbstractInsnNode insn,
+        final SourceValue value,
+        final SourceValue expected)
+    {
+    }
+
+    @Override
+    public SourceValue merge(final SourceValue d, final SourceValue w) {
+        if (d.insns instanceof SmallSet && w.insns instanceof SmallSet) {
+            Set<AbstractInsnNode> s = ((SmallSet<AbstractInsnNode>) d.insns).union((SmallSet<AbstractInsnNode>) w.insns);
+            if (s == d.insns && d.size == w.size) {
+                return d;
+            } else {
+                return new SourceValue(Math.min(d.size, w.size), s);
+            }
+        }
+        if (d.size != w.size || !d.insns.containsAll(w.insns)) {
+            HashSet<AbstractInsnNode> s = new HashSet<AbstractInsnNode>();
+            s.addAll(d.insns);
+            s.addAll(w.insns);
+            return new SourceValue(Math.min(d.size, w.size), s);
+        }
+        return d;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/SourceValue.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,126 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.Set;
+
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+
+/**
+ * A {@link Value} that is represented by its type in a two types type system.
+ * This type system distinguishes the ONEWORD and TWOWORDS types.
+ *
+ * @author Eric Bruneton
+ */
+public class SourceValue implements Value {
+
+    /**
+     * The size of this value.
+     */
+    public final int size;
+
+    /**
+     * The instructions that can produce this value. For example, for the Java
+     * code below, the instructions that can produce the value of <tt>i</tt>
+     * at line 5 are the txo ISTORE instructions at line 1 and 3:
+     *
+     * <pre>
+     * 1: i = 0;
+     * 2: if (...) {
+     * 3:   i = 1;
+     * 4: }
+     * 5: return i;
+     * </pre>
+     *
+     * This field is a set of {@link AbstractInsnNode} objects.
+     */
+    public final Set<AbstractInsnNode> insns;
+
+    public SourceValue(final int size) {
+        this(size, SmallSet.<AbstractInsnNode>emptySet());
+    }
+
+    public SourceValue(final int size, final AbstractInsnNode insn) {
+        this.size = size;
+        this.insns = new SmallSet<AbstractInsnNode>(insn, null);
+    }
+
+    public SourceValue(final int size, final Set<AbstractInsnNode> insns) {
+        this.size = size;
+        this.insns = insns;
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    @Override
+    public boolean equals(final Object value) {
+        if (!(value instanceof SourceValue)) {
+            return false;
+        }
+        SourceValue v = (SourceValue) value;
+        return size == v.size && insns.equals(v.insns);
+    }
+
+    @Override
+    public int hashCode() {
+        return insns.hashCode();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Subroutine.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,122 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.tree.JumpInsnNode;
+import jdk.internal.org.objectweb.asm.tree.LabelNode;
+
+/**
+ * A method subroutine (corresponds to a JSR instruction).
+ *
+ * @author Eric Bruneton
+ */
+class Subroutine {
+
+    LabelNode start;
+
+    boolean[] access;
+
+    List<JumpInsnNode> callers;
+
+    private Subroutine() {
+    }
+
+    Subroutine(
+        final LabelNode start,
+        final int maxLocals,
+        final JumpInsnNode caller)
+    {
+        this.start = start;
+        this.access = new boolean[maxLocals];
+        this.callers = new ArrayList<JumpInsnNode>();
+        callers.add(caller);
+    }
+
+    public Subroutine copy() {
+        Subroutine result = new Subroutine();
+        result.start = start;
+        result.access = new boolean[access.length];
+        System.arraycopy(access, 0, result.access, 0, access.length);
+        result.callers = new ArrayList<JumpInsnNode>(callers);
+        return result;
+    }
+
+    public boolean merge(final Subroutine subroutine) throws AnalyzerException {
+        boolean changes = false;
+        for (int i = 0; i < access.length; ++i) {
+            if (subroutine.access[i] && !access[i]) {
+                access[i] = true;
+                changes = true;
+            }
+        }
+        if (subroutine.start == start) {
+            for (int i = 0; i < subroutine.callers.size(); ++i) {
+                JumpInsnNode caller = subroutine.callers.get(i);
+                if (!callers.contains(caller)) {
+                    callers.add(caller);
+                    changes = true;
+                }
+            }
+        }
+        return changes;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/tree/analysis/Value.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,74 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.tree.analysis;
+
+/**
+ * An immutable symbolic value for semantic interpretation of bytecode.
+ *
+ * @author Eric Bruneton
+ */
+public interface Value {
+
+    /**
+     * Returns the size of this value in words.
+     *
+     * @return either 1 or 2.
+     */
+    int getSize();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/ASMifiable.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,82 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Label;
+
+/**
+ * An {@link jdk.internal.org.objectweb.asm.Attribute Attribute} that can print the ASM code
+ * to create an equivalent attribute.
+ *
+ * @author Eugene Kuleshov
+ */
+public interface ASMifiable {
+
+    /**
+     * Prints the ASM code to create an attribute equal to this attribute.
+     *
+     * @param buf a buffer used for printing Java code.
+     * @param varName name of the variable in a printed code used to store
+     *        attribute instance.
+     * @param labelNames map of label instances to their names.
+     */
+    void asmify(StringBuffer buf, String varName, Map<Label, String> labelNames);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/ASMifier.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1268 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * A {@link Printer} that prints the ASM code to generate the classes if visits.
+ *
+ * @author Eric Bruneton
+ */
+public class ASMifier extends Printer {
+
+    /**
+     * The name of the visitor variable in the produced code.
+     */
+    protected final String name;
+
+    /**
+     * Identifier of the annotation visitor variable in the produced code.
+     */
+    protected final int id;
+
+    /**
+     * The label names. This map associates String values to Label keys. It is
+     * used only in ASMifierMethodVisitor.
+     */
+    protected Map<Label, String> labelNames;
+
+    /**
+     * Pseudo access flag used to distinguish class access flags.
+     */
+    private static final int ACCESS_CLASS = 262144;
+
+    /**
+     * Pseudo access flag used to distinguish field access flags.
+     */
+    private static final int ACCESS_FIELD = 524288;
+
+    /**
+     * Pseudo access flag used to distinguish inner class flags.
+     */
+    private static final int ACCESS_INNER = 1048576;
+
+    /**
+     * Constructs a new {@link ASMifier}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the
+     * {@link #ASMifier(int, String, int)} version.
+     */
+    public ASMifier() {
+        this(Opcodes.ASM4, "cw", 0);
+    }
+
+    /**
+     * Constructs a new {@link ASMifier}.
+     *
+     * @param api the ASM API version implemented by this class. Must be one of
+     *        {@link Opcodes#ASM4}.
+     * @param name the name of the visitor variable in the produced code.
+     * @param id identifier of the annotation visitor variable in the produced
+     *        code.
+     */
+    protected ASMifier(final int api, final String name, final int id) {
+        super(api);
+        this.name = name;
+        this.id = id;
+    }
+
+    /**
+     * Prints the ASM source code to generate the given class to the standard
+     * output. <p> Usage: ASMifier [-debug] &lt;binary
+     * class name or class file name&gt;
+     *
+     * @param args the command line arguments.
+     *
+     * @throws Exception if the class cannot be found, or if an IO exception
+     *         occurs.
+     */
+    public static void main(final String[] args) throws Exception {
+        int i = 0;
+        int flags = ClassReader.SKIP_DEBUG;
+
+        boolean ok = true;
+        if (args.length < 1 || args.length > 2) {
+            ok = false;
+        }
+        if (ok && "-debug".equals(args[0])) {
+            i = 1;
+            flags = 0;
+            if (args.length != 2) {
+                ok = false;
+            }
+        }
+        if (!ok) {
+            System.err.println("Prints the ASM code to generate the given class.");
+            System.err.println("Usage: ASMifier [-debug] "
+                    + "<fully qualified class name or class file name>");
+            return;
+        }
+        ClassReader cr;
+        if (args[i].endsWith(".class") || args[i].indexOf('\\') > -1
+                || args[i].indexOf('/') > -1)
+        {
+            cr = new ClassReader(new FileInputStream(args[i]));
+        } else {
+            cr = new ClassReader(args[i]);
+        }
+        cr.accept(new TraceClassVisitor(null,
+                new ASMifier(),
+                new PrintWriter(System.out)), flags);
+    }
+
+    // ------------------------------------------------------------------------
+    // Classes
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        String simpleName;
+        int n = name.lastIndexOf('/');
+        if (n == -1) {
+            simpleName = name;
+        } else {
+            text.add("package asm." + name.substring(0, n).replace('/', '.')
+                    + ";\n");
+            simpleName = name.substring(n + 1);
+        }
+        text.add("import java.util.*;\n");
+        text.add("import jdk.internal.org.objectweb.asm.*;\n");
+        text.add("import jdk.internal.org.objectweb.asm.attrs.*;\n");
+        text.add("public class " + simpleName + "Dump implements Opcodes {\n\n");
+        text.add("public static byte[] dump () throws Exception {\n\n");
+        text.add("ClassWriter cw = new ClassWriter(0);\n");
+        text.add("FieldVisitor fv;\n");
+        text.add("MethodVisitor mv;\n");
+        text.add("AnnotationVisitor av0;\n\n");
+
+        buf.setLength(0);
+        buf.append("cw.visit(");
+        switch (version) {
+            case Opcodes.V1_1:
+                buf.append("V1_1");
+                break;
+            case Opcodes.V1_2:
+                buf.append("V1_2");
+                break;
+            case Opcodes.V1_3:
+                buf.append("V1_3");
+                break;
+            case Opcodes.V1_4:
+                buf.append("V1_4");
+                break;
+            case Opcodes.V1_5:
+                buf.append("V1_5");
+                break;
+            case Opcodes.V1_6:
+                buf.append("V1_6");
+                break;
+            case Opcodes.V1_7:
+                buf.append("V1_7");
+                break;
+            default:
+                buf.append(version);
+                break;
+        }
+        buf.append(", ");
+        appendAccess(access | ACCESS_CLASS);
+        buf.append(", ");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(signature);
+        buf.append(", ");
+        appendConstant(superName);
+        buf.append(", ");
+        if (interfaces != null && interfaces.length > 0) {
+            buf.append("new String[] {");
+            for (int i = 0; i < interfaces.length; ++i) {
+                buf.append(i == 0 ? " " : ", ");
+                appendConstant(interfaces[i]);
+            }
+            buf.append(" }");
+        } else {
+            buf.append("null");
+        }
+        buf.append(");\n\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitSource(final String file, final String debug) {
+        buf.setLength(0);
+        buf.append("cw.visitSource(");
+        appendConstant(file);
+        buf.append(", ");
+        appendConstant(debug);
+        buf.append(");\n\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append("cw.visitOuterClass(");
+        appendConstant(owner);
+        buf.append(", ");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(");\n\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public ASMifier visitClassAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        return visitAnnotation(desc, visible);
+    }
+
+    @Override
+    public void visitClassAttribute(final Attribute attr) {
+        visitAttribute(attr);
+    }
+
+    @Override
+    public void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        buf.setLength(0);
+        buf.append("cw.visitInnerClass(");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(outerName);
+        buf.append(", ");
+        appendConstant(innerName);
+        buf.append(", ");
+        appendAccess(access | ACCESS_INNER);
+        buf.append(");\n\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public ASMifier visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        buf.setLength(0);
+        buf.append("{\n");
+        buf.append("fv = cw.visitField(");
+        appendAccess(access | ACCESS_FIELD);
+        buf.append(", ");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(", ");
+        appendConstant(signature);
+        buf.append(", ");
+        appendConstant(value);
+        buf.append(");\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("fv", 0);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    @Override
+    public ASMifier visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        buf.setLength(0);
+        buf.append("{\n");
+        buf.append("mv = cw.visitMethod(");
+        appendAccess(access);
+        buf.append(", ");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(", ");
+        appendConstant(signature);
+        buf.append(", ");
+        if (exceptions != null && exceptions.length > 0) {
+            buf.append("new String[] {");
+            for (int i = 0; i < exceptions.length; ++i) {
+                buf.append(i == 0 ? " " : ", ");
+                appendConstant(exceptions[i]);
+            }
+            buf.append(" }");
+        } else {
+            buf.append("null");
+        }
+        buf.append(");\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("mv", 0);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    @Override
+    public void visitClassEnd() {
+        text.add("cw.visitEnd();\n\n");
+        text.add("return cw.toByteArray();\n");
+        text.add("}\n");
+        text.add("}\n");
+    }
+
+    // ------------------------------------------------------------------------
+    // Annotations
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(final String name, final Object value) {
+        buf.setLength(0);
+        buf.append("av").append(id).append(".visit(");
+        appendConstant(buf, name);
+        buf.append(", ");
+        appendConstant(buf, value);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitEnum(
+        final String name,
+        final String desc,
+        final String value)
+    {
+        buf.setLength(0);
+        buf.append("av").append(id).append(".visitEnum(");
+        appendConstant(buf, name);
+        buf.append(", ");
+        appendConstant(buf, desc);
+        buf.append(", ");
+        appendConstant(buf, value);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public ASMifier visitAnnotation(
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append("{\n");
+        buf.append("AnnotationVisitor av").append(id + 1).append(" = av");
+        buf.append(id).append(".visitAnnotation(");
+        appendConstant(buf, name);
+        buf.append(", ");
+        appendConstant(buf, desc);
+        buf.append(");\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("av", id + 1);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    @Override
+    public ASMifier visitArray(final String name) {
+        buf.setLength(0);
+        buf.append("{\n");
+        buf.append("AnnotationVisitor av").append(id + 1).append(" = av");
+        buf.append(id).append(".visitArray(");
+        appendConstant(buf, name);
+        buf.append(");\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("av", id + 1);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    @Override
+    public void visitAnnotationEnd() {
+        buf.setLength(0);
+        buf.append("av").append(id).append(".visitEnd();\n");
+        text.add(buf.toString());
+    }
+
+    // ------------------------------------------------------------------------
+    // Fields
+    // ------------------------------------------------------------------------
+
+    @Override
+    public ASMifier visitFieldAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        return visitAnnotation(desc, visible);
+    }
+
+    @Override
+    public void visitFieldAttribute(final Attribute attr) {
+        visitAttribute(attr);
+    }
+
+    @Override
+    public void visitFieldEnd() {
+        buf.setLength(0);
+        buf.append(name).append(".visitEnd();\n");
+        text.add(buf.toString());
+    }
+
+    // ------------------------------------------------------------------------
+    // Methods
+    // ------------------------------------------------------------------------
+
+    @Override
+    public ASMifier visitAnnotationDefault() {
+        buf.setLength(0);
+        buf.append("{\n")
+                .append("av0 = ")
+                .append(name)
+                .append(".visitAnnotationDefault();\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("av", 0);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    @Override
+    public ASMifier visitMethodAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        return visitAnnotation(desc, visible);
+    }
+
+    @Override
+    public ASMifier visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible)
+    {
+        buf.setLength(0);
+        buf.append("{\n")
+                .append("av0 = ").append(name).append(".visitParameterAnnotation(")
+                .append(parameter)
+                .append(", ");
+        appendConstant(desc);
+        buf.append(", ").append(visible).append(");\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("av", 0);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    @Override
+    public void visitMethodAttribute(final Attribute attr) {
+        visitAttribute(attr);
+    }
+
+    @Override
+    public void visitCode() {
+        text.add(name + ".visitCode();\n");
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        buf.setLength(0);
+        switch (type) {
+            case Opcodes.F_NEW:
+            case Opcodes.F_FULL:
+                declareFrameTypes(nLocal, local);
+                declareFrameTypes(nStack, stack);
+                if (type == Opcodes.F_NEW) {
+                    buf.append(name).append(".visitFrame(Opcodes.F_NEW, ");
+                } else {
+                    buf.append(name).append(".visitFrame(Opcodes.F_FULL, ");
+                }
+                buf.append(nLocal).append(", new Object[] {");
+                appendFrameTypes(nLocal, local);
+                buf.append("}, ").append(nStack).append(", new Object[] {");
+                appendFrameTypes(nStack, stack);
+                buf.append('}');
+                break;
+            case Opcodes.F_APPEND:
+                declareFrameTypes(nLocal, local);
+                buf.append(name).append(".visitFrame(Opcodes.F_APPEND,")
+                        .append(nLocal)
+                        .append(", new Object[] {");
+                appendFrameTypes(nLocal, local);
+                buf.append("}, 0, null");
+                break;
+            case Opcodes.F_CHOP:
+                buf.append(name).append(".visitFrame(Opcodes.F_CHOP,")
+                        .append(nLocal)
+                        .append(", null, 0, null");
+                break;
+            case Opcodes.F_SAME:
+                buf.append(name).append(".visitFrame(Opcodes.F_SAME, 0, null, 0, null");
+                break;
+            case Opcodes.F_SAME1:
+                declareFrameTypes(1, stack);
+                buf.append(name).append(".visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {");
+                appendFrameTypes(1, stack);
+                buf.append('}');
+                break;
+        }
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        buf.setLength(0);
+        buf.append(name).append(".visitInsn(").append(OPCODES[opcode]).append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        buf.setLength(0);
+        buf.append(name)
+                .append(".visitIntInsn(")
+                .append(OPCODES[opcode])
+                .append(", ")
+                .append(opcode == Opcodes.NEWARRAY
+                        ? TYPES[operand]
+                        : Integer.toString(operand))
+                .append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        buf.setLength(0);
+        buf.append(name)
+                .append(".visitVarInsn(")
+                .append(OPCODES[opcode])
+                .append(", ")
+                .append(var)
+                .append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        buf.setLength(0);
+        buf.append(name).append(".visitTypeInsn(").append(OPCODES[opcode]).append(", ");
+        appendConstant(type);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append(this.name).append(".visitFieldInsn(").append(OPCODES[opcode]).append(", ");
+        appendConstant(owner);
+        buf.append(", ");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append(this.name).append(".visitMethodInsn(").append(OPCODES[opcode]).append(", ");
+        appendConstant(owner);
+        buf.append(", ");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        buf.setLength(0);
+        buf.append(this.name).append(".visitInvokeDynamicInsn(");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(", ");
+        appendConstant(bsm);
+        buf.append(", new Object[]{");
+        for (int i = 0; i < bsmArgs.length; ++i) {
+            appendConstant(bsmArgs[i]);
+            if (i != bsmArgs.length - 1) {
+                buf.append(", ");
+            }
+        }
+        buf.append("});\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        buf.setLength(0);
+        declareLabel(label);
+        buf.append(name).append(".visitJumpInsn(").append(OPCODES[opcode]).append(", ");
+        appendLabel(label);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        buf.setLength(0);
+        declareLabel(label);
+        buf.append(name).append(".visitLabel(");
+        appendLabel(label);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        buf.setLength(0);
+        buf.append(name).append(".visitLdcInsn(");
+        appendConstant(cst);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        buf.setLength(0);
+        buf.append(name)
+                .append(".visitIincInsn(")
+                .append(var)
+                .append(", ")
+                .append(increment)
+                .append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        buf.setLength(0);
+        for (int i = 0; i < labels.length; ++i) {
+            declareLabel(labels[i]);
+        }
+        declareLabel(dflt);
+
+        buf.append(name)
+                .append(".visitTableSwitchInsn(")
+                .append(min)
+                .append(", ")
+                .append(max)
+                .append(", ");
+        appendLabel(dflt);
+        buf.append(", new Label[] {");
+        for (int i = 0; i < labels.length; ++i) {
+            buf.append(i == 0 ? " " : ", ");
+            appendLabel(labels[i]);
+        }
+        buf.append(" });\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        buf.setLength(0);
+        for (int i = 0; i < labels.length; ++i) {
+            declareLabel(labels[i]);
+        }
+        declareLabel(dflt);
+
+        buf.append(name).append(".visitLookupSwitchInsn(");
+        appendLabel(dflt);
+        buf.append(", new int[] {");
+        for (int i = 0; i < keys.length; ++i) {
+            buf.append(i == 0 ? " " : ", ").append(keys[i]);
+        }
+        buf.append(" }, new Label[] {");
+        for (int i = 0; i < labels.length; ++i) {
+            buf.append(i == 0 ? " " : ", ");
+            appendLabel(labels[i]);
+        }
+        buf.append(" });\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        buf.setLength(0);
+        buf.append(name).append(".visitMultiANewArrayInsn(");
+        appendConstant(desc);
+        buf.append(", ").append(dims).append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type)
+    {
+        buf.setLength(0);
+        declareLabel(start);
+        declareLabel(end);
+        declareLabel(handler);
+        buf.append(name).append(".visitTryCatchBlock(");
+        appendLabel(start);
+        buf.append(", ");
+        appendLabel(end);
+        buf.append(", ");
+        appendLabel(handler);
+        buf.append(", ");
+        appendConstant(type);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        buf.setLength(0);
+        buf.append(this.name).append(".visitLocalVariable(");
+        appendConstant(name);
+        buf.append(", ");
+        appendConstant(desc);
+        buf.append(", ");
+        appendConstant(signature);
+        buf.append(", ");
+        appendLabel(start);
+        buf.append(", ");
+        appendLabel(end);
+        buf.append(", ").append(index).append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLineNumber(final int line, final Label start) {
+        buf.setLength(0);
+        buf.append(name).append(".visitLineNumber(").append(line).append(", ");
+        appendLabel(start);
+        buf.append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        buf.setLength(0);
+        buf.append(name)
+                .append(".visitMaxs(")
+                .append(maxStack)
+                .append(", ")
+                .append(maxLocals)
+                .append(");\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMethodEnd() {
+        buf.setLength(0);
+        buf.append(name).append(".visitEnd();\n");
+        text.add(buf.toString());
+    }
+
+    // ------------------------------------------------------------------------
+    // Common methods
+    // ------------------------------------------------------------------------
+
+    public ASMifier visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        buf.setLength(0);
+        buf.append("{\n")
+                .append("av0 = ")
+                .append(name)
+                .append(".visitAnnotation(");
+        appendConstant(desc);
+        buf.append(", ").append(visible).append(");\n");
+        text.add(buf.toString());
+        ASMifier a = createASMifier("av", 0);
+        text.add(a.getText());
+        text.add("}\n");
+        return a;
+    }
+
+    public void visitAttribute(final Attribute attr) {
+        buf.setLength(0);
+        buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
+        if (attr instanceof ASMifiable) {
+            if (labelNames == null) {
+                labelNames = new HashMap<Label, String>();
+            }
+            buf.append("{\n");
+            ((ASMifiable) attr).asmify(buf, "attr", labelNames);
+            buf.append(name).append(".visitAttribute(attr);\n");
+            buf.append("}\n");
+        }
+        text.add(buf.toString());
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    protected ASMifier createASMifier(final String name, final int id)    {
+        return new ASMifier(Opcodes.ASM4, name, id);
+    }
+
+    /**
+     * Appends a string representation of the given access modifiers to {@link
+     * #buf buf}.
+     *
+     * @param access some access modifiers.
+     */
+    void appendAccess(final int access) {
+        boolean first = true;
+        if ((access & Opcodes.ACC_PUBLIC) != 0) {
+            buf.append("ACC_PUBLIC");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_PRIVATE) != 0) {
+            buf.append("ACC_PRIVATE");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_PROTECTED) != 0) {
+            buf.append("ACC_PROTECTED");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_FINAL) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_FINAL");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_STATIC) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_STATIC");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            if ((access & ACCESS_CLASS) == 0) {
+                buf.append("ACC_SYNCHRONIZED");
+            } else {
+                buf.append("ACC_SUPER");
+            }
+            first = false;
+        }
+        if ((access & Opcodes.ACC_VOLATILE) != 0
+                && (access & ACCESS_FIELD) != 0)
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_VOLATILE");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_BRIDGE) != 0 && (access & ACCESS_CLASS) == 0
+                && (access & ACCESS_FIELD) == 0)
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_BRIDGE");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_VARARGS) != 0 && (access & ACCESS_CLASS) == 0
+                && (access & ACCESS_FIELD) == 0)
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_VARARGS");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_TRANSIENT) != 0
+                && (access & ACCESS_FIELD) != 0)
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_TRANSIENT");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_NATIVE) != 0 && (access & ACCESS_CLASS) == 0
+                && (access & ACCESS_FIELD) == 0)
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_NATIVE");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_ENUM) != 0
+                && ((access & ACCESS_CLASS) != 0
+                        || (access & ACCESS_FIELD) != 0 || (access & ACCESS_INNER) != 0))
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_ENUM");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_ANNOTATION) != 0
+                && ((access & ACCESS_CLASS) != 0 || (access & ACCESS_INNER) != 0))
+        {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_ANNOTATION");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_ABSTRACT) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_ABSTRACT");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_INTERFACE) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_INTERFACE");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_STRICT) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_STRICT");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_SYNTHETIC");
+            first = false;
+        }
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            if (!first) {
+                buf.append(" + ");
+            }
+            buf.append("ACC_DEPRECATED");
+            first = false;
+        }
+        if (first) {
+            buf.append('0');
+        }
+    }
+
+    /**
+     * Appends a string representation of the given constant to the given
+     * buffer.
+     *
+     * @param cst an {@link Integer}, {@link Float}, {@link Long},
+     *        {@link Double} or {@link String} object. May be <tt>null</tt>.
+     */
+    protected void appendConstant(final Object cst) {
+        appendConstant(buf, cst);
+    }
+
+    /**
+     * Appends a string representation of the given constant to the given
+     * buffer.
+     *
+     * @param buf a string buffer.
+     * @param cst an {@link Integer}, {@link Float}, {@link Long},
+     *        {@link Double} or {@link String} object. May be <tt>null</tt>.
+     */
+    static void appendConstant(final StringBuffer buf, final Object cst) {
+        if (cst == null) {
+            buf.append("null");
+        } else if (cst instanceof String) {
+            appendString(buf, (String) cst);
+        } else if (cst instanceof Type) {
+            buf.append("Type.getType(\"");
+            buf.append(((Type) cst).getDescriptor());
+            buf.append("\")");
+        } else if (cst instanceof Handle) {
+            buf.append("new Handle(");
+            Handle h = (Handle) cst;
+            buf.append("Opcodes.").append(HANDLE_TAG[h.getTag()]).append(", \"");
+            buf.append(h.getOwner()).append("\", \"");
+            buf.append(h.getName()).append("\", \"");
+            buf.append(h.getDesc()).append("\")");
+        } else if (cst instanceof Byte) {
+            buf.append("new Byte((byte)").append(cst).append(')');
+        } else if (cst instanceof Boolean) {
+            buf.append(((Boolean) cst).booleanValue() ? "Boolean.TRUE" : "Boolean.FALSE");
+        } else if (cst instanceof Short) {
+            buf.append("new Short((short)").append(cst).append(')');
+        } else if (cst instanceof Character) {
+            int c = ((Character) cst).charValue();
+            buf.append("new Character((char)").append(c).append(')');
+        } else if (cst instanceof Integer) {
+            buf.append("new Integer(").append(cst).append(')');
+        } else if (cst instanceof Float) {
+            buf.append("new Float(\"").append(cst).append("\")");
+        } else if (cst instanceof Long) {
+            buf.append("new Long(").append(cst).append("L)");
+        } else if (cst instanceof Double) {
+            buf.append("new Double(\"").append(cst).append("\")");
+        } else if (cst instanceof byte[]) {
+            byte[] v = (byte[]) cst;
+            buf.append("new byte[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append(v[i]);
+            }
+            buf.append('}');
+        } else if (cst instanceof boolean[]) {
+            boolean[] v = (boolean[]) cst;
+            buf.append("new boolean[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append(v[i]);
+            }
+            buf.append('}');
+        } else if (cst instanceof short[]) {
+            short[] v = (short[]) cst;
+            buf.append("new short[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append("(short)").append(v[i]);
+            }
+            buf.append('}');
+        } else if (cst instanceof char[]) {
+            char[] v = (char[]) cst;
+            buf.append("new char[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",")
+                        .append("(char)")
+                        .append((int) v[i]);
+            }
+            buf.append('}');
+        } else if (cst instanceof int[]) {
+            int[] v = (int[]) cst;
+            buf.append("new int[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append(v[i]);
+            }
+            buf.append('}');
+        } else if (cst instanceof long[]) {
+            long[] v = (long[]) cst;
+            buf.append("new long[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append(v[i]).append('L');
+            }
+            buf.append('}');
+        } else if (cst instanceof float[]) {
+            float[] v = (float[]) cst;
+            buf.append("new float[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append(v[i]).append('f');
+            }
+            buf.append('}');
+        } else if (cst instanceof double[]) {
+            double[] v = (double[]) cst;
+            buf.append("new double[] {");
+            for (int i = 0; i < v.length; i++) {
+                buf.append(i == 0 ? "" : ",").append(v[i]).append('d');
+            }
+            buf.append('}');
+        }
+    }
+
+    private void declareFrameTypes(final int n, final Object[] o) {
+        for (int i = 0; i < n; ++i) {
+            if (o[i] instanceof Label) {
+                declareLabel((Label) o[i]);
+            }
+        }
+    }
+
+    private void appendFrameTypes(final int n, final Object[] o) {
+        for (int i = 0; i < n; ++i) {
+            if (i > 0) {
+                buf.append(", ");
+            }
+            if (o[i] instanceof String) {
+                appendConstant(o[i]);
+            } else if (o[i] instanceof Integer) {
+                switch (((Integer) o[i]).intValue()) {
+                    case 0:
+                        buf.append("Opcodes.TOP");
+                        break;
+                    case 1:
+                        buf.append("Opcodes.INTEGER");
+                        break;
+                    case 2:
+                        buf.append("Opcodes.FLOAT");
+                        break;
+                    case 3:
+                        buf.append("Opcodes.DOUBLE");
+                        break;
+                    case 4:
+                        buf.append("Opcodes.LONG");
+                        break;
+                    case 5:
+                        buf.append("Opcodes.NULL");
+                        break;
+                    case 6:
+                        buf.append("Opcodes.UNINITIALIZED_THIS");
+                        break;
+                }
+            } else {
+                appendLabel((Label) o[i]);
+            }
+        }
+    }
+
+    /**
+     * Appends a declaration of the given label to {@link #buf buf}. This
+     * declaration is of the form "Label lXXX = new Label();". Does nothing if
+     * the given label has already been declared.
+     *
+     * @param l a label.
+     */
+    protected void declareLabel(final Label l) {
+        if (labelNames == null) {
+            labelNames = new HashMap<Label, String>();
+        }
+        String name = labelNames.get(l);
+        if (name == null) {
+            name = "l" + labelNames.size();
+            labelNames.put(l, name);
+            buf.append("Label ").append(name).append(" = new Label();\n");
+        }
+    }
+
+    /**
+     * Appends the name of the given label to {@link #buf buf}. The given label
+     * <i>must</i> already have a name. One way to ensure this is to always
+     * call {@link #declareLabel declared} before calling this method.
+     *
+     * @param l a label.
+     */
+    protected void appendLabel(final Label l) {
+        buf.append(labelNames.get(l));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/CheckAnnotationAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,171 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+
+/**
+ * An {@link AnnotationVisitor} that checks that its methods are properly used.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckAnnotationAdapter extends AnnotationVisitor {
+
+    private final boolean named;
+
+    private boolean end;
+
+    public CheckAnnotationAdapter(final AnnotationVisitor av) {
+        this(av, true);
+    }
+
+    CheckAnnotationAdapter(final AnnotationVisitor av, final boolean named) {
+        super(Opcodes.ASM4, av);
+        this.named = named;
+    }
+
+    @Override
+    public void visit(final String name, final Object value) {
+        checkEnd();
+        checkName(name);
+        if (!(value instanceof Byte || value instanceof Boolean
+                || value instanceof Character || value instanceof Short
+                || value instanceof Integer || value instanceof Long
+                || value instanceof Float || value instanceof Double
+                || value instanceof String || value instanceof Type
+                || value instanceof byte[] || value instanceof boolean[]
+                || value instanceof char[] || value instanceof short[]
+                || value instanceof int[] || value instanceof long[]
+                || value instanceof float[] || value instanceof double[]))
+        {
+            throw new IllegalArgumentException("Invalid annotation value");
+        }
+        if (value instanceof Type) {
+            int sort = ((Type) value).getSort();
+            if (sort != Type.OBJECT && sort != Type.ARRAY) {
+                throw new IllegalArgumentException("Invalid annotation value");
+            }
+        }
+        if (av != null) {
+            av.visit(name, value);
+        }
+    }
+
+    @Override
+    public void visitEnum(
+        final String name,
+        final String desc,
+        final String value)
+    {
+        checkEnd();
+        checkName(name);
+        CheckMethodAdapter.checkDesc(desc, false);
+        if (value == null) {
+            throw new IllegalArgumentException("Invalid enum value");
+        }
+        if (av != null) {
+            av.visitEnum(name, desc, value);
+        }
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String name,
+        final String desc)
+    {
+        checkEnd();
+        checkName(name);
+        CheckMethodAdapter.checkDesc(desc, false);
+        return new CheckAnnotationAdapter(av == null
+                ? null
+                : av.visitAnnotation(name, desc));
+    }
+
+    @Override
+    public AnnotationVisitor visitArray(final String name) {
+        checkEnd();
+        checkName(name);
+        return new CheckAnnotationAdapter(av == null
+                ? null
+                : av.visitArray(name), false);
+    }
+
+    @Override
+    public void visitEnd() {
+        checkEnd();
+        end = true;
+        if (av != null) {
+            av.visitEnd();
+        }
+    }
+
+    private void checkEnd() {
+        if (end) {
+            throw new IllegalStateException("Cannot call a visit method after visitEnd has been called");
+        }
+    }
+
+    private void checkName(final String name) {
+        if (named && name == null) {
+            throw new IllegalArgumentException("Annotation value name must not be null");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/CheckClassAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,632 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.ClassNode;
+import jdk.internal.org.objectweb.asm.tree.MethodNode;
+import jdk.internal.org.objectweb.asm.tree.analysis.Analyzer;
+import jdk.internal.org.objectweb.asm.tree.analysis.BasicValue;
+import jdk.internal.org.objectweb.asm.tree.analysis.Frame;
+import jdk.internal.org.objectweb.asm.tree.analysis.SimpleVerifier;
+
+/**
+ * A {@link ClassVisitor} that checks that its methods are properly used. More
+ * precisely this class adapter checks each method call individually, based
+ * <i>only</i> on its arguments, but does <i>not</i> check the <i>sequence</i>
+ * of method calls. For example, the invalid sequence
+ * <tt>visitField(ACC_PUBLIC, "i", "I", null)</tt> <tt>visitField(ACC_PUBLIC,
+ * "i", "D", null)</tt>
+ * will <i>not</i> be detected by this class adapter.
+ *
+ * <p><code>CheckClassAdapter</code> can be also used to verify bytecode
+ * transformations in order to make sure transformed bytecode is sane. For
+ * example:
+ *
+ * <pre>
+ *   InputStream is = ...; // get bytes for the source class
+ *   ClassReader cr = new ClassReader(is);
+ *   ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);
+ *   ClassVisitor cv = new <b>MyClassAdapter</b>(new CheckClassAdapter(cw));
+ *   cr.accept(cv, 0);
+ *
+ *   StringWriter sw = new StringWriter();
+ *   PrintWriter pw = new PrintWriter(sw);
+ *   CheckClassAdapter.verify(new ClassReader(cw.toByteArray()), false, pw);
+ *   assertTrue(sw.toString(), sw.toString().length()==0);
+ * </pre>
+ *
+ * Above code runs transformed bytecode trough the
+ * <code>CheckClassAdapter</code>. It won't be exactly the same verification
+ * as JVM does, but it run data flow analysis for the code of each method and
+ * checks that expectations are met for each method instruction.
+ *
+ * <p>If method bytecode has errors, assertion text will show the erroneous
+ * instruction number and dump of the failed method with information about
+ * locals and stack slot for each instruction. For example (format is -
+ * insnNumber locals : stack):
+ *
+ * <pre>
+ * jdk.internal.org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 71: Expected I, but found .
+ *   at jdk.internal.org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:289)
+ *   at jdk.internal.org.objectweb.asm.util.CheckClassAdapter.verify(CheckClassAdapter.java:135)
+ * ...
+ * remove()V
+ * 00000 LinkedBlockingQueue$Itr . . . . . . . .  :
+ *   ICONST_0
+ * 00001 LinkedBlockingQueue$Itr . . . . . . . .  : I
+ *   ISTORE 2
+ * 00001 LinkedBlockingQueue$Itr <b>.</b> I . . . . . .  :
+ * ...
+ *
+ * 00071 LinkedBlockingQueue$Itr <b>.</b> I . . . . . .  :
+ *   ILOAD 1
+ * 00072 <b>?</b>
+ *   INVOKESPECIAL java/lang/Integer.<init> (I)V
+ * ...
+ * </pre>
+ *
+ * In the above output you can see that variable 1 loaded by
+ * <code>ILOAD 1</code> instruction at position <code>00071</code> is not
+ * initialized. You can also see that at the beginning of the method (code
+ * inserted by the transformation) variable 2 is initialized.
+ *
+ * <p>Note that when used like that, <code>CheckClassAdapter.verify()</code>
+ * can trigger additional class loading, because it is using
+ * <code>SimpleVerifier</code>.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckClassAdapter extends ClassVisitor {
+
+    /**
+     * The class version number.
+     */
+    private int version;
+
+    /**
+     * <tt>true</tt> if the visit method has been called.
+     */
+    private boolean start;
+
+    /**
+     * <tt>true</tt> if the visitSource method has been called.
+     */
+    private boolean source;
+
+    /**
+     * <tt>true</tt> if the visitOuterClass method has been called.
+     */
+    private boolean outer;
+
+    /**
+     * <tt>true</tt> if the visitEnd method has been called.
+     */
+    private boolean end;
+
+    /**
+     * The already visited labels. This map associate Integer values to Label
+     * keys.
+     */
+    private Map<Label, Integer> labels;
+
+    /**
+     * <tt>true</tt> if the method code must be checked with a BasicVerifier.
+     */
+    private boolean checkDataFlow;
+
+    /**
+     * Checks a given class. <p> Usage: CheckClassAdapter &lt;binary
+     * class name or class file name&gt;
+     *
+     * @param args the command line arguments.
+     *
+     * @throws Exception if the class cannot be found, or if an IO exception
+     *         occurs.
+     */
+    public static void main(final String[] args) throws Exception {
+        if (args.length != 1) {
+            System.err.println("Verifies the given class.");
+            System.err.println("Usage: CheckClassAdapter "
+                    + "<fully qualified class name or class file name>");
+            return;
+        }
+        ClassReader cr;
+        if (args[0].endsWith(".class")) {
+            cr = new ClassReader(new FileInputStream(args[0]));
+        } else {
+            cr = new ClassReader(args[0]);
+        }
+
+        verify(cr, false, new PrintWriter(System.err));
+    }
+
+    /**
+     * Checks a given class.
+     *
+     * @param cr a <code>ClassReader</code> that contains bytecode for the
+     *        analysis.
+     * @param loader a <code>ClassLoader</code> which will be used to load
+     *        referenced classes. This is useful if you are verifiying multiple
+     *        interdependent classes.
+     * @param dump true if bytecode should be printed out not only when errors
+     *        are found.
+     * @param pw write where results going to be printed
+     */
+    public static void verify(
+        final ClassReader cr,
+        final ClassLoader loader,
+        final boolean dump,
+        final PrintWriter pw)
+    {
+        ClassNode cn = new ClassNode();
+        cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG);
+
+        Type syperType = cn.superName == null
+                ? null
+                : Type.getObjectType(cn.superName);
+        List<MethodNode> methods = cn.methods;
+
+        List<Type> interfaces = new ArrayList<Type>();
+        for (Iterator<String> i = cn.interfaces.iterator(); i.hasNext();) {
+            interfaces.add(Type.getObjectType(i.next().toString()));
+        }
+
+        for (int i = 0; i < methods.size(); ++i) {
+            MethodNode method = methods.get(i);
+            SimpleVerifier verifier = new SimpleVerifier(Type.getObjectType(cn.name),
+                    syperType,
+                    interfaces,
+                    (cn.access & Opcodes.ACC_INTERFACE) != 0);
+            Analyzer<BasicValue> a = new Analyzer<BasicValue>(verifier);
+            if (loader != null) {
+                verifier.setClassLoader(loader);
+            }
+            try {
+                a.analyze(cn.name, method);
+                if (!dump) {
+                    continue;
+                }
+            } catch (Exception e) {
+                e.printStackTrace(pw);
+            }
+            printAnalyzerResult(method, a, pw);
+        }
+        pw.flush();
+    }
+
+    /**
+     * Checks a given class
+     *
+     * @param cr a <code>ClassReader</code> that contains bytecode for the
+     *        analysis.
+     * @param dump true if bytecode should be printed out not only when errors
+     *        are found.
+     * @param pw write where results going to be printed
+     */
+    public static void verify(
+        final ClassReader cr,
+        final boolean dump,
+        final PrintWriter pw)
+    {
+        verify(cr, null, dump, pw);
+    }
+
+    static void printAnalyzerResult(
+        MethodNode method,
+        Analyzer<BasicValue> a,
+        final PrintWriter pw)
+    {
+        Frame<BasicValue>[] frames = a.getFrames();
+        Textifier t = new Textifier();
+        TraceMethodVisitor mv = new TraceMethodVisitor(t);
+
+        pw.println(method.name + method.desc);
+        for (int j = 0; j < method.instructions.size(); ++j) {
+            method.instructions.get(j).accept(mv);
+
+            StringBuffer s = new StringBuffer();
+            Frame<BasicValue> f = frames[j];
+            if (f == null) {
+                s.append('?');
+            } else {
+                for (int k = 0; k < f.getLocals(); ++k) {
+                    s.append(getShortName(f.getLocal(k).toString()))
+                            .append(' ');
+                }
+                s.append(" : ");
+                for (int k = 0; k < f.getStackSize(); ++k) {
+                    s.append(getShortName(f.getStack(k).toString()))
+                            .append(' ');
+                }
+            }
+            while (s.length() < method.maxStack + method.maxLocals + 1) {
+                s.append(' ');
+            }
+            pw.print(Integer.toString(j + 100000).substring(1));
+            pw.print(" " + s + " : " + t.text.get(t.text.size() - 1));
+        }
+        for (int j = 0; j < method.tryCatchBlocks.size(); ++j) {
+            method.tryCatchBlocks.get(j).accept(mv);
+            pw.print(" " + t.text.get(t.text.size() - 1));
+        }
+        pw.println();
+    }
+
+    private static String getShortName(final String name) {
+        int n = name.lastIndexOf('/');
+        int k = name.length();
+        if (name.charAt(k - 1) == ';') {
+            k--;
+        }
+        return n == -1 ? name : name.substring(n + 1, k);
+    }
+
+    /**
+     * Constructs a new {@link CheckClassAdapter}. <i>Subclasses must not use
+     * this constructor</i>. Instead, they must use the
+     * {@link #CheckClassAdapter(int, ClassVisitor, boolean)} version.
+     *
+     * @param cv the class visitor to which this adapter must delegate calls.
+     */
+    public CheckClassAdapter(final ClassVisitor cv) {
+        this(cv, true);
+    }
+
+    /**
+     * Constructs a new {@link CheckClassAdapter}. <i>Subclasses must not use
+     * this constructor</i>. Instead, they must use the
+     * {@link #CheckClassAdapter(int, ClassVisitor, boolean)} version.
+     *
+     * @param cv the class visitor to which this adapter must delegate calls.
+     * @param checkDataFlow <tt>true</tt> to perform basic data flow checks, or
+     *        <tt>false</tt> to not perform any data flow check (see
+     *        {@link CheckMethodAdapter}). This option requires valid maxLocals
+     *        and maxStack values.
+     */
+    public CheckClassAdapter(final ClassVisitor cv, final boolean checkDataFlow)
+    {
+        this(Opcodes.ASM4, cv, checkDataFlow);
+    }
+
+    /**
+     * Constructs a new {@link CheckClassAdapter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param cv the class visitor to which this adapter must delegate calls.
+     * @param checkDataFlow <tt>true</tt> to perform basic data flow checks, or
+     *        <tt>false</tt> to not perform any data flow check (see
+     *        {@link CheckMethodAdapter}). This option requires valid maxLocals
+     *        and maxStack values.
+     */
+    protected CheckClassAdapter(
+        final int api,
+        final ClassVisitor cv,
+        final boolean checkDataFlow)
+    {
+        super(api, cv);
+        this.labels = new HashMap<Label, Integer>();
+        this.checkDataFlow = checkDataFlow;
+    }
+
+    // ------------------------------------------------------------------------
+    // Implementation of the ClassVisitor interface
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        if (start) {
+            throw new IllegalStateException("visit must be called only once");
+        }
+        start = true;
+        checkState();
+        checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL
+                + Opcodes.ACC_SUPER + Opcodes.ACC_INTERFACE
+                + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC
+                + Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM
+                + Opcodes.ACC_DEPRECATED
+                + 0x40000); // ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+        if (name == null || !name.endsWith("package-info")) {
+            CheckMethodAdapter.checkInternalName(name, "class name");
+        }
+        if ("java/lang/Object".equals(name)) {
+            if (superName != null) {
+                throw new IllegalArgumentException("The super class name of the Object class must be 'null'");
+            }
+        } else {
+            CheckMethodAdapter.checkInternalName(superName, "super class name");
+        }
+        if (signature != null) {
+            CheckMethodAdapter.checkClassSignature(signature);
+        }
+        if ((access & Opcodes.ACC_INTERFACE) != 0) {
+            if (!"java/lang/Object".equals(superName)) {
+                throw new IllegalArgumentException("The super class name of interfaces must be 'java/lang/Object'");
+            }
+        }
+        if (interfaces != null) {
+            for (int i = 0; i < interfaces.length; ++i) {
+                CheckMethodAdapter.checkInternalName(interfaces[i],
+                        "interface name at index " + i);
+            }
+        }
+        this.version = version;
+        super.visit(version, access, name, signature, superName, interfaces);
+    }
+
+    @Override
+    public void visitSource(final String file, final String debug) {
+        checkState();
+        if (source) {
+            throw new IllegalStateException("visitSource can be called only once.");
+        }
+        source = true;
+        super.visitSource(file, debug);
+    }
+
+    @Override
+    public void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        checkState();
+        if (outer) {
+            throw new IllegalStateException("visitOuterClass can be called only once.");
+        }
+        outer = true;
+        if (owner == null) {
+            throw new IllegalArgumentException("Illegal outer class owner");
+        }
+        if (desc != null) {
+            CheckMethodAdapter.checkMethodDesc(desc);
+        }
+        super.visitOuterClass(owner, name, desc);
+    }
+
+    @Override
+    public void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        checkState();
+        CheckMethodAdapter.checkInternalName(name, "class name");
+        if (outerName != null) {
+            CheckMethodAdapter.checkInternalName(outerName, "outer class name");
+        }
+        if (innerName != null) {
+            CheckMethodAdapter.checkIdentifier(innerName, "inner class name");
+        }
+        checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
+                + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
+                + Opcodes.ACC_FINAL + Opcodes.ACC_INTERFACE
+                + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC
+                + Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM);
+        super.visitInnerClass(name, outerName, innerName, access);
+    }
+
+    @Override
+    public FieldVisitor visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        checkState();
+        checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
+                + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
+                + Opcodes.ACC_FINAL + Opcodes.ACC_VOLATILE
+                + Opcodes.ACC_TRANSIENT + Opcodes.ACC_SYNTHETIC
+                + Opcodes.ACC_ENUM + Opcodes.ACC_DEPRECATED
+                + 0x40000); // ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+        CheckMethodAdapter.checkUnqualifiedName(version, name, "field name");
+        CheckMethodAdapter.checkDesc(desc, false);
+        if (signature != null) {
+            CheckMethodAdapter.checkFieldSignature(signature);
+        }
+        if (value != null) {
+            CheckMethodAdapter.checkConstant(value);
+        }
+        FieldVisitor av = super.visitField(access, name, desc, signature, value);
+        return new CheckFieldAdapter(av);
+    }
+
+    @Override
+    public MethodVisitor visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        checkState();
+        checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
+                + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
+                + Opcodes.ACC_FINAL + Opcodes.ACC_SYNCHRONIZED
+                + Opcodes.ACC_BRIDGE + Opcodes.ACC_VARARGS + Opcodes.ACC_NATIVE
+                + Opcodes.ACC_ABSTRACT + Opcodes.ACC_STRICT
+                + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_DEPRECATED
+                + 0x40000); // ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+        CheckMethodAdapter.checkMethodIdentifier(version, name, "method name");
+        CheckMethodAdapter.checkMethodDesc(desc);
+        if (signature != null) {
+            CheckMethodAdapter.checkMethodSignature(signature);
+        }
+        if (exceptions != null) {
+            for (int i = 0; i < exceptions.length; ++i) {
+                CheckMethodAdapter.checkInternalName(exceptions[i],
+                        "exception name at index " + i);
+            }
+        }
+        CheckMethodAdapter cma;
+        if (checkDataFlow) {
+            cma = new CheckMethodAdapter(access,
+                    name,
+                    desc,
+                    super.visitMethod(access, name, desc, signature, exceptions),
+                    labels);
+        } else {
+            cma = new CheckMethodAdapter(super.visitMethod(access,
+                    name,
+                    desc,
+                    signature,
+                    exceptions), labels);
+        }
+        cma.version = version;
+        return cma;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        checkState();
+        CheckMethodAdapter.checkDesc(desc, false);
+        return new CheckAnnotationAdapter(super.visitAnnotation(desc, visible));
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        checkState();
+        if (attr == null) {
+            throw new IllegalArgumentException("Invalid attribute (must not be null)");
+        }
+        super.visitAttribute(attr);
+    }
+
+    @Override
+    public void visitEnd() {
+        checkState();
+        end = true;
+        super.visitEnd();
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Checks that the visit method has been called and that visitEnd has not
+     * been called.
+     */
+    private void checkState() {
+        if (!start) {
+            throw new IllegalStateException("Cannot visit member before visit has been called.");
+        }
+        if (end) {
+            throw new IllegalStateException("Cannot visit member after visitEnd has been called.");
+        }
+    }
+
+    /**
+     * Checks that the given access flags do not contain invalid flags. This
+     * method also checks that mutually incompatible flags are not set
+     * simultaneously.
+     *
+     * @param access the access flags to be checked
+     * @param possibleAccess the valid access flags.
+     */
+    static void checkAccess(final int access, final int possibleAccess) {
+        if ((access & ~possibleAccess) != 0) {
+            throw new IllegalArgumentException("Invalid access flags: "
+                    + access);
+        }
+        int pub = (access & Opcodes.ACC_PUBLIC) == 0 ? 0 : 1;
+        int pri = (access & Opcodes.ACC_PRIVATE) == 0 ? 0 : 1;
+        int pro = (access & Opcodes.ACC_PROTECTED) == 0 ? 0 : 1;
+        if (pub + pri + pro > 1) {
+            throw new IllegalArgumentException("public private and protected are mutually exclusive: "
+                    + access);
+        }
+        int fin = (access & Opcodes.ACC_FINAL) == 0 ? 0 : 1;
+        int abs = (access & Opcodes.ACC_ABSTRACT) == 0 ? 0 : 1;
+        if (fin + abs > 1) {
+            throw new IllegalArgumentException("final and abstract are mutually exclusive: "
+                    + access);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/CheckFieldAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,126 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link FieldVisitor} that checks that its methods are properly used.
+ */
+public class CheckFieldAdapter extends FieldVisitor {
+
+    private boolean end;
+
+    /**
+     * Constructs a new {@link CheckFieldAdapter}. <i>Subclasses must not use
+     * this constructor</i>. Instead, they must use the
+     * {@link #CheckFieldAdapter(int, FieldVisitor)} version.
+     *
+     * @param fv the field visitor to which this adapter must delegate calls.
+     */
+    public CheckFieldAdapter(final FieldVisitor fv) {
+        this(Opcodes.ASM4, fv);
+    }
+
+    /**
+     * Constructs a new {@link CheckFieldAdapter}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param fv the field visitor to which this adapter must delegate calls.
+     */
+    protected CheckFieldAdapter(final int api, final FieldVisitor fv) {
+        super(api, fv);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        checkEnd();
+        CheckMethodAdapter.checkDesc(desc, false);
+        return new CheckAnnotationAdapter(super.visitAnnotation(desc, visible));
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        checkEnd();
+        if (attr == null) {
+            throw new IllegalArgumentException("Invalid attribute (must not be null)");
+        }
+        super.visitAttribute(attr);
+    }
+
+    @Override
+    public void visitEnd() {
+        checkEnd();
+        end = true;
+        super.visitEnd();
+    }
+
+    private void checkEnd() {
+        if (end) {
+            throw new IllegalStateException("Cannot call a visit method after visitEnd has been called");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/CheckMethodAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1697 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.MethodNode;
+import jdk.internal.org.objectweb.asm.tree.analysis.Analyzer;
+import jdk.internal.org.objectweb.asm.tree.analysis.BasicValue;
+import jdk.internal.org.objectweb.asm.tree.analysis.BasicVerifier;
+
+/**
+ * A {@link MethodVisitor} that checks that its methods are properly used. More
+ * precisely this method adapter checks each instruction individually, i.e.,
+ * each visit method checks some preconditions based <i>only</i> on its
+ * arguments - such as the fact that the given opcode is correct for a given
+ * visit method. This adapter can also perform some basic data flow checks (more
+ * precisely those that can be performed without the full class hierarchy - see
+ * {@link jdk.internal.org.objectweb.asm.tree.analysis.BasicVerifier}). For instance in a
+ * method whose signature is <tt>void m ()</tt>, the invalid instruction
+ * IRETURN, or the invalid sequence IADD L2I will be detected if the data flow
+ * checks are enabled. These checks are enabled by using the
+ * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)} constructor.
+ * They are not performed if any other constructor is used.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckMethodAdapter extends MethodVisitor {
+
+    /**
+     * The class version number.
+     */
+    public int version;
+
+    /**
+     * <tt>true</tt> if the visitCode method has been called.
+     */
+    private boolean startCode;
+
+    /**
+     * <tt>true</tt> if the visitMaxs method has been called.
+     */
+    private boolean endCode;
+
+    /**
+     * <tt>true</tt> if the visitEnd method has been called.
+     */
+    private boolean endMethod;
+
+    /**
+     * Number of visited instructions.
+     */
+    private int insnCount;
+
+    /**
+     * The already visited labels. This map associate Integer values to pseudo
+     * code offsets.
+     */
+    private final Map<Label, Integer> labels;
+
+    /**
+     * The labels used in this method. Every used label must be visited with
+     * visitLabel before the end of the method (i.e. should be in #labels).
+     */
+    private Set<Label> usedLabels;
+
+    /**
+     * The exception handler ranges. Each pair of list element contains the
+     * start and end labels of an exception handler block.
+     */
+    private List<Label> handlers;
+
+    /**
+     * Code of the visit method to be used for each opcode.
+     */
+    private static final int[] TYPE;
+
+    /**
+     * The Label.status field.
+     */
+    private static Field labelStatusField;
+
+    static {
+        String s = "BBBBBBBBBBBBBBBBCCIAADDDDDAAAAAAAAAAAAAAAAAAAABBBBBBBBDD"
+                + "DDDAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
+                + "BBBBBBBBBBBBBBBBBBBJBBBBBBBBBBBBBBBBBBBBHHHHHHHHHHHHHHHHD"
+                + "KLBBBBBBFFFFGGGGAECEBBEEBBAMHHAA";
+        TYPE = new int[s.length()];
+        for (int i = 0; i < TYPE.length; ++i) {
+            TYPE[i] = s.charAt(i) - 'A' - 1;
+        }
+    }
+
+    // code to generate the above string
+    // public static void main (String[] args) {
+    // int[] TYPE = new int[] {
+    // 0, //NOP
+    // 0, //ACONST_NULL
+    // 0, //ICONST_M1
+    // 0, //ICONST_0
+    // 0, //ICONST_1
+    // 0, //ICONST_2
+    // 0, //ICONST_3
+    // 0, //ICONST_4
+    // 0, //ICONST_5
+    // 0, //LCONST_0
+    // 0, //LCONST_1
+    // 0, //FCONST_0
+    // 0, //FCONST_1
+    // 0, //FCONST_2
+    // 0, //DCONST_0
+    // 0, //DCONST_1
+    // 1, //BIPUSH
+    // 1, //SIPUSH
+    // 7, //LDC
+    // -1, //LDC_W
+    // -1, //LDC2_W
+    // 2, //ILOAD
+    // 2, //LLOAD
+    // 2, //FLOAD
+    // 2, //DLOAD
+    // 2, //ALOAD
+    // -1, //ILOAD_0
+    // -1, //ILOAD_1
+    // -1, //ILOAD_2
+    // -1, //ILOAD_3
+    // -1, //LLOAD_0
+    // -1, //LLOAD_1
+    // -1, //LLOAD_2
+    // -1, //LLOAD_3
+    // -1, //FLOAD_0
+    // -1, //FLOAD_1
+    // -1, //FLOAD_2
+    // -1, //FLOAD_3
+    // -1, //DLOAD_0
+    // -1, //DLOAD_1
+    // -1, //DLOAD_2
+    // -1, //DLOAD_3
+    // -1, //ALOAD_0
+    // -1, //ALOAD_1
+    // -1, //ALOAD_2
+    // -1, //ALOAD_3
+    // 0, //IALOAD
+    // 0, //LALOAD
+    // 0, //FALOAD
+    // 0, //DALOAD
+    // 0, //AALOAD
+    // 0, //BALOAD
+    // 0, //CALOAD
+    // 0, //SALOAD
+    // 2, //ISTORE
+    // 2, //LSTORE
+    // 2, //FSTORE
+    // 2, //DSTORE
+    // 2, //ASTORE
+    // -1, //ISTORE_0
+    // -1, //ISTORE_1
+    // -1, //ISTORE_2
+    // -1, //ISTORE_3
+    // -1, //LSTORE_0
+    // -1, //LSTORE_1
+    // -1, //LSTORE_2
+    // -1, //LSTORE_3
+    // -1, //FSTORE_0
+    // -1, //FSTORE_1
+    // -1, //FSTORE_2
+    // -1, //FSTORE_3
+    // -1, //DSTORE_0
+    // -1, //DSTORE_1
+    // -1, //DSTORE_2
+    // -1, //DSTORE_3
+    // -1, //ASTORE_0
+    // -1, //ASTORE_1
+    // -1, //ASTORE_2
+    // -1, //ASTORE_3
+    // 0, //IASTORE
+    // 0, //LASTORE
+    // 0, //FASTORE
+    // 0, //DASTORE
+    // 0, //AASTORE
+    // 0, //BASTORE
+    // 0, //CASTORE
+    // 0, //SASTORE
+    // 0, //POP
+    // 0, //POP2
+    // 0, //DUP
+    // 0, //DUP_X1
+    // 0, //DUP_X2
+    // 0, //DUP2
+    // 0, //DUP2_X1
+    // 0, //DUP2_X2
+    // 0, //SWAP
+    // 0, //IADD
+    // 0, //LADD
+    // 0, //FADD
+    // 0, //DADD
+    // 0, //ISUB
+    // 0, //LSUB
+    // 0, //FSUB
+    // 0, //DSUB
+    // 0, //IMUL
+    // 0, //LMUL
+    // 0, //FMUL
+    // 0, //DMUL
+    // 0, //IDIV
+    // 0, //LDIV
+    // 0, //FDIV
+    // 0, //DDIV
+    // 0, //IREM
+    // 0, //LREM
+    // 0, //FREM
+    // 0, //DREM
+    // 0, //INEG
+    // 0, //LNEG
+    // 0, //FNEG
+    // 0, //DNEG
+    // 0, //ISHL
+    // 0, //LSHL
+    // 0, //ISHR
+    // 0, //LSHR
+    // 0, //IUSHR
+    // 0, //LUSHR
+    // 0, //IAND
+    // 0, //LAND
+    // 0, //IOR
+    // 0, //LOR
+    // 0, //IXOR
+    // 0, //LXOR
+    // 8, //IINC
+    // 0, //I2L
+    // 0, //I2F
+    // 0, //I2D
+    // 0, //L2I
+    // 0, //L2F
+    // 0, //L2D
+    // 0, //F2I
+    // 0, //F2L
+    // 0, //F2D
+    // 0, //D2I
+    // 0, //D2L
+    // 0, //D2F
+    // 0, //I2B
+    // 0, //I2C
+    // 0, //I2S
+    // 0, //LCMP
+    // 0, //FCMPL
+    // 0, //FCMPG
+    // 0, //DCMPL
+    // 0, //DCMPG
+    // 6, //IFEQ
+    // 6, //IFNE
+    // 6, //IFLT
+    // 6, //IFGE
+    // 6, //IFGT
+    // 6, //IFLE
+    // 6, //IF_ICMPEQ
+    // 6, //IF_ICMPNE
+    // 6, //IF_ICMPLT
+    // 6, //IF_ICMPGE
+    // 6, //IF_ICMPGT
+    // 6, //IF_ICMPLE
+    // 6, //IF_ACMPEQ
+    // 6, //IF_ACMPNE
+    // 6, //GOTO
+    // 6, //JSR
+    // 2, //RET
+    // 9, //TABLESWITCH
+    // 10, //LOOKUPSWITCH
+    // 0, //IRETURN
+    // 0, //LRETURN
+    // 0, //FRETURN
+    // 0, //DRETURN
+    // 0, //ARETURN
+    // 0, //RETURN
+    // 4, //GETSTATIC
+    // 4, //PUTSTATIC
+    // 4, //GETFIELD
+    // 4, //PUTFIELD
+    // 5, //INVOKEVIRTUAL
+    // 5, //INVOKESPECIAL
+    // 5, //INVOKESTATIC
+    // 5, //INVOKEINTERFACE
+    // -1, //INVOKEDYNAMIC
+    // 3, //NEW
+    // 1, //NEWARRAY
+    // 3, //ANEWARRAY
+    // 0, //ARRAYLENGTH
+    // 0, //ATHROW
+    // 3, //CHECKCAST
+    // 3, //INSTANCEOF
+    // 0, //MONITORENTER
+    // 0, //MONITOREXIT
+    // -1, //WIDE
+    // 11, //MULTIANEWARRAY
+    // 6, //IFNULL
+    // 6, //IFNONNULL
+    // -1, //GOTO_W
+    // -1 //JSR_W
+    // };
+    // for (int i = 0; i < TYPE.length; ++i) {
+    // System.out.print((char)(TYPE[i] + 1 + 'A'));
+    // }
+    // System.out.println();
+    // }
+
+    /**
+     * Constructs a new {@link CheckMethodAdapter} object. This method adapter
+     * will not perform any data flow check (see
+     * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}).
+     * <i>Subclasses must not use this constructor</i>. Instead, they must use
+     * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version.
+     *
+     * @param mv the method visitor to which this adapter must delegate calls.
+     */
+    public CheckMethodAdapter(final MethodVisitor mv) {
+        this(mv, new HashMap<Label, Integer>());
+    }
+
+    /**
+     * Constructs a new {@link CheckMethodAdapter} object. This method adapter
+     * will not perform any data flow check (see
+     * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}).
+     * <i>Subclasses must not use this constructor</i>. Instead, they must use
+     * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version.
+     *
+     * @param mv the method visitor to which this adapter must delegate calls.
+     * @param labels a map of already visited labels (in other methods).
+     */
+    public CheckMethodAdapter(
+        final MethodVisitor mv,
+        final Map<Label, Integer> labels)
+    {
+        this(Opcodes.ASM4, mv, labels);
+    }
+
+    /**
+     * Constructs a new {@link CheckMethodAdapter} object. This method adapter
+     * will not perform any data flow check (see
+     * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}).
+     *
+     * @param mv the method visitor to which this adapter must delegate calls.
+     * @param labels a map of already visited labels (in other methods).
+     */
+    protected CheckMethodAdapter(
+        final int api,
+        final MethodVisitor mv,
+        final Map<Label, Integer> labels)
+    {
+        super(api, mv);
+        this.labels = labels;
+        this.usedLabels = new HashSet<Label>();
+        this.handlers = new ArrayList<Label>();
+    }
+
+    /**
+     * Constructs a new {@link CheckMethodAdapter} object. This method adapter
+     * will perform basic data flow checks. For instance in a method whose
+     * signature is <tt>void m ()</tt>, the invalid instruction IRETURN, or the
+     * invalid sequence IADD L2I will be detected.
+     *
+     * @param access the method's access flags.
+     * @param name the method's name.
+     * @param desc the method's descriptor (see {@link Type Type}).
+     * @param cmv the method visitor to which this adapter must delegate calls.
+     * @param labels a map of already visited labels (in other methods).
+     */
+    public CheckMethodAdapter(
+        final int access,
+        final String name,
+        final String desc,
+        final MethodVisitor cmv,
+        final Map<Label, Integer> labels)
+    {
+        this(new MethodNode(access, name, desc, null, null) {
+            @Override
+            public void visitEnd() {
+                Analyzer<BasicValue> a = new Analyzer<BasicValue>(new BasicVerifier());
+                try {
+                    a.analyze("dummy", this);
+                } catch (Exception e) {
+                    if (e instanceof IndexOutOfBoundsException
+                            && maxLocals == 0 && maxStack == 0)
+                    {
+                        throw new RuntimeException("Data flow checking option requires valid, non zero maxLocals and maxStack values.");
+                    }
+                    e.printStackTrace();
+                    StringWriter sw = new StringWriter();
+                    PrintWriter pw = new PrintWriter(sw, true);
+                    CheckClassAdapter.printAnalyzerResult(this, a, pw);
+                    pw.close();
+                    throw new RuntimeException(e.getMessage() + ' '
+                            + sw.toString());
+                }
+                accept(cmv);
+            }
+        },
+                labels);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        checkEndMethod();
+        checkDesc(desc, false);
+        return new CheckAnnotationAdapter(super.visitAnnotation(desc, visible));
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotationDefault() {
+        checkEndMethod();
+        return new CheckAnnotationAdapter(super.visitAnnotationDefault(), false);
+    }
+
+    @Override
+    public AnnotationVisitor visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible)
+    {
+        checkEndMethod();
+        checkDesc(desc, false);
+        return new CheckAnnotationAdapter(super.visitParameterAnnotation(parameter,
+                desc,
+                visible));
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        checkEndMethod();
+        if (attr == null) {
+            throw new IllegalArgumentException("Invalid attribute (must not be null)");
+        }
+        super.visitAttribute(attr);
+    }
+
+    @Override
+    public void visitCode() {
+        startCode = true;
+        super.visitCode();
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        int mLocal;
+        int mStack;
+        switch (type) {
+            case Opcodes.F_NEW:
+            case Opcodes.F_FULL:
+                mLocal = Integer.MAX_VALUE;
+                mStack = Integer.MAX_VALUE;
+                break;
+
+            case Opcodes.F_SAME:
+                mLocal = 0;
+                mStack = 0;
+                break;
+
+            case Opcodes.F_SAME1:
+                mLocal = 0;
+                mStack = 1;
+                break;
+
+            case Opcodes.F_APPEND:
+            case Opcodes.F_CHOP:
+                mLocal = 3;
+                mStack = 0;
+                break;
+
+            default:
+                throw new IllegalArgumentException("Invalid frame type " + type);
+        }
+
+        if (nLocal > mLocal) {
+            throw new IllegalArgumentException("Invalid nLocal=" + nLocal
+                    + " for frame type " + type);
+        }
+        if (nStack > mStack) {
+            throw new IllegalArgumentException("Invalid nStack=" + nStack
+                    + " for frame type " + type);
+        }
+
+        if (type != Opcodes.F_CHOP) {
+            if (nLocal > 0 && (local == null || local.length < nLocal)) {
+                throw new IllegalArgumentException("Array local[] is shorter than nLocal");
+            }
+            for (int i = 0; i < nLocal; ++i) {
+                checkFrameValue(local[i]);
+            }
+        }
+        if (nStack > 0 && (stack == null || stack.length < nStack)) {
+            throw new IllegalArgumentException("Array stack[] is shorter than nStack");
+        }
+        for (int i = 0; i < nStack; ++i) {
+            checkFrameValue(stack[i]);
+        }
+
+        super.visitFrame(type, nLocal, local, nStack, stack);
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 0);
+        super.visitInsn(opcode);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 1);
+        switch (opcode) {
+            case Opcodes.BIPUSH:
+                checkSignedByte(operand, "Invalid operand");
+                break;
+            case Opcodes.SIPUSH:
+                checkSignedShort(operand, "Invalid operand");
+                break;
+            // case Constants.NEWARRAY:
+            default:
+                if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
+                    throw new IllegalArgumentException("Invalid operand (must be an array type code T_...): "
+                            + operand);
+                }
+        }
+        super.visitIntInsn(opcode, operand);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 2);
+        checkUnsignedShort(var, "Invalid variable index");
+        super.visitVarInsn(opcode, var);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 3);
+        checkInternalName(type, "type");
+        if (opcode == Opcodes.NEW && type.charAt(0) == '[') {
+            throw new IllegalArgumentException("NEW cannot be used to create arrays: "
+                    + type);
+        }
+        super.visitTypeInsn(opcode, type);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 4);
+        checkInternalName(owner, "owner");
+        checkUnqualifiedName(version, name, "name");
+        checkDesc(desc, false);
+        super.visitFieldInsn(opcode, owner, name, desc);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 5);
+        checkMethodIdentifier(version, name, "name");
+        checkInternalName(owner, "owner");
+        checkMethodDesc(desc);
+        super.visitMethodInsn(opcode, owner, name, desc);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        checkStartCode();
+        checkEndCode();
+        checkMethodIdentifier(version, name, "name");
+        checkMethodDesc(desc);
+        if (bsm.getTag() != Opcodes.H_INVOKESTATIC
+                && bsm.getTag() != Opcodes.H_NEWINVOKESPECIAL)
+        {
+            throw new IllegalArgumentException("invalid handle tag "
+                    + bsm.getTag());
+        }
+        for (int i = 0; i < bsmArgs.length; i++) {
+            checkLDCConstant(bsmArgs[i]);
+        }
+        super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        checkStartCode();
+        checkEndCode();
+        checkOpcode(opcode, 6);
+        checkLabel(label, false, "label");
+        checkNonDebugLabel(label);
+        super.visitJumpInsn(opcode, label);
+        usedLabels.add(label);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        checkStartCode();
+        checkEndCode();
+        checkLabel(label, false, "label");
+        if (labels.get(label) != null) {
+            throw new IllegalArgumentException("Already visited label");
+        }
+        labels.put(label, new Integer(insnCount));
+        super.visitLabel(label);
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        checkStartCode();
+        checkEndCode();
+        checkLDCConstant(cst);
+        super.visitLdcInsn(cst);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        checkStartCode();
+        checkEndCode();
+        checkUnsignedShort(var, "Invalid variable index");
+        checkSignedShort(increment, "Invalid increment");
+        super.visitIincInsn(var, increment);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        checkStartCode();
+        checkEndCode();
+        if (max < min) {
+            throw new IllegalArgumentException("Max = " + max
+                    + " must be greater than or equal to min = " + min);
+        }
+        checkLabel(dflt, false, "default label");
+        checkNonDebugLabel(dflt);
+        if (labels == null || labels.length != max - min + 1) {
+            throw new IllegalArgumentException("There must be max - min + 1 labels");
+        }
+        for (int i = 0; i < labels.length; ++i) {
+            checkLabel(labels[i], false, "label at index " + i);
+            checkNonDebugLabel(labels[i]);
+        }
+        super.visitTableSwitchInsn(min, max, dflt, labels);
+        for (int i = 0; i < labels.length; ++i) {
+            usedLabels.add(labels[i]);
+        }
+        ++insnCount;
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        checkEndCode();
+        checkStartCode();
+        checkLabel(dflt, false, "default label");
+        checkNonDebugLabel(dflt);
+        if (keys == null || labels == null || keys.length != labels.length) {
+            throw new IllegalArgumentException("There must be the same number of keys and labels");
+        }
+        for (int i = 0; i < labels.length; ++i) {
+            checkLabel(labels[i], false, "label at index " + i);
+            checkNonDebugLabel(labels[i]);
+        }
+        super.visitLookupSwitchInsn(dflt, keys, labels);
+        usedLabels.add(dflt);
+        for (int i = 0; i < labels.length; ++i) {
+            usedLabels.add(labels[i]);
+        }
+        ++insnCount;
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        checkStartCode();
+        checkEndCode();
+        checkDesc(desc, false);
+        if (desc.charAt(0) != '[') {
+            throw new IllegalArgumentException("Invalid descriptor (must be an array type descriptor): "
+                    + desc);
+        }
+        if (dims < 1) {
+            throw new IllegalArgumentException("Invalid dimensions (must be greater than 0): "
+                    + dims);
+        }
+        if (dims > desc.lastIndexOf('[') + 1) {
+            throw new IllegalArgumentException("Invalid dimensions (must not be greater than dims(desc)): "
+                    + dims);
+        }
+        super.visitMultiANewArrayInsn(desc, dims);
+        ++insnCount;
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type)
+    {
+        checkStartCode();
+        checkEndCode();
+        checkLabel(start, false, "start label");
+        checkLabel(end, false, "end label");
+        checkLabel(handler, false, "handler label");
+        checkNonDebugLabel(start);
+        checkNonDebugLabel(end);
+        checkNonDebugLabel(handler);
+        if (labels.get(start) != null || labels.get(end) != null
+                || labels.get(handler) != null)
+        {
+            throw new IllegalStateException("Try catch blocks must be visited before their labels");
+        }
+        if (type != null) {
+            checkInternalName(type, "type");
+        }
+        super.visitTryCatchBlock(start, end, handler, type);
+        handlers.add(start);
+        handlers.add(end);
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        checkStartCode();
+        checkEndCode();
+        checkUnqualifiedName(version, name, "name");
+        checkDesc(desc, false);
+        checkLabel(start, true, "start label");
+        checkLabel(end, true, "end label");
+        checkUnsignedShort(index, "Invalid variable index");
+        int s = labels.get(start).intValue();
+        int e = labels.get(end).intValue();
+        if (e < s) {
+            throw new IllegalArgumentException("Invalid start and end labels (end must be greater than start)");
+        }
+        super.visitLocalVariable(name, desc, signature, start, end, index);
+    }
+
+    @Override
+    public void visitLineNumber(final int line, final Label start) {
+        checkStartCode();
+        checkEndCode();
+        checkUnsignedShort(line, "Invalid line number");
+        checkLabel(start, true, "start label");
+        super.visitLineNumber(line, start);
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        checkStartCode();
+        checkEndCode();
+        endCode = true;
+        for (Label l : usedLabels) {
+            if (labels.get(l) == null) {
+                throw new IllegalStateException("Undefined label used");
+            }
+        }
+        for (int i = 0; i < handlers.size(); ) {
+            Integer start = labels.get(handlers.get(i++));
+            Integer end = labels.get(handlers.get(i++));
+            if (start == null || end == null) {
+                throw new IllegalStateException("Undefined try catch block labels");
+            }
+            if (end.intValue() <= start.intValue()) {
+                throw new IllegalStateException("Emty try catch block handler range");
+            }
+        }
+        checkUnsignedShort(maxStack, "Invalid max stack");
+        checkUnsignedShort(maxLocals, "Invalid max locals");
+        super.visitMaxs(maxStack, maxLocals);
+    }
+
+    @Override
+    public void visitEnd() {
+        checkEndMethod();
+        endMethod = true;
+        super.visitEnd();
+    }
+
+    // -------------------------------------------------------------------------
+
+    /**
+     * Checks that the visitCode method has been called.
+     */
+    void checkStartCode() {
+        if (!startCode) {
+            throw new IllegalStateException("Cannot visit instructions before visitCode has been called.");
+        }
+    }
+
+    /**
+     * Checks that the visitMaxs method has not been called.
+     */
+    void checkEndCode() {
+        if (endCode) {
+            throw new IllegalStateException("Cannot visit instructions after visitMaxs has been called.");
+        }
+    }
+
+    /**
+     * Checks that the visitEnd method has not been called.
+     */
+    void checkEndMethod() {
+        if (endMethod) {
+            throw new IllegalStateException("Cannot visit elements after visitEnd has been called.");
+        }
+    }
+
+    /**
+     * Checks a stack frame value.
+     *
+     * @param value the value to be checked.
+     */
+    void checkFrameValue(final Object value) {
+        if (value == Opcodes.TOP || value == Opcodes.INTEGER
+                || value == Opcodes.FLOAT || value == Opcodes.LONG
+                || value == Opcodes.DOUBLE || value == Opcodes.NULL
+                || value == Opcodes.UNINITIALIZED_THIS)
+        {
+            return;
+        }
+        if (value instanceof String) {
+            checkInternalName((String) value, "Invalid stack frame value");
+            return;
+        }
+        if (!(value instanceof Label)) {
+            throw new IllegalArgumentException("Invalid stack frame value: "
+                    + value);
+        } else {
+            usedLabels.add((Label) value);
+        }
+    }
+
+    /**
+     * Checks that the type of the given opcode is equal to the given type.
+     *
+     * @param opcode the opcode to be checked.
+     * @param type the expected opcode type.
+     */
+    static void checkOpcode(final int opcode, final int type) {
+        if (opcode < 0 || opcode > 199 || TYPE[opcode] != type) {
+            throw new IllegalArgumentException("Invalid opcode: " + opcode);
+        }
+    }
+
+    /**
+     * Checks that the given value is a signed byte.
+     *
+     * @param value the value to be checked.
+     * @param msg an message to be used in case of error.
+     */
+    static void checkSignedByte(final int value, final String msg) {
+        if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
+            throw new IllegalArgumentException(msg
+                    + " (must be a signed byte): " + value);
+        }
+    }
+
+    /**
+     * Checks that the given value is a signed short.
+     *
+     * @param value the value to be checked.
+     * @param msg an message to be used in case of error.
+     */
+    static void checkSignedShort(final int value, final String msg) {
+        if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) {
+            throw new IllegalArgumentException(msg
+                    + " (must be a signed short): " + value);
+        }
+    }
+
+    /**
+     * Checks that the given value is an unsigned short.
+     *
+     * @param value the value to be checked.
+     * @param msg an message to be used in case of error.
+     */
+    static void checkUnsignedShort(final int value, final String msg) {
+        if (value < 0 || value > 65535) {
+            throw new IllegalArgumentException(msg
+                    + " (must be an unsigned short): " + value);
+        }
+    }
+
+    /**
+     * Checks that the given value is an {@link Integer}, a{@link Float}, a
+     * {@link Long}, a {@link Double} or a {@link String}.
+     *
+     * @param cst the value to be checked.
+     */
+    static void checkConstant(final Object cst) {
+        if (!(cst instanceof Integer) && !(cst instanceof Float)
+                && !(cst instanceof Long) && !(cst instanceof Double)
+                && !(cst instanceof String))
+        {
+            throw new IllegalArgumentException("Invalid constant: " + cst);
+        }
+    }
+
+    void checkLDCConstant(final Object cst) {
+        if (cst instanceof Type) {
+            int s = ((Type) cst).getSort();
+            if (s != Type.OBJECT && s != Type.ARRAY && s != Type.METHOD) {
+                throw new IllegalArgumentException("Illegal LDC constant value");
+            }
+            if (s != Type.METHOD && (version & 0xFFFF) < Opcodes.V1_5) {
+                throw new IllegalArgumentException("ldc of a constant class requires at least version 1.5");
+            }
+            if (s == Type.METHOD && (version & 0xFFFF) < Opcodes.V1_7) {
+                throw new IllegalArgumentException("ldc of a method type requires at least version 1.7");
+            }
+        } else if (cst instanceof Handle) {
+            if ((version & 0xFFFF) < Opcodes.V1_7) {
+                throw new IllegalArgumentException("ldc of a handle requires at least version 1.7");
+            }
+            int tag = ((Handle) cst).getTag();
+            if (tag < Opcodes.H_GETFIELD || tag > Opcodes.H_INVOKEINTERFACE) {
+                throw new IllegalArgumentException("invalid handle tag "
+                        + tag);
+            }
+        } else {
+            checkConstant(cst);
+        }
+    }
+
+    /**
+     * Checks that the given string is a valid unqualified name.
+     *
+     * @param version the class version.
+     * @param name the string to be checked.
+     * @param msg a message to be used in case of error.
+     */
+    static void checkUnqualifiedName(
+        int version,
+        final String name,
+        final String msg)
+    {
+        if ((version & 0xFFFF) < Opcodes.V1_5) {
+            checkIdentifier(name, msg);
+        } else {
+            for (int i = 0; i < name.length(); ++i) {
+                if (".;[/".indexOf(name.charAt(i)) != -1) {
+                    throw new IllegalArgumentException("Invalid " + msg
+                            + " (must be a valid unqualified name): " + name);
+                }
+            }
+        }
+    }
+
+    /**
+     * Checks that the given string is a valid Java identifier.
+     *
+     * @param name the string to be checked.
+     * @param msg a message to be used in case of error.
+     */
+    static void checkIdentifier(final String name, final String msg) {
+        checkIdentifier(name, 0, -1, msg);
+    }
+
+    /**
+     * Checks that the given substring is a valid Java identifier.
+     *
+     * @param name the string to be checked.
+     * @param start index of the first character of the identifier (inclusive).
+     * @param end index of the last character of the identifier (exclusive). -1
+     *        is equivalent to <tt>name.length()</tt> if name is not
+     *        <tt>null</tt>.
+     * @param msg a message to be used in case of error.
+     */
+    static void checkIdentifier(
+        final String name,
+        final int start,
+        final int end,
+        final String msg)
+    {
+        if (name == null || (end == -1 ? name.length() <= start : end <= start))
+        {
+            throw new IllegalArgumentException("Invalid " + msg
+                    + " (must not be null or empty)");
+        }
+        if (!Character.isJavaIdentifierStart(name.charAt(start))) {
+            throw new IllegalArgumentException("Invalid " + msg
+                    + " (must be a valid Java identifier): " + name);
+        }
+        int max = end == -1 ? name.length() : end;
+        for (int i = start + 1; i < max; ++i) {
+            if (!Character.isJavaIdentifierPart(name.charAt(i))) {
+                throw new IllegalArgumentException("Invalid " + msg
+                        + " (must be a valid Java identifier): " + name);
+            }
+        }
+    }
+
+    /**
+     * Checks that the given string is a valid Java identifier or is equal to
+     * '&lt;init&gt;' or '&lt;clinit&gt;'.
+     *
+     * @param version the class version.
+     * @param name the string to be checked.
+     * @param msg a message to be used in case of error.
+     */
+    static void checkMethodIdentifier(
+        int version,
+        final String name,
+        final String msg)
+    {
+        if (name == null || name.length() == 0) {
+            throw new IllegalArgumentException("Invalid " + msg
+                    + " (must not be null or empty)");
+        }
+        if ("<init>".equals(name) || "<clinit>".equals(name)) {
+            return;
+        }
+        if ((version & 0xFFFF) >= Opcodes.V1_5) {
+            for (int i = 0; i < name.length(); ++i) {
+                if (".;[/<>".indexOf(name.charAt(i)) != -1) {
+                    throw new IllegalArgumentException("Invalid " + msg
+                            + " (must be a valid unqualified name): " + name);
+                }
+            }
+            return;
+        }
+        if (!Character.isJavaIdentifierStart(name.charAt(0))) {
+            throw new IllegalArgumentException("Invalid "
+                    + msg
+                    + " (must be a '<init>', '<clinit>' or a valid Java identifier): "
+                    + name);
+        }
+        for (int i = 1; i < name.length(); ++i) {
+            if (!Character.isJavaIdentifierPart(name.charAt(i))) {
+                throw new IllegalArgumentException("Invalid "
+                        + msg
+                        + " (must be '<init>' or '<clinit>' or a valid Java identifier): "
+                        + name);
+            }
+        }
+    }
+
+    /**
+     * Checks that the given string is a valid internal class name.
+     *
+     * @param name the string to be checked.
+     * @param msg a message to be used in case of error.
+     */
+    static void checkInternalName(final String name, final String msg) {
+        if (name == null || name.length() == 0) {
+            throw new IllegalArgumentException("Invalid " + msg
+                    + " (must not be null or empty)");
+        }
+        if (name.charAt(0) == '[') {
+            checkDesc(name, false);
+        } else {
+            checkInternalName(name, 0, -1, msg);
+        }
+    }
+
+    /**
+     * Checks that the given substring is a valid internal class name.
+     *
+     * @param name the string to be checked.
+     * @param start index of the first character of the identifier (inclusive).
+     * @param end index of the last character of the identifier (exclusive). -1
+     *        is equivalent to <tt>name.length()</tt> if name is not
+     *        <tt>null</tt>.
+     * @param msg a message to be used in case of error.
+     */
+    static void checkInternalName(
+        final String name,
+        final int start,
+        final int end,
+        final String msg)
+    {
+        int max = end == -1 ? name.length() : end;
+        try {
+            int begin = start;
+            int slash;
+            do {
+                slash = name.indexOf('/', begin + 1);
+                if (slash == -1 || slash > max) {
+                    slash = max;
+                }
+                checkIdentifier(name, begin, slash, null);
+                begin = slash + 1;
+            } while (slash != max);
+        } catch (IllegalArgumentException _) {
+            throw new IllegalArgumentException("Invalid "
+                    + msg
+                    + " (must be a fully qualified class name in internal form): "
+                    + name);
+        }
+    }
+
+    /**
+     * Checks that the given string is a valid type descriptor.
+     *
+     * @param desc the string to be checked.
+     * @param canBeVoid <tt>true</tt> if <tt>V</tt> can be considered valid.
+     */
+    static void checkDesc(final String desc, final boolean canBeVoid) {
+        int end = checkDesc(desc, 0, canBeVoid);
+        if (end != desc.length()) {
+            throw new IllegalArgumentException("Invalid descriptor: " + desc);
+        }
+    }
+
+    /**
+     * Checks that a the given substring is a valid type descriptor.
+     *
+     * @param desc the string to be checked.
+     * @param start index of the first character of the identifier (inclusive).
+     * @param canBeVoid <tt>true</tt> if <tt>V</tt> can be considered valid.
+     * @return the index of the last character of the type decriptor, plus one.
+     */
+    static int checkDesc(
+        final String desc,
+        final int start,
+        final boolean canBeVoid)
+    {
+        if (desc == null || start >= desc.length()) {
+            throw new IllegalArgumentException("Invalid type descriptor (must not be null or empty)");
+        }
+        int index;
+        switch (desc.charAt(start)) {
+            case 'V':
+                if (canBeVoid) {
+                    return start + 1;
+                } else {
+                    throw new IllegalArgumentException("Invalid descriptor: "
+                            + desc);
+                }
+            case 'Z':
+            case 'C':
+            case 'B':
+            case 'S':
+            case 'I':
+            case 'F':
+            case 'J':
+            case 'D':
+                return start + 1;
+            case '[':
+                index = start + 1;
+                while (index < desc.length() && desc.charAt(index) == '[') {
+                    ++index;
+                }
+                if (index < desc.length()) {
+                    return checkDesc(desc, index, false);
+                } else {
+                    throw new IllegalArgumentException("Invalid descriptor: "
+                            + desc);
+                }
+            case 'L':
+                index = desc.indexOf(';', start);
+                if (index == -1 || index - start < 2) {
+                    throw new IllegalArgumentException("Invalid descriptor: "
+                            + desc);
+                }
+                try {
+                    checkInternalName(desc, start + 1, index, null);
+                } catch (IllegalArgumentException _) {
+                    throw new IllegalArgumentException("Invalid descriptor: "
+                            + desc);
+                }
+                return index + 1;
+            default:
+                throw new IllegalArgumentException("Invalid descriptor: "
+                        + desc);
+        }
+    }
+
+    /**
+     * Checks that the given string is a valid method descriptor.
+     *
+     * @param desc the string to be checked.
+     */
+    static void checkMethodDesc(final String desc) {
+        if (desc == null || desc.length() == 0) {
+            throw new IllegalArgumentException("Invalid method descriptor (must not be null or empty)");
+        }
+        if (desc.charAt(0) != '(' || desc.length() < 3) {
+            throw new IllegalArgumentException("Invalid descriptor: " + desc);
+        }
+        int start = 1;
+        if (desc.charAt(start) != ')') {
+            do {
+                if (desc.charAt(start) == 'V') {
+                    throw new IllegalArgumentException("Invalid descriptor: "
+                            + desc);
+                }
+                start = checkDesc(desc, start, false);
+            } while (start < desc.length() && desc.charAt(start) != ')');
+        }
+        start = checkDesc(desc, start + 1, true);
+        if (start != desc.length()) {
+            throw new IllegalArgumentException("Invalid descriptor: " + desc);
+        }
+    }
+
+    /**
+     * Checks a class signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     */
+    static void checkClassSignature(final String signature) {
+        // ClassSignature:
+        // FormalTypeParameters? ClassTypeSignature ClassTypeSignature*
+
+        int pos = 0;
+        if (getChar(signature, 0) == '<') {
+            pos = checkFormalTypeParameters(signature, pos);
+        }
+        pos = checkClassTypeSignature(signature, pos);
+        while (getChar(signature, pos) == 'L') {
+            pos = checkClassTypeSignature(signature, pos);
+        }
+        if (pos != signature.length()) {
+            throw new IllegalArgumentException(signature + ": error at index "
+                    + pos);
+        }
+    }
+
+    /**
+     * Checks a method signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     */
+    static void checkMethodSignature(final String signature) {
+        // MethodTypeSignature:
+        // FormalTypeParameters? ( TypeSignature* ) ( TypeSignature | V ) (
+        // ^ClassTypeSignature | ^TypeVariableSignature )*
+
+        int pos = 0;
+        if (getChar(signature, 0) == '<') {
+            pos = checkFormalTypeParameters(signature, pos);
+        }
+        pos = checkChar('(', signature, pos);
+        while ("ZCBSIFJDL[T".indexOf(getChar(signature, pos)) != -1) {
+            pos = checkTypeSignature(signature, pos);
+        }
+        pos = checkChar(')', signature, pos);
+        if (getChar(signature, pos) == 'V') {
+            ++pos;
+        } else {
+            pos = checkTypeSignature(signature, pos);
+        }
+        while (getChar(signature, pos) == '^') {
+            ++pos;
+            if (getChar(signature, pos) == 'L') {
+                pos = checkClassTypeSignature(signature, pos);
+            } else {
+                pos = checkTypeVariableSignature(signature, pos);
+            }
+        }
+        if (pos != signature.length()) {
+            throw new IllegalArgumentException(signature + ": error at index "
+                    + pos);
+        }
+    }
+
+    /**
+     * Checks a field signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     */
+    static void checkFieldSignature(final String signature) {
+        int pos = checkFieldTypeSignature(signature, 0);
+        if (pos != signature.length()) {
+            throw new IllegalArgumentException(signature + ": error at index "
+                    + pos);
+        }
+    }
+
+    /**
+     * Checks the formal type parameters of a class or method signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkFormalTypeParameters(final String signature, int pos)
+    {
+        // FormalTypeParameters:
+        // < FormalTypeParameter+ >
+
+        pos = checkChar('<', signature, pos);
+        pos = checkFormalTypeParameter(signature, pos);
+        while (getChar(signature, pos) != '>') {
+            pos = checkFormalTypeParameter(signature, pos);
+        }
+        return pos + 1;
+    }
+
+    /**
+     * Checks a formal type parameter of a class or method signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkFormalTypeParameter(final String signature, int pos)
+    {
+        // FormalTypeParameter:
+        // Identifier : FieldTypeSignature? (: FieldTypeSignature)*
+
+        pos = checkIdentifier(signature, pos);
+        pos = checkChar(':', signature, pos);
+        if ("L[T".indexOf(getChar(signature, pos)) != -1) {
+            pos = checkFieldTypeSignature(signature, pos);
+        }
+        while (getChar(signature, pos) == ':') {
+            pos = checkFieldTypeSignature(signature, pos + 1);
+        }
+        return pos;
+    }
+
+    /**
+     * Checks a field type signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkFieldTypeSignature(final String signature, int pos)
+    {
+        // FieldTypeSignature:
+        // ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature
+        //
+        // ArrayTypeSignature:
+        // [ TypeSignature
+
+        switch (getChar(signature, pos)) {
+            case 'L':
+                return checkClassTypeSignature(signature, pos);
+            case '[':
+                return checkTypeSignature(signature, pos + 1);
+            default:
+                return checkTypeVariableSignature(signature, pos);
+        }
+    }
+
+    /**
+     * Checks a class type signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkClassTypeSignature(final String signature, int pos)
+    {
+        // ClassTypeSignature:
+        // L Identifier ( / Identifier )* TypeArguments? ( . Identifier
+        // TypeArguments? )* ;
+
+        pos = checkChar('L', signature, pos);
+        pos = checkIdentifier(signature, pos);
+        while (getChar(signature, pos) == '/') {
+            pos = checkIdentifier(signature, pos + 1);
+        }
+        if (getChar(signature, pos) == '<') {
+            pos = checkTypeArguments(signature, pos);
+        }
+        while (getChar(signature, pos) == '.') {
+            pos = checkIdentifier(signature, pos + 1);
+            if (getChar(signature, pos) == '<') {
+                pos = checkTypeArguments(signature, pos);
+            }
+        }
+        return checkChar(';', signature, pos);
+    }
+
+    /**
+     * Checks the type arguments in a class type signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkTypeArguments(final String signature, int pos) {
+        // TypeArguments:
+        // < TypeArgument+ >
+
+        pos = checkChar('<', signature, pos);
+        pos = checkTypeArgument(signature, pos);
+        while (getChar(signature, pos) != '>') {
+            pos = checkTypeArgument(signature, pos);
+        }
+        return pos + 1;
+    }
+
+    /**
+     * Checks a type argument in a class type signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkTypeArgument(final String signature, int pos) {
+        // TypeArgument:
+        // * | ( ( + | - )? FieldTypeSignature )
+
+        char c = getChar(signature, pos);
+        if (c == '*') {
+            return pos + 1;
+        } else if (c == '+' || c == '-') {
+            pos++;
+        }
+        return checkFieldTypeSignature(signature, pos);
+    }
+
+    /**
+     * Checks a type variable signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkTypeVariableSignature(
+        final String signature,
+        int pos)
+    {
+        // TypeVariableSignature:
+        // T Identifier ;
+
+        pos = checkChar('T', signature, pos);
+        pos = checkIdentifier(signature, pos);
+        return checkChar(';', signature, pos);
+    }
+
+    /**
+     * Checks a type signature.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkTypeSignature(final String signature, int pos) {
+        // TypeSignature:
+        // Z | C | B | S | I | F | J | D | FieldTypeSignature
+
+        switch (getChar(signature, pos)) {
+            case 'Z':
+            case 'C':
+            case 'B':
+            case 'S':
+            case 'I':
+            case 'F':
+            case 'J':
+            case 'D':
+                return pos + 1;
+            default:
+                return checkFieldTypeSignature(signature, pos);
+        }
+    }
+
+    /**
+     * Checks an identifier.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkIdentifier(final String signature, int pos) {
+        if (!Character.isJavaIdentifierStart(getChar(signature, pos))) {
+            throw new IllegalArgumentException(signature
+                    + ": identifier expected at index " + pos);
+        }
+        ++pos;
+        while (Character.isJavaIdentifierPart(getChar(signature, pos))) {
+            ++pos;
+        }
+        return pos;
+    }
+
+    /**
+     * Checks a single character.
+     *
+     * @param signature a string containing the signature that must be checked.
+     * @param pos index of first character to be checked.
+     * @return the index of the first character after the checked part.
+     */
+    private static int checkChar(final char c, final String signature, int pos)
+    {
+        if (getChar(signature, pos) == c) {
+            return pos + 1;
+        }
+        throw new IllegalArgumentException(signature + ": '" + c
+                + "' expected at index " + pos);
+    }
+
+    /**
+     * Returns the signature car at the given index.
+     *
+     * @param signature a signature.
+     * @param pos an index in signature.
+     * @return the character at the given index, or 0 if there is no such
+     *         character.
+     */
+    private static char getChar(final String signature, int pos) {
+        return pos < signature.length() ? signature.charAt(pos) : (char) 0;
+    }
+
+    /**
+     * Checks that the given label is not null. This method can also check that
+     * the label has been visited.
+     *
+     * @param label the label to be checked.
+     * @param checkVisited <tt>true</tt> to check that the label has been
+     *        visited.
+     * @param msg a message to be used in case of error.
+     */
+    void checkLabel(
+        final Label label,
+        final boolean checkVisited,
+        final String msg)
+    {
+        if (label == null) {
+            throw new IllegalArgumentException("Invalid " + msg
+                    + " (must not be null)");
+        }
+        if (checkVisited && labels.get(label) == null) {
+            throw new IllegalArgumentException("Invalid " + msg
+                    + " (must be visited first)");
+        }
+    }
+
+    /**
+     * Checks that the given label is not a label used only for debug purposes.
+     *
+     * @param label the label to be checked.
+     */
+    private static void checkNonDebugLabel(final Label label) {
+        Field f = getLabelStatusField();
+        int status = 0;
+        try {
+            status = f == null ? 0 : ((Integer) f.get(label)).intValue();
+        } catch (IllegalAccessException e) {
+            throw new Error("Internal error");
+        }
+        if ((status & 0x01) != 0) {
+            throw new IllegalArgumentException("Labels used for debug info cannot be reused for control flow");
+        }
+    }
+
+    /**
+     * Returns the Field object corresponding to the Label.status field.
+     *
+     * @return the Field object corresponding to the Label.status field.
+     */
+    private static Field getLabelStatusField() {
+        if (labelStatusField == null) {
+            labelStatusField = getLabelField("a");
+            if (labelStatusField == null) {
+                labelStatusField = getLabelField("status");
+            }
+        }
+        return labelStatusField;
+    }
+
+    /**
+     * Returns the field of the Label class whose name is given.
+     *
+     * @param name a field name.
+     * @return the field of the Label class whose name is given, or null.
+     */
+    private static Field getLabelField(final String name) {
+        try {
+            Field f = Label.class.getDeclaredField(name);
+            f.setAccessible(true);
+            return f;
+        } catch (NoSuchFieldException e) {
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/CheckSignatureAdapter.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,358 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
+
+/**
+ * A {@link SignatureVisitor} that checks that its methods are properly used.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckSignatureAdapter extends SignatureVisitor {
+
+    /**
+     * Type to be used to check class signatures. See
+     * {@link #CheckSignatureAdapter(int, SignatureVisitor) CheckSignatureAdapter}.
+     */
+    public static final int CLASS_SIGNATURE = 0;
+
+    /**
+     * Type to be used to check method signatures. See
+     * {@link #CheckSignatureAdapter(int, SignatureVisitor) CheckSignatureAdapter}.
+     */
+    public static final int METHOD_SIGNATURE = 1;
+
+    /**
+     * Type to be used to check type signatures.See
+     * {@link #CheckSignatureAdapter(int, SignatureVisitor) CheckSignatureAdapter}.
+     */
+    public static final int TYPE_SIGNATURE = 2;
+
+    private static final int EMPTY = 1;
+
+    private static final int FORMAL = 2;
+
+    private static final int BOUND = 4;
+
+    private static final int SUPER = 8;
+
+    private static final int PARAM = 16;
+
+    private static final int RETURN = 32;
+
+    private static final int SIMPLE_TYPE = 64;
+
+    private static final int CLASS_TYPE = 128;
+
+    private static final int END = 256;
+
+    /**
+     * Type of the signature to be checked.
+     */
+    private final int type;
+
+    /**
+     * State of the automaton used to check the order of method calls.
+     */
+    private int state;
+
+    /**
+     * <tt>true</tt> if the checked type signature can be 'V'.
+     */
+    private boolean canBeVoid;
+
+    /**
+     * The visitor to which this adapter must delegate calls. May be
+     * <tt>null</tt>.
+     */
+    private final SignatureVisitor sv;
+
+    /**
+     * Creates a new {@link CheckSignatureAdapter} object. <i>Subclasses must
+     * not use this constructor</i>. Instead, they must use the
+     * {@link #CheckSignatureAdapter(int, int, SignatureVisitor)} version.
+     *
+     * @param type the type of signature to be checked. See
+     *        {@link #CLASS_SIGNATURE}, {@link #METHOD_SIGNATURE} and
+     *        {@link #TYPE_SIGNATURE}.
+     * @param sv the visitor to which this adapter must delegate calls. May be
+     *        <tt>null</tt>.
+     */
+    public CheckSignatureAdapter(final int type, final SignatureVisitor sv) {
+        this(Opcodes.ASM4, type, sv);
+    }
+
+    /**
+     * Creates a new {@link CheckSignatureAdapter} object.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     * @param type the type of signature to be checked. See
+     *        {@link #CLASS_SIGNATURE}, {@link #METHOD_SIGNATURE} and
+     *        {@link #TYPE_SIGNATURE}.
+     * @param sv the visitor to which this adapter must delegate calls. May be
+     *        <tt>null</tt>.
+     */
+    protected CheckSignatureAdapter(
+        final int api,
+        final int type,
+        final SignatureVisitor sv)
+    {
+        super(api);
+        this.type = type;
+        this.state = EMPTY;
+        this.sv = sv;
+    }
+
+    // class and method signatures
+
+    @Override
+    public void visitFormalTypeParameter(final String name) {
+        if (type == TYPE_SIGNATURE
+                || (state != EMPTY && state != FORMAL && state != BOUND))
+        {
+            throw new IllegalStateException();
+        }
+        CheckMethodAdapter.checkIdentifier(name, "formal type parameter");
+        state = FORMAL;
+        if (sv != null) {
+            sv.visitFormalTypeParameter(name);
+        }
+    }
+
+    @Override
+    public SignatureVisitor visitClassBound() {
+        if (state != FORMAL) {
+            throw new IllegalStateException();
+        }
+        state = BOUND;
+        SignatureVisitor v = sv == null ? null : sv.visitClassBound();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    @Override
+    public SignatureVisitor visitInterfaceBound() {
+        if (state != FORMAL && state != BOUND) {
+            throw new IllegalArgumentException();
+        }
+        SignatureVisitor v = sv == null ? null : sv.visitInterfaceBound();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    // class signatures
+
+    @Override
+    public SignatureVisitor visitSuperclass() {
+        if (type != CLASS_SIGNATURE || (state & (EMPTY | FORMAL | BOUND)) == 0)
+        {
+            throw new IllegalArgumentException();
+        }
+        state = SUPER;
+        SignatureVisitor v = sv == null ? null : sv.visitSuperclass();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    @Override
+    public SignatureVisitor visitInterface() {
+        if (state != SUPER) {
+            throw new IllegalStateException();
+        }
+        SignatureVisitor v = sv == null ? null : sv.visitInterface();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    // method signatures
+
+    @Override
+    public SignatureVisitor visitParameterType() {
+        if (type != METHOD_SIGNATURE
+                || (state & (EMPTY | FORMAL | BOUND | PARAM)) == 0)
+        {
+            throw new IllegalArgumentException();
+        }
+        state = PARAM;
+        SignatureVisitor v = sv == null ? null : sv.visitParameterType();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    @Override
+    public SignatureVisitor visitReturnType() {
+        if (type != METHOD_SIGNATURE
+                || (state & (EMPTY | FORMAL | BOUND | PARAM)) == 0)
+        {
+            throw new IllegalArgumentException();
+        }
+        state = RETURN;
+        SignatureVisitor v = sv == null ? null : sv.visitReturnType();
+        CheckSignatureAdapter cv = new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+        cv.canBeVoid = true;
+        return cv;
+    }
+
+    @Override
+    public SignatureVisitor visitExceptionType() {
+        if (state != RETURN) {
+            throw new IllegalStateException();
+        }
+        SignatureVisitor v = sv == null ? null : sv.visitExceptionType();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    // type signatures
+
+    @Override
+    public void visitBaseType(final char descriptor) {
+        if (type != TYPE_SIGNATURE || state != EMPTY) {
+            throw new IllegalStateException();
+        }
+        if (descriptor == 'V') {
+            if (!canBeVoid) {
+                throw new IllegalArgumentException();
+            }
+        } else {
+            if ("ZCBSIFJD".indexOf(descriptor) == -1) {
+                throw new IllegalArgumentException();
+            }
+        }
+        state = SIMPLE_TYPE;
+        if (sv != null) {
+            sv.visitBaseType(descriptor);
+        }
+    }
+
+    @Override
+    public void visitTypeVariable(final String name) {
+        if (type != TYPE_SIGNATURE || state != EMPTY) {
+            throw new IllegalStateException();
+        }
+        CheckMethodAdapter.checkIdentifier(name, "type variable");
+        state = SIMPLE_TYPE;
+        if (sv != null) {
+            sv.visitTypeVariable(name);
+        }
+    }
+
+    @Override
+    public SignatureVisitor visitArrayType() {
+        if (type != TYPE_SIGNATURE || state != EMPTY) {
+            throw new IllegalStateException();
+        }
+        state = SIMPLE_TYPE;
+        SignatureVisitor v = sv == null ? null : sv.visitArrayType();
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    @Override
+    public void visitClassType(final String name) {
+        if (type != TYPE_SIGNATURE || state != EMPTY) {
+            throw new IllegalStateException();
+        }
+        CheckMethodAdapter.checkInternalName(name, "class name");
+        state = CLASS_TYPE;
+        if (sv != null) {
+            sv.visitClassType(name);
+        }
+    }
+
+    @Override
+    public void visitInnerClassType(final String name) {
+        if (state != CLASS_TYPE) {
+            throw new IllegalStateException();
+        }
+        CheckMethodAdapter.checkIdentifier(name, "inner class name");
+        if (sv != null) {
+            sv.visitInnerClassType(name);
+        }
+    }
+
+    @Override
+    public void visitTypeArgument() {
+        if (state != CLASS_TYPE) {
+            throw new IllegalStateException();
+        }
+        if (sv != null) {
+            sv.visitTypeArgument();
+        }
+    }
+
+    @Override
+    public SignatureVisitor visitTypeArgument(final char wildcard) {
+        if (state != CLASS_TYPE) {
+            throw new IllegalStateException();
+        }
+        if ("+-=".indexOf(wildcard) == -1) {
+            throw new IllegalArgumentException();
+        }
+        SignatureVisitor v = sv == null ? null : sv.visitTypeArgument(wildcard);
+        return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
+    }
+
+    @Override
+    public void visitEnd() {
+        if (state != CLASS_TYPE) {
+            throw new IllegalStateException();
+        }
+        state = END;
+        if (sv != null) {
+            sv.visitEnd();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/Printer.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,587 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * An abstract converter from visit events to text.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class Printer {
+
+    /**
+     * The names of the Java Virtual Machine opcodes.
+     */
+    public static final String[] OPCODES;
+
+    /**
+     * The names of the for <code>operand</code> parameter values of the
+     * {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitIntInsn} method when
+     * <code>opcode</code> is <code>NEWARRAY</code>.
+     */
+    public static final String[] TYPES;
+
+    /**
+     * The names of the <code>tag</code> field values for
+     * {@link jdk.internal.org.objectweb.asm.Handle}.
+     */
+    public static final String[] HANDLE_TAG;
+
+    static {
+        String s = "NOP,ACONST_NULL,ICONST_M1,ICONST_0,ICONST_1,ICONST_2,"
+                + "ICONST_3,ICONST_4,ICONST_5,LCONST_0,LCONST_1,FCONST_0,"
+                + "FCONST_1,FCONST_2,DCONST_0,DCONST_1,BIPUSH,SIPUSH,LDC,,,"
+                + "ILOAD,LLOAD,FLOAD,DLOAD,ALOAD,,,,,,,,,,,,,,,,,,,,,IALOAD,"
+                + "LALOAD,FALOAD,DALOAD,AALOAD,BALOAD,CALOAD,SALOAD,ISTORE,"
+                + "LSTORE,FSTORE,DSTORE,ASTORE,,,,,,,,,,,,,,,,,,,,,IASTORE,"
+                + "LASTORE,FASTORE,DASTORE,AASTORE,BASTORE,CASTORE,SASTORE,POP,"
+                + "POP2,DUP,DUP_X1,DUP_X2,DUP2,DUP2_X1,DUP2_X2,SWAP,IADD,LADD,"
+                + "FADD,DADD,ISUB,LSUB,FSUB,DSUB,IMUL,LMUL,FMUL,DMUL,IDIV,LDIV,"
+                + "FDIV,DDIV,IREM,LREM,FREM,DREM,INEG,LNEG,FNEG,DNEG,ISHL,LSHL,"
+                + "ISHR,LSHR,IUSHR,LUSHR,IAND,LAND,IOR,LOR,IXOR,LXOR,IINC,I2L,"
+                + "I2F,I2D,L2I,L2F,L2D,F2I,F2L,F2D,D2I,D2L,D2F,I2B,I2C,I2S,LCMP,"
+                + "FCMPL,FCMPG,DCMPL,DCMPG,IFEQ,IFNE,IFLT,IFGE,IFGT,IFLE,"
+                + "IF_ICMPEQ,IF_ICMPNE,IF_ICMPLT,IF_ICMPGE,IF_ICMPGT,IF_ICMPLE,"
+                + "IF_ACMPEQ,IF_ACMPNE,GOTO,JSR,RET,TABLESWITCH,LOOKUPSWITCH,"
+                + "IRETURN,LRETURN,FRETURN,DRETURN,ARETURN,RETURN,GETSTATIC,"
+                + "PUTSTATIC,GETFIELD,PUTFIELD,INVOKEVIRTUAL,INVOKESPECIAL,"
+                + "INVOKESTATIC,INVOKEINTERFACE,INVOKEDYNAMIC,NEW,NEWARRAY,"
+                + "ANEWARRAY,ARRAYLENGTH,ATHROW,CHECKCAST,INSTANCEOF,"
+                + "MONITORENTER,MONITOREXIT,,MULTIANEWARRAY,IFNULL,IFNONNULL,";
+        OPCODES = new String[200];
+        int i = 0;
+        int j = 0;
+        int l;
+        while ((l = s.indexOf(',', j)) > 0) {
+            OPCODES[i++] = j + 1 == l ? null : s.substring(j, l);
+            j = l + 1;
+        }
+
+        s = "T_BOOLEAN,T_CHAR,T_FLOAT,T_DOUBLE,T_BYTE,T_SHORT,T_INT,T_LONG,";
+        TYPES = new String[12];
+        j = 0;
+        i = 4;
+        while ((l = s.indexOf(',', j)) > 0) {
+            TYPES[i++] = s.substring(j, l);
+            j = l + 1;
+        }
+
+        s = "H_GETFIELD,H_GETSTATIC,H_PUTFIELD,H_PUTSTATIC,"
+          + "H_INVOKEVIRTUAL,H_INVOKESTATIC,H_INVOKESPECIAL,"
+          + "H_NEWINVOKESPECIAL,H_INVOKEINTERFACE,";
+        HANDLE_TAG = new String[10];
+        j = 0;
+        i = 1;
+        while ((l = s.indexOf(',', j)) > 0) {
+            HANDLE_TAG[i++] = s.substring(j, l);
+            j = l + 1;
+        }
+    }
+
+    /**
+     * The ASM API version implemented by this class. The value of this field
+     * must be one of {@link Opcodes#ASM4}.
+     */
+    protected final int api;
+
+    /**
+     * A buffer that can be used to create strings.
+     */
+    protected final StringBuffer buf;
+
+    /**
+     * The text to be printed. Since the code of methods is not necessarily
+     * visited in sequential order, one method after the other, but can be
+     * interlaced (some instructions from method one, then some instructions
+     * from method two, then some instructions from method one again...), it is
+     * not possible to print the visited instructions directly to a sequential
+     * stream. A class is therefore printed in a two steps process: a string
+     * tree is constructed during the visit, and printed to a sequential stream
+     * at the end of the visit. This string tree is stored in this field, as a
+     * string list that can contain other string lists, which can themselves
+     * contain other string lists, and so on.
+     */
+    public final List<Object> text;
+
+    /**
+     * Constructs a new {@link Printer}.
+     */
+    protected Printer(final int api) {
+        this.api = api;
+        this.buf = new StringBuffer();
+        this.text = new ArrayList<Object>();
+    }
+
+    /**
+     * Class header.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visit}.
+     */
+    public abstract void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces);
+
+    /**
+     * Class source.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitSource}.
+     */
+    public abstract void visitSource(final String file, final String debug);
+
+    /**
+     * Class outer class.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitOuterClass}.
+     */
+    public abstract void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc);
+
+    /**
+     * Class annotation.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitAnnotation}.
+     */
+    public abstract Printer visitClassAnnotation(
+        final String desc,
+        final boolean visible);
+
+    /**
+     * Class attribute.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitAttribute}.
+     */
+    public abstract void visitClassAttribute(final Attribute attr);
+
+    /**
+     * Class inner name.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitInnerClass}.
+     */
+    public abstract void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access);
+
+    /**
+     * Class field.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitField}.
+     */
+    public abstract Printer visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value);
+
+    /**
+     * Class method.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitMethod}.
+     */
+    public abstract Printer visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions);
+
+    /**
+     * Class end.
+     * See {@link jdk.internal.org.objectweb.asm.ClassVisitor#visitEnd}.
+     */
+    public abstract void visitClassEnd();
+
+    // ------------------------------------------------------------------------
+    // Annotations
+    // ------------------------------------------------------------------------
+
+    /**
+     * Annotation value.
+     * See {@link jdk.internal.org.objectweb.asm.AnnotationVisitor#visit}.
+     */
+    public abstract void visit(final String name, final Object value);
+
+    /**
+     * Annotation enum value.
+     * See {@link jdk.internal.org.objectweb.asm.AnnotationVisitor#visitEnum}.
+     */
+    public abstract void visitEnum(
+        final String name,
+        final String desc,
+        final String value);
+
+    /**
+     * Nested annotation value.
+     * See {@link jdk.internal.org.objectweb.asm.AnnotationVisitor#visitAnnotation}.
+     */
+    public abstract Printer visitAnnotation(
+        final String name,
+        final String desc);
+
+    /**
+     * Annotation array value.
+     * See {@link jdk.internal.org.objectweb.asm.AnnotationVisitor#visitArray}.
+     */
+    public abstract Printer visitArray(final String name);
+
+    /**
+     * Annotation end.
+     * See {@link jdk.internal.org.objectweb.asm.AnnotationVisitor#visitEnd}.
+     */
+    public abstract void visitAnnotationEnd();
+
+    // ------------------------------------------------------------------------
+    // Fields
+    // ------------------------------------------------------------------------
+
+    /**
+     * Field annotation.
+     * See {@link jdk.internal.org.objectweb.asm.FieldVisitor#visitAnnotation}.
+     */
+    public abstract Printer visitFieldAnnotation(
+        final String desc,
+        final boolean visible);
+
+    /**
+     * Field attribute.
+     * See {@link jdk.internal.org.objectweb.asm.FieldVisitor#visitAttribute}.
+     */
+    public abstract void visitFieldAttribute(final Attribute attr);
+
+    /**
+     * Field end.
+     * See {@link jdk.internal.org.objectweb.asm.FieldVisitor#visitEnd}.
+     */
+    public abstract void visitFieldEnd();
+
+    // ------------------------------------------------------------------------
+    // Methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Method default annotation.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitAnnotationDefault}.
+     */
+    public abstract Printer visitAnnotationDefault();
+
+    /**
+     * Method annotation.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitAnnotation}.
+     */
+    public abstract Printer visitMethodAnnotation(
+        final String desc,
+        final boolean visible);
+
+    /**
+     * Method parameter annotation.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitParameterAnnotation}.
+     */
+    public abstract Printer visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible);
+
+    /**
+     * Method attribute.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitAttribute}.
+     */
+    public abstract void visitMethodAttribute(final Attribute attr);
+
+    /**
+     * Method start.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitCode}.
+     */
+    public abstract void visitCode();
+
+    /**
+     * Method stack frame.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitFrame}.
+     */
+    public abstract void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitInsn}.
+     */
+    public abstract void visitInsn(final int opcode);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitIntInsn}.
+     */
+    public abstract void visitIntInsn(final int opcode, final int operand);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitVarInsn}.
+     */
+    public abstract void visitVarInsn(final int opcode, final int var);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitTypeInsn}.
+     */
+    public abstract void visitTypeInsn(final int opcode, final String type);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitFieldInsn}.
+     */
+    public abstract void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitMethodInsn}.
+     */
+    public abstract void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitInvokeDynamicInsn}.
+     */
+    public abstract void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitJumpInsn}.
+     */
+    public abstract void visitJumpInsn(final int opcode, final Label label);
+
+    /**
+     * Method label.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitLabel}.
+     */
+    public abstract void visitLabel(final Label label);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitLdcInsn}.
+     */
+    public abstract void visitLdcInsn(final Object cst);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitIincInsn}.
+     */
+    public abstract void visitIincInsn(final int var, final int increment);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitTableSwitchInsn}.
+     */
+    public abstract void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitLookupSwitchInsn}.
+     */
+    public abstract void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels);
+
+    /**
+     * Method instruction.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitMultiANewArrayInsn}.
+     */
+    public abstract void visitMultiANewArrayInsn(
+        final String desc,
+        final int dims);
+
+    /**
+     * Method exception handler.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitTryCatchBlock}.
+     */
+    public abstract void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type);
+
+    /**
+     * Method debug info.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitLocalVariable}.
+     */
+    public abstract void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index);
+
+    /**
+     * Method debug info.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitLineNumber}.
+     */
+    public abstract void visitLineNumber(final int line, final Label start);
+
+    /**
+     * Method max stack and max locals.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitMaxs}.
+     */
+    public abstract void visitMaxs(final int maxStack, final int maxLocals);
+
+    /**
+     * Method end.
+     * See {@link jdk.internal.org.objectweb.asm.MethodVisitor#visitEnd}.
+     */
+    public abstract void visitMethodEnd();
+
+    /**
+     * Returns the text constructed by this visitor.
+     *
+     * @return the text constructed by this visitor.
+     */
+    public List<Object> getText() {
+        return text;
+    }
+
+    /**
+     * Prints the text constructed by this visitor.
+     *
+     * @param pw the print writer to be used.
+     */
+    public void print(final PrintWriter pw) {
+        printList(pw, text);
+    }
+
+    /**
+     * Appends a quoted string to a given buffer.
+     *
+     * @param buf the buffer where the string must be added.
+     * @param s the string to be added.
+     */
+    public static void appendString(final StringBuffer buf, final String s) {
+        buf.append('\"');
+        for (int i = 0; i < s.length(); ++i) {
+            char c = s.charAt(i);
+            if (c == '\n') {
+                buf.append("\\n");
+            } else if (c == '\r') {
+                buf.append("\\r");
+            } else if (c == '\\') {
+                buf.append("\\\\");
+            } else if (c == '"') {
+                buf.append("\\\"");
+            } else if (c < 0x20 || c > 0x7f) {
+                buf.append("\\u");
+                if (c < 0x10) {
+                    buf.append("000");
+                } else if (c < 0x100) {
+                    buf.append("00");
+                } else if (c < 0x1000) {
+                    buf.append('0');
+                }
+                buf.append(Integer.toString(c, 16));
+            } else {
+                buf.append(c);
+            }
+        }
+        buf.append('\"');
+    }
+
+    /**
+     * Prints the given string tree.
+     *
+     * @param pw the writer to be used to print the tree.
+     * @param l a string tree, i.e., a string list that can contain other string
+     *        lists, and so on recursively.
+     */
+    static void printList(final PrintWriter pw, final List<?> l) {
+        for (int i = 0; i < l.size(); ++i) {
+            Object o = l.get(i);
+            if (o instanceof List) {
+                printList(pw, (List<?>) o);
+            } else {
+                pw.print(o.toString());
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/Textifiable.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,83 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Label;
+
+/**
+ * An {@link jdk.internal.org.objectweb.asm.Attribute Attribute} that can print a readable
+ * representation of itself.
+ *
+ * Implementations should construct readable output from an attribute data
+ * structure. Such representation could be used in unit test assertions.
+ *
+ * @author Eugene Kuleshov
+ */
+public interface Textifiable {
+
+    /**
+     * Build a human readable representation of this attribute.
+     *
+     * @param buf a buffer used for printing Java code.
+     * @param labelNames map of label instances to their names.
+     */
+    void textify(StringBuffer buf, Map<Label, String> labelNames);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/Textifier.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,1315 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.signature.SignatureReader;
+
+/**
+ * A {@link Printer} that prints a disassembled view of the classes it visits.
+ *
+ * @author Eric Bruneton
+ */
+public class Textifier extends Printer {
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for internal
+     * type names in bytecode notation.
+     */
+    public static final int INTERNAL_NAME = 0;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for field
+     * descriptors, formatted in bytecode notation
+     */
+    public static final int FIELD_DESCRIPTOR = 1;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for field
+     * signatures, formatted in bytecode notation
+     */
+    public static final int FIELD_SIGNATURE = 2;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for method
+     * descriptors, formatted in bytecode notation
+     */
+    public static final int METHOD_DESCRIPTOR = 3;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for method
+     * signatures, formatted in bytecode notation
+     */
+    public static final int METHOD_SIGNATURE = 4;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for class
+     * signatures, formatted in bytecode notation
+     */
+    public static final int CLASS_SIGNATURE = 5;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for field or
+     * method return value signatures, formatted in default Java notation
+     * (non-bytecode)
+     */
+    public static final int TYPE_DECLARATION = 6;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for class
+     * signatures, formatted in default Java notation (non-bytecode)
+     */
+    public static final int CLASS_DECLARATION = 7;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for method
+     * parameter signatures, formatted in default Java notation (non-bytecode)
+     */
+    public static final int PARAMETERS_DECLARATION = 8;
+
+    /**
+     * Constant used in {@link #appendDescriptor appendDescriptor} for handle
+     * descriptors, formatted in bytecode notation
+     */
+    public static final int HANDLE_DESCRIPTOR = 9;
+
+    /**
+     * Tab for class members.
+     */
+    protected String tab = "  ";
+
+    /**
+     * Tab for bytecode instructions.
+     */
+    protected String tab2 = "    ";
+
+    /**
+     * Tab for table and lookup switch instructions.
+     */
+    protected String tab3 = "      ";
+
+    /**
+     * Tab for labels.
+     */
+    protected String ltab = "   ";
+
+    /**
+     * The label names. This map associate String values to Label keys.
+     */
+    protected Map<Label, String> labelNames;
+
+    private int valueNumber = 0;
+
+    /**
+     * Constructs a new {@link Textifier}. <i>Subclasses must not use this
+     * constructor</i>. Instead, they must use the {@link #Textifier(int)}
+     * version.
+     */
+    public Textifier() {
+        this(Opcodes.ASM4);
+    }
+
+    /**
+     * Constructs a new {@link Textifier}.
+     *
+     * @param api the ASM API version implemented by this visitor. Must be one
+     *        of {@link Opcodes#ASM4}.
+     */
+    protected Textifier(final int api) {
+        super(api);
+    }
+
+    /**
+     * Prints a disassembled view of the given class to the standard output. <p>
+     * Usage: Textifier [-debug] &lt;binary class name or class
+     * file name &gt;
+     *
+     * @param args the command line arguments.
+     *
+     * @throws Exception if the class cannot be found, or if an IO exception
+     *         occurs.
+     */
+    public static void main(final String[] args) throws Exception {
+        int i = 0;
+        int flags = ClassReader.SKIP_DEBUG;
+
+        boolean ok = true;
+        if (args.length < 1 || args.length > 2) {
+            ok = false;
+        }
+        if (ok && "-debug".equals(args[0])) {
+            i = 1;
+            flags = 0;
+            if (args.length != 2) {
+                ok = false;
+            }
+        }
+        if (!ok) {
+            System.err.println("Prints a disassembled view of the given class.");
+            System.err.println("Usage: Textifier [-debug] "
+                    + "<fully qualified class name or class file name>");
+            return;
+        }
+        ClassReader cr;
+        if (args[i].endsWith(".class") || args[i].indexOf('\\') > -1
+                || args[i].indexOf('/') > -1)
+        {
+            cr = new ClassReader(new FileInputStream(args[i]));
+        } else {
+            cr = new ClassReader(args[i]);
+        }
+        cr.accept(new TraceClassVisitor(new PrintWriter(System.out)),
+                flags);
+    }
+
+    // ------------------------------------------------------------------------
+    // Classes
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        int major = version & 0xFFFF;
+        int minor = version >>> 16;
+        buf.setLength(0);
+        buf.append("// class version ")
+                .append(major)
+                .append('.')
+                .append(minor)
+                .append(" (")
+                .append(version)
+                .append(")\n");
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            buf.append("// DEPRECATED\n");
+        }
+        buf.append("// access flags 0x").append(Integer.toHexString(access).toUpperCase()).append('\n');
+
+        appendDescriptor(CLASS_SIGNATURE, signature);
+        if (signature != null) {
+            TraceSignatureVisitor sv = new TraceSignatureVisitor(access);
+            SignatureReader r = new SignatureReader(signature);
+            r.accept(sv);
+            buf.append("// declaration: ")
+                    .append(name)
+                    .append(sv.getDeclaration())
+                    .append('\n');
+        }
+
+        appendAccess(access & ~Opcodes.ACC_SUPER);
+        if ((access & Opcodes.ACC_ANNOTATION) != 0) {
+            buf.append("@interface ");
+        } else if ((access & Opcodes.ACC_INTERFACE) != 0) {
+            buf.append("interface ");
+        } else if ((access & Opcodes.ACC_ENUM) == 0) {
+            buf.append("class ");
+        }
+        appendDescriptor(INTERNAL_NAME, name);
+
+        if (superName != null && !"java/lang/Object".equals(superName)) {
+            buf.append(" extends ");
+            appendDescriptor(INTERNAL_NAME, superName);
+            buf.append(' ');
+        }
+        if (interfaces != null && interfaces.length > 0) {
+            buf.append(" implements ");
+            for (int i = 0; i < interfaces.length; ++i) {
+                appendDescriptor(INTERNAL_NAME, interfaces[i]);
+                buf.append(' ');
+            }
+        }
+        buf.append(" {\n\n");
+
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitSource(final String file, final String debug) {
+        buf.setLength(0);
+        if (file != null) {
+            buf.append(tab)
+                    .append("// compiled from: ")
+                    .append(file)
+                    .append('\n');
+        }
+        if (debug != null) {
+            buf.append(tab)
+                    .append("// debug info: ")
+                    .append(debug)
+                    .append('\n');
+        }
+        if (buf.length() > 0) {
+            text.add(buf.toString());
+        }
+    }
+
+    @Override
+    public void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append(tab).append("OUTERCLASS ");
+        appendDescriptor(INTERNAL_NAME, owner);
+        buf.append(' ');
+        if (name != null) {
+            buf.append(name).append(' ');
+        }
+        appendDescriptor(METHOD_DESCRIPTOR, desc);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public Textifier visitClassAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        text.add("\n");
+        return visitAnnotation(desc, visible);
+    }
+
+    @Override
+    public void visitClassAttribute(final Attribute attr) {
+        text.add("\n");
+        visitAttribute(attr);
+    }
+
+    @Override
+    public void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        buf.setLength(0);
+        buf.append(tab).append("// access flags 0x");
+        buf.append(Integer.toHexString(access & ~Opcodes.ACC_SUPER).toUpperCase()).append('\n');
+        buf.append(tab);
+        appendAccess(access);
+        buf.append("INNERCLASS ");
+        appendDescriptor(INTERNAL_NAME, name);
+        buf.append(' ');
+        appendDescriptor(INTERNAL_NAME, outerName);
+        buf.append(' ');
+        appendDescriptor(INTERNAL_NAME, innerName);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public Textifier visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        buf.setLength(0);
+        buf.append('\n');
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            buf.append(tab).append("// DEPRECATED\n");
+        }
+        buf.append(tab).append("// access flags 0x").append(Integer.toHexString(access).toUpperCase()).append('\n');
+        if (signature != null) {
+            buf.append(tab);
+            appendDescriptor(FIELD_SIGNATURE, signature);
+
+            TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
+            SignatureReader r = new SignatureReader(signature);
+            r.acceptType(sv);
+            buf.append(tab)
+                    .append("// declaration: ")
+                    .append(sv.getDeclaration())
+                    .append('\n');
+        }
+
+        buf.append(tab);
+        appendAccess(access);
+
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append(' ').append(name);
+        if (value != null) {
+            buf.append(" = ");
+            if (value instanceof String) {
+                buf.append('\"').append(value).append('\"');
+            } else {
+                buf.append(value);
+            }
+        }
+
+        buf.append('\n');
+        text.add(buf.toString());
+
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        return t;
+    }
+
+    @Override
+    public Textifier visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        buf.setLength(0);
+        buf.append('\n');
+        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+            buf.append(tab).append("// DEPRECATED\n");
+        }
+        buf.append(tab).append("// access flags 0x").append(Integer.toHexString(access).toUpperCase()).append('\n');
+
+        if (signature != null) {
+            buf.append(tab);
+            appendDescriptor(METHOD_SIGNATURE, signature);
+
+            TraceSignatureVisitor v = new TraceSignatureVisitor(0);
+            SignatureReader r = new SignatureReader(signature);
+            r.accept(v);
+            String genericDecl = v.getDeclaration();
+            String genericReturn = v.getReturnType();
+            String genericExceptions = v.getExceptions();
+
+            buf.append(tab)
+                    .append("// declaration: ")
+                    .append(genericReturn)
+                    .append(' ')
+                    .append(name)
+                    .append(genericDecl);
+            if (genericExceptions != null) {
+                buf.append(" throws ").append(genericExceptions);
+            }
+            buf.append('\n');
+        }
+
+        buf.append(tab);
+        appendAccess(access);
+        if ((access & Opcodes.ACC_NATIVE) != 0) {
+            buf.append("native ");
+        }
+        if ((access & Opcodes.ACC_VARARGS) != 0) {
+            buf.append("varargs ");
+        }
+        if ((access & Opcodes.ACC_BRIDGE) != 0) {
+            buf.append("bridge ");
+        }
+
+        buf.append(name);
+        appendDescriptor(METHOD_DESCRIPTOR, desc);
+        if (exceptions != null && exceptions.length > 0) {
+            buf.append(" throws ");
+            for (int i = 0; i < exceptions.length; ++i) {
+                appendDescriptor(INTERNAL_NAME, exceptions[i]);
+                buf.append(' ');
+            }
+        }
+
+        buf.append('\n');
+        text.add(buf.toString());
+
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        return t;
+    }
+
+    @Override
+    public void visitClassEnd() {
+        text.add("}\n");
+    }
+
+    // ------------------------------------------------------------------------
+    // Annotations
+    // ------------------------------------------------------------------------
+
+    @Override
+    public void visit(final String name, final Object value) {
+        buf.setLength(0);
+        appendComa(valueNumber++);
+
+        if (name != null) {
+            buf.append(name).append('=');
+        }
+
+        if (value instanceof String) {
+            visitString((String) value);
+        } else if (value instanceof Type) {
+            visitType((Type) value);
+        } else if (value instanceof Byte) {
+            visitByte(((Byte) value).byteValue());
+        } else if (value instanceof Boolean) {
+            visitBoolean(((Boolean) value).booleanValue());
+        } else if (value instanceof Short) {
+            visitShort(((Short) value).shortValue());
+        } else if (value instanceof Character) {
+            visitChar(((Character) value).charValue());
+        } else if (value instanceof Integer) {
+            visitInt(((Integer) value).intValue());
+        } else if (value instanceof Float) {
+            visitFloat(((Float) value).floatValue());
+        } else if (value instanceof Long) {
+            visitLong(((Long) value).longValue());
+        } else if (value instanceof Double) {
+            visitDouble(((Double) value).doubleValue());
+        } else if (value.getClass().isArray()) {
+            buf.append('{');
+            if (value instanceof byte[]) {
+                byte[] v = (byte[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitByte(v[i]);
+                }
+            } else if (value instanceof boolean[]) {
+                boolean[] v = (boolean[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitBoolean(v[i]);
+                }
+            } else if (value instanceof short[]) {
+                short[] v = (short[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitShort(v[i]);
+                }
+            } else if (value instanceof char[]) {
+                char[] v = (char[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitChar(v[i]);
+                }
+            } else if (value instanceof int[]) {
+                int[] v = (int[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitInt(v[i]);
+                }
+            } else if (value instanceof long[]) {
+                long[] v = (long[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitLong(v[i]);
+                }
+            } else if (value instanceof float[]) {
+                float[] v = (float[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitFloat(v[i]);
+                }
+            } else if (value instanceof double[]) {
+                double[] v = (double[]) value;
+                for (int i = 0; i < v.length; i++) {
+                    appendComa(i);
+                    visitDouble(v[i]);
+                }
+            }
+            buf.append('}');
+        }
+
+        text.add(buf.toString());
+    }
+
+    private void visitInt(final int value) {
+        buf.append(value);
+    }
+
+    private void visitLong(final long value) {
+        buf.append(value).append('L');
+    }
+
+    private void visitFloat(final float value) {
+        buf.append(value).append('F');
+    }
+
+    private void visitDouble(final double value) {
+        buf.append(value).append('D');
+    }
+
+    private void visitChar(final char value) {
+        buf.append("(char)").append((int) value);
+    }
+
+    private void visitShort(final short value) {
+        buf.append("(short)").append(value);
+    }
+
+    private void visitByte(final byte value) {
+        buf.append("(byte)").append(value);
+    }
+
+    private void visitBoolean(final boolean value) {
+        buf.append(value);
+    }
+
+    private void visitString(final String value) {
+        appendString(buf, value);
+    }
+
+    private void visitType(final Type value) {
+        buf.append(value.getClassName()).append(".class");
+    }
+
+    @Override
+    public void visitEnum(
+        final String name,
+        final String desc,
+        final String value)
+    {
+        buf.setLength(0);
+        appendComa(valueNumber++);
+        if (name != null) {
+            buf.append(name).append('=');
+        }
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append('.').append(value);
+        text.add(buf.toString());
+    }
+
+    @Override
+    public Textifier visitAnnotation(
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        appendComa(valueNumber++);
+        if (name != null) {
+            buf.append(name).append('=');
+        }
+        buf.append('@');
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append('(');
+        text.add(buf.toString());
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        text.add(")");
+        return t;
+    }
+
+    @Override
+    public Textifier visitArray(
+        final String name)
+    {
+        buf.setLength(0);
+        appendComa(valueNumber++);
+        if (name != null) {
+            buf.append(name).append('=');
+        }
+        buf.append('{');
+        text.add(buf.toString());
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        text.add("}");
+        return t;
+    }
+
+    @Override
+    public void visitAnnotationEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Fields
+    // ------------------------------------------------------------------------
+
+    @Override
+    public Textifier visitFieldAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        return visitAnnotation(desc, visible);
+    }
+
+    @Override
+    public void visitFieldAttribute(final Attribute attr) {
+        visitAttribute(attr);
+    }
+
+    @Override
+    public void visitFieldEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Methods
+    // ------------------------------------------------------------------------
+
+    @Override
+    public Textifier visitAnnotationDefault() {
+        text.add(tab2 + "default=");
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        text.add("\n");
+        return t;
+    }
+
+    @Override
+    public Textifier visitMethodAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        return visitAnnotation(desc, visible);
+    }
+
+    @Override
+    public Textifier visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append('@');
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append('(');
+        text.add(buf.toString());
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        text.add(visible ? ") // parameter " : ") // invisible, parameter ");
+        text.add(new Integer(parameter));
+        text.add("\n");
+        return t;
+    }
+
+    @Override
+    public void visitMethodAttribute(final Attribute attr) {
+        buf.setLength(0);
+        buf.append(tab).append("ATTRIBUTE ");
+        appendDescriptor(-1, attr.type);
+
+        if (attr instanceof Textifiable) {
+            ((Textifiable) attr).textify(buf, labelNames);
+        } else {
+            buf.append(" : unknown\n");
+        }
+
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitCode() {
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        buf.setLength(0);
+        buf.append(ltab);
+        buf.append("FRAME ");
+        switch (type) {
+            case Opcodes.F_NEW:
+            case Opcodes.F_FULL:
+                buf.append("FULL [");
+                appendFrameTypes(nLocal, local);
+                buf.append("] [");
+                appendFrameTypes(nStack, stack);
+                buf.append(']');
+                break;
+            case Opcodes.F_APPEND:
+                buf.append("APPEND [");
+                appendFrameTypes(nLocal, local);
+                buf.append(']');
+                break;
+            case Opcodes.F_CHOP:
+                buf.append("CHOP ").append(nLocal);
+                break;
+            case Opcodes.F_SAME:
+                buf.append("SAME");
+                break;
+            case Opcodes.F_SAME1:
+                buf.append("SAME1 ");
+                appendFrameTypes(1, stack);
+                break;
+        }
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        buf.setLength(0);
+        buf.append(tab2).append(OPCODES[opcode]).append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        buf.setLength(0);
+        buf.append(tab2)
+                .append(OPCODES[opcode])
+                .append(' ')
+                .append(opcode == Opcodes.NEWARRAY
+                        ? TYPES[operand]
+                        : Integer.toString(operand))
+                .append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        buf.setLength(0);
+        buf.append(tab2)
+                .append(OPCODES[opcode])
+                .append(' ')
+                .append(var)
+                .append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        buf.setLength(0);
+        buf.append(tab2).append(OPCODES[opcode]).append(' ');
+        appendDescriptor(INTERNAL_NAME, type);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append(OPCODES[opcode]).append(' ');
+        appendDescriptor(INTERNAL_NAME, owner);
+        buf.append('.').append(name).append(" : ");
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append(OPCODES[opcode]).append(' ');
+        appendDescriptor(INTERNAL_NAME, owner);
+        buf.append('.').append(name).append(' ');
+        appendDescriptor(METHOD_DESCRIPTOR, desc);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append("INVOKEDYNAMIC").append(' ');
+        buf.append(name);
+        appendDescriptor(METHOD_DESCRIPTOR, desc);
+        buf.append(" [");
+        appendHandle(bsm);
+        buf.append(tab3).append("// arguments:");
+        if(bsmArgs.length == 0) {
+            buf.append(" none");
+        } else {
+            buf.append('\n').append(tab3);
+            for(int i = 0; i < bsmArgs.length; i++) {
+                Object cst = bsmArgs[i];
+                if (cst instanceof String) {
+                    Printer.appendString(buf, (String) cst);
+                } else if (cst instanceof Type) {
+                    buf.append(((Type) cst).getDescriptor()).append(".class");
+                } else if (cst instanceof Handle) {
+                    appendHandle((Handle) cst);
+                } else {
+                    buf.append(cst);
+                }
+                buf.append(", ");
+            }
+            buf.setLength(buf.length() - 2);
+        }
+        buf.append('\n');
+        buf.append(tab2).append("]\n");
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        buf.setLength(0);
+        buf.append(tab2).append(OPCODES[opcode]).append(' ');
+        appendLabel(label);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        buf.setLength(0);
+        buf.append(ltab);
+        appendLabel(label);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        buf.setLength(0);
+        buf.append(tab2).append("LDC ");
+        if (cst instanceof String) {
+            Printer.appendString(buf, (String) cst);
+        } else if (cst instanceof Type) {
+            buf.append(((Type) cst).getDescriptor()).append(".class");
+        } else {
+            buf.append(cst);
+        }
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        buf.setLength(0);
+        buf.append(tab2)
+                .append("IINC ")
+                .append(var)
+                .append(' ')
+                .append(increment)
+                .append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append("TABLESWITCH\n");
+        for (int i = 0; i < labels.length; ++i) {
+            buf.append(tab3).append(min + i).append(": ");
+            appendLabel(labels[i]);
+            buf.append('\n');
+        }
+        buf.append(tab3).append("default: ");
+        appendLabel(dflt);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append("LOOKUPSWITCH\n");
+        for (int i = 0; i < labels.length; ++i) {
+            buf.append(tab3).append(keys[i]).append(": ");
+            appendLabel(labels[i]);
+            buf.append('\n');
+        }
+        buf.append(tab3).append("default: ");
+        appendLabel(dflt);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        buf.setLength(0);
+        buf.append(tab2).append("MULTIANEWARRAY ");
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append(' ').append(dims).append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append("TRYCATCHBLOCK ");
+        appendLabel(start);
+        buf.append(' ');
+        appendLabel(end);
+        buf.append(' ');
+        appendLabel(handler);
+        buf.append(' ');
+        appendDescriptor(INTERNAL_NAME, type);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        buf.setLength(0);
+        buf.append(tab2).append("LOCALVARIABLE ").append(name).append(' ');
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append(' ');
+        appendLabel(start);
+        buf.append(' ');
+        appendLabel(end);
+        buf.append(' ').append(index).append('\n');
+
+        if (signature != null) {
+            buf.append(tab2);
+            appendDescriptor(FIELD_SIGNATURE, signature);
+
+            TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
+            SignatureReader r = new SignatureReader(signature);
+            r.acceptType(sv);
+            buf.append(tab2)
+                    .append("// declaration: ")
+                    .append(sv.getDeclaration())
+                    .append('\n');
+        }
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitLineNumber(final int line, final Label start) {
+        buf.setLength(0);
+        buf.append(tab2).append("LINENUMBER ").append(line).append(' ');
+        appendLabel(start);
+        buf.append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        buf.setLength(0);
+        buf.append(tab2).append("MAXSTACK = ").append(maxStack).append('\n');
+        text.add(buf.toString());
+
+        buf.setLength(0);
+        buf.append(tab2).append("MAXLOCALS = ").append(maxLocals).append('\n');
+        text.add(buf.toString());
+    }
+
+    @Override
+    public void visitMethodEnd() {
+    }
+
+    // ------------------------------------------------------------------------
+    // Common methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Prints a disassembled view of the given annotation.
+     *
+     * @param desc the class descriptor of the annotation class.
+     * @param visible <tt>true</tt> if the annotation is visible at runtime.
+     * @return a visitor to visit the annotation values.
+     */
+    public Textifier visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        buf.setLength(0);
+        buf.append(tab).append('@');
+        appendDescriptor(FIELD_DESCRIPTOR, desc);
+        buf.append('(');
+        text.add(buf.toString());
+        Textifier t = createTextifier();
+        text.add(t.getText());
+        text.add(visible ? ")\n" : ") // invisible\n");
+        return t;
+    }
+
+    /**
+     * Prints a disassembled view of the given attribute.
+     *
+     * @param attr an attribute.
+     */
+    public void visitAttribute(final Attribute attr) {
+        buf.setLength(0);
+        buf.append(tab).append("ATTRIBUTE ");
+        appendDescriptor(-1, attr.type);
+
+        if (attr instanceof Textifiable) {
+            ((Textifiable) attr).textify(buf, null);
+        } else {
+            buf.append(" : unknown\n");
+        }
+
+        text.add(buf.toString());
+    }
+
+    // ------------------------------------------------------------------------
+    // Utility methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Creates a new TraceVisitor instance.
+     *
+     * @return a new TraceVisitor.
+     */
+    protected Textifier createTextifier() {
+        return new Textifier();
+    }
+
+    /**
+     * Appends an internal name, a type descriptor or a type signature to
+     * {@link #buf buf}.
+     *
+     * @param type indicates if desc is an internal name, a field descriptor, a
+     *        method descriptor, a class signature, ...
+     * @param desc an internal name, type descriptor, or type signature. May be
+     *        <tt>null</tt>.
+     */
+    protected void appendDescriptor(final int type, final String desc) {
+        if (type == CLASS_SIGNATURE || type == FIELD_SIGNATURE
+                || type == METHOD_SIGNATURE)
+        {
+            if (desc != null) {
+                buf.append("// signature ").append(desc).append('\n');
+            }
+        } else {
+            buf.append(desc);
+        }
+    }
+
+    /**
+     * Appends the name of the given label to {@link #buf buf}. Creates a new
+     * label name if the given label does not yet have one.
+     *
+     * @param l a label.
+     */
+    protected void appendLabel(final Label l) {
+        if (labelNames == null) {
+            labelNames = new HashMap<Label, String>();
+        }
+        String name = labelNames.get(l);
+        if (name == null) {
+            name = "L" + labelNames.size();
+            labelNames.put(l, name);
+        }
+        buf.append(name);
+    }
+
+    /**
+     * Appends the information about the given handle to {@link #buf buf}.
+     *
+     * @param h a handle, non null.
+     */
+    protected void appendHandle(final Handle h) {
+        buf.append('\n').append(tab3);
+        int tag = h.getTag();
+        buf.append("// handle kind 0x").append(Integer.toHexString(tag)).append(" : ");
+        switch (tag) {
+            case Opcodes.H_GETFIELD:
+                buf.append("GETFIELD");
+                break;
+            case Opcodes.H_GETSTATIC:
+                buf.append("GETSTATIC");
+                break;
+            case Opcodes.H_PUTFIELD:
+                buf.append("PUTFIELD");
+                break;
+            case Opcodes.H_PUTSTATIC:
+                buf.append("PUTSTATIC");
+                break;
+            case Opcodes.H_INVOKEINTERFACE:
+                buf.append("INVOKEINTERFACE");
+                break;
+            case Opcodes.H_INVOKESPECIAL:
+                buf.append("INVOKESPECIAL");
+                break;
+            case Opcodes.H_INVOKESTATIC:
+                buf.append("INVOKESTATIC");
+                break;
+            case Opcodes.H_INVOKEVIRTUAL:
+                buf.append("INVOKEVIRTUAL");
+                break;
+            case Opcodes.H_NEWINVOKESPECIAL:
+                buf.append("NEWINVOKESPECIAL");
+                break;
+        }
+        buf.append('\n');
+        buf.append(tab3);
+        appendDescriptor(INTERNAL_NAME, h.getOwner());
+        buf.append('.');
+        buf.append(h.getName());
+        buf.append('(');
+        appendDescriptor(HANDLE_DESCRIPTOR, h.getDesc());
+        buf.append(')').append('\n');
+    }
+
+    /**
+     * Appends a string representation of the given access modifiers to {@link
+     * #buf buf}.
+     *
+     * @param access some access modifiers.
+     */
+    private void appendAccess(final int access) {
+        if ((access & Opcodes.ACC_PUBLIC) != 0) {
+            buf.append("public ");
+        }
+        if ((access & Opcodes.ACC_PRIVATE) != 0) {
+            buf.append("private ");
+        }
+        if ((access & Opcodes.ACC_PROTECTED) != 0) {
+            buf.append("protected ");
+        }
+        if ((access & Opcodes.ACC_FINAL) != 0) {
+            buf.append("final ");
+        }
+        if ((access & Opcodes.ACC_STATIC) != 0) {
+            buf.append("static ");
+        }
+        if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
+            buf.append("synchronized ");
+        }
+        if ((access & Opcodes.ACC_VOLATILE) != 0) {
+            buf.append("volatile ");
+        }
+        if ((access & Opcodes.ACC_TRANSIENT) != 0) {
+            buf.append("transient ");
+        }
+        if ((access & Opcodes.ACC_ABSTRACT) != 0) {
+            buf.append("abstract ");
+        }
+        if ((access & Opcodes.ACC_STRICT) != 0) {
+            buf.append("strictfp ");
+        }
+        if ((access & Opcodes.ACC_ENUM) != 0) {
+            buf.append("enum ");
+        }
+    }
+
+    private void appendComa(final int i) {
+        if (i != 0) {
+            buf.append(", ");
+        }
+    }
+
+    private void appendFrameTypes(final int n, final Object[] o) {
+        for (int i = 0; i < n; ++i) {
+            if (i > 0) {
+                buf.append(' ');
+            }
+            if (o[i] instanceof String) {
+                String desc = (String) o[i];
+                if (desc.startsWith("[")) {
+                    appendDescriptor(FIELD_DESCRIPTOR, desc);
+                } else {
+                    appendDescriptor(INTERNAL_NAME, desc);
+                }
+            } else if (o[i] instanceof Integer) {
+                switch (((Integer) o[i]).intValue()) {
+                    case 0:
+                        appendDescriptor(FIELD_DESCRIPTOR, "T");
+                        break;
+                    case 1:
+                        appendDescriptor(FIELD_DESCRIPTOR, "I");
+                        break;
+                    case 2:
+                        appendDescriptor(FIELD_DESCRIPTOR, "F");
+                        break;
+                    case 3:
+                        appendDescriptor(FIELD_DESCRIPTOR, "D");
+                        break;
+                    case 4:
+                        appendDescriptor(FIELD_DESCRIPTOR, "J");
+                        break;
+                    case 5:
+                        appendDescriptor(FIELD_DESCRIPTOR, "N");
+                        break;
+                    case 6:
+                        appendDescriptor(FIELD_DESCRIPTOR, "U");
+                        break;
+                }
+            } else {
+                appendLabel((Label) o[i]);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/TraceAnnotationVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,125 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * An {@link AnnotationVisitor} that prints the annotations it visits with a
+ * {@link Printer}.
+ *
+ * @author Eric Bruneton
+ */
+public final class TraceAnnotationVisitor extends AnnotationVisitor {
+
+    private final Printer p;
+
+    public TraceAnnotationVisitor(final Printer p) {
+        this(null, p);
+    }
+
+    public TraceAnnotationVisitor(final AnnotationVisitor av, final Printer p) {
+        super(Opcodes.ASM4, av);
+        this.p = p;
+    }
+
+    @Override
+    public void visit(final String name, final Object value) {
+        p.visit(name, value);
+        super.visit(name, value);
+    }
+
+    @Override
+    public void visitEnum(
+        final String name,
+        final String desc,
+        final String value)
+    {
+        p.visitEnum(name, desc, value);
+        super.visitEnum(name, desc, value);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String name,
+        final String desc)
+    {
+        Printer p = this.p.visitAnnotation(name, desc);
+        AnnotationVisitor av = this.av == null
+                ? null
+                : this.av.visitAnnotation(name, desc);
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public AnnotationVisitor visitArray(final String name) {
+        Printer p = this.p.visitArray(name);
+        AnnotationVisitor av = this.av == null
+                ? null
+                : this.av.visitArray(name);
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public void visitEnd() {
+        p.visitAnnotationEnd();
+        super.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/TraceClassVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,262 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import java.io.PrintWriter;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassVisitor} that prints the classes it visits with a
+ * {@link Printer}. This class visitor can be used in the middle of a class
+ * visitor chain to trace the class that is visited at a given point in this
+ * chain. This may be useful for debugging purposes. <p> The trace printed when
+ * visiting the <tt>Hello</tt> class is the following: <p> <blockquote>
+ *
+ * <pre> // class version 49.0 (49) // access flags 0x21 public class Hello {
+ *
+ * // compiled from: Hello.java
+ *
+ * // access flags 0x1 public &lt;init&gt; ()V ALOAD 0 INVOKESPECIAL
+ * java/lang/Object &lt;init&gt; ()V RETURN MAXSTACK = 1 MAXLOCALS = 1
+ *
+ * // access flags 0x9 public static main ([Ljava/lang/String;)V GETSTATIC
+ * java/lang/System out Ljava/io/PrintStream; LDC &quot;hello&quot;
+ * INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V RETURN
+ * MAXSTACK = 2 MAXLOCALS = 1 } </pre>
+ *
+ * </blockquote> where <tt>Hello</tt> is defined by: <p> <blockquote>
+ *
+ * <pre> public class Hello {
+ *
+ * public static void main(String[] args) {
+ * System.out.println(&quot;hello&quot;); } } </pre>
+ *
+ * </blockquote>
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public final class TraceClassVisitor extends ClassVisitor {
+
+    /**
+     * The print writer to be used to print the class. May be null.
+     */
+    private final PrintWriter pw;
+
+    /**
+     * The object that actually converts visit events into text.
+     */
+    public final Printer p;
+
+    /**
+     * Constructs a new {@link TraceClassVisitor}.
+     *
+     * @param pw the print writer to be used to print the class.
+     */
+    public TraceClassVisitor(final PrintWriter pw) {
+        this(null, pw);
+    }
+
+    /**
+     * Constructs a new {@link TraceClassVisitor}.
+     *
+     * @param cv the {@link ClassVisitor} to which this visitor delegates calls.
+     *        May be <tt>null</tt>.
+     * @param pw the print writer to be used to print the class.
+     */
+    public TraceClassVisitor(final ClassVisitor cv, final PrintWriter pw) {
+        this(cv, new Textifier(), pw);
+    }
+
+    /**
+     * Constructs a new {@link TraceClassVisitor}.
+     *
+     * @param cv the {@link ClassVisitor} to which this visitor delegates calls.
+     *        May be <tt>null</tt>.
+     * @param p the object that actually converts visit events into text.
+     * @param pw the print writer to be used to print the class. May be null if
+     *        you simply want to use the result via
+     *        {@link Printer#getText()}, instead of printing it.
+     */
+    public TraceClassVisitor(
+        final ClassVisitor cv,
+        final Printer p,
+        final PrintWriter pw)
+    {
+        super(Opcodes.ASM4, cv);
+        this.pw = pw;
+        this.p = p;
+    }
+
+    @Override
+    public void visit(
+        final int version,
+        final int access,
+        final String name,
+        final String signature,
+        final String superName,
+        final String[] interfaces)
+    {
+        p.visit(version, access, name, signature, superName, interfaces);
+        super.visit(version, access, name, signature, superName, interfaces);
+    }
+
+    @Override
+    public void visitSource(final String file, final String debug) {
+        p.visitSource(file, debug);
+        super.visitSource(file, debug);
+    }
+
+    @Override
+    public void visitOuterClass(
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        p.visitOuterClass(owner, name, desc);
+        super.visitOuterClass(owner, name, desc);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        Printer p = this.p.visitClassAnnotation(desc, visible);
+        AnnotationVisitor av = cv == null ? null : cv.visitAnnotation(desc,
+                visible);
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        p.visitClassAttribute(attr);
+        super.visitAttribute(attr);
+    }
+
+    @Override
+    public void visitInnerClass(
+        final String name,
+        final String outerName,
+        final String innerName,
+        final int access)
+    {
+        p.visitInnerClass(name, outerName, innerName, access);
+        super.visitInnerClass(name, outerName, innerName, access);
+    }
+
+    @Override
+    public FieldVisitor visitField(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final Object value)
+    {
+        Printer p = this.p.visitField(access,
+                name,
+                desc,
+                signature,
+                value);
+        FieldVisitor fv = cv == null ? null : cv.visitField(access,
+                name,
+                desc,
+                signature,
+                value);
+        return new TraceFieldVisitor(fv, p);
+    }
+
+    @Override
+    public MethodVisitor visitMethod(
+        final int access,
+        final String name,
+        final String desc,
+        final String signature,
+        final String[] exceptions)
+    {
+        Printer p = this.p.visitMethod(access,
+                name,
+                desc,
+                signature,
+                exceptions);
+        MethodVisitor mv = cv == null ? null : cv.visitMethod(access,
+                name,
+                desc,
+                signature,
+                exceptions);
+        return new TraceMethodVisitor(mv, p);
+    }
+
+    @Override
+    public void visitEnd() {
+        p.visitClassEnd();
+        if (pw != null) {
+            p.print(pw);
+            pw.flush();
+        }
+        super.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/TraceFieldVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,108 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link FieldVisitor} that prints the fields it visits with a
+ * {@link Printer}.
+ *
+ * @author Eric Bruneton
+ */
+public final class TraceFieldVisitor extends FieldVisitor {
+
+    public final Printer p;
+
+    public TraceFieldVisitor(final Printer p) {
+        this(null, p);
+    }
+
+    public TraceFieldVisitor(final FieldVisitor fv, final Printer p) {
+        super(Opcodes.ASM4, fv);
+        this.p = p;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        Printer p = this.p.visitFieldAnnotation(desc, visible);
+        AnnotationVisitor av = fv == null ? null : fv.visitAnnotation(desc,
+                visible);
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        p.visitFieldAttribute(attr);
+        super.visitAttribute(attr);
+    }
+
+    @Override
+    public void visitEnd() {
+        p.visitFieldEnd();
+        super.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/TraceMethodVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,294 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * Copyright (c) 2011 Google
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link MethodVisitor} that prints the methods it visits with a
+ * {@link Printer}.
+ *
+ * @author Eric Bruneton
+ */
+public final class TraceMethodVisitor extends MethodVisitor {
+
+    public final Printer p;
+
+    public TraceMethodVisitor(final Printer p) {
+        this(null, p);
+    }
+
+    public TraceMethodVisitor(final MethodVisitor mv, final Printer p) {
+        super(Opcodes.ASM4, mv);
+        this.p = p;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(
+        final String desc,
+        final boolean visible)
+    {
+        Printer p = this.p.visitMethodAnnotation(desc, visible);
+        AnnotationVisitor av = mv == null ? null : mv.visitAnnotation(desc,
+                visible);
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public void visitAttribute(final Attribute attr) {
+        p.visitMethodAttribute(attr);
+        super.visitAttribute(attr);
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotationDefault() {
+        Printer p = this.p.visitAnnotationDefault();
+        AnnotationVisitor av = mv == null ? null : mv.visitAnnotationDefault();
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public AnnotationVisitor visitParameterAnnotation(
+        final int parameter,
+        final String desc,
+        final boolean visible)
+    {
+        Printer p = this.p.visitParameterAnnotation(parameter,
+                desc,
+                visible);
+        AnnotationVisitor av = mv == null
+                ? null
+                : mv.visitParameterAnnotation(parameter, desc, visible);
+        return new TraceAnnotationVisitor(av, p);
+    }
+
+    @Override
+    public void visitCode() {
+        p.visitCode();
+        super.visitCode();
+    }
+
+    @Override
+    public void visitFrame(
+        final int type,
+        final int nLocal,
+        final Object[] local,
+        final int nStack,
+        final Object[] stack)
+    {
+        p.visitFrame(type, nLocal, local, nStack, stack);
+        super.visitFrame(type, nLocal, local, nStack, stack);
+    }
+
+    @Override
+    public void visitInsn(final int opcode) {
+        p.visitInsn(opcode);
+        super.visitInsn(opcode);
+    }
+
+    @Override
+    public void visitIntInsn(final int opcode, final int operand) {
+        p.visitIntInsn(opcode, operand);
+        super.visitIntInsn(opcode, operand);
+    }
+
+    @Override
+    public void visitVarInsn(final int opcode, final int var) {
+        p.visitVarInsn(opcode, var);
+        super.visitVarInsn(opcode, var);
+    }
+
+    @Override
+    public void visitTypeInsn(final int opcode, final String type) {
+        p.visitTypeInsn(opcode, type);
+        super.visitTypeInsn(opcode, type);
+    }
+
+    @Override
+    public void visitFieldInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        p.visitFieldInsn(opcode, owner, name, desc);
+        super.visitFieldInsn(opcode, owner, name, desc);
+    }
+
+    @Override
+    public void visitMethodInsn(
+        final int opcode,
+        final String owner,
+        final String name,
+        final String desc)
+    {
+        p.visitMethodInsn(opcode, owner, name, desc);
+        super.visitMethodInsn(opcode, owner, name, desc);
+    }
+
+    @Override
+    public void visitInvokeDynamicInsn(
+        String name,
+        String desc,
+        Handle bsm,
+        Object... bsmArgs)
+    {
+        p.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+        super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+    }
+
+    @Override
+    public void visitJumpInsn(final int opcode, final Label label) {
+        p.visitJumpInsn(opcode, label);
+        super.visitJumpInsn(opcode, label);
+    }
+
+    @Override
+    public void visitLabel(final Label label) {
+        p.visitLabel(label);
+        super.visitLabel(label);
+    }
+
+    @Override
+    public void visitLdcInsn(final Object cst) {
+        p.visitLdcInsn(cst);
+        super.visitLdcInsn(cst);
+    }
+
+    @Override
+    public void visitIincInsn(final int var, final int increment) {
+        p.visitIincInsn(var, increment);
+        super.visitIincInsn(var, increment);
+    }
+
+    @Override
+    public void visitTableSwitchInsn(
+        final int min,
+        final int max,
+        final Label dflt,
+        final Label... labels)
+    {
+        p.visitTableSwitchInsn(min, max, dflt, labels);
+        super.visitTableSwitchInsn(min, max, dflt, labels);
+    }
+
+    @Override
+    public void visitLookupSwitchInsn(
+        final Label dflt,
+        final int[] keys,
+        final Label[] labels)
+    {
+        p.visitLookupSwitchInsn(dflt, keys, labels);
+        super.visitLookupSwitchInsn(dflt, keys, labels);
+    }
+
+    @Override
+    public void visitMultiANewArrayInsn(final String desc, final int dims) {
+        p.visitMultiANewArrayInsn(desc, dims);
+        super.visitMultiANewArrayInsn(desc, dims);
+    }
+
+    @Override
+    public void visitTryCatchBlock(
+        final Label start,
+        final Label end,
+        final Label handler,
+        final String type)
+    {
+        p.visitTryCatchBlock(start, end, handler, type);
+        super.visitTryCatchBlock(start, end, handler, type);
+    }
+
+    @Override
+    public void visitLocalVariable(
+        final String name,
+        final String desc,
+        final String signature,
+        final Label start,
+        final Label end,
+        final int index)
+    {
+        p.visitLocalVariable(name, desc, signature, start, end, index);
+        super.visitLocalVariable(name, desc, signature, start, end, index);
+    }
+
+    @Override
+    public void visitLineNumber(final int line, final Label start) {
+        p.visitLineNumber(line, start);
+        super.visitLineNumber(line, start);
+    }
+
+    @Override
+    public void visitMaxs(final int maxStack, final int maxLocals) {
+        p.visitMaxs(maxStack, maxLocals);
+        super.visitMaxs(maxStack, maxLocals);
+    }
+
+    @Override
+    public void visitEnd() {
+        p.visitMethodEnd();
+        super.visitEnd();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/internal/org/objectweb/asm/util/TraceSignatureVisitor.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,347 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package jdk.internal.org.objectweb.asm.util;
+
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
+
+/**
+ * A {@link SignatureVisitor} that prints a disassembled view of the signature
+ * it visits.
+ *
+ * @author Eugene Kuleshov
+ * @author Eric Bruneton
+ */
+public final class TraceSignatureVisitor extends SignatureVisitor {
+
+    private final StringBuffer declaration;
+
+    private boolean isInterface;
+
+    private boolean seenFormalParameter;
+
+    private boolean seenInterfaceBound;
+
+    private boolean seenParameter;
+
+    private boolean seenInterface;
+
+    private StringBuffer returnType;
+
+    private StringBuffer exceptions;
+
+    /**
+     * Stack used to keep track of class types that have arguments. Each element
+     * of this stack is a boolean encoded in one bit. The top of the stack is
+     * the lowest order bit. Pushing false = *2, pushing true = *2+1, popping =
+     * /2.
+     */
+    private int argumentStack;
+
+    /**
+     * Stack used to keep track of array class types. Each element of this stack
+     * is a boolean encoded in one bit. The top of the stack is the lowest order
+     * bit. Pushing false = *2, pushing true = *2+1, popping = /2.
+     */
+    private int arrayStack;
+
+    private String separator = "";
+
+    public TraceSignatureVisitor(final int access) {
+        super(Opcodes.ASM4);
+        isInterface = (access & Opcodes.ACC_INTERFACE) != 0;
+        this.declaration = new StringBuffer();
+    }
+
+    private TraceSignatureVisitor(final StringBuffer buf) {
+        super(Opcodes.ASM4);
+        this.declaration = buf;
+    }
+
+    @Override
+    public void visitFormalTypeParameter(final String name) {
+        declaration.append(seenFormalParameter ? ", " : "<").append(name);
+        seenFormalParameter = true;
+        seenInterfaceBound = false;
+    }
+
+    @Override
+    public SignatureVisitor visitClassBound() {
+        separator = " extends ";
+        startType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitInterfaceBound() {
+        separator = seenInterfaceBound ? ", " : " extends ";
+        seenInterfaceBound = true;
+        startType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitSuperclass() {
+        endFormals();
+        separator = " extends ";
+        startType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitInterface() {
+        separator = seenInterface ? ", " : isInterface
+                ? " extends "
+                : " implements ";
+        seenInterface = true;
+        startType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitParameterType() {
+        endFormals();
+        if (seenParameter) {
+            declaration.append(", ");
+        } else {
+            seenParameter = true;
+            declaration.append('(');
+        }
+        startType();
+        return this;
+    }
+
+    @Override
+    public SignatureVisitor visitReturnType() {
+        endFormals();
+        if (seenParameter) {
+            seenParameter = false;
+        } else {
+            declaration.append('(');
+        }
+        declaration.append(')');
+        returnType = new StringBuffer();
+        return new TraceSignatureVisitor(returnType);
+    }
+
+    @Override
+    public SignatureVisitor visitExceptionType() {
+        if (exceptions == null) {
+            exceptions = new StringBuffer();
+        } else {
+            exceptions.append(", ");
+        }
+        // startType();
+        return new TraceSignatureVisitor(exceptions);
+    }
+
+    @Override
+    public void visitBaseType(final char descriptor) {
+        switch (descriptor) {
+            case 'V':
+                declaration.append("void");
+                break;
+            case 'B':
+                declaration.append("byte");
+                break;
+            case 'J':
+                declaration.append("long");
+                break;
+            case 'Z':
+                declaration.append("boolean");
+                break;
+            case 'I':
+                declaration.append("int");
+                break;
+            case 'S':
+                declaration.append("short");
+                break;
+            case 'C':
+                declaration.append("char");
+                break;
+            case 'F':
+                declaration.append("float");
+                break;
+            // case 'D':
+            default:
+                declaration.append("double");
+                break;
+        }
+        endType();
+    }
+
+    @Override
+    public void visitTypeVariable(final String name) {
+        declaration.append(name);
+        endType();
+    }
+
+    @Override
+    public SignatureVisitor visitArrayType() {
+        startType();
+        arrayStack |= 1;
+        return this;
+    }
+
+    @Override
+    public void visitClassType(final String name) {
+        if ("java/lang/Object".equals(name)) {
+            // Map<java.lang.Object,java.util.List>
+            // or
+            // abstract public V get(Object key); (seen in Dictionary.class)
+            // should have Object
+            // but java.lang.String extends java.lang.Object is unnecessary
+            boolean needObjectClass = argumentStack % 2 != 0 || seenParameter;
+            if (needObjectClass) {
+                declaration.append(separator).append(name.replace('/', '.'));
+            }
+        } else {
+            declaration.append(separator).append(name.replace('/', '.'));
+        }
+        separator = "";
+        argumentStack *= 2;
+    }
+
+    @Override
+    public void visitInnerClassType(final String name) {
+        if (argumentStack % 2 != 0) {
+            declaration.append('>');
+        }
+        argumentStack /= 2;
+        declaration.append('.');
+        declaration.append(separator).append(name.replace('/', '.'));
+        separator = "";
+        argumentStack *= 2;
+    }
+
+    @Override
+    public void visitTypeArgument() {
+        if (argumentStack % 2 == 0) {
+            ++argumentStack;
+            declaration.append('<');
+        } else {
+            declaration.append(", ");
+        }
+        declaration.append('?');
+    }
+
+    @Override
+    public SignatureVisitor visitTypeArgument(final char tag) {
+        if (argumentStack % 2 == 0) {
+            ++argumentStack;
+            declaration.append('<');
+        } else {
+            declaration.append(", ");
+        }
+
+        if (tag == EXTENDS) {
+            declaration.append("? extends ");
+        } else if (tag == SUPER) {
+            declaration.append("? super ");
+        }
+
+        startType();
+        return this;
+    }
+
+    @Override
+    public void visitEnd() {
+        if (argumentStack % 2 != 0) {
+            declaration.append('>');
+        }
+        argumentStack /= 2;
+        endType();
+    }
+
+    public String getDeclaration() {
+        return declaration.toString();
+    }
+
+    public String getReturnType() {
+        return returnType == null ? null : returnType.toString();
+    }
+
+    public String getExceptions() {
+        return exceptions == null ? null : exceptions.toString();
+    }
+
+    // -----------------------------------------------
+
+    private void endFormals() {
+        if (seenFormalParameter) {
+            declaration.append('>');
+            seenFormalParameter = false;
+        }
+    }
+
+    private void startType() {
+        arrayStack *= 2;
+    }
+
+    private void endType() {
+        if (arrayStack % 2 == 0) {
+            arrayStack /= 2;
+        } else {
+            while (arrayStack % 2 != 0) {
+                arrayStack /= 2;
+                declaration.append("[]");
+            }
+        }
+    }
+}
--- a/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Tue Oct 23 09:41:52 2012 -0700
@@ -348,7 +348,7 @@
      * Returns path name of the credentials cache file.
      * The path name is searched in the following order:
      *
-     * 1. KRB5CCNAME
+     * 1. KRB5CCNAME (bare file name without FILE:)
      * 2. /tmp/krb5cc_<uid> on unix systems
      * 3. <user.home>/krb5cc_<user.name>
      * 4. <user.home>/krb5cc (if can't get <user.name>)
@@ -359,11 +359,19 @@
         String stdCacheNameComponent = "krb5cc";
         String name;
 
+        // The env var can start with TYPE:, we only support FILE: here.
+        // http://docs.oracle.com/cd/E19082-01/819-2252/6n4i8rtr3/index.html
         name = java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction<String>() {
             @Override
             public String run() {
-                return System.getenv("KRB5CCNAME");
+                String cache = System.getenv("KRB5CCNAME");
+                if (cache != null &&
+                        (cache.length() >= 5) &&
+                        cache.regionMatches(true, 0, "FILE:", 0, 5)) {
+                    cache = cache.substring(5);
+                }
+                return cache;
             }
         });
         if (name != null) {
--- a/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,6 @@
  * questions.
  */
 
-
 package sun.security.ssl;
 
 import java.io.*;
@@ -55,16 +54,25 @@
      * recurse infinitely ... e.g. close() calling itself, or doing
      * I/O in terms of our own streams.
      */
-    final Socket self;
+    final private Socket self;
+    final private InputStream consumedInput;
 
     BaseSSLSocketImpl() {
         super();
         this.self = this;
+        this.consumedInput = null;
     }
 
     BaseSSLSocketImpl(Socket socket) {
         super();
         this.self = socket;
+        this.consumedInput = null;
+    }
+
+    BaseSSLSocketImpl(Socket socket, InputStream consumed) {
+        super();
+        this.self = socket;
+        this.consumedInput = consumed;
     }
 
     //
@@ -541,4 +549,57 @@
         }
     }
 
+    @Override
+    public String toString() {
+        if (self == this) {
+            return super.toString();
+        }
+
+        return self.toString();
+    }
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        if (self == this) {
+            return super.getInputStream();
+        }
+
+        if (consumedInput != null) {
+            return new SequenceInputStream(consumedInput,
+                                                self.getInputStream());
+        }
+
+        return self.getInputStream();
+    }
+
+    @Override
+    public OutputStream getOutputStream() throws IOException {
+        if (self == this) {
+            return super.getOutputStream();
+        }
+
+        return self.getOutputStream();
+    }
+
+    @Override
+    public synchronized void close() throws IOException {
+        if (self == this) {
+            super.close();
+        } else {
+            self.close();
+        }
+    }
+
+    @Override
+    public synchronized void setSoTimeout(int timeout) throws SocketException {
+        if (self == this) {
+            super.setSoTimeout(timeout);
+        } else {
+            self.setSoTimeout(timeout);
+        }
+    }
+
+    boolean isLayered() {
+        return (self != this);
+    }
 }
--- a/src/share/classes/sun/security/ssl/ClientHandshaker.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/ClientHandshaker.java	Tue Oct 23 09:41:52 2012 -0700
@@ -48,8 +48,6 @@
 import sun.security.ssl.CipherSuite.*;
 import static sun.security.ssl.CipherSuite.KeyExchange.*;
 
-import sun.net.util.IPAddressUtil;
-
 /**
  * ClientHandshaker does the protocol handshaking from the point
  * of view of a client.  It is driven asychronously by handshake messages
@@ -92,6 +90,9 @@
     private final static boolean enableSNIExtension =
             Debug.getBooleanProperty("jsse.enableSNIExtension", true);
 
+    private List<SNIServerName> requestedServerNames =
+            Collections.<SNIServerName>emptyList();
+
     /*
      * Constructors
      */
@@ -579,6 +580,7 @@
         session = new SSLSessionImpl(protocolVersion, cipherSuite,
                             getLocalSupportedSignAlgs(),
                             mesg.sessionId, getHostSE(), getPortSE());
+        session.setRequestedServerNames(requestedServerNames);
         setHandshakeSessionSE(session);
         if (debug != null && Debug.isOn("handshake")) {
             System.out.println("** " + cipherSuite);
@@ -1246,17 +1248,14 @@
 
         // add server_name extension
         if (enableSNIExtension) {
-            // We cannot use the hostname resolved from name services.  For
-            // virtual hosting, multiple hostnames may be bound to the same IP
-            // address, so the hostname resolved from name services is not
-            // reliable.
-            String hostname = getRawHostnameSE();
+            if (session != null) {
+                requestedServerNames = session.getRequestedServerNames();
+            } else {
+                requestedServerNames = serverNames;
+            }
 
-            // we only allow FQDN
-            if (hostname != null && hostname.indexOf('.') > 0 &&
-                    !IPAddressUtil.isIPv4LiteralAddress(hostname) &&
-                    !IPAddressUtil.isIPv6LiteralAddress(hostname)) {
-                clientHelloMessage.addServerNameIndicationExtension(hostname);
+            if (!requestedServerNames.isEmpty()) {
+                clientHelloMessage.addSNIExtension(requestedServerNames);
             }
         }
 
--- a/src/share/classes/sun/security/ssl/HandshakeInStream.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/HandshakeInStream.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,8 @@
         r.mark(readlimit);
     }
 
-    public void reset() {
+    @Override
+    public void reset() throws IOException {
         r.reset();
     }
 
--- a/src/share/classes/sun/security/ssl/HandshakeMessage.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java	Tue Oct 23 09:41:52 2012 -0700
@@ -256,13 +256,9 @@
     }
 
     // add server_name extension
-    void addServerNameIndicationExtension(String hostname) {
-        // We would have checked that the hostname ia a FQDN.
-        ArrayList<String> hostnames = new ArrayList<>(1);
-        hostnames.add(hostname);
-
+    void addSNIExtension(List<SNIServerName> serverNames) {
         try {
-            extensions.add(new ServerNameExtension(hostnames));
+            extensions.add(new ServerNameExtension(serverNames));
         } catch (IOException ioe) {
             // ignore the exception and return
         }
--- a/src/share/classes/sun/security/ssl/Handshaker.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/Handshaker.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -112,6 +112,12 @@
      */
     private CipherSuiteList    activeCipherSuites;
 
+    // The server name indication and matchers
+    List<SNIServerName>         serverNames =
+                                    Collections.<SNIServerName>emptyList();
+    Collection<SNIMatcher>      sniMatchers =
+                                    Collections.<SNIMatcher>emptyList();
+
     private boolean             isClient;
     private boolean             needCertVerify;
 
@@ -287,14 +293,7 @@
         }
     }
 
-    String getRawHostnameSE() {
-        if (conn != null) {
-            return conn.getRawHostname();
-        } else {
-            return engine.getPeerHost();
-        }
-    }
-
+    // ONLY used by ClientHandshaker to setup the peer host in SSLSession.
     String getHostSE() {
         if (conn != null) {
             return conn.getHost();
@@ -303,6 +302,7 @@
         }
     }
 
+    // ONLY used by ServerHandshaker to setup the peer host in SSLSession.
     String getHostAddressSE() {
         if (conn != null) {
             return conn.getInetAddress().getHostAddress();
@@ -436,6 +436,22 @@
     }
 
     /**
+     * Sets the server name indication of the handshake.
+     */
+    void setSNIServerNames(List<SNIServerName> serverNames) {
+        // The serverNames parameter is unmodifiable.
+        this.serverNames = serverNames;
+    }
+
+    /**
+     * Sets the server name matchers of the handshaking.
+     */
+    void setSNIMatchers(Collection<SNIMatcher> sniMatchers) {
+        // The sniMatchers parameter is unmodifiable.
+        this.sniMatchers = sniMatchers;
+    }
+
+    /**
      * Prior to handshaking, activate the handshake and initialize the version,
      * input stream and output stream.
      */
--- a/src/share/classes/sun/security/ssl/HelloExtensions.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/HelloExtensions.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,10 @@
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.*;
-
+import javax.net.ssl.*;
+import java.nio.charset.StandardCharsets;
 import java.security.spec.ECParameterSpec;
 
-import javax.net.ssl.SSLProtocolException;
-
 /**
  * This file contains all the classes relevant to TLS Extensions for the
  * ClientHello and ServerHello messages. The extension mechanism and
@@ -274,11 +273,11 @@
 }
 
 /*
- * [RFC4366] To facilitate secure connections to servers that host multiple
- * 'virtual' servers at a single underlying network address, clients MAY
- * include an extension of type "server_name" in the (extended) client hello.
- * The "extension_data" field of this extension SHALL contain "ServerNameList"
- * where:
+ * [RFC 4366/6066] To facilitate secure connections to servers that host
+ * multiple 'virtual' servers at a single underlying network address, clients
+ * MAY include an extension of type "server_name" in the (extended) client
+ * hello.  The "extension_data" field of this extension SHALL contain
+ * "ServerNameList" where:
  *
  *     struct {
  *         NameType name_type;
@@ -299,44 +298,47 @@
  */
 final class ServerNameExtension extends HelloExtension {
 
-    final static int NAME_HOST_NAME = 0;
-
-    private List<ServerName> names;
+    // For backward compatibility, all future data structures associated with
+    // new NameTypes MUST begin with a 16-bit length field.
+    final static int NAME_HEADER_LENGTH = 3;    // NameType: 1 byte
+                                                // Name length: 2 bytes
+    private Map<Integer, SNIServerName> sniMap;
     private int listLength;     // ServerNameList length
 
-    ServerNameExtension(List<String> hostnames) throws IOException {
+    // constructor for ServerHello
+    ServerNameExtension() throws IOException {
+        super(ExtensionType.EXT_SERVER_NAME);
+
+        listLength = 0;
+        sniMap = Collections.<Integer, SNIServerName>emptyMap();
+    }
+
+    // constructor for ClientHello
+    ServerNameExtension(List<SNIServerName> serverNames)
+            throws IOException {
         super(ExtensionType.EXT_SERVER_NAME);
 
         listLength = 0;
-        names = new ArrayList<ServerName>(hostnames.size());
-        for (String hostname : hostnames) {
-            if (hostname != null && hostname.length() != 0) {
-                // we only support DNS hostname now.
-                ServerName serverName =
-                        new ServerName(NAME_HOST_NAME, hostname);
-                names.add(serverName);
-                listLength += serverName.length;
+        sniMap = new LinkedHashMap<>();
+        for (SNIServerName serverName : serverNames) {
+            // check for duplicated server name type
+            if (sniMap.put(serverName.getType(), serverName) != null) {
+                // unlikely to happen, but in case ...
+                throw new RuntimeException(
+                    "Duplicated server name of type " + serverName.getType());
             }
+
+            listLength += serverName.getEncoded().length + NAME_HEADER_LENGTH;
         }
 
-        // As we only support DNS hostname now, the hostname list must
-        // not contain more than one hostname
-        if (names.size() > 1) {
-            throw new SSLProtocolException(
-                    "The ServerNameList MUST NOT contain more than " +
-                    "one name of the same name_type");
-        }
-
-        // We only need to add "server_name" extension in ClientHello unless
-        // we support SNI in server side in the future. It is possible that
-        // the SNI is empty in ServerHello. As we don't support SNI in
-        // ServerHello now, we will throw exception for empty list for now.
+        // This constructor is used for ClientHello only.  Empty list is
+        // not allowed in client mode.
         if (listLength == 0) {
-            throw new SSLProtocolException(
-                    "The ServerNameList cannot be empty");
+            throw new RuntimeException("The ServerNameList cannot be empty");
         }
     }
 
+    // constructor for ServerHello for parsing SNI extension
     ServerNameExtension(HandshakeInStream s, int len)
             throws IOException {
         super(ExtensionType.EXT_SERVER_NAME);
@@ -350,17 +352,54 @@
             }
 
             remains -= 2;
-            names = new ArrayList<ServerName>();
+            sniMap = new LinkedHashMap<>();
             while (remains > 0) {
-                ServerName name = new ServerName(s);
-                names.add(name);
-                remains -= name.length;
+                int code = s.getInt8();       // NameType
 
-                // we may need to check the duplicated ServerName type
+                // HostName (length read in getBytes16);
+                byte[] encoded = s.getBytes16();
+                SNIServerName serverName;
+                switch (code) {
+                    case StandardConstants.SNI_HOST_NAME:
+                        if (encoded.length == 0) {
+                            throw new SSLProtocolException(
+                                "Empty HostName in server name indication");
+                        }
+                        try {
+                            serverName = new SNIHostName(encoded);
+                        } catch (IllegalArgumentException iae) {
+                            SSLProtocolException spe = new SSLProtocolException(
+                                "Illegal server name, type=host_name(" +
+                                code + "), name=" +
+                                (new String(encoded, StandardCharsets.UTF_8)) +
+                                ", value=" + Debug.toString(encoded));
+                            spe.initCause(iae);
+                            throw spe;
+                        }
+                        break;
+                    default:
+                        try {
+                            serverName = new UnknownServerName(code, encoded);
+                        } catch (IllegalArgumentException iae) {
+                            SSLProtocolException spe = new SSLProtocolException(
+                                "Illegal server name, type=(" + code +
+                                "), value=" + Debug.toString(encoded));
+                            spe.initCause(iae);
+                            throw spe;
+                        }
+                }
+                // check for duplicated server name type
+                if (sniMap.put(serverName.getType(), serverName) != null) {
+                    throw new SSLProtocolException(
+                            "Duplicated server name of type " +
+                            serverName.getType());
+                }
+
+                remains -= encoded.length + NAME_HEADER_LENGTH;
             }
         } else if (len == 0) {     // "server_name" extension in ServerHello
             listLength = 0;
-            names = Collections.<ServerName>emptyList();
+            sniMap = Collections.<Integer, SNIServerName>emptyMap();
         }
 
         if (remains != 0) {
@@ -368,39 +407,72 @@
         }
     }
 
-    static class ServerName {
-        final int length;
-        final int type;
-        final byte[] data;
-        final String hostname;
-
-        ServerName(int type, String hostname) throws IOException {
-            this.type = type;                       // NameType
-            this.hostname = hostname;
-            this.data = hostname.getBytes("UTF8");  // HostName
-            this.length = data.length + 3;          // NameType: 1 byte
-                                                    // HostName length: 2 bytes
+    List<SNIServerName> getServerNames() {
+        if (sniMap != null && !sniMap.isEmpty()) {
+            return Collections.<SNIServerName>unmodifiableList(
+                                        new ArrayList<>(sniMap.values()));
         }
 
-        ServerName(HandshakeInStream s) throws IOException {
-            type = s.getInt8();         // NameType
-            data = s.getBytes16();      // HostName (length read in getBytes16)
-            length = data.length + 3;   // NameType: 1 byte
-                                        // HostName length: 2 bytes
-            if (type == NAME_HOST_NAME) {
-                hostname = new String(data, "UTF8");
-            } else {
-                hostname = null;
+        return Collections.<SNIServerName>emptyList();
+    }
+
+    /*
+     * Is the extension recognized by the corresponding matcher?
+     *
+     * This method is used to check whether the server name indication can
+     * be recognized by the server name matchers.
+     *
+     * Per RFC 6066, if the server understood the ClientHello extension but
+     * does not recognize the server name, the server SHOULD take one of two
+     * actions: either abort the handshake by sending a fatal-level
+     * unrecognized_name(112) alert or continue the handshake.
+     *
+     * If there is an instance of SNIMatcher defined for a particular name
+     * type, it must be used to perform match operations on the server name.
+     */
+    boolean isMatched(Collection<SNIMatcher> matchers) {
+        if (sniMap != null && !sniMap.isEmpty()) {
+            for (SNIMatcher matcher : matchers) {
+                SNIServerName sniName = sniMap.get(matcher.getType());
+                if (sniName != null && (!matcher.matches(sniName))) {
+                    return false;
+                }
             }
         }
 
-        public String toString() {
-            if (type == NAME_HOST_NAME) {
-                return "host_name: " + hostname;
-            } else {
-                return "unknown-" + type + ": " + Debug.toString(data);
+        return true;
+    }
+
+    /*
+     * Is the extension is identical to a server name list?
+     *
+     * This method is used to check the server name indication during session
+     * resumption.
+     *
+     * Per RFC 6066, when the server is deciding whether or not to accept a
+     * request to resume a session, the contents of a server_name extension
+     * MAY be used in the lookup of the session in the session cache.  The
+     * client SHOULD include the same server_name extension in the session
+     * resumption request as it did in the full handshake that established
+     * the session.  A server that implements this extension MUST NOT accept
+     * the request to resume the session if the server_name extension contains
+     * a different name.  Instead, it proceeds with a full handshake to
+     * establish a new session.  When resuming a session, the server MUST NOT
+     * include a server_name extension in the server hello.
+     */
+    boolean isIdentical(List<SNIServerName> other) {
+        if (other.size() == sniMap.size()) {
+            for(SNIServerName sniInOther : other) {
+                SNIServerName sniName = sniMap.get(sniInOther.getType());
+                if (sniName == null || !sniInOther.equals(sniName)) {
+                    return false;
+                }
             }
+
+            return true;
         }
+
+        return false;
     }
 
     int length() {
@@ -409,25 +481,34 @@
 
     void send(HandshakeOutStream s) throws IOException {
         s.putInt16(type.id);
-        s.putInt16(listLength + 2);
-        if (listLength != 0) {
-            s.putInt16(listLength);
+        if (listLength == 0) {
+            s.putInt16(listLength);     // in ServerHello, empty extension_data
+        } else {
+            s.putInt16(listLength + 2); // length of extension_data
+            s.putInt16(listLength);     // length of ServerNameList
 
-            for (ServerName name : names) {
-                s.putInt8(name.type);           // NameType
-                s.putBytes16(name.data);        // HostName
+            for (SNIServerName sniName : sniMap.values()) {
+                s.putInt8(sniName.getType());         // server name type
+                s.putBytes16(sniName.getEncoded());   // server name value
             }
         }
     }
 
     public String toString() {
         StringBuffer buffer = new StringBuffer();
-        for (ServerName name : names) {
-            buffer.append("[" + name + "]");
+        for (SNIServerName sniName : sniMap.values()) {
+            buffer.append("[" + sniName + "]");
         }
 
         return "Extension " + type + ", server_name: " + buffer;
     }
+
+    private static class UnknownServerName extends SNIServerName {
+        UnknownServerName(int code, byte[] encoded) {
+            super(code, encoded);
+        }
+    }
+
 }
 
 final class SupportedEllipticCurvesExtension extends HelloExtension {
--- a/src/share/classes/sun/security/ssl/ProtocolList.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/ProtocolList.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@
             throw new IllegalArgumentException("Protocols may not be null");
         }
 
-        ArrayList<ProtocolVersion> versions = new ArrayList<>(3);
+        ArrayList<ProtocolVersion> versions = new ArrayList<>(names.length);
         for (int i = 0; i < names.length; i++ ) {
             ProtocolVersion version = ProtocolVersion.valueOf(names[i]);
             if (versions.contains(version) == false) {
--- a/src/share/classes/sun/security/ssl/SSLEngineImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SSLEngineImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -27,6 +27,7 @@
 
 import java.io.*;
 import java.nio.*;
+import java.util.*;
 import java.security.*;
 
 import javax.crypto.BadPaddingException;
@@ -34,7 +35,6 @@
 import javax.net.ssl.*;
 import javax.net.ssl.SSLEngineResult.*;
 
-
 /**
  * Implementation of an non-blocking SSLEngine.
  *
@@ -253,6 +253,12 @@
     // The cryptographic algorithm constraints
     private AlgorithmConstraints        algorithmConstraints = null;
 
+    // The server name indication and matchers
+    List<SNIServerName>         serverNames =
+                                    Collections.<SNIServerName>emptyList();
+    Collection<SNIMatcher>      sniMatchers =
+                                    Collections.<SNIMatcher>emptyList();
+
     // Have we been told whether we're client or server?
     private boolean                     serverModeSet = false;
     private boolean                     roleIsServer;
@@ -361,6 +367,10 @@
         roleIsServer = true;
         connectionState = cs_START;
 
+        // default server name indication
+        serverNames =
+            Utilities.addToSNIServerNameList(serverNames, getPeerHost());
+
         /*
          * default read and write side cipher and MAC support
          *
@@ -459,11 +469,13 @@
                     enabledProtocols, doClientAuth,
                     protocolVersion, connectionState == cs_HANDSHAKE,
                     secureRenegotiation, clientVerifyData, serverVerifyData);
+            handshaker.setSNIMatchers(sniMatchers);
         } else {
             handshaker = new ClientHandshaker(this, sslContext,
                     enabledProtocols,
                     protocolVersion, connectionState == cs_HANDSHAKE,
                     secureRenegotiation, clientVerifyData, serverVerifyData);
+            handshaker.setSNIServerNames(serverNames);
         }
         handshaker.setEnabledCipherSuites(enabledCipherSuites);
         handshaker.setEnableSessionCreation(enableSessionCreation);
@@ -1100,7 +1112,7 @@
                     // TLS requires that unrecognized records be ignored.
                     //
                     if (debug != null && Debug.isOn("ssl")) {
-                        System.out.println(threadName() +
+                        System.out.println(Thread.currentThread().getName() +
                             ", Received record type: "
                             + inputRecord.contentType());
                     }
@@ -1384,7 +1396,7 @@
              * for handshaking and bad_record_mac for other records.
              */
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", sequence number extremely close to overflow " +
                     "(2^64-1 packets). Closing connection.");
             }
@@ -1402,7 +1414,8 @@
          */
         if ((type != Record.ct_handshake) && mac.seqNumIsHuge()) {
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() + ", request renegotiation " +
+                System.out.println(Thread.currentThread().getName() +
+                        ", request renegotiation " +
                         "to avoid sequence number overflow");
             }
 
@@ -1420,7 +1433,8 @@
     private void closeOutboundInternal() {
 
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", closeOutboundInternal()");
+            System.out.println(Thread.currentThread().getName() +
+                                    ", closeOutboundInternal()");
         }
 
         /*
@@ -1467,7 +1481,8 @@
          * Dump out a close_notify to the remote side
          */
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", called closeOutbound()");
+            System.out.println(Thread.currentThread().getName() +
+                                    ", called closeOutbound()");
         }
 
         closeOutboundInternal();
@@ -1487,7 +1502,8 @@
     private void closeInboundInternal() {
 
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", closeInboundInternal()");
+            System.out.println(Thread.currentThread().getName() +
+                                    ", closeInboundInternal()");
         }
 
         /*
@@ -1519,7 +1535,8 @@
          * someday in the future.
          */
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", called closeInbound()");
+            System.out.println(Thread.currentThread().getName() +
+                                    ", called closeInbound()");
         }
 
         /*
@@ -1642,7 +1659,7 @@
          */
         if (closeReason != null) {
             if ((debug != null) && Debug.isOn("ssl")) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", fatal: engine already closed.  Rethrowing " +
                     cause.toString());
             }
@@ -1656,7 +1673,7 @@
         }
 
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName()
+            System.out.println(Thread.currentThread().getName()
                         + ", fatal error: " + description +
                         ": " + diagnostic + "\n" + cause.toString());
         }
@@ -1723,7 +1740,7 @@
         if (debug != null && (Debug.isOn("record") ||
                 Debug.isOn("handshake"))) {
             synchronized (System.out) {
-                System.out.print(threadName());
+                System.out.print(Thread.currentThread().getName());
                 System.out.print(", RECV " + protocolVersion + " ALERT:  ");
                 if (level == Alerts.alert_fatal) {
                     System.out.print("fatal, ");
@@ -1790,7 +1807,7 @@
         boolean useDebug = debug != null && Debug.isOn("ssl");
         if (useDebug) {
             synchronized (System.out) {
-                System.out.print(threadName());
+                System.out.print(Thread.currentThread().getName());
                 System.out.print(", SEND " + protocolVersion + " ALERT:  ");
                 if (level == Alerts.alert_fatal) {
                     System.out.print("fatal, ");
@@ -1810,7 +1827,7 @@
             writeRecord(r);
         } catch (IOException e) {
             if (useDebug) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", Exception sending alert: " + e);
             }
         }
@@ -1948,7 +1965,7 @@
 
         default:
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", setUseClientMode() invoked in state = " +
                     connectionState);
             }
@@ -2050,6 +2067,8 @@
         // the super implementation does not handle the following parameters
         params.setEndpointIdentificationAlgorithm(identificationProtocol);
         params.setAlgorithmConstraints(algorithmConstraints);
+        params.setSNIMatchers(sniMatchers);
+        params.setServerNames(serverNames);
 
         return params;
     }
@@ -2063,20 +2082,29 @@
         // the super implementation does not handle the following parameters
         identificationProtocol = params.getEndpointIdentificationAlgorithm();
         algorithmConstraints = params.getAlgorithmConstraints();
+
+        List<SNIServerName> sniNames = params.getServerNames();
+        if (sniNames != null) {
+            serverNames = sniNames;
+        }
+
+        Collection<SNIMatcher> matchers = params.getSNIMatchers();
+        if (matchers != null) {
+            sniMatchers = matchers;
+        }
+
         if ((handshaker != null) && !handshaker.started()) {
             handshaker.setIdentificationProtocol(identificationProtocol);
             handshaker.setAlgorithmConstraints(algorithmConstraints);
+            if (roleIsServer) {
+                handshaker.setSNIMatchers(sniMatchers);
+            } else {
+                handshaker.setSNIServerNames(serverNames);
+            }
         }
     }
 
     /**
-     * Return the name of the current thread. Utility method.
-     */
-    private static String threadName() {
-        return Thread.currentThread().getName();
-    }
-
-    /**
      * Returns a printable representation of this end of the connection.
      */
     public String toString() {
--- a/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -39,6 +39,7 @@
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLParameters;
+import javax.net.ssl.SNIMatcher;
 
 
 /**
@@ -92,6 +93,10 @@
     // The cryptographic algorithm constraints
     private AlgorithmConstraints    algorithmConstraints = null;
 
+    // The server name indication
+    Collection<SNIMatcher>      sniMatchers =
+                                    Collections.<SNIMatcher>emptyList();
+
     /**
      * Create an SSL server socket on a port, using a non-default
      * authentication context and a specified connection backlog.
@@ -289,6 +294,7 @@
         // the super implementation does not handle the following parameters
         params.setEndpointIdentificationAlgorithm(identificationProtocol);
         params.setAlgorithmConstraints(algorithmConstraints);
+        params.setSNIMatchers(sniMatchers);
 
         return params;
     }
@@ -302,6 +308,10 @@
         // the super implementation does not handle the following parameters
         identificationProtocol = params.getEndpointIdentificationAlgorithm();
         algorithmConstraints = params.getAlgorithmConstraints();
+        Collection<SNIMatcher> matchers = params.getSNIMatchers();
+        if (matchers != null) {
+            sniMatchers = params.getSNIMatchers();
+        }
     }
 
     /**
@@ -312,7 +322,8 @@
     public Socket accept() throws IOException {
         SSLSocketImpl s = new SSLSocketImpl(sslContext, useServerMode,
             enabledCipherSuites, doClientAuth, enableSessionCreation,
-            enabledProtocols, identificationProtocol, algorithmConstraints);
+            enabledProtocols, identificationProtocol, algorithmConstraints,
+            sniMatchers);
 
         implAccept(s);
         s.doneConnect();
--- a/src/share/classes/sun/security/ssl/SSLSessionImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SSLSessionImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,9 @@
 import java.util.Vector;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.ArrayList;
 
 import java.security.Principal;
 import java.security.PrivateKey;
@@ -51,6 +54,7 @@
 import javax.net.ssl.SSLPermission;
 import javax.net.ssl.SSLException;
 import javax.net.ssl.ExtendedSSLSession;
+import javax.net.ssl.SNIServerName;
 
 import javax.security.auth.x500.X500Principal;
 
@@ -111,6 +115,8 @@
     private PrivateKey          localPrivateKey;
     private String[]            localSupportedSignAlgs;
     private String[]            peerSupportedSignAlgs;
+    private List<SNIServerName>    requestedServerNames;
+
 
     // Principals for non-certificate based cipher suites
     private Principal peerPrincipal;
@@ -212,6 +218,10 @@
             SignatureAndHashAlgorithm.getAlgorithmNames(algorithms);
     }
 
+    void setRequestedServerNames(List<SNIServerName> requestedServerNames) {
+        this.requestedServerNames = new ArrayList<>(requestedServerNames);
+    }
+
     /**
      * Set the peer principal.
      */
@@ -748,6 +758,7 @@
      * Gets an array of supported signature algorithms that the local side is
      * willing to verify.
      */
+    @Override
     public String[] getLocalSupportedSignatureAlgorithms() {
         if (localSupportedSignAlgs != null) {
             return localSupportedSignAlgs.clone();
@@ -760,6 +771,7 @@
      * Gets an array of supported signature algorithms that the peer is
      * able to verify.
      */
+    @Override
     public String[] getPeerSupportedSignatureAlgorithms() {
         if (peerSupportedSignAlgs != null) {
             return peerSupportedSignAlgs.clone();
@@ -768,6 +780,20 @@
         return new String[0];
     }
 
+    /**
+     * Obtains a <code>List</code> containing all {@link SNIServerName}s
+     * of the requested Server Name Indication (SNI) extension.
+     */
+    @Override
+    public List<SNIServerName> getRequestedServerNames() {
+        if (requestedServerNames != null && !requestedServerNames.isEmpty()) {
+            return Collections.<SNIServerName>unmodifiableList(
+                                                requestedServerNames);
+        }
+
+        return Collections.<SNIServerName>emptyList();
+    }
+
     /** Returns a string representation of this SSL session */
     public String toString() {
         return "[Session-" + sessionCount
--- a/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -109,6 +109,16 @@
         return new SSLSocketImpl(context, s, host, port, autoClose);
     }
 
+    @Override
+    public Socket createSocket(Socket s, InputStream consumed,
+            boolean autoClose) throws IOException {
+        if (s == null) {
+            throw new NullPointerException(
+                    "the existing socket cannot be null");
+        }
+
+        return new SSLSocketImpl(context, s, consumed, autoClose);
+    }
 
     /**
      * Constructs an SSL connection to a server at a specified address
--- a/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -36,9 +36,9 @@
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.ReentrantLock;
+import java.nio.charset.StandardCharsets;
 
 import javax.crypto.BadPaddingException;
-
 import javax.net.ssl.*;
 
 /**
@@ -198,14 +198,6 @@
     private boolean             autoClose = true;
     private AccessControlContext acc;
 
-    /*
-     * We cannot use the hostname resolved from name services.  For
-     * virtual hosting, multiple hostnames may be bound to the same IP
-     * address, so the hostname resolved from name services is not
-     * reliable.
-     */
-    private String              rawHostname;
-
     // The cipher suites enabled for use on this connection.
     private CipherSuiteList     enabledCipherSuites;
 
@@ -215,6 +207,12 @@
     // The cryptographic algorithm constraints
     private AlgorithmConstraints    algorithmConstraints = null;
 
+    // The server name indication and matchers
+    List<SNIServerName>         serverNames =
+                                    Collections.<SNIServerName>emptyList();
+    Collection<SNIMatcher>      sniMatchers =
+                                    Collections.<SNIMatcher>emptyList();
+
     /*
      * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME *
      * IMPORTANT STUFF TO UNDERSTANDING THE SYNCHRONIZATION ISSUES.
@@ -397,7 +395,8 @@
             throws IOException, UnknownHostException {
         super();
         this.host = host;
-        this.rawHostname = host;
+        this.serverNames =
+            Utilities.addToSNIServerNameList(this.serverNames, this.host);
         init(context, false);
         SocketAddress socketAddress =
                host != null ? new InetSocketAddress(host, port) :
@@ -440,7 +439,8 @@
             throws IOException, UnknownHostException {
         super();
         this.host = host;
-        this.rawHostname = host;
+        this.serverNames =
+            Utilities.addToSNIServerNameList(this.serverNames, this.host);
         init(context, false);
         bind(new InetSocketAddress(localAddr, localPort));
         SocketAddress socketAddress =
@@ -482,13 +482,15 @@
             CipherSuiteList suites, byte clientAuth,
             boolean sessionCreation, ProtocolList protocols,
             String identificationProtocol,
-            AlgorithmConstraints algorithmConstraints) throws IOException {
+            AlgorithmConstraints algorithmConstraints,
+            Collection<SNIMatcher> sniMatchers) throws IOException {
 
         super();
         doClientAuth = clientAuth;
         enableSessionCreation = sessionCreation;
         this.identificationProtocol = identificationProtocol;
         this.algorithmConstraints = algorithmConstraints;
+        this.sniMatchers = sniMatchers;
         init(context, serverMode);
 
         /*
@@ -535,13 +537,36 @@
             throw new SocketException("Underlying socket is not connected");
         }
         this.host = host;
-        this.rawHostname = host;
+        this.serverNames =
+            Utilities.addToSNIServerNameList(this.serverNames, this.host);
         init(context, false);
         this.autoClose = autoClose;
         doneConnect();
     }
 
     /**
+     * Creates a server mode {@link Socket} layered over an
+     * existing connected socket, and is able to read data which has
+     * already been consumed/removed from the {@link Socket}'s
+     * underlying {@link InputStream}.
+     */
+    SSLSocketImpl(SSLContextImpl context, Socket sock,
+            InputStream consumed, boolean autoClose) throws IOException {
+        super(sock, consumed);
+        // We always layer over a connected socket
+        if (!sock.isConnected()) {
+            throw new SocketException("Underlying socket is not connected");
+        }
+
+        // In server mode, it is not necessary to set host and serverNames.
+        // Otherwise, would require a reverse DNS lookup to get the hostname.
+
+        init(context, true);
+        this.autoClose = autoClose;
+        doneConnect();
+    }
+
+    /**
      * Initializes the client socket.
      */
     private void init(SSLContextImpl context, boolean isServer) {
@@ -604,7 +629,7 @@
     public void connect(SocketAddress endpoint, int timeout)
             throws IOException {
 
-        if (self != this) {
+        if (isLayered()) {
             throw new SocketException("Already connected");
         }
 
@@ -628,13 +653,8 @@
          * java.net actually connects using the socket "self", else
          * we get some pretty bizarre failure modes.
          */
-        if (self == this) {
-            sockInput = super.getInputStream();
-            sockOutput = super.getOutputStream();
-        } else {
-            sockInput = self.getInputStream();
-            sockOutput = self.getOutputStream();
-        }
+        sockInput = super.getInputStream();
+        sockOutput = super.getOutputStream();
 
         /*
          * Move to handshaking state, with pending session initialized
@@ -761,13 +781,14 @@
                         // For layered, non-autoclose sockets, we are not
                         // able to bring them into a usable state, so we
                         // treat it as fatal error.
-                        if (self != this && !autoClose) {
+                        if (isLayered() && !autoClose) {
                             // Note that the alert description is
                             // specified as -1, so no message will be send
                             // to peer anymore.
                             fatal((byte)(-1), ssle);
                         } else if ((debug != null) && Debug.isOn("ssl")) {
-                            System.out.println(threadName() +
+                            System.out.println(
+                                Thread.currentThread().getName() +
                                 ", received Exception: " + ssle);
                         }
 
@@ -935,7 +956,7 @@
                 boolean handshaking = (getConnectionState() <= cs_HANDSHAKE);
                 boolean rethrow = requireCloseNotify || handshaking;
                 if ((debug != null) && Debug.isOn("ssl")) {
-                    System.out.println(threadName() +
+                    System.out.println(Thread.currentThread().getName() +
                         ", received EOFException: "
                         + (rethrow ? "error" : "ignored"));
                 }
@@ -1119,7 +1140,7 @@
                     // TLS requires that unrecognized records be ignored.
                     //
                     if (debug != null && Debug.isOn("ssl")) {
-                        System.out.println(threadName() +
+                        System.out.println(Thread.currentThread().getName() +
                             ", Received record type: "
                             + r.contentType());
                     }
@@ -1183,7 +1204,7 @@
              * for handshaking and bad_record_mac for other records.
              */
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", sequence number extremely close to overflow " +
                     "(2^64-1 packets). Closing connection.");
 
@@ -1200,7 +1221,8 @@
          */
         if ((type != Record.ct_handshake) && mac.seqNumIsHuge()) {
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() + ", request renegotiation " +
+                System.out.println(Thread.currentThread().getName() +
+                        ", request renegotiation " +
                         "to avoid sequence number overflow");
             }
 
@@ -1278,11 +1300,13 @@
                     enabledProtocols, doClientAuth,
                     protocolVersion, connectionState == cs_HANDSHAKE,
                     secureRenegotiation, clientVerifyData, serverVerifyData);
+            handshaker.setSNIMatchers(sniMatchers);
         } else {
             handshaker = new ClientHandshaker(this, sslContext,
                     enabledProtocols,
                     protocolVersion, connectionState == cs_HANDSHAKE,
                     secureRenegotiation, clientVerifyData, serverVerifyData);
+            handshaker.setSNIServerNames(serverNames);
         }
         handshaker.setEnabledCipherSuites(enabledCipherSuites);
         handshaker.setEnableSessionCreation(enableSessionCreation);
@@ -1509,24 +1533,20 @@
     protected void closeSocket() throws IOException {
 
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", called closeSocket()");
+            System.out.println(Thread.currentThread().getName() +
+                                                ", called closeSocket()");
         }
-        if (self == this) {
-            super.close();
-        } else {
-            self.close();
-        }
+
+        super.close();
     }
 
     private void closeSocket(boolean selfInitiated) throws IOException {
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() +
+            System.out.println(Thread.currentThread().getName() +
                 ", called closeSocket(" + selfInitiated + ")");
         }
-        if (self == this) {
+        if (!isLayered() || autoClose) {
             super.close();
-        } else if (autoClose) {
-            self.close();
         } else if (selfInitiated) {
             // layered && non-autoclose
             // read close_notify alert to clear input stream
@@ -1549,7 +1569,8 @@
      */
     public void close() throws IOException {
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", called close()");
+            System.out.println(Thread.currentThread().getName() +
+                                                    ", called close()");
         }
         closeInternal(true);  // caller is initiating close
         setConnectionState(cs_APP_CLOSED);
@@ -1567,8 +1588,8 @@
      */
     private void closeInternal(boolean selfInitiated) throws IOException {
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() + ", called closeInternal("
-                + selfInitiated + ")");
+            System.out.println(Thread.currentThread().getName() +
+                        ", called closeInternal(" + selfInitiated + ")");
         }
 
         int state = getConnectionState();
@@ -1630,7 +1651,7 @@
                 // closing since it is already in progress.
                 if (state == cs_SENT_CLOSE) {
                     if (debug != null && Debug.isOn("ssl")) {
-                        System.out.println(threadName() +
+                        System.out.println(Thread.currentThread().getName() +
                             ", close invoked again; state = " +
                             getConnectionState());
                     }
@@ -1653,7 +1674,7 @@
                         }
                     }
                     if ((debug != null) && Debug.isOn("ssl")) {
-                        System.out.println(threadName() +
+                        System.out.println(Thread.currentThread().getName() +
                             ", after primary close; state = " +
                             getConnectionState());
                     }
@@ -1701,7 +1722,7 @@
      */
     void waitForClose(boolean rethrow) throws IOException {
         if (debug != null && Debug.isOn("ssl")) {
-            System.out.println(threadName() +
+            System.out.println(Thread.currentThread().getName() +
                 ", waiting for close_notify or alert: state "
                 + getConnectionState());
         }
@@ -1726,7 +1747,7 @@
             inrec = null;
         } catch (IOException e) {
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", Exception while waiting for close " +e);
             }
             if (rethrow) {
@@ -1788,8 +1809,8 @@
     synchronized private void handleException(Exception e, boolean resumable)
         throws IOException {
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName()
-                        + ", handling exception: " + e.toString());
+            System.out.println(Thread.currentThread().getName() +
+                        ", handling exception: " + e.toString());
         }
 
         // don't close the Socket in case of timeouts or interrupts if
@@ -1935,7 +1956,7 @@
         if (debug != null && (Debug.isOn("record") ||
                 Debug.isOn("handshake"))) {
             synchronized (System.out) {
-                System.out.print(threadName());
+                System.out.print(Thread.currentThread().getName());
                 System.out.print(", RECV " + protocolVersion + " ALERT:  ");
                 if (level == Alerts.alert_fatal) {
                     System.out.print("fatal, ");
@@ -2001,7 +2022,7 @@
         boolean useDebug = debug != null && Debug.isOn("ssl");
         if (useDebug) {
             synchronized (System.out) {
-                System.out.print(threadName());
+                System.out.print(Thread.currentThread().getName());
                 System.out.print(", SEND " + protocolVersion + " ALERT:  ");
                 if (level == Alerts.alert_fatal) {
                     System.out.print("fatal, ");
@@ -2021,7 +2042,7 @@
             writeRecord(r);
         } catch (IOException e) {
             if (useDebug) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", Exception sending alert: " + e);
             }
         }
@@ -2118,14 +2139,15 @@
         return host;
     }
 
-    synchronized String getRawHostname() {
-        return rawHostname;
-    }
-
     // ONLY used by HttpsClient to setup the URI specified hostname
+    //
+    // Please NOTE that this method MUST be called before calling to
+    // SSLSocket.setSSLParameters(). Otherwise, the {@code host} parameter
+    // may override SNIHostName in the customized server name indication.
     synchronized public void setHost(String host) {
         this.host = host;
-        this.rawHostname = host;
+        this.serverNames =
+            Utilities.addToSNIServerNameList(this.serverNames, this.host);
     }
 
     /**
@@ -2186,7 +2208,7 @@
             } catch (IOException e) {
                 // handshake failed. log and return a nullSession
                 if (debug != null && Debug.isOn("handshake")) {
-                      System.out.println(threadName() +
+                      System.out.println(Thread.currentThread().getName() +
                           ", IOException in getSession():  " + e);
                 }
             }
@@ -2328,7 +2350,7 @@
 
         default:
             if (debug != null && Debug.isOn("ssl")) {
-                System.out.println(threadName() +
+                System.out.println(Thread.currentThread().getName() +
                     ", setUseClientMode() invoked in state = " +
                     connectionState);
             }
@@ -2422,14 +2444,11 @@
      */
     public void setSoTimeout(int timeout) throws SocketException {
         if ((debug != null) && Debug.isOn("ssl")) {
-            System.out.println(threadName() +
+            System.out.println(Thread.currentThread().getName() +
                 ", setSoTimeout(" + timeout + ") called");
         }
-        if (self == this) {
-            super.setSoTimeout(timeout);
-        } else {
-            self.setSoTimeout(timeout);
-        }
+
+        super.setSoTimeout(timeout);
     }
 
     /**
@@ -2474,6 +2493,8 @@
         // the super implementation does not handle the following parameters
         params.setEndpointIdentificationAlgorithm(identificationProtocol);
         params.setAlgorithmConstraints(algorithmConstraints);
+        params.setSNIMatchers(sniMatchers);
+        params.setServerNames(serverNames);
 
         return params;
     }
@@ -2487,9 +2508,25 @@
         // the super implementation does not handle the following parameters
         identificationProtocol = params.getEndpointIdentificationAlgorithm();
         algorithmConstraints = params.getAlgorithmConstraints();
+
+        List<SNIServerName> sniNames = params.getServerNames();
+        if (sniNames != null) {
+            serverNames = sniNames;
+        }
+
+        Collection<SNIMatcher> matchers = params.getSNIMatchers();
+        if (matchers != null) {
+            sniMatchers = matchers;
+        }
+
         if ((handshaker != null) && !handshaker.started()) {
             handshaker.setIdentificationProtocol(identificationProtocol);
             handshaker.setAlgorithmConstraints(algorithmConstraints);
+            if (roleIsServer) {
+                handshaker.setSNIMatchers(sniMatchers);
+            } else {
+                handshaker.setSNIServerNames(serverNames);
+            }
         }
     }
 
@@ -2531,13 +2568,6 @@
     }
 
     /**
-     * Return the name of the current thread. Utility method.
-     */
-    private static String threadName() {
-        return Thread.currentThread().getName();
-    }
-
-    /**
      * Returns a printable representation of this end of the connection.
      */
     public String toString() {
@@ -2548,11 +2578,7 @@
         retval.append(sess.getCipherSuite());
         retval.append(": ");
 
-        if (self == this) {
-            retval.append(super.toString());
-        } else {
-            retval.append(self.toString());
-        }
+        retval.append(super.toString());
         retval.append("]");
 
         return retval.toString();
--- a/src/share/classes/sun/security/ssl/ServerHandshaker.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/ServerHandshaker.java	Tue Oct 23 09:41:52 2012 -0700
@@ -276,6 +276,18 @@
             mesg.print(System.out);
         }
 
+        // check the server name indication if required
+        ServerNameExtension clientHelloSNIExt = (ServerNameExtension)
+                    mesg.extensions.get(ExtensionType.EXT_SERVER_NAME);
+        if (!sniMatchers.isEmpty()) {
+            // we do not reject client without SNI extension
+            if (clientHelloSNIExt != null &&
+                        !clientHelloSNIExt.isMatched(sniMatchers)) {
+                fatalSE(Alerts.alert_unrecognized_name,
+                    "Unrecognized server name indication");
+            }
+        }
+
         // Does the message include security renegotiation indication?
         boolean renegotiationIndicated = false;
 
@@ -474,6 +486,26 @@
                     }
                 }
 
+                // cannot resume session with different server name indication
+                if (resumingSession) {
+                    List<SNIServerName> oldServerNames =
+                            previous.getRequestedServerNames();
+                    if (clientHelloSNIExt != null) {
+                        if (!clientHelloSNIExt.isIdentical(oldServerNames)) {
+                            resumingSession = false;
+                        }
+                    } else if (!oldServerNames.isEmpty()) {
+                        resumingSession = false;
+                    }
+
+                    if (!resumingSession &&
+                            debug != null && Debug.isOn("handshake")) {
+                        System.out.println(
+                            "The requested server name indication " +
+                            "is not identical to the previous one");
+                    }
+                }
+
                 if (resumingSession &&
                         (doClientAuth == SSLEngineImpl.clauth_required)) {
                     try {
@@ -613,6 +645,14 @@
                     // algorithms in chooseCipherSuite()
             }
 
+            // set the server name indication in the session
+            List<SNIServerName> clientHelloSNI =
+                    Collections.<SNIServerName>emptyList();
+            if (clientHelloSNIExt != null) {
+                clientHelloSNI = clientHelloSNIExt.getServerNames();
+            }
+            session.setRequestedServerNames(clientHelloSNI);
+
             // set the handshake session
             setHandshakeSessionSE(session);
 
@@ -654,6 +694,15 @@
             m1.extensions.add(serverHelloRI);
         }
 
+        if (!sniMatchers.isEmpty() && clientHelloSNIExt != null) {
+            // When resuming a session, the server MUST NOT include a
+            // server_name extension in the server hello.
+            if (!resumingSession) {
+                ServerNameExtension serverHelloSNI = new ServerNameExtension();
+                m1.extensions.add(serverHelloSNI);
+            }
+        }
+
         if (debug != null && Debug.isOn("handshake")) {
             m1.print(System.out);
             System.out.println("Cipher suite:  " + session.getSuite());
--- a/src/share/classes/sun/security/ssl/SunJSSE.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/SunJSSE.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
 
     // standard constructor
     protected SunJSSE() {
-        super("SunJSSE", 1.7d, info);
+        super("SunJSSE", 1.8d, info);
         subclassCheck();
         if (Boolean.TRUE.equals(fips)) {
             throw new ProviderException
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/ssl/Utilities.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.ssl;
+
+import javax.net.ssl.*;
+import java.util.*;
+import sun.net.util.IPAddressUtil;
+
+/**
+ * A utility class to share the static methods.
+ */
+final class Utilities {
+    /**
+     * Puts {@code hostname} into the {@code serverNames} list.
+     * <P>
+     * If the {@code serverNames} does not look like a legal FQDN, it will
+     * not be put into the returned list.
+     * <P>
+     * Note that the returned list does not allow duplicated name type.
+     *
+     * @return a list of {@link SNIServerName}
+     */
+    static List<SNIServerName> addToSNIServerNameList(
+            List<SNIServerName> serverNames, String hostname) {
+
+        SNIHostName sniHostName = rawToSNIHostName(hostname);
+        if (sniHostName == null) {
+            return serverNames;
+        }
+
+        int size = serverNames.size();
+        List<SNIServerName> sniList = (size != 0) ?
+                new ArrayList<SNIServerName>(serverNames) :
+                new ArrayList<SNIServerName>(1);
+
+        boolean reset = false;
+        for (int i = 0; i < size; i++) {
+            SNIServerName serverName = sniList.get(i);
+            if (serverName.getType() == StandardConstants.SNI_HOST_NAME) {
+                sniList.set(i, sniHostName);
+                if (Debug.isOn("ssl")) {
+                    System.out.println(Thread.currentThread().getName() +
+                        ", the previous server name in SNI (" + serverName +
+                        ") was replaced with (" + sniHostName + ")");
+                }
+                reset = true;
+                break;
+            }
+        }
+
+        if (!reset) {
+            sniList.add(sniHostName);
+        }
+
+        return Collections.<SNIServerName>unmodifiableList(sniList);
+    }
+
+    /**
+     * Converts string hostname to {@code SNIHostName}.
+     * <P>
+     * Note that to check whether a hostname is a valid domain name, we cannot
+     * use the hostname resolved from name services.  For virtual hosting,
+     * multiple hostnames may be bound to the same IP address, so the hostname
+     * resolved from name services is not always reliable.
+     *
+     * @param  hostname
+     *         the raw hostname
+     * @return an instance of {@link SNIHostName}, or null if the hostname does
+     *         not look like a FQDN
+     */
+    private static SNIHostName rawToSNIHostName(String hostname) {
+        SNIHostName sniHostName = null;
+        if (hostname != null && hostname.indexOf('.') > 0 &&
+                !hostname.endsWith(".") &&
+                !IPAddressUtil.isIPv4LiteralAddress(hostname) &&
+                !IPAddressUtil.isIPv6LiteralAddress(hostname)) {
+
+            try {
+                sniHostName = new SNIHostName(hostname);
+            } catch (IllegalArgumentException iae) {
+                // don't bother to handle illegal host_name
+                if (Debug.isOn("ssl")) {
+                    System.out.println(Thread.currentThread().getName() +
+                        ", \"" + hostname + "\" " +
+                        "is not a legal HostName for  server name indication");
+                }
+            }
+        }
+
+        return sniHostName;
+    }
+}
--- a/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/X509KeyManagerImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,13 +128,35 @@
     public String chooseServerAlias(String keyType,
             Principal[] issuers, Socket socket) {
         return chooseAlias(getKeyTypes(keyType), issuers, CheckType.SERVER,
-                        getAlgorithmConstraints(socket));
+            getAlgorithmConstraints(socket),
+            X509TrustManagerImpl.getRequestedServerNames(socket),
+            "HTTPS");    // The SNI HostName is a fully qualified domain name.
+                         // The certificate selection scheme for SNI HostName
+                         // is similar to HTTPS endpoint identification scheme
+                         // implemented in this provider.
+                         //
+                         // Using HTTPS endpoint identification scheme to guide
+                         // the selection of an appropriate authentication
+                         // certificate according to requested SNI extension.
+                         //
+                         // It is not a really HTTPS endpoint identification.
     }
 
     public String chooseEngineServerAlias(String keyType,
             Principal[] issuers, SSLEngine engine) {
         return chooseAlias(getKeyTypes(keyType), issuers, CheckType.SERVER,
-                        getAlgorithmConstraints(engine));
+            getAlgorithmConstraints(engine),
+            X509TrustManagerImpl.getRequestedServerNames(engine),
+            "HTTPS");    // The SNI HostName is a fully qualified domain name.
+                         // The certificate selection scheme for SNI HostName
+                         // is similar to HTTPS endpoint identification scheme
+                         // implemented in this provider.
+                         //
+                         // Using HTTPS endpoint identification scheme to guide
+                         // the selection of an appropriate authentication
+                         // certificate according to requested SNI extension.
+                         //
+                         // It is not a really HTTPS endpoint identification.
     }
 
     public String[] getClientAliases(String keyType, Principal[] issuers) {
@@ -321,8 +343,8 @@
      * The algorithm we use is:
      *   . scan through all the aliases in all builders in order
      *   . as soon as we find a perfect match, return
-     *     (i.e. a match with a cert that has appropriate key usage
-     *      and is not expired).
+     *     (i.e. a match with a cert that has appropriate key usage,
+     *      qualified endpoint identity, and is not expired).
      *   . if we do not find a perfect match, keep looping and remember
      *     the imperfect matches
      *   . at the end, sort the imperfect matches. we prefer expired certs
@@ -331,6 +353,15 @@
      */
     private String chooseAlias(List<KeyType> keyTypeList, Principal[] issuers,
             CheckType checkType, AlgorithmConstraints constraints) {
+
+        return chooseAlias(keyTypeList, issuers,
+                                    checkType, constraints, null, null);
+    }
+
+    private String chooseAlias(List<KeyType> keyTypeList, Principal[] issuers,
+            CheckType checkType, AlgorithmConstraints constraints,
+            List<SNIServerName> requestedServerNames, String idAlgorithm) {
+
         if (keyTypeList == null || keyTypeList.isEmpty()) {
             return null;
         }
@@ -340,7 +371,8 @@
         for (int i = 0, n = builders.size(); i < n; i++) {
             try {
                 List<EntryStatus> results = getAliases(i, keyTypeList,
-                                    issuerSet, false, checkType, constraints);
+                            issuerSet, false, checkType, constraints,
+                            requestedServerNames, idAlgorithm);
                 if (results != null) {
                     // the results will either be a single perfect match
                     // or 1 or more imperfect matches
@@ -394,7 +426,8 @@
         for (int i = 0, n = builders.size(); i < n; i++) {
             try {
                 List<EntryStatus> results = getAliases(i, keyTypeList,
-                                    issuerSet, true, checkType, constraints);
+                                    issuerSet, true, checkType, constraints,
+                                    null, null);
                 if (results != null) {
                     if (allResults == null) {
                         allResults = new ArrayList<EntryStatus>();
@@ -504,7 +537,9 @@
         // first check extensions, if they match, check expiration
         // note: we may want to move this code into the sun.security.validator
         // package
-        CheckResult check(X509Certificate cert, Date date) {
+        CheckResult check(X509Certificate cert, Date date,
+                List<SNIServerName> serverNames, String idAlgorithm) {
+
             if (this == NONE) {
                 return CheckResult.OK;
             }
@@ -553,11 +588,11 @@
                                 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.
+                            // 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;
                             }
@@ -571,10 +606,50 @@
 
             try {
                 cert.checkValidity(date);
-                return CheckResult.OK;
             } catch (CertificateException e) {
                 return CheckResult.EXPIRED;
             }
+
+            if (serverNames != null && !serverNames.isEmpty()) {
+                for (SNIServerName serverName : serverNames) {
+                    if (serverName.getType() ==
+                                StandardConstants.SNI_HOST_NAME) {
+                        if (!(serverName instanceof SNIHostName)) {
+                            try {
+                                serverName =
+                                    new SNIHostName(serverName.getEncoded());
+                            } catch (IllegalArgumentException iae) {
+                                // unlikely to happen, just in case ...
+                                if (useDebug) {
+                                    debug.println(
+                                       "Illegal server name: " + serverName);
+                                }
+
+                                return CheckResult.INSENSITIVE;
+                            }
+                        }
+                        String hostname =
+                                ((SNIHostName)serverName).getAsciiName();
+
+                        try {
+                            X509TrustManagerImpl.checkIdentity(hostname,
+                                                        cert, idAlgorithm);
+                        } catch (CertificateException e) {
+                            if (useDebug) {
+                                debug.println(
+                                   "Certificate identity does not match " +
+                                   "Server Name Inidication (SNI): " +
+                                   hostname);
+                            }
+                            return CheckResult.INSENSITIVE;
+                        }
+
+                        break;
+                    }
+                }
+            }
+
+            return CheckResult.OK;
         }
     }
 
@@ -583,6 +658,7 @@
     // for sorting, i.e. OK is best, followed by EXPIRED and EXTENSION_MISMATCH
     private static enum CheckResult {
         OK,                     // ok or not checked
+        INSENSITIVE,            // server name indication insensitive
         EXPIRED,                // extensions valid but cert expired
         EXTENSION_MISMATCH,     // extensions invalid (expiration not checked)
     }
@@ -616,7 +692,10 @@
     private List<EntryStatus> getAliases(int builderIndex,
             List<KeyType> keyTypes, Set<Principal> issuerSet,
             boolean findAll, CheckType checkType,
-            AlgorithmConstraints constraints) throws Exception {
+            AlgorithmConstraints constraints,
+            List<SNIServerName> requestedServerNames,
+            String idAlgorithm) throws Exception {
+
         Builder builder = builders.get(builderIndex);
         KeyStore ks = builder.getKeyStore();
         List<EntryStatus> results = null;
@@ -699,7 +778,8 @@
                 date = new Date();
             }
             CheckResult checkResult =
-                    checkType.check((X509Certificate)chain[0], date);
+                    checkType.check((X509Certificate)chain[0], date,
+                                    requestedServerNames, idAlgorithm);
             EntryStatus status =
                     new EntryStatus(builderIndex, keyIndex,
                                         alias, chain, checkResult);
--- a/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +28,14 @@
 
 import java.net.Socket;
 import javax.net.ssl.SSLSession;
+import java.nio.charset.StandardCharsets;
 
 import java.util.*;
 import java.security.*;
 import java.security.cert.*;
-
 import javax.net.ssl.*;
 
 import sun.security.validator.*;
-
 import sun.security.util.HostnameChecker;
 
 /**
@@ -199,8 +198,8 @@
             String identityAlg = sslSocket.getSSLParameters().
                                         getEndpointIdentificationAlgorithm();
             if (identityAlg != null && identityAlg.length() != 0) {
-                String hostname = session.getPeerHost();
-                checkIdentity(hostname, chain[0], identityAlg);
+                checkIdentity(session, chain[0], identityAlg, isClient,
+                        getRequestedServerNames(socket));
             }
 
             // create the algorithm constraints
@@ -251,8 +250,8 @@
             String identityAlg = engine.getSSLParameters().
                                         getEndpointIdentificationAlgorithm();
             if (identityAlg != null && identityAlg.length() != 0) {
-                String hostname = session.getPeerHost();
-                checkIdentity(hostname, chain[0], identityAlg);
+                checkIdentity(session, chain[0], identityAlg, isClient,
+                        getRequestedServerNames(engine));
             }
 
             // create the algorithm constraints
@@ -329,6 +328,117 @@
         }
     }
 
+    // Get string representation of HostName from a list of server names.
+    //
+    // We are only accepting host_name name type in the list.
+    private static String getHostNameInSNI(List<SNIServerName> sniNames) {
+
+        SNIHostName hostname = null;
+        for (SNIServerName sniName : sniNames) {
+            if (sniName.getType() != StandardConstants.SNI_HOST_NAME) {
+                continue;
+            }
+
+            if (sniName instanceof SNIHostName) {
+                hostname = (SNIHostName)sniName;
+            } else {
+                try {
+                    hostname = new SNIHostName(sniName.getEncoded());
+                } catch (IllegalArgumentException iae) {
+                    // unlikely to happen, just in case ...
+                    if ((debug != null) && Debug.isOn("trustmanager")) {
+                        byte[] encoded = hostname.getEncoded();
+                        System.out.println("Illegal server name: " + sniName);
+                    }
+                }
+            }
+
+            // no more than server name of the same name type
+            break;
+        }
+
+        if (hostname != null) {
+            return hostname.getAsciiName();
+        }
+
+        return null;
+    }
+
+    // Also used by X509KeyManagerImpl
+    static List<SNIServerName> getRequestedServerNames(Socket socket) {
+        if (socket != null && socket.isConnected() &&
+                                        socket instanceof SSLSocket) {
+
+            SSLSocket sslSocket = (SSLSocket)socket;
+            SSLSession session = sslSocket.getHandshakeSession();
+
+            if (session != null && (session instanceof ExtendedSSLSession)) {
+                ExtendedSSLSession extSession = (ExtendedSSLSession)session;
+                return extSession.getRequestedServerNames();
+            }
+        }
+
+        return Collections.<SNIServerName>emptyList();
+    }
+
+    // Also used by X509KeyManagerImpl
+    static List<SNIServerName> getRequestedServerNames(SSLEngine engine) {
+        if (engine != null) {
+            SSLSession session = engine.getHandshakeSession();
+
+            if (session != null && (session instanceof ExtendedSSLSession)) {
+                ExtendedSSLSession extSession = (ExtendedSSLSession)session;
+                return extSession.getRequestedServerNames();
+            }
+        }
+
+        return Collections.<SNIServerName>emptyList();
+    }
+
+    /*
+     * Per RFC 6066, if an application negotiates a server name using an
+     * application protocol and then upgrades to TLS, and if a server_name
+     * extension is sent, then the extension SHOULD contain the same name
+     * that was negotiated in the application protocol.  If the server_name
+     * is established in the TLS session handshake, the client SHOULD NOT
+     * attempt to request a different server name at the application layer.
+     *
+     * According to the above spec, we only need to check either the identity
+     * in server_name extension or the peer host of the connection.  Peer host
+     * is not always a reliable fully qualified domain name. The HostName in
+     * server_name extension is more reliable than peer host. So we prefer
+     * the identity checking aginst the server_name extension if present, and
+     * may failove to peer host checking.
+     */
+    private static void checkIdentity(SSLSession session,
+            X509Certificate cert,
+            String algorithm,
+            boolean isClient,
+            List<SNIServerName> sniNames) throws CertificateException {
+
+        boolean identifiable = false;
+        String peerHost = session.getPeerHost();
+        if (isClient) {
+            String hostname = getHostNameInSNI(sniNames);
+            if (hostname != null) {
+                try {
+                    checkIdentity(hostname, cert, algorithm);
+                    identifiable = true;
+                } catch (CertificateException ce) {
+                    if (hostname.equalsIgnoreCase(peerHost)) {
+                        throw ce;
+                    }
+
+                    // otherwisw, failover to check peer host
+                }
+            }
+        }
+
+        if (!identifiable) {
+            checkIdentity(peerHost, cert, algorithm);
+        }
+    }
+
     /*
      * Identify the peer by its certificate and hostname.
      *
--- a/src/share/classes/sun/security/tools/CertAndKeyGen.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-import java.io.IOException;
-import java.security.cert.X509Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateEncodingException;
-import java.security.*;
-import java.util.Date;
-
-import sun.security.pkcs10.PKCS10;
-import sun.security.x509.*;
-
-
-/**
- * Generate a pair of keys, and provide access to them.  This class is
- * provided primarily for ease of use.
- *
- * <P>This provides some simple certificate management functionality.
- * Specifically, it allows you to create self-signed X.509 certificates
- * as well as PKCS 10 based certificate signing requests.
- *
- * <P>Keys for some public key signature algorithms have algorithm
- * parameters, such as DSS/DSA.  Some sites' Certificate Authorities
- * adopt fixed algorithm parameters, which speeds up some operations
- * including key generation and signing.  <em>At this time, this interface
- * does not provide a way to provide such algorithm parameters, e.g.
- * by providing the CA certificate which includes those parameters.</em>
- *
- * <P>Also, note that at this time only signature-capable keys may be
- * acquired through this interface.  Diffie-Hellman keys, used for secure
- * key exchange, may be supported later.
- *
- * @author David Brownell
- * @author Hemma Prafullchandra
- * @see PKCS10
- * @see X509CertImpl
- */
-public final class CertAndKeyGen {
-    /**
-     * Creates a CertAndKeyGen object for a particular key type
-     * and signature algorithm.
-     *
-     * @param keyType type of key, e.g. "RSA", "DSA"
-     * @param sigAlg name of the signature algorithm, e.g. "MD5WithRSA",
-     *          "MD2WithRSA", "SHAwithDSA".
-     * @exception NoSuchAlgorithmException on unrecognized algorithms.
-     */
-    public CertAndKeyGen (String keyType, String sigAlg)
-    throws NoSuchAlgorithmException
-    {
-        keyGen = KeyPairGenerator.getInstance(keyType);
-        this.sigAlg = sigAlg;
-    }
-
-    /**
-     * Creates a CertAndKeyGen object for a particular key type,
-     * signature algorithm, and provider.
-     *
-     * @param keyType type of key, e.g. "RSA", "DSA"
-     * @param sigAlg name of the signature algorithm, e.g. "MD5WithRSA",
-     *          "MD2WithRSA", "SHAwithDSA".
-     * @param providerName name of the provider
-     * @exception NoSuchAlgorithmException on unrecognized algorithms.
-     * @exception NoSuchProviderException on unrecognized providers.
-     */
-    public CertAndKeyGen (String keyType, String sigAlg, String providerName)
-    throws NoSuchAlgorithmException, NoSuchProviderException
-    {
-        if (providerName == null) {
-            keyGen = KeyPairGenerator.getInstance(keyType);
-        } else {
-            try {
-                keyGen = KeyPairGenerator.getInstance(keyType, providerName);
-            } catch (Exception e) {
-                // try first available provider instead
-                keyGen = KeyPairGenerator.getInstance(keyType);
-            }
-        }
-        this.sigAlg = sigAlg;
-    }
-
-    /**
-     * Sets the source of random numbers used when generating keys.
-     * If you do not provide one, a system default facility is used.
-     * You may wish to provide your own source of random numbers
-     * to get a reproducible sequence of keys and signatures, or
-     * because you may be able to take advantage of strong sources
-     * of randomness/entropy in your environment.
-     */
-    public void         setRandom (SecureRandom generator)
-    {
-        prng = generator;
-    }
-
-    // want "public void generate (X509Certificate)" ... inherit DSA/D-H param
-
-    /**
-     * Generates a random public/private key pair, with a given key
-     * size.  Different algorithms provide different degrees of security
-     * for the same key size, because of the "work factor" involved in
-     * brute force attacks.  As computers become faster, it becomes
-     * easier to perform such attacks.  Small keys are to be avoided.
-     *
-     * <P>Note that not all values of "keyBits" are valid for all
-     * algorithms, and not all public key algorithms are currently
-     * supported for use in X.509 certificates.  If the algorithm
-     * you specified does not produce X.509 compatible keys, an
-     * invalid key exception is thrown.
-     *
-     * @param keyBits the number of bits in the keys.
-     * @exception InvalidKeyException if the environment does not
-     *  provide X.509 public keys for this signature algorithm.
-     */
-    public void generate (int keyBits)
-    throws InvalidKeyException
-    {
-        KeyPair pair;
-
-        try {
-            if (prng == null) {
-                prng = new SecureRandom();
-            }
-            keyGen.initialize(keyBits, prng);
-            pair = keyGen.generateKeyPair();
-
-        } catch (Exception e) {
-            throw new IllegalArgumentException(e.getMessage());
-        }
-
-        publicKey = pair.getPublic();
-        privateKey = pair.getPrivate();
-
-        // publicKey's format must be X.509 otherwise
-        // the whole CertGen part of this class is broken.
-        if (!"X.509".equalsIgnoreCase(publicKey.getFormat())) {
-            throw new IllegalArgumentException("publicKey's is not X.509, but "
-                    + publicKey.getFormat());
-        }
-    }
-
-
-    /**
-     * Returns the public key of the generated key pair if it is of type
-     * <code>X509Key</code>, or null if the public key is of a different type.
-     *
-     * XXX Note: This behaviour is needed for backwards compatibility.
-     * What this method really should return is the public key of the
-     * generated key pair, regardless of whether or not it is an instance of
-     * <code>X509Key</code>. Accordingly, the return type of this method
-     * should be <code>PublicKey</code>.
-     */
-    public X509Key getPublicKey()
-    {
-        if (!(publicKey instanceof X509Key)) {
-            return null;
-        }
-        return (X509Key)publicKey;
-    }
-
-    /**
-     * Always returns the public key of the generated key pair. Used
-     * by KeyTool only.
-     *
-     * The publicKey is not necessarily to be an instance of
-     * X509Key in some JCA/JCE providers, for example SunPKCS11.
-     */
-    public PublicKey getPublicKeyAnyway() {
-        return publicKey;
-    }
-
-    /**
-     * Returns the private key of the generated key pair.
-     *
-     * <P><STRONG><em>Be extremely careful when handling private keys.
-     * When private keys are not kept secret, they lose their ability
-     * to securely authenticate specific entities ... that is a huge
-     * security risk!</em></STRONG>
-     */
-    public PrivateKey getPrivateKey ()
-    {
-        return privateKey;
-    }
-
-    /**
-     * Returns a self-signed X.509v3 certificate for the public key.
-     * The certificate is immediately valid. No extensions.
-     *
-     * <P>Such certificates normally are used to identify a "Certificate
-     * Authority" (CA).  Accordingly, they will not always be accepted by
-     * other parties.  However, such certificates are also useful when
-     * you are bootstrapping your security infrastructure, or deploying
-     * system prototypes.
-     *
-     * @param myname X.500 name of the subject (who is also the issuer)
-     * @param firstDate the issue time of the certificate
-     * @param validity how long the certificate should be valid, in seconds
-     * @exception CertificateException on certificate handling errors.
-     * @exception InvalidKeyException on key handling errors.
-     * @exception SignatureException on signature handling errors.
-     * @exception NoSuchAlgorithmException on unrecognized algorithms.
-     * @exception NoSuchProviderException on unrecognized providers.
-     */
-    public X509Certificate getSelfCertificate (
-            X500Name myname, Date firstDate, long validity)
-    throws CertificateException, InvalidKeyException, SignatureException,
-        NoSuchAlgorithmException, NoSuchProviderException
-    {
-        return getSelfCertificate(myname, firstDate, validity, null);
-    }
-
-    // Like above, plus a CertificateExtensions argument, which can be null.
-    public X509Certificate getSelfCertificate (X500Name myname, Date firstDate,
-            long validity, CertificateExtensions ext)
-    throws CertificateException, InvalidKeyException, SignatureException,
-        NoSuchAlgorithmException, NoSuchProviderException
-    {
-        X509CertImpl    cert;
-        Date            lastDate;
-
-        try {
-            lastDate = new Date ();
-            lastDate.setTime (firstDate.getTime () + validity * 1000);
-
-            CertificateValidity interval =
-                                   new CertificateValidity(firstDate,lastDate);
-
-            X509CertInfo info = new X509CertInfo();
-            // Add all mandatory attributes
-            info.set(X509CertInfo.VERSION,
-                     new CertificateVersion(CertificateVersion.V3));
-            info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
-                    new java.util.Random().nextInt() & 0x7fffffff));
-            AlgorithmId algID = AlgorithmId.get(sigAlg);
-            info.set(X509CertInfo.ALGORITHM_ID,
-                     new CertificateAlgorithmId(algID));
-            info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(myname));
-            info.set(X509CertInfo.KEY, new CertificateX509Key(publicKey));
-            info.set(X509CertInfo.VALIDITY, interval);
-            info.set(X509CertInfo.ISSUER, new CertificateIssuerName(myname));
-            if (ext != null) info.set(X509CertInfo.EXTENSIONS, ext);
-
-            cert = new X509CertImpl(info);
-            cert.sign(privateKey, this.sigAlg);
-
-            return (X509Certificate)cert;
-
-        } catch (IOException e) {
-             throw new CertificateEncodingException("getSelfCert: " +
-                                                    e.getMessage());
-        }
-    }
-
-    // Keep the old method
-    public X509Certificate getSelfCertificate (X500Name myname, long validity)
-    throws CertificateException, InvalidKeyException, SignatureException,
-        NoSuchAlgorithmException, NoSuchProviderException
-    {
-        return getSelfCertificate(myname, new Date(), validity);
-    }
-
-    /**
-     * Returns a PKCS #10 certificate request.  The caller uses either
-     * <code>PKCS10.print</code> or <code>PKCS10.toByteArray</code>
-     * operations on the result, to get the request in an appropriate
-     * transmission format.
-     *
-     * <P>PKCS #10 certificate requests are sent, along with some proof
-     * of identity, to Certificate Authorities (CAs) which then issue
-     * X.509 public key certificates.
-     *
-     * @param myname X.500 name of the subject
-     * @exception InvalidKeyException on key handling errors.
-     * @exception SignatureException on signature handling errors.
-     */
-    public PKCS10 getCertRequest (X500Name myname)
-    throws InvalidKeyException, SignatureException
-    {
-        PKCS10  req = new PKCS10 (publicKey);
-
-        try {
-            Signature signature = Signature.getInstance(sigAlg);
-            signature.initSign (privateKey);
-            req.encodeAndSign(myname, signature);
-
-        } catch (CertificateException e) {
-            throw new SignatureException (sigAlg + " CertificateException");
-
-        } catch (IOException e) {
-            throw new SignatureException (sigAlg + " IOException");
-
-        } catch (NoSuchAlgorithmException e) {
-            // "can't happen"
-            throw new SignatureException (sigAlg + " unavailable?");
-        }
-        return req;
-    }
-
-    private SecureRandom        prng;
-    private String              sigAlg;
-    private KeyPairGenerator    keyGen;
-    private PublicKey           publicKey;
-    private PrivateKey          privateKey;
-}
--- a/src/share/classes/sun/security/tools/JarSigner.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2467 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-import java.io.*;
-import java.util.*;
-import java.util.zip.*;
-import java.util.jar.*;
-import java.math.BigInteger;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.text.Collator;
-import java.text.MessageFormat;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.security.cert.CertificateException;
-import java.security.*;
-import java.lang.reflect.Constructor;
-
-import com.sun.jarsigner.ContentSigner;
-import com.sun.jarsigner.ContentSignerParameters;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.cert.CertPath;
-import java.security.cert.CertPathValidator;
-import java.security.cert.CertificateExpiredException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.PKIXParameters;
-import java.security.cert.TrustAnchor;
-import java.util.Map.Entry;
-import sun.security.x509.*;
-import sun.security.util.*;
-import sun.misc.BASE64Encoder;
-
-
-/**
- * <p>The jarsigner utility.
- *
- * The exit codes for the main method are:
- *
- * 0: success
- * 1: any error that the jar cannot be signed or verified, including:
- *      keystore loading error
- *      TSP communication error
- *      jarsigner command line error...
- * otherwise: error codes from -strict
- *
- * @author Roland Schemers
- * @author Jan Luehe
- */
-
-public class JarSigner {
-
-    // for i18n
-    private static final java.util.ResourceBundle rb =
-        java.util.ResourceBundle.getBundle
-        ("sun.security.tools.JarSignerResources");
-    private static final Collator collator = Collator.getInstance();
-    static {
-        // this is for case insensitive string comparisions
-        collator.setStrength(Collator.PRIMARY);
-    }
-
-    private static final String META_INF = "META-INF/";
-
-    // prefix for new signature-related files in META-INF directory
-    private static final String SIG_PREFIX = META_INF + "SIG-";
-
-    private static final Class[] PARAM_STRING = { String.class };
-
-    private static final String NONE = "NONE";
-    private static final String P11KEYSTORE = "PKCS11";
-
-    private static final long SIX_MONTHS = 180*24*60*60*1000L; //milliseconds
-
-    // Attention:
-    // This is the entry that get launched by the security tool jarsigner.
-    public static void main(String args[]) throws Exception {
-        JarSigner js = new JarSigner();
-        js.run(args);
-    }
-
-    static final String VERSION = "1.0";
-
-    static final int IN_KEYSTORE = 0x01;        // signer is in keystore
-    static final int IN_SCOPE = 0x02;
-    static final int NOT_ALIAS = 0x04;          // alias list is NOT empty and
-                                                // signer is not in alias list
-    static final int SIGNED_BY_ALIAS = 0x08;    // signer is in alias list
-
-    X509Certificate[] certChain;    // signer's cert chain (when composing)
-    PrivateKey privateKey;          // private key
-    KeyStore store;                 // the keystore specified by -keystore
-                                    // or the default keystore, never null
-
-    String keystore; // key store file
-    boolean nullStream = false; // null keystore input stream (NONE)
-    boolean token = false; // token-based keystore
-    String jarfile;  // jar files to sign or verify
-    String alias;    // alias to sign jar with
-    List<String> ckaliases = new ArrayList<>(); // aliases in -verify
-    char[] storepass; // keystore password
-    boolean protectedPath; // protected authentication path
-    String storetype; // keystore type
-    String providerName; // provider name
-    Vector<String> providers = null; // list of providers
-    // arguments for provider constructors
-    HashMap<String,String> providerArgs = new HashMap<>();
-    char[] keypass; // private key password
-    String sigfile; // name of .SF file
-    String sigalg; // name of signature algorithm
-    String digestalg = "SHA-256"; // name of digest algorithm
-    String signedjar; // output filename
-    String tsaUrl; // location of the Timestamping Authority
-    String tsaAlias; // alias for the Timestamping Authority's certificate
-    String altCertChain; // file to read alternative cert chain from
-    boolean verify = false; // verify the jar
-    String verbose = null; // verbose output when signing/verifying
-    boolean showcerts = false; // show certs when verifying
-    boolean debug = false; // debug
-    boolean signManifest = true; // "sign" the whole manifest
-    boolean externalSF = true; // leave the .SF out of the PKCS7 block
-    boolean strict = false;  // treat warnings as error
-
-    // read zip entry raw bytes
-    private ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
-    private byte[] buffer = new byte[8192];
-    private ContentSigner signingMechanism = null;
-    private String altSignerClass = null;
-    private String altSignerClasspath = null;
-    private ZipFile zipFile = null;
-
-    private boolean hasExpiredCert = false;
-    private boolean hasExpiringCert = false;
-    private boolean notYetValidCert = false;
-    private boolean chainNotValidated = false;
-    private boolean notSignedByAlias = false;
-    private boolean aliasNotInStore = false;
-    private boolean hasUnsignedEntry = false;
-    private boolean badKeyUsage = false;
-    private boolean badExtendedKeyUsage = false;
-    private boolean badNetscapeCertType = false;
-
-    CertificateFactory certificateFactory;
-    CertPathValidator validator;
-    PKIXParameters pkixParameters;
-
-    public void run(String args[]) {
-        try {
-            parseArgs(args);
-
-            // Try to load and install the specified providers
-            if (providers != null) {
-                ClassLoader cl = ClassLoader.getSystemClassLoader();
-                Enumeration<String> e = providers.elements();
-                while (e.hasMoreElements()) {
-                    String provName = e.nextElement();
-                    Class<?> provClass;
-                    if (cl != null) {
-                        provClass = cl.loadClass(provName);
-                    } else {
-                        provClass = Class.forName(provName);
-                    }
-
-                    String provArg = providerArgs.get(provName);
-                    Object obj;
-                    if (provArg == null) {
-                        obj = provClass.newInstance();
-                    } else {
-                        Constructor<?> c =
-                                provClass.getConstructor(PARAM_STRING);
-                        obj = c.newInstance(provArg);
-                    }
-
-                    if (!(obj instanceof Provider)) {
-                        MessageFormat form = new MessageFormat(rb.getString
-                            ("provName.not.a.provider"));
-                        Object[] source = {provName};
-                        throw new Exception(form.format(source));
-                    }
-                    Security.addProvider((Provider)obj);
-                }
-            }
-
-            if (verify) {
-                try {
-                    loadKeyStore(keystore, false);
-                } catch (Exception e) {
-                    if ((keystore != null) || (storepass != null)) {
-                        System.out.println(rb.getString("jarsigner.error.") +
-                                        e.getMessage());
-                        System.exit(1);
-                    }
-                }
-                /*              if (debug) {
-                    SignatureFileVerifier.setDebug(true);
-                    ManifestEntryVerifier.setDebug(true);
-                }
-                */
-                verifyJar(jarfile);
-            } else {
-                loadKeyStore(keystore, true);
-                getAliasInfo(alias);
-
-                // load the alternative signing mechanism
-                if (altSignerClass != null) {
-                    signingMechanism = loadSigningMechanism(altSignerClass,
-                        altSignerClasspath);
-                }
-                signJar(jarfile, alias, args);
-            }
-        } catch (Exception e) {
-            System.out.println(rb.getString("jarsigner.error.") + e);
-            if (debug) {
-                e.printStackTrace();
-            }
-            System.exit(1);
-        } finally {
-            // zero-out private key password
-            if (keypass != null) {
-                Arrays.fill(keypass, ' ');
-                keypass = null;
-            }
-            // zero-out keystore password
-            if (storepass != null) {
-                Arrays.fill(storepass, ' ');
-                storepass = null;
-            }
-        }
-
-        if (strict) {
-            int exitCode = 0;
-            if (hasExpiringCert) {
-                exitCode |= 2;
-            }
-            if (chainNotValidated || hasExpiredCert || notYetValidCert) {
-                exitCode |= 4;
-            }
-            if (badKeyUsage || badExtendedKeyUsage || badNetscapeCertType) {
-                exitCode |= 8;
-            }
-            if (hasUnsignedEntry) {
-                exitCode |= 16;
-            }
-            if (notSignedByAlias || aliasNotInStore) {
-                exitCode |= 32;
-            }
-            if (exitCode != 0) {
-                System.exit(exitCode);
-            }
-        }
-    }
-
-    /*
-     * Parse command line arguments.
-     */
-    void parseArgs(String args[]) {
-        /* parse flags */
-        int n = 0;
-
-        if (args.length == 0) fullusage();
-        for (n=0; n < args.length; n++) {
-
-            String flags = args[n];
-            String modifier = null;
-            if (flags.charAt(0) == '-') {
-                int pos = flags.indexOf(':');
-                if (pos > 0) {
-                    modifier = flags.substring(pos+1);
-                    flags = flags.substring(0, pos);
-                }
-            }
-
-            if (collator.compare(flags, "-keystore") == 0) {
-                if (++n == args.length) usageNoArg();
-                keystore = args[n];
-            } else if (collator.compare(flags, "-storepass") ==0) {
-                if (++n == args.length) usageNoArg();
-                storepass = getPass(modifier, args[n]);
-            } else if (collator.compare(flags, "-storetype") ==0) {
-                if (++n == args.length) usageNoArg();
-                storetype = args[n];
-            } else if (collator.compare(flags, "-providerName") ==0) {
-                if (++n == args.length) usageNoArg();
-                providerName = args[n];
-            } else if ((collator.compare(flags, "-provider") == 0) ||
-                        (collator.compare(flags, "-providerClass") == 0)) {
-                if (++n == args.length) usageNoArg();
-                if (providers == null) {
-                    providers = new Vector<String>(3);
-                }
-                providers.add(args[n]);
-
-                if (args.length > (n+1)) {
-                    flags = args[n+1];
-                    if (collator.compare(flags, "-providerArg") == 0) {
-                        if (args.length == (n+2)) usageNoArg();
-                        providerArgs.put(args[n], args[n+2]);
-                        n += 2;
-                    }
-                }
-            } else if (collator.compare(flags, "-protected") ==0) {
-                protectedPath = true;
-            } else if (collator.compare(flags, "-certchain") ==0) {
-                if (++n == args.length) usageNoArg();
-                altCertChain = args[n];
-            } else if (collator.compare(flags, "-debug") ==0) {
-                debug = true;
-            } else if (collator.compare(flags, "-keypass") ==0) {
-                if (++n == args.length) usageNoArg();
-                keypass = getPass(modifier, args[n]);
-            } else if (collator.compare(flags, "-sigfile") ==0) {
-                if (++n == args.length) usageNoArg();
-                sigfile = args[n];
-            } else if (collator.compare(flags, "-signedjar") ==0) {
-                if (++n == args.length) usageNoArg();
-                signedjar = args[n];
-            } else if (collator.compare(flags, "-tsa") ==0) {
-                if (++n == args.length) usageNoArg();
-                tsaUrl = args[n];
-            } else if (collator.compare(flags, "-tsacert") ==0) {
-                if (++n == args.length) usageNoArg();
-                tsaAlias = args[n];
-            } else if (collator.compare(flags, "-altsigner") ==0) {
-                if (++n == args.length) usageNoArg();
-                altSignerClass = args[n];
-            } else if (collator.compare(flags, "-altsignerpath") ==0) {
-                if (++n == args.length) usageNoArg();
-                altSignerClasspath = args[n];
-            } else if (collator.compare(flags, "-sectionsonly") ==0) {
-                signManifest = false;
-            } else if (collator.compare(flags, "-internalsf") ==0) {
-                externalSF = false;
-            } else if (collator.compare(flags, "-verify") ==0) {
-                verify = true;
-            } else if (collator.compare(flags, "-verbose") ==0) {
-                verbose = (modifier != null) ? modifier : "all";
-            } else if (collator.compare(flags, "-sigalg") ==0) {
-                if (++n == args.length) usageNoArg();
-                sigalg = args[n];
-            } else if (collator.compare(flags, "-digestalg") ==0) {
-                if (++n == args.length) usageNoArg();
-                digestalg = args[n];
-            } else if (collator.compare(flags, "-certs") ==0) {
-                showcerts = true;
-            } else if (collator.compare(flags, "-strict") ==0) {
-                strict = true;
-            } else if (collator.compare(flags, "-h") == 0 ||
-                        collator.compare(flags, "-help") == 0) {
-                fullusage();
-            } else {
-                if (!flags.startsWith("-")) {
-                    if (jarfile == null) {
-                        jarfile = flags;
-                    } else {
-                        alias = flags;
-                        ckaliases.add(alias);
-                    }
-                } else {
-                    System.err.println(
-                            rb.getString("Illegal.option.") + flags);
-                    usage();
-                }
-            }
-        }
-
-        // -certs must always be specified with -verbose
-        if (verbose == null) showcerts = false;
-
-        if (jarfile == null) {
-            System.err.println(rb.getString("Please.specify.jarfile.name"));
-            usage();
-        }
-        if (!verify && alias == null) {
-            System.err.println(rb.getString("Please.specify.alias.name"));
-            usage();
-        }
-        if (!verify && ckaliases.size() > 1) {
-            System.err.println(rb.getString("Only.one.alias.can.be.specified"));
-            usage();
-        }
-
-        if (storetype == null) {
-            storetype = KeyStore.getDefaultType();
-        }
-        storetype = KeyStoreUtil.niceStoreTypeName(storetype);
-
-        try {
-            if (signedjar != null && new File(signedjar).getCanonicalPath().equals(
-                    new File(jarfile).getCanonicalPath())) {
-                signedjar = null;
-            }
-        } catch (IOException ioe) {
-            // File system error?
-            // Just ignore it.
-        }
-
-        if (P11KEYSTORE.equalsIgnoreCase(storetype) ||
-                KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            token = true;
-            if (keystore == null) {
-                keystore = NONE;
-            }
-        }
-
-        if (NONE.equals(keystore)) {
-            nullStream = true;
-        }
-
-        if (token && !nullStream) {
-            System.err.println(MessageFormat.format(rb.getString
-                (".keystore.must.be.NONE.if.storetype.is.{0}"), storetype));
-            usage();
-        }
-
-        if (token && keypass != null) {
-            System.err.println(MessageFormat.format(rb.getString
-                (".keypass.can.not.be.specified.if.storetype.is.{0}"), storetype));
-            usage();
-        }
-
-        if (protectedPath) {
-            if (storepass != null || keypass != null) {
-                System.err.println(rb.getString
-                        ("If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified"));
-                usage();
-            }
-        }
-        if (KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            if (storepass != null || keypass != null) {
-                System.err.println(rb.getString
-                        ("If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified"));
-                usage();
-            }
-        }
-    }
-
-    static char[] getPass(String modifier, String arg) {
-        char[] output = KeyTool.getPassWithModifier(modifier, arg);
-        if (output != null) return output;
-        usage();
-        return null;    // Useless, usage() already exit
-    }
-
-    static void usageNoArg() {
-        System.out.println(rb.getString("Option.lacks.argument"));
-        usage();
-    }
-
-    static void usage() {
-        System.out.println();
-        System.out.println(rb.getString("Please.type.jarsigner.help.for.usage"));
-        System.exit(1);
-    }
-
-    static void fullusage() {
-        System.out.println(rb.getString
-                ("Usage.jarsigner.options.jar.file.alias"));
-        System.out.println(rb.getString
-                (".jarsigner.verify.options.jar.file.alias."));
-        System.out.println();
-        System.out.println(rb.getString
-                (".keystore.url.keystore.location"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".storepass.password.password.for.keystore.integrity"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".storetype.type.keystore.type"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".keypass.password.password.for.private.key.if.different."));
-        System.out.println();
-        System.out.println(rb.getString
-                (".certchain.file.name.of.alternative.certchain.file"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".sigfile.file.name.of.SF.DSA.file"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".signedjar.file.name.of.signed.JAR.file"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".digestalg.algorithm.name.of.digest.algorithm"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".sigalg.algorithm.name.of.signature.algorithm"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".verify.verify.a.signed.JAR.file"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".verbose.suboptions.verbose.output.when.signing.verifying."));
-        System.out.println(rb.getString
-                (".suboptions.can.be.all.grouped.or.summary"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".certs.display.certificates.when.verbose.and.verifying"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".tsa.url.location.of.the.Timestamping.Authority"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".tsacert.alias.public.key.certificate.for.Timestamping.Authority"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".altsigner.class.class.name.of.an.alternative.signing.mechanism"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".internalsf.include.the.SF.file.inside.the.signature.block"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".sectionsonly.don.t.compute.hash.of.entire.manifest"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".protected.keystore.has.protected.authentication.path"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".providerName.name.provider.name"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".providerClass.class.name.of.cryptographic.service.provider.s"));
-        System.out.println(rb.getString
-                (".providerArg.arg.master.class.file.and.constructor.argument"));
-        System.out.println();
-        System.out.println(rb.getString
-                (".strict.treat.warnings.as.errors"));
-        System.out.println();
-
-        System.exit(0);
-    }
-
-    void verifyJar(String jarName)
-        throws Exception
-    {
-        boolean anySigned = false;  // if there exists entry inside jar signed
-        JarFile jf = null;
-
-        try {
-            jf = new JarFile(jarName, true);
-            Vector<JarEntry> entriesVec = new Vector<>();
-            byte[] buffer = new byte[8192];
-
-            Enumeration<JarEntry> entries = jf.entries();
-            while (entries.hasMoreElements()) {
-                JarEntry je = entries.nextElement();
-                entriesVec.addElement(je);
-                InputStream is = null;
-                try {
-                    is = jf.getInputStream(je);
-                    int n;
-                    while ((n = is.read(buffer, 0, buffer.length)) != -1) {
-                        // we just read. this will throw a SecurityException
-                        // if  a signature/digest check fails.
-                    }
-                } finally {
-                    if (is != null) {
-                        is.close();
-                    }
-                }
-            }
-
-            Manifest man = jf.getManifest();
-
-            // The map to record display info, only used when -verbose provided
-            //      key: signer info string
-            //      value: the list of files with common key
-            Map<String,List<String>> output = new LinkedHashMap<>();
-
-            if (man != null) {
-                if (verbose != null) System.out.println();
-                Enumeration<JarEntry> e = entriesVec.elements();
-
-                String tab = rb.getString("6SPACE");
-
-                while (e.hasMoreElements()) {
-                    JarEntry je = e.nextElement();
-                    String name = je.getName();
-                    CodeSigner[] signers = je.getCodeSigners();
-                    boolean isSigned = (signers != null);
-                    anySigned |= isSigned;
-                    hasUnsignedEntry |= !je.isDirectory() && !isSigned
-                                        && !signatureRelated(name);
-
-                    int inStoreOrScope = inKeyStore(signers);
-
-                    boolean inStore = (inStoreOrScope & IN_KEYSTORE) != 0;
-                    boolean inScope = (inStoreOrScope & IN_SCOPE) != 0;
-
-                    notSignedByAlias |= (inStoreOrScope & NOT_ALIAS) != 0;
-                    if (keystore != null) {
-                        aliasNotInStore |= isSigned && (!inStore && !inScope);
-                    }
-
-                    // Only used when -verbose provided
-                    StringBuffer sb = null;
-                    if (verbose != null) {
-                        sb = new StringBuffer();
-                        boolean inManifest =
-                            ((man.getAttributes(name) != null) ||
-                             (man.getAttributes("./"+name) != null) ||
-                             (man.getAttributes("/"+name) != null));
-                        sb.append(
-                          (isSigned ? rb.getString("s") : rb.getString("SPACE")) +
-                          (inManifest ? rb.getString("m") : rb.getString("SPACE")) +
-                          (inStore ? rb.getString("k") : rb.getString("SPACE")) +
-                          (inScope ? rb.getString("i") : rb.getString("SPACE")) +
-                          ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") +
-                          rb.getString("SPACE"));
-                        sb.append("|");
-                    }
-
-                    // When -certs provided, display info has extra empty
-                    // lines at the beginning and end.
-                    if (isSigned) {
-                        if (showcerts) sb.append('\n');
-                        for (CodeSigner signer: signers) {
-                            // signerInfo() must be called even if -verbose
-                            // not provided. The method updates various
-                            // warning flags.
-                            String si = signerInfo(signer, tab);
-                            if (showcerts) {
-                                sb.append(si);
-                                sb.append('\n');
-                            }
-                        }
-                    } else if (showcerts && !verbose.equals("all")) {
-                        // Print no info for unsigned entries when -verbose:all,
-                        // to be consistent with old behavior.
-                        if (signatureRelated(name)) {
-                            sb.append("\n" + tab + rb.getString(
-                                    ".Signature.related.entries.") + "\n\n");
-                        } else {
-                            sb.append("\n" + tab + rb.getString(
-                                    ".Unsigned.entries.") + "\n\n");
-                        }
-                    }
-
-                    if (verbose != null) {
-                        String label = sb.toString();
-                        if (signatureRelated(name)) {
-                            // Entries inside META-INF and other unsigned
-                            // entries are grouped separately.
-                            label = "-" + label;
-                        }
-
-                        // The label finally contains 2 parts separated by '|':
-                        // The legend displayed before the entry names, and
-                        // the cert info (if -certs specfied).
-
-                        if (!output.containsKey(label)) {
-                            output.put(label, new ArrayList<String>());
-                        }
-
-                        StringBuffer fb = new StringBuffer();
-                        String s = Long.toString(je.getSize());
-                        for (int i = 6 - s.length(); i > 0; --i) {
-                            fb.append(' ');
-                        }
-                        fb.append(s).append(' ').
-                                append(new Date(je.getTime()).toString());
-                        fb.append(' ').append(name);
-
-                        output.get(label).add(fb.toString());
-                    }
-                }
-            }
-            if (verbose != null) {
-                for (Entry<String,List<String>> s: output.entrySet()) {
-                    List<String> files = s.getValue();
-                    String key = s.getKey();
-                    if (key.charAt(0) == '-') { // the signature-related group
-                        key = key.substring(1);
-                    }
-                    int pipe = key.indexOf('|');
-                    if (verbose.equals("all")) {
-                        for (String f: files) {
-                            System.out.println(key.substring(0, pipe) + f);
-                            System.out.printf(key.substring(pipe+1));
-                        }
-                    } else {
-                        if (verbose.equals("grouped")) {
-                            for (String f: files) {
-                                System.out.println(key.substring(0, pipe) + f);
-                            }
-                        } else if (verbose.equals("summary")) {
-                            System.out.print(key.substring(0, pipe));
-                            if (files.size() > 1) {
-                                System.out.println(files.get(0) + " " +
-                                        String.format(rb.getString(
-                                        ".and.d.more."), files.size()-1));
-                            } else {
-                                System.out.println(files.get(0));
-                            }
-                        }
-                        System.out.printf(key.substring(pipe+1));
-                    }
-                }
-                System.out.println();
-                System.out.println(rb.getString(
-                    ".s.signature.was.verified."));
-                System.out.println(rb.getString(
-                    ".m.entry.is.listed.in.manifest"));
-                System.out.println(rb.getString(
-                    ".k.at.least.one.certificate.was.found.in.keystore"));
-                System.out.println(rb.getString(
-                    ".i.at.least.one.certificate.was.found.in.identity.scope"));
-                if (ckaliases.size() > 0) {
-                    System.out.println(rb.getString(
-                        ".X.not.signed.by.specified.alias.es."));
-                }
-                System.out.println();
-            }
-            if (man == null)
-                System.out.println(rb.getString("no.manifest."));
-
-            if (!anySigned) {
-                System.out.println(rb.getString(
-                      "jar.is.unsigned.signatures.missing.or.not.parsable."));
-            } else {
-                System.out.println(rb.getString("jar.verified."));
-                if (hasUnsignedEntry || hasExpiredCert || hasExpiringCert ||
-                    badKeyUsage || badExtendedKeyUsage || badNetscapeCertType ||
-                    notYetValidCert || chainNotValidated ||
-                    aliasNotInStore || notSignedByAlias) {
-
-                    System.out.println();
-                    System.out.println(rb.getString("Warning."));
-                    if (badKeyUsage) {
-                        System.out.println(
-                            rb.getString("This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing."));
-                    }
-
-                    if (badExtendedKeyUsage) {
-                        System.out.println(
-                            rb.getString("This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing."));
-                    }
-
-                    if (badNetscapeCertType) {
-                        System.out.println(
-                            rb.getString("This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing."));
-                    }
-
-                    if (hasUnsignedEntry) {
-                        System.out.println(rb.getString(
-                            "This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked."));
-                    }
-                    if (hasExpiredCert) {
-                        System.out.println(rb.getString(
-                            "This.jar.contains.entries.whose.signer.certificate.has.expired."));
-                    }
-                    if (hasExpiringCert) {
-                        System.out.println(rb.getString(
-                            "This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months."));
-                    }
-                    if (notYetValidCert) {
-                        System.out.println(rb.getString(
-                            "This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid."));
-                    }
-
-                    if (chainNotValidated) {
-                        System.out.println(
-                                rb.getString("This.jar.contains.entries.whose.certificate.chain.is.not.validated."));
-                    }
-
-                    if (notSignedByAlias) {
-                        System.out.println(
-                                rb.getString("This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es."));
-                    }
-
-                    if (aliasNotInStore) {
-                        System.out.println(rb.getString("This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore."));
-                    }
-                    if (! (verbose != null && showcerts)) {
-                        System.out.println();
-                        System.out.println(rb.getString(
-                            "Re.run.with.the.verbose.and.certs.options.for.more.details."));
-                    }
-                }
-            }
-            return;
-        } catch (Exception e) {
-            System.out.println(rb.getString("jarsigner.") + e);
-            if (debug) {
-                e.printStackTrace();
-            }
-        } finally { // close the resource
-            if (jf != null) {
-                jf.close();
-            }
-        }
-
-        System.exit(1);
-    }
-
-    private static MessageFormat validityTimeForm = null;
-    private static MessageFormat notYetTimeForm = null;
-    private static MessageFormat expiredTimeForm = null;
-    private static MessageFormat expiringTimeForm = null;
-
-    /*
-     * Display some details about a certificate:
-     *
-     * [<tab>] <cert-type> [", " <subject-DN>] [" (" <keystore-entry-alias> ")"]
-     * [<validity-period> | <expiry-warning>]
-     *
-     * Note: no newline character at the end
-     */
-    String printCert(String tab, Certificate c, boolean checkValidityPeriod,
-        Date timestamp, boolean checkUsage) {
-
-        StringBuilder certStr = new StringBuilder();
-        String space = rb.getString("SPACE");
-        X509Certificate x509Cert = null;
-
-        if (c instanceof X509Certificate) {
-            x509Cert = (X509Certificate) c;
-            certStr.append(tab).append(x509Cert.getType())
-                .append(rb.getString("COMMA"))
-                .append(x509Cert.getSubjectDN().getName());
-        } else {
-            certStr.append(tab).append(c.getType());
-        }
-
-        String alias = storeHash.get(c);
-        if (alias != null) {
-            certStr.append(space).append(alias);
-        }
-
-        if (checkValidityPeriod && x509Cert != null) {
-
-            certStr.append("\n").append(tab).append("[");
-            Date notAfter = x509Cert.getNotAfter();
-            try {
-                boolean printValidity = true;
-                if (timestamp == null) {
-                    x509Cert.checkValidity();
-                    // test if cert will expire within six months
-                    if (notAfter.getTime() < System.currentTimeMillis() + SIX_MONTHS) {
-                        hasExpiringCert = true;
-                        if (expiringTimeForm == null) {
-                            expiringTimeForm = new MessageFormat(
-                                rb.getString("certificate.will.expire.on"));
-                        }
-                        Object[] source = { notAfter };
-                        certStr.append(expiringTimeForm.format(source));
-                        printValidity = false;
-                    }
-                } else {
-                    x509Cert.checkValidity(timestamp);
-                }
-                if (printValidity) {
-                    if (validityTimeForm == null) {
-                        validityTimeForm = new MessageFormat(
-                            rb.getString("certificate.is.valid.from"));
-                    }
-                    Object[] source = { x509Cert.getNotBefore(), notAfter };
-                    certStr.append(validityTimeForm.format(source));
-                }
-            } catch (CertificateExpiredException cee) {
-                hasExpiredCert = true;
-
-                if (expiredTimeForm == null) {
-                    expiredTimeForm = new MessageFormat(
-                        rb.getString("certificate.expired.on"));
-                }
-                Object[] source = { notAfter };
-                certStr.append(expiredTimeForm.format(source));
-
-            } catch (CertificateNotYetValidException cnyve) {
-                notYetValidCert = true;
-
-                if (notYetTimeForm == null) {
-                    notYetTimeForm = new MessageFormat(
-                        rb.getString("certificate.is.not.valid.until"));
-                }
-                Object[] source = { x509Cert.getNotBefore() };
-                certStr.append(notYetTimeForm.format(source));
-            }
-            certStr.append("]");
-
-            if (checkUsage) {
-                boolean[] bad = new boolean[3];
-                checkCertUsage(x509Cert, bad);
-                if (bad[0] || bad[1] || bad[2]) {
-                    String x = "";
-                    if (bad[0]) {
-                        x ="KeyUsage";
-                    }
-                    if (bad[1]) {
-                        if (x.length() > 0) x = x + ", ";
-                        x = x + "ExtendedKeyUsage";
-                    }
-                    if (bad[2]) {
-                        if (x.length() > 0) x = x + ", ";
-                        x = x + "NetscapeCertType";
-                    }
-                    certStr.append("\n").append(tab)
-                        .append(MessageFormat.format(rb.getString(
-                        ".{0}.extension.does.not.support.code.signing."), x));
-                }
-            }
-        }
-        return certStr.toString();
-    }
-
-    private static MessageFormat signTimeForm = null;
-
-    private String printTimestamp(String tab, Timestamp timestamp) {
-
-        if (signTimeForm == null) {
-            signTimeForm =
-                new MessageFormat(rb.getString("entry.was.signed.on"));
-        }
-        Object[] source = { timestamp.getTimestamp() };
-
-        return new StringBuilder().append(tab).append("[")
-            .append(signTimeForm.format(source)).append("]").toString();
-    }
-
-    private Map<CodeSigner,Integer> cacheForInKS = new IdentityHashMap<>();
-
-    private int inKeyStoreForOneSigner(CodeSigner signer) {
-        if (cacheForInKS.containsKey(signer)) {
-            return cacheForInKS.get(signer);
-        }
-
-        boolean found = false;
-        int result = 0;
-        List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();
-        for (Certificate c : certs) {
-            String alias = storeHash.get(c);
-            if (alias != null) {
-                if (alias.startsWith("(")) {
-                    result |= IN_KEYSTORE;
-                } else if (alias.startsWith("[")) {
-                    result |= IN_SCOPE;
-                }
-                if (ckaliases.contains(alias.substring(1, alias.length() - 1))) {
-                    result |= SIGNED_BY_ALIAS;
-                }
-            } else {
-                if (store != null) {
-                    try {
-                        alias = store.getCertificateAlias(c);
-                    } catch (KeyStoreException kse) {
-                        // never happens, because keystore has been loaded
-                    }
-                    if (alias != null) {
-                        storeHash.put(c, "(" + alias + ")");
-                        found = true;
-                        result |= IN_KEYSTORE;
-                    }
-                }
-                if (ckaliases.contains(alias)) {
-                    result |= SIGNED_BY_ALIAS;
-                }
-            }
-        }
-        cacheForInKS.put(signer, result);
-        return result;
-    }
-
-    Hashtable<Certificate, String> storeHash = new Hashtable<>();
-
-    int inKeyStore(CodeSigner[] signers) {
-
-        if (signers == null)
-            return 0;
-
-        int output = 0;
-
-        for (CodeSigner signer: signers) {
-            int result = inKeyStoreForOneSigner(signer);
-            output |= result;
-        }
-        if (ckaliases.size() > 0 && (output & SIGNED_BY_ALIAS) == 0) {
-            output |= NOT_ALIAS;
-        }
-        return output;
-    }
-
-    void signJar(String jarName, String alias, String[] args)
-        throws Exception {
-        boolean aliasUsed = false;
-        X509Certificate tsaCert = null;
-
-        if (sigfile == null) {
-            sigfile = alias;
-            aliasUsed = true;
-        }
-
-        if (sigfile.length() > 8) {
-            sigfile = sigfile.substring(0, 8).toUpperCase(Locale.ENGLISH);
-        } else {
-            sigfile = sigfile.toUpperCase(Locale.ENGLISH);
-        }
-
-        StringBuilder tmpSigFile = new StringBuilder(sigfile.length());
-        for (int j = 0; j < sigfile.length(); j++) {
-            char c = sigfile.charAt(j);
-            if (!
-                ((c>= 'A' && c<= 'Z') ||
-                (c>= '0' && c<= '9') ||
-                (c == '-') ||
-                (c == '_'))) {
-                if (aliasUsed) {
-                    // convert illegal characters from the alias to be _'s
-                    c = '_';
-                } else {
-                 throw new
-                   RuntimeException(rb.getString
-                        ("signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or."));
-                }
-            }
-            tmpSigFile.append(c);
-        }
-
-        sigfile = tmpSigFile.toString();
-
-        String tmpJarName;
-        if (signedjar == null) tmpJarName = jarName+".sig";
-        else tmpJarName = signedjar;
-
-        File jarFile = new File(jarName);
-        File signedJarFile = new File(tmpJarName);
-
-        // Open the jar (zip) file
-        try {
-            zipFile = new ZipFile(jarName);
-        } catch (IOException ioe) {
-            error(rb.getString("unable.to.open.jar.file.")+jarName, ioe);
-        }
-
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(signedJarFile);
-        } catch (IOException ioe) {
-            error(rb.getString("unable.to.create.")+tmpJarName, ioe);
-        }
-
-        PrintStream ps = new PrintStream(fos);
-        ZipOutputStream zos = new ZipOutputStream(ps);
-
-        /* First guess at what they might be - we don't xclude RSA ones. */
-        String sfFilename = (META_INF + sigfile + ".SF").toUpperCase(Locale.ENGLISH);
-        String bkFilename = (META_INF + sigfile + ".DSA").toUpperCase(Locale.ENGLISH);
-
-        Manifest manifest = new Manifest();
-        Map<String,Attributes> mfEntries = manifest.getEntries();
-
-        // The Attributes of manifest before updating
-        Attributes oldAttr = null;
-
-        boolean mfModified = false;
-        boolean mfCreated = false;
-        byte[] mfRawBytes = null;
-
-        try {
-            MessageDigest digests[] = { MessageDigest.getInstance(digestalg) };
-
-            // Check if manifest exists
-            ZipEntry mfFile;
-            if ((mfFile = getManifestFile(zipFile)) != null) {
-                // Manifest exists. Read its raw bytes.
-                mfRawBytes = getBytes(zipFile, mfFile);
-                manifest.read(new ByteArrayInputStream(mfRawBytes));
-                oldAttr = (Attributes)(manifest.getMainAttributes().clone());
-            } else {
-                // Create new manifest
-                Attributes mattr = manifest.getMainAttributes();
-                mattr.putValue(Attributes.Name.MANIFEST_VERSION.toString(),
-                               "1.0");
-                String javaVendor = System.getProperty("java.vendor");
-                String jdkVersion = System.getProperty("java.version");
-                mattr.putValue("Created-By", jdkVersion + " (" +javaVendor
-                               + ")");
-                mfFile = new ZipEntry(JarFile.MANIFEST_NAME);
-                mfCreated = true;
-            }
-
-            /*
-             * For each entry in jar
-             * (except for signature-related META-INF entries),
-             * do the following:
-             *
-             * - if entry is not contained in manifest, add it to manifest;
-             * - if entry is contained in manifest, calculate its hash and
-             *   compare it with the one in the manifest; if they are
-             *   different, replace the hash in the manifest with the newly
-             *   generated one. (This may invalidate existing signatures!)
-             */
-            BASE64Encoder encoder = new JarBASE64Encoder();
-            Vector<ZipEntry> mfFiles = new Vector<>();
-
-            boolean wasSigned = false;
-
-            for (Enumeration<? extends ZipEntry> enum_=zipFile.entries();
-                        enum_.hasMoreElements();) {
-                ZipEntry ze = enum_.nextElement();
-
-                if (ze.getName().startsWith(META_INF)) {
-                    // Store META-INF files in vector, so they can be written
-                    // out first
-                    mfFiles.addElement(ze);
-
-                    if (SignatureFileVerifier.isBlockOrSF(
-                            ze.getName().toUpperCase(Locale.ENGLISH))) {
-                        wasSigned = true;
-                    }
-
-                    if (signatureRelated(ze.getName())) {
-                        // ignore signature-related and manifest files
-                        continue;
-                    }
-                }
-
-                if (manifest.getAttributes(ze.getName()) != null) {
-                    // jar entry is contained in manifest, check and
-                    // possibly update its digest attributes
-                    if (updateDigests(ze, zipFile, digests, encoder,
-                                      manifest) == true) {
-                        mfModified = true;
-                    }
-                } else if (!ze.isDirectory()) {
-                    // Add entry to manifest
-                    Attributes attrs = getDigestAttributes(ze, zipFile,
-                                                           digests,
-                                                           encoder);
-                    mfEntries.put(ze.getName(), attrs);
-                    mfModified = true;
-                }
-            }
-
-            // Recalculate the manifest raw bytes if necessary
-            if (mfModified) {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                manifest.write(baos);
-                if (wasSigned) {
-                    byte[] newBytes = baos.toByteArray();
-                    if (mfRawBytes != null
-                            && oldAttr.equals(manifest.getMainAttributes())) {
-
-                        /*
-                         * Note:
-                         *
-                         * The Attributes object is based on HashMap and can handle
-                         * continuation columns. Therefore, even if the contents are
-                         * not changed (in a Map view), the bytes that it write()
-                         * may be different from the original bytes that it read()
-                         * from. Since the signature on the main attributes is based
-                         * on raw bytes, we must retain the exact bytes.
-                         */
-
-                        int newPos = findHeaderEnd(newBytes);
-                        int oldPos = findHeaderEnd(mfRawBytes);
-
-                        if (newPos == oldPos) {
-                            System.arraycopy(mfRawBytes, 0, newBytes, 0, oldPos);
-                        } else {
-                            // cat oldHead newTail > newBytes
-                            byte[] lastBytes = new byte[oldPos +
-                                    newBytes.length - newPos];
-                            System.arraycopy(mfRawBytes, 0, lastBytes, 0, oldPos);
-                            System.arraycopy(newBytes, newPos, lastBytes, oldPos,
-                                    newBytes.length - newPos);
-                            newBytes = lastBytes;
-                        }
-                    }
-                    mfRawBytes = newBytes;
-                } else {
-                    mfRawBytes = baos.toByteArray();
-                }
-            }
-
-            // Write out the manifest
-            if (mfModified) {
-                // manifest file has new length
-                mfFile = new ZipEntry(JarFile.MANIFEST_NAME);
-            }
-            if (verbose != null) {
-                if (mfCreated) {
-                    System.out.println(rb.getString(".adding.") +
-                                        mfFile.getName());
-                } else if (mfModified) {
-                    System.out.println(rb.getString(".updating.") +
-                                        mfFile.getName());
-                }
-            }
-            zos.putNextEntry(mfFile);
-            zos.write(mfRawBytes);
-
-            // Calculate SignatureFile (".SF") and SignatureBlockFile
-            ManifestDigester manDig = new ManifestDigester(mfRawBytes);
-            SignatureFile sf = new SignatureFile(digests, manifest, manDig,
-                                                 sigfile, signManifest);
-
-            if (tsaAlias != null) {
-                tsaCert = getTsaCert(tsaAlias);
-            }
-
-            SignatureFile.Block block = null;
-
-            try {
-                block =
-                    sf.generateBlock(privateKey, sigalg, certChain,
-                        externalSF, tsaUrl, tsaCert, signingMechanism, args,
-                        zipFile);
-            } catch (SocketTimeoutException e) {
-                // Provide a helpful message when TSA is beyond a firewall
-                error(rb.getString("unable.to.sign.jar.") +
-                rb.getString("no.response.from.the.Timestamping.Authority.") +
-                "\n  -J-Dhttp.proxyHost=<hostname>" +
-                "\n  -J-Dhttp.proxyPort=<portnumber>\n" +
-                rb.getString("or") +
-                "\n  -J-Dhttps.proxyHost=<hostname> " +
-                "\n  -J-Dhttps.proxyPort=<portnumber> ", e);
-            }
-
-            sfFilename = sf.getMetaName();
-            bkFilename = block.getMetaName();
-
-            ZipEntry sfFile = new ZipEntry(sfFilename);
-            ZipEntry bkFile = new ZipEntry(bkFilename);
-
-            long time = System.currentTimeMillis();
-            sfFile.setTime(time);
-            bkFile.setTime(time);
-
-            // signature file
-            zos.putNextEntry(sfFile);
-            sf.write(zos);
-            if (verbose != null) {
-                if (zipFile.getEntry(sfFilename) != null) {
-                    System.out.println(rb.getString(".updating.") +
-                                sfFilename);
-                } else {
-                    System.out.println(rb.getString(".adding.") +
-                                sfFilename);
-                }
-            }
-
-            if (verbose != null) {
-                if (tsaUrl != null || tsaCert != null) {
-                    System.out.println(
-                        rb.getString("requesting.a.signature.timestamp"));
-                }
-                if (tsaUrl != null) {
-                    System.out.println(rb.getString("TSA.location.") + tsaUrl);
-                }
-                if (tsaCert != null) {
-                    URI tsaURI = TimestampedSigner.getTimestampingURI(tsaCert);
-                    if (tsaURI != null) {
-                        System.out.println(rb.getString("TSA.location.") +
-                            tsaURI);
-                    }
-                    System.out.println(rb.getString("TSA.certificate.") +
-                        printCert("", tsaCert, false, null, false));
-                }
-                if (signingMechanism != null) {
-                    System.out.println(
-                        rb.getString("using.an.alternative.signing.mechanism"));
-                }
-            }
-
-            // signature block file
-            zos.putNextEntry(bkFile);
-            block.write(zos);
-            if (verbose != null) {
-                if (zipFile.getEntry(bkFilename) != null) {
-                    System.out.println(rb.getString(".updating.") +
-                        bkFilename);
-                } else {
-                    System.out.println(rb.getString(".adding.") +
-                        bkFilename);
-                }
-            }
-
-            // Write out all other META-INF files that we stored in the
-            // vector
-            for (int i=0; i<mfFiles.size(); i++) {
-                ZipEntry ze = mfFiles.elementAt(i);
-                if (!ze.getName().equalsIgnoreCase(JarFile.MANIFEST_NAME)
-                    && !ze.getName().equalsIgnoreCase(sfFilename)
-                    && !ze.getName().equalsIgnoreCase(bkFilename)) {
-                    writeEntry(zipFile, zos, ze);
-                }
-            }
-
-            // Write out all other files
-            for (Enumeration<? extends ZipEntry> enum_=zipFile.entries();
-                        enum_.hasMoreElements();) {
-                ZipEntry ze = enum_.nextElement();
-
-                if (!ze.getName().startsWith(META_INF)) {
-                    if (verbose != null) {
-                        if (manifest.getAttributes(ze.getName()) != null)
-                          System.out.println(rb.getString(".signing.") +
-                                ze.getName());
-                        else
-                          System.out.println(rb.getString(".adding.") +
-                                ze.getName());
-                    }
-                    writeEntry(zipFile, zos, ze);
-                }
-            }
-        } catch(IOException ioe) {
-            error(rb.getString("unable.to.sign.jar.")+ioe, ioe);
-        } finally {
-            // close the resouces
-            if (zipFile != null) {
-                zipFile.close();
-                zipFile = null;
-            }
-
-            if (zos != null) {
-                zos.close();
-            }
-        }
-
-        // no IOException thrown in the follow try clause, so disable
-        // the try clause.
-        // try {
-            if (signedjar == null) {
-                // attempt an atomic rename. If that fails,
-                // rename the original jar file, then the signed
-                // one, then delete the original.
-                if (!signedJarFile.renameTo(jarFile)) {
-                    File origJar = new File(jarName+".orig");
-
-                    if (jarFile.renameTo(origJar)) {
-                        if (signedJarFile.renameTo(jarFile)) {
-                            origJar.delete();
-                        } else {
-                            MessageFormat form = new MessageFormat(rb.getString
-                        ("attempt.to.rename.signedJarFile.to.jarFile.failed"));
-                            Object[] source = {signedJarFile, jarFile};
-                            error(form.format(source));
-                        }
-                    } else {
-                        MessageFormat form = new MessageFormat(rb.getString
-                            ("attempt.to.rename.jarFile.to.origJar.failed"));
-                        Object[] source = {jarFile, origJar};
-                        error(form.format(source));
-                    }
-                }
-            }
-
-            if (hasExpiredCert || hasExpiringCert || notYetValidCert
-                    || badKeyUsage || badExtendedKeyUsage
-                    || badNetscapeCertType || chainNotValidated) {
-                System.out.println();
-
-                System.out.println(rb.getString("Warning."));
-                if (badKeyUsage) {
-                    System.out.println(
-                        rb.getString("The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing."));
-                }
-
-                if (badExtendedKeyUsage) {
-                    System.out.println(
-                        rb.getString("The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing."));
-                }
-
-                if (badNetscapeCertType) {
-                    System.out.println(
-                        rb.getString("The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing."));
-                }
-
-                if (hasExpiredCert) {
-                    System.out.println(
-                        rb.getString("The.signer.certificate.has.expired."));
-                } else if (hasExpiringCert) {
-                    System.out.println(
-                        rb.getString("The.signer.certificate.will.expire.within.six.months."));
-                } else if (notYetValidCert) {
-                    System.out.println(
-                        rb.getString("The.signer.certificate.is.not.yet.valid."));
-                }
-
-                if (chainNotValidated) {
-                    System.out.println(
-                            rb.getString("The.signer.s.certificate.chain.is.not.validated."));
-                }
-            }
-
-        // no IOException thrown in the above try clause, so disable
-        // the catch clause.
-        // } catch(IOException ioe) {
-        //     error(rb.getString("unable.to.sign.jar.")+ioe, ioe);
-        // }
-    }
-
-    /**
-     * Find the length of header inside bs. The header is a multiple (>=0)
-     * 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
-        int len = bs.length;
-        for (int i=0; i<len; i++) {
-            switch (bs[i]) {
-                case '\r':
-                    if (i < len - 1 && bs[i+1] == '\n') i++;
-                    // fallthrough
-                case '\n':
-                    if (newline) return i+1;    //+1 to get length
-                    newline = true;
-                    break;
-                default:
-                    newline = false;
-            }
-        }
-        // If header end is not found, it means the MANIFEST.MF has only
-        // the main attributes section and it does not end with 2 newlines.
-        // Returns the whole length so that it can be completely replaced.
-        return len;
-    }
-
-    /**
-     * signature-related files include:
-     * . META-INF/MANIFEST.MF
-     * . META-INF/SIG-*
-     * . META-INF/*.SF
-     * . META-INF/*.DSA
-     * . META-INF/*.RSA
-     * . META-INF/*.EC
-     */
-    private boolean signatureRelated(String name) {
-        String ucName = name.toUpperCase(Locale.ENGLISH);
-        if (ucName.equals(JarFile.MANIFEST_NAME) ||
-            ucName.equals(META_INF) ||
-            (ucName.startsWith(SIG_PREFIX) &&
-                ucName.indexOf("/") == ucName.lastIndexOf("/"))) {
-            return true;
-        }
-
-        if (ucName.startsWith(META_INF) &&
-            SignatureFileVerifier.isBlockOrSF(ucName)) {
-            // .SF/.DSA/.RSA/.EC files in META-INF subdirs
-            // are not considered signature-related
-            return (ucName.indexOf("/") == ucName.lastIndexOf("/"));
-        }
-
-        return false;
-    }
-
-    Map<CodeSigner,String> cacheForSignerInfo = new IdentityHashMap<>();
-
-    /**
-     * Returns a string of singer info, with a newline at the end
-     */
-    private String signerInfo(CodeSigner signer, String tab) {
-        if (cacheForSignerInfo.containsKey(signer)) {
-            return cacheForSignerInfo.get(signer);
-        }
-        StringBuffer s = new StringBuffer();
-        List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();
-        // display the signature timestamp, if present
-        Date timestamp;
-        Timestamp ts = signer.getTimestamp();
-        if (ts != null) {
-            s.append(printTimestamp(tab, ts));
-            s.append('\n');
-            timestamp = ts.getTimestamp();
-        } else {
-            timestamp = null;
-        }
-        // display the certificate(s). The first one is end-entity cert and
-        // its KeyUsage should be checked.
-        boolean first = true;
-        for (Certificate c : certs) {
-            s.append(printCert(tab, c, true, timestamp, first));
-            s.append('\n');
-            first = false;
-        }
-        try {
-            CertPath cp = certificateFactory.generateCertPath(certs);
-            validator.validate(cp, pkixParameters);
-        } catch (Exception e) {
-            if (debug) {
-                e.printStackTrace();
-            }
-            if (e.getCause() != null &&
-                    (e.getCause() instanceof CertificateExpiredException ||
-                     e.getCause() instanceof CertificateNotYetValidException)) {
-                // No more warning, we alreay have hasExpiredCert or notYetValidCert
-            } else {
-                chainNotValidated = true;
-                s.append(tab + rb.getString(".CertPath.not.validated.") +
-                        e.getLocalizedMessage() + "]\n");   // TODO
-            }
-        }
-        String result = s.toString();
-        cacheForSignerInfo.put(signer, result);
-        return result;
-    }
-
-    private void writeEntry(ZipFile zf, ZipOutputStream os, ZipEntry ze)
-    throws IOException
-    {
-        ZipEntry ze2 = new ZipEntry(ze.getName());
-        ze2.setMethod(ze.getMethod());
-        ze2.setTime(ze.getTime());
-        ze2.setComment(ze.getComment());
-        ze2.setExtra(ze.getExtra());
-        if (ze.getMethod() == ZipEntry.STORED) {
-            ze2.setSize(ze.getSize());
-            ze2.setCrc(ze.getCrc());
-        }
-        os.putNextEntry(ze2);
-        writeBytes(zf, ze, os);
-    }
-
-    /**
-     * Writes all the bytes for a given entry to the specified output stream.
-     */
-    private synchronized void writeBytes
-        (ZipFile zf, ZipEntry ze, ZipOutputStream os) throws IOException {
-        int n;
-
-        InputStream is = null;
-        try {
-            is = zf.getInputStream(ze);
-            long left = ze.getSize();
-
-            while((left > 0) && (n = is.read(buffer, 0, buffer.length)) != -1) {
-                os.write(buffer, 0, n);
-                left -= n;
-            }
-        } finally {
-            if (is != null) {
-                is.close();
-            }
-        }
-    }
-
-    void loadKeyStore(String keyStoreName, boolean prompt) {
-
-        if (!nullStream && keyStoreName == null) {
-            keyStoreName = System.getProperty("user.home") + File.separator
-                + ".keystore";
-        }
-
-        try {
-
-            certificateFactory = CertificateFactory.getInstance("X.509");
-            validator = CertPathValidator.getInstance("PKIX");
-            Set<TrustAnchor> tas = new HashSet<>();
-            try {
-                KeyStore caks = KeyTool.getCacertsKeyStore();
-                if (caks != null) {
-                    Enumeration<String> aliases = caks.aliases();
-                    while (aliases.hasMoreElements()) {
-                        String a = aliases.nextElement();
-                        try {
-                            tas.add(new TrustAnchor((X509Certificate)caks.getCertificate(a), null));
-                        } catch (Exception e2) {
-                            // ignore, when a SecretkeyEntry does not include a cert
-                        }
-                    }
-                }
-            } catch (Exception e) {
-                // Ignore, if cacerts cannot be loaded
-            }
-
-            if (providerName == null) {
-                store = KeyStore.getInstance(storetype);
-            } else {
-                store = KeyStore.getInstance(storetype, providerName);
-            }
-
-            // Get pass phrase
-            // XXX need to disable echo; on UNIX, call getpass(char *prompt)Z
-            // and on NT call ??
-            if (token && storepass == null && !protectedPath
-                    && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
-                storepass = getPass
-                        (rb.getString("Enter.Passphrase.for.keystore."));
-            } else if (!token && storepass == null && prompt) {
-                storepass = getPass
-                        (rb.getString("Enter.Passphrase.for.keystore."));
-            }
-
-            try {
-                if (nullStream) {
-                    store.load(null, storepass);
-                } else {
-                    keyStoreName = keyStoreName.replace(File.separatorChar, '/');
-                    URL url = null;
-                    try {
-                        url = new URL(keyStoreName);
-                    } catch (java.net.MalformedURLException e) {
-                        // try as file
-                        url = new File(keyStoreName).toURI().toURL();
-                    }
-                    InputStream is = null;
-                    try {
-                        is = url.openStream();
-                        store.load(is, storepass);
-                    } finally {
-                        if (is != null) {
-                            is.close();
-                        }
-                    }
-                }
-                Enumeration<String> aliases = store.aliases();
-                while (aliases.hasMoreElements()) {
-                    String a = aliases.nextElement();
-                    try {
-                        X509Certificate c = (X509Certificate)store.getCertificate(a);
-                        // Only add TrustedCertificateEntry and self-signed
-                        // PrivateKeyEntry
-                        if (store.isCertificateEntry(a) ||
-                                c.getSubjectDN().equals(c.getIssuerDN())) {
-                            tas.add(new TrustAnchor(c, null));
-                        }
-                    } catch (Exception e2) {
-                        // ignore, when a SecretkeyEntry does not include a cert
-                    }
-                }
-            } finally {
-                try {
-                    pkixParameters = new PKIXParameters(tas);
-                    pkixParameters.setRevocationEnabled(false);
-                } catch (InvalidAlgorithmParameterException ex) {
-                    // Only if tas is empty
-                }
-            }
-        } catch (IOException ioe) {
-            throw new RuntimeException(rb.getString("keystore.load.") +
-                                        ioe.getMessage());
-        } catch (java.security.cert.CertificateException ce) {
-            throw new RuntimeException(rb.getString("certificate.exception.") +
-                                        ce.getMessage());
-        } catch (NoSuchProviderException pe) {
-            throw new RuntimeException(rb.getString("keystore.load.") +
-                                        pe.getMessage());
-        } catch (NoSuchAlgorithmException nsae) {
-            throw new RuntimeException(rb.getString("keystore.load.") +
-                                        nsae.getMessage());
-        } catch (KeyStoreException kse) {
-            throw new RuntimeException
-                (rb.getString("unable.to.instantiate.keystore.class.") +
-                kse.getMessage());
-        }
-    }
-
-    X509Certificate getTsaCert(String alias) {
-
-        java.security.cert.Certificate cs = null;
-
-        try {
-            cs = store.getCertificate(alias);
-        } catch (KeyStoreException kse) {
-            // this never happens, because keystore has been loaded
-        }
-        if (cs == null || (!(cs instanceof X509Certificate))) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the"));
-            Object[] source = {alias, alias};
-            error(form.format(source));
-        }
-        return (X509Certificate) cs;
-    }
-
-    /**
-     * Check if userCert is designed to be a code signer
-     * @param userCert the certificate to be examined
-     * @param bad 3 booleans to show if the KeyUsage, ExtendedKeyUsage,
-     *            NetscapeCertType has codeSigning flag turned on.
-     *            If null, the class field badKeyUsage, badExtendedKeyUsage,
-     *            badNetscapeCertType will be set.
-     */
-    void checkCertUsage(X509Certificate userCert, boolean[] bad) {
-
-        // Can act as a signer?
-        // 1. if KeyUsage, then [0:digitalSignature] or
-        //    [1:nonRepudiation] should be true
-        // 2. if ExtendedKeyUsage, then should contains ANY or CODE_SIGNING
-        // 3. if NetscapeCertType, then should contains OBJECT_SIGNING
-        // 1,2,3 must be true
-
-        if (bad != null) {
-            bad[0] = bad[1] = bad[2] = false;
-        }
-
-        boolean[] keyUsage = userCert.getKeyUsage();
-        if (keyUsage != null) {
-            keyUsage = Arrays.copyOf(keyUsage, 9);
-            if (!keyUsage[0] && !keyUsage[1]) {
-                if (bad != null) {
-                    bad[0] = true;
-                    badKeyUsage = true;
-                }
-            }
-        }
-
-        try {
-            List<String> xKeyUsage = userCert.getExtendedKeyUsage();
-            if (xKeyUsage != null) {
-                if (!xKeyUsage.contains("2.5.29.37.0") // anyExtendedKeyUsage
-                        && !xKeyUsage.contains("1.3.6.1.5.5.7.3.3")) {  // codeSigning
-                    if (bad != null) {
-                        bad[1] = true;
-                        badExtendedKeyUsage = true;
-                    }
-                }
-            }
-        } catch (java.security.cert.CertificateParsingException e) {
-            // shouldn't happen
-        }
-
-        try {
-            // OID_NETSCAPE_CERT_TYPE
-            byte[] netscapeEx = userCert.getExtensionValue
-                    ("2.16.840.1.113730.1.1");
-            if (netscapeEx != null) {
-                DerInputStream in = new DerInputStream(netscapeEx);
-                byte[] encoded = in.getOctetString();
-                encoded = new DerValue(encoded).getUnalignedBitString()
-                        .toByteArray();
-
-                NetscapeCertTypeExtension extn =
-                        new NetscapeCertTypeExtension(encoded);
-
-                Boolean val = extn.get(NetscapeCertTypeExtension.OBJECT_SIGNING);
-                if (!val) {
-                    if (bad != null) {
-                        bad[2] = true;
-                        badNetscapeCertType = true;
-                    }
-                }
-            }
-        } catch (IOException e) {
-            //
-        }
-    }
-
-    void getAliasInfo(String alias) {
-
-        Key key = null;
-
-        try {
-            java.security.cert.Certificate[] cs = null;
-            if (altCertChain != null) {
-                try {
-                    cs = CertificateFactory.getInstance("X.509").
-                            generateCertificates(new FileInputStream(altCertChain)).
-                            toArray(new Certificate[0]);
-                } catch (CertificateException ex) {
-                    error(rb.getString("Cannot.restore.certchain.from.file.specified"));
-                } catch (FileNotFoundException ex) {
-                    error(rb.getString("File.specified.by.certchain.does.not.exist"));
-                }
-            } else {
-                try {
-                    cs = store.getCertificateChain(alias);
-                } catch (KeyStoreException kse) {
-                    // this never happens, because keystore has been loaded
-                }
-            }
-            if (cs == null || cs.length == 0) {
-                if (altCertChain != null) {
-                    error(rb.getString
-                            ("Certificate.chain.not.found.in.the.file.specified."));
-                } else {
-                    MessageFormat form = new MessageFormat(rb.getString
-                        ("Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and"));
-                    Object[] source = {alias, alias};
-                    error(form.format(source));
-                }
-            }
-
-            certChain = new X509Certificate[cs.length];
-            for (int i=0; i<cs.length; i++) {
-                if (!(cs[i] instanceof X509Certificate)) {
-                    error(rb.getString
-                        ("found.non.X.509.certificate.in.signer.s.chain"));
-                }
-                certChain[i] = (X509Certificate)cs[i];
-            }
-
-            // We don't meant to print anything, the next call
-            // checks validity and keyUsage etc
-            printCert("", certChain[0], true, null, true);
-
-            try {
-                CertPath cp = certificateFactory.generateCertPath(Arrays.asList(certChain));
-                validator.validate(cp, pkixParameters);
-            } catch (Exception e) {
-                if (debug) {
-                    e.printStackTrace();
-                }
-                if (e.getCause() != null &&
-                        (e.getCause() instanceof CertificateExpiredException ||
-                        e.getCause() instanceof CertificateNotYetValidException)) {
-                    // No more warning, we alreay have hasExpiredCert or notYetValidCert
-                } else {
-                    chainNotValidated = true;
-                }
-            }
-
-            try {
-                if (!token && keypass == null)
-                    key = store.getKey(alias, storepass);
-                else
-                    key = store.getKey(alias, keypass);
-            } catch (UnrecoverableKeyException e) {
-                if (token) {
-                    throw e;
-                } else if (keypass == null) {
-                    // Did not work out, so prompt user for key password
-                    MessageFormat form = new MessageFormat(rb.getString
-                        ("Enter.key.password.for.alias."));
-                    Object[] source = {alias};
-                    keypass = getPass(form.format(source));
-                    key = store.getKey(alias, keypass);
-                }
-            }
-        } catch (NoSuchAlgorithmException e) {
-            error(e.getMessage());
-        } catch (UnrecoverableKeyException e) {
-            error(rb.getString("unable.to.recover.key.from.keystore"));
-        } catch (KeyStoreException kse) {
-            // this never happens, because keystore has been loaded
-        }
-
-        if (!(key instanceof PrivateKey)) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("key.associated.with.alias.not.a.private.key"));
-            Object[] source = {alias};
-            error(form.format(source));
-        } else {
-            privateKey = (PrivateKey)key;
-        }
-    }
-
-    void error(String message)
-    {
-        System.out.println(rb.getString("jarsigner.")+message);
-        System.exit(1);
-    }
-
-
-    void error(String message, Exception e)
-    {
-        System.out.println(rb.getString("jarsigner.")+message);
-        if (debug) {
-            e.printStackTrace();
-        }
-        System.exit(1);
-    }
-
-    char[] getPass(String prompt)
-    {
-        System.err.print(prompt);
-        System.err.flush();
-        try {
-            char[] pass = Password.readPassword(System.in);
-
-            if (pass == null) {
-                error(rb.getString("you.must.enter.key.password"));
-            } else {
-                return pass;
-            }
-        } catch (IOException ioe) {
-            error(rb.getString("unable.to.read.password.")+ioe.getMessage());
-        }
-        // this shouldn't happen
-        return null;
-    }
-
-    /*
-     * Reads all the bytes for a given zip entry.
-     */
-    private synchronized byte[] getBytes(ZipFile zf,
-                                         ZipEntry ze) throws IOException {
-        int n;
-
-        InputStream is = null;
-        try {
-            is = zf.getInputStream(ze);
-            baos.reset();
-            long left = ze.getSize();
-
-            while((left > 0) && (n = is.read(buffer, 0, buffer.length)) != -1) {
-                baos.write(buffer, 0, n);
-                left -= n;
-            }
-        } finally {
-            if (is != null) {
-                is.close();
-            }
-        }
-
-        return baos.toByteArray();
-    }
-
-    /*
-     * Returns manifest entry from given jar file, or null if given jar file
-     * does not have a manifest entry.
-     */
-    private ZipEntry getManifestFile(ZipFile zf) {
-        ZipEntry ze = zf.getEntry(JarFile.MANIFEST_NAME);
-        if (ze == null) {
-            // Check all entries for matching name
-            Enumeration<? extends ZipEntry> enum_ = zf.entries();
-            while (enum_.hasMoreElements() && ze == null) {
-                ze = enum_.nextElement();
-                if (!JarFile.MANIFEST_NAME.equalsIgnoreCase
-                    (ze.getName())) {
-                    ze = null;
-                }
-            }
-        }
-        return ze;
-    }
-
-    /*
-     * Computes the digests of a zip entry, and returns them as an array
-     * of base64-encoded strings.
-     */
-    private synchronized String[] getDigests(ZipEntry ze, ZipFile zf,
-                                             MessageDigest[] digests,
-                                             BASE64Encoder encoder)
-        throws IOException {
-
-        int n, i;
-        InputStream is = null;
-        try {
-            is = zf.getInputStream(ze);
-            long left = ze.getSize();
-            while((left > 0)
-                && (n = is.read(buffer, 0, buffer.length)) != -1) {
-                for (i=0; i<digests.length; i++) {
-                    digests[i].update(buffer, 0, n);
-                }
-                left -= n;
-            }
-        } finally {
-            if (is != null) {
-                is.close();
-            }
-        }
-
-        // complete the digests
-        String[] base64Digests = new String[digests.length];
-        for (i=0; i<digests.length; i++) {
-            base64Digests[i] = encoder.encode(digests[i].digest());
-        }
-        return base64Digests;
-    }
-
-    /*
-     * Computes the digests of a zip entry, and returns them as a list of
-     * attributes
-     */
-    private Attributes getDigestAttributes(ZipEntry ze, ZipFile zf,
-                                           MessageDigest[] digests,
-                                           BASE64Encoder encoder)
-        throws IOException {
-
-        String[] base64Digests = getDigests(ze, zf, digests, encoder);
-        Attributes attrs = new Attributes();
-
-        for (int i=0; i<digests.length; i++) {
-            attrs.putValue(digests[i].getAlgorithm()+"-Digest",
-                           base64Digests[i]);
-        }
-        return attrs;
-    }
-
-    /*
-     * Updates the digest attributes of a manifest entry, by adding or
-     * replacing digest values.
-     * A digest value is added if the manifest entry does not contain a digest
-     * for that particular algorithm.
-     * A digest value is replaced if it is obsolete.
-     *
-     * Returns true if the manifest entry has been changed, and false
-     * otherwise.
-     */
-    private boolean updateDigests(ZipEntry ze, ZipFile zf,
-                                  MessageDigest[] digests,
-                                  BASE64Encoder encoder,
-                                  Manifest mf) throws IOException {
-        boolean update = false;
-
-        Attributes attrs = mf.getAttributes(ze.getName());
-        String[] base64Digests = getDigests(ze, zf, digests, encoder);
-
-        for (int i=0; i<digests.length; i++) {
-            // The entry name to be written into attrs
-            String name = null;
-            try {
-                // Find if the digest already exists
-                AlgorithmId aid = AlgorithmId.get(digests[i].getAlgorithm());
-                for (Object key: attrs.keySet()) {
-                    if (key instanceof Attributes.Name) {
-                        String n = ((Attributes.Name)key).toString();
-                        if (n.toUpperCase(Locale.ENGLISH).endsWith("-DIGEST")) {
-                            String tmp = n.substring(0, n.length() - 7);
-                            if (AlgorithmId.get(tmp).equals(aid)) {
-                                name = n;
-                                break;
-                            }
-                        }
-                    }
-                }
-            } catch (NoSuchAlgorithmException nsae) {
-                // Ignored. Writing new digest entry.
-            }
-
-            if (name == null) {
-                name = digests[i].getAlgorithm()+"-Digest";
-                attrs.putValue(name, base64Digests[i]);
-                update=true;
-            } else {
-                // compare digests, and replace the one in the manifest
-                // if they are different
-                String mfDigest = attrs.getValue(name);
-                if (!mfDigest.equalsIgnoreCase(base64Digests[i])) {
-                    attrs.putValue(name, base64Digests[i]);
-                    update=true;
-                }
-            }
-        }
-        return update;
-    }
-
-    /*
-     * Try to load the specified signing mechanism.
-     * The URL class loader is used.
-     */
-    private ContentSigner loadSigningMechanism(String signerClassName,
-        String signerClassPath) throws Exception {
-
-        // construct class loader
-        String cpString = null;   // make sure env.class.path defaults to dot
-
-        // do prepends to get correct ordering
-        cpString = PathList.appendPath(System.getProperty("env.class.path"), cpString);
-        cpString = PathList.appendPath(System.getProperty("java.class.path"), cpString);
-        cpString = PathList.appendPath(signerClassPath, cpString);
-        URL[] urls = PathList.pathToURLs(cpString);
-        ClassLoader appClassLoader = new URLClassLoader(urls);
-
-        // attempt to find signer
-        Class<?> signerClass = appClassLoader.loadClass(signerClassName);
-
-        // Check that it implements ContentSigner
-        Object signer = signerClass.newInstance();
-        if (!(signer instanceof ContentSigner)) {
-            MessageFormat form = new MessageFormat(
-                rb.getString("signerClass.is.not.a.signing.mechanism"));
-            Object[] source = {signerClass.getName()};
-            throw new IllegalArgumentException(form.format(source));
-        }
-        return (ContentSigner)signer;
-    }
-}
-
-/**
- * This is a BASE64Encoder that does not insert a default newline at the end of
- * every output line. This is necessary because java.util.jar does its own
- * line management (see Manifest.make72Safe()). Inserting additional new lines
- * can cause line-wrapping problems (see CR 6219522).
- */
-class JarBASE64Encoder extends BASE64Encoder {
-    /**
-     * Encode the suffix that ends every output line.
-     */
-    protected void encodeLineSuffix(OutputStream aStream) throws IOException { }
-}
-
-class SignatureFile {
-
-    /** SignatureFile */
-    Manifest sf;
-
-    /** .SF base name */
-    String baseName;
-
-    public SignatureFile(MessageDigest digests[],
-                         Manifest mf,
-                         ManifestDigester md,
-                         String baseName,
-                         boolean signManifest)
-
-    {
-        this.baseName = baseName;
-
-        String version = System.getProperty("java.version");
-        String javaVendor = System.getProperty("java.vendor");
-
-        sf = new Manifest();
-        Attributes mattr = sf.getMainAttributes();
-        BASE64Encoder encoder = new JarBASE64Encoder();
-
-        mattr.putValue(Attributes.Name.SIGNATURE_VERSION.toString(), "1.0");
-        mattr.putValue("Created-By", version + " (" + javaVendor + ")");
-
-        if (signManifest) {
-            // sign the whole manifest
-            for (int i=0; i < digests.length; i++) {
-                mattr.putValue(digests[i].getAlgorithm()+"-Digest-Manifest",
-                               encoder.encode(md.manifestDigest(digests[i])));
-            }
-        }
-
-        // create digest of the manifest main attributes
-        ManifestDigester.Entry mde =
-                md.get(ManifestDigester.MF_MAIN_ATTRS, false);
-        if (mde != null) {
-            for (int i=0; i < digests.length; i++) {
-                mattr.putValue(digests[i].getAlgorithm() +
-                        "-Digest-" + ManifestDigester.MF_MAIN_ATTRS,
-                        encoder.encode(mde.digest(digests[i])));
-            }
-        } else {
-            throw new IllegalStateException
-                ("ManifestDigester failed to create " +
-                "Manifest-Main-Attribute entry");
-        }
-
-        /* go through the manifest entries and create the digests */
-
-        Map<String,Attributes> entries = sf.getEntries();
-        Iterator<Map.Entry<String,Attributes>> mit =
-                                mf.getEntries().entrySet().iterator();
-        while(mit.hasNext()) {
-            Map.Entry<String,Attributes> e = mit.next();
-            String name = e.getKey();
-            mde = md.get(name, false);
-            if (mde != null) {
-                Attributes attr = new Attributes();
-                for (int i=0; i < digests.length; i++) {
-                    attr.putValue(digests[i].getAlgorithm()+"-Digest",
-                                  encoder.encode(mde.digest(digests[i])));
-                }
-                entries.put(name, attr);
-            }
-        }
-    }
-
-    /**
-     * Writes the SignatureFile to the specified OutputStream.
-     *
-     * @param out the output stream
-     * @exception IOException if an I/O error has occurred
-     */
-
-    public void write(OutputStream out) throws IOException
-    {
-        sf.write(out);
-    }
-
-    /**
-     * get .SF file name
-     */
-    public String getMetaName()
-    {
-        return "META-INF/"+ baseName + ".SF";
-    }
-
-    /**
-     * get base file name
-     */
-    public String getBaseName()
-    {
-        return baseName;
-    }
-
-    /*
-     * Generate a signed data block.
-     * If a URL or a certificate (containing a URL) for a Timestamping
-     * Authority is supplied then a signature timestamp is generated and
-     * inserted into the signed data block.
-     *
-     * @param sigalg signature algorithm to use, or null to use default
-     * @param tsaUrl The location of the Timestamping Authority. If null
-     *               then no timestamp is requested.
-     * @param tsaCert The certificate for the Timestamping Authority. If null
-     *               then no timestamp is requested.
-     * @param signingMechanism The signing mechanism to use.
-     * @param args The command-line arguments to jarsigner.
-     * @param zipFile The original source Zip file.
-     */
-    public Block generateBlock(PrivateKey privateKey,
-                               String sigalg,
-                               X509Certificate[] certChain,
-                               boolean externalSF, String tsaUrl,
-                               X509Certificate tsaCert,
-                               ContentSigner signingMechanism,
-                               String[] args, ZipFile zipFile)
-        throws NoSuchAlgorithmException, InvalidKeyException, IOException,
-            SignatureException, CertificateException
-    {
-        return new Block(this, privateKey, sigalg, certChain, externalSF,
-                tsaUrl, tsaCert, signingMechanism, args, zipFile);
-    }
-
-
-    public static class Block {
-
-        private byte[] block;
-        private String blockFileName;
-
-        /*
-         * Construct a new signature block.
-         */
-        Block(SignatureFile sfg, PrivateKey privateKey, String sigalg,
-            X509Certificate[] certChain, boolean externalSF, String tsaUrl,
-            X509Certificate tsaCert, ContentSigner signingMechanism,
-            String[] args, ZipFile zipFile)
-            throws NoSuchAlgorithmException, InvalidKeyException, IOException,
-            SignatureException, CertificateException {
-
-            Principal issuerName = certChain[0].getIssuerDN();
-            if (!(issuerName instanceof X500Name)) {
-                // must extract the original encoded form of DN for subsequent
-                // name comparison checks (converting to a String and back to
-                // an encoded DN could cause the types of String attribute
-                // values to be changed)
-                X509CertInfo tbsCert = new
-                    X509CertInfo(certChain[0].getTBSCertificate());
-                issuerName = (Principal)
-                    tbsCert.get(CertificateIssuerName.NAME + "." +
-                                CertificateIssuerName.DN_NAME);
-            }
-            BigInteger serial = certChain[0].getSerialNumber();
-
-            String signatureAlgorithm;
-            String keyAlgorithm = privateKey.getAlgorithm();
-            /*
-             * If no signature algorithm was specified, we choose a
-             * default that is compatible with the private key algorithm.
-             */
-            if (sigalg == null) {
-
-                if (keyAlgorithm.equalsIgnoreCase("DSA"))
-                    signatureAlgorithm = "SHA1withDSA";
-                else if (keyAlgorithm.equalsIgnoreCase("RSA"))
-                    signatureAlgorithm = "SHA256withRSA";
-                else if (keyAlgorithm.equalsIgnoreCase("EC"))
-                    signatureAlgorithm = "SHA256withECDSA";
-                else
-                    throw new RuntimeException("private key is not a DSA or "
-                                               + "RSA key");
-            } else {
-                signatureAlgorithm = sigalg;
-            }
-
-            // check common invalid key/signature algorithm combinations
-            String sigAlgUpperCase = signatureAlgorithm.toUpperCase(Locale.ENGLISH);
-            if ((sigAlgUpperCase.endsWith("WITHRSA") &&
-                !keyAlgorithm.equalsIgnoreCase("RSA")) ||
-                (sigAlgUpperCase.endsWith("WITHECDSA") &&
-                !keyAlgorithm.equalsIgnoreCase("EC")) ||
-                (sigAlgUpperCase.endsWith("WITHDSA") &&
-                !keyAlgorithm.equalsIgnoreCase("DSA"))) {
-                throw new SignatureException
-                    ("private key algorithm is not compatible with signature algorithm");
-            }
-
-            blockFileName = "META-INF/"+sfg.getBaseName()+"."+keyAlgorithm;
-
-            AlgorithmId sigAlg = AlgorithmId.get(signatureAlgorithm);
-            AlgorithmId digEncrAlg = AlgorithmId.get(keyAlgorithm);
-
-            Signature sig = Signature.getInstance(signatureAlgorithm);
-            sig.initSign(privateKey);
-
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            sfg.write(baos);
-
-            byte[] content = baos.toByteArray();
-
-            sig.update(content);
-            byte[] signature = sig.sign();
-
-            // Timestamp the signature and generate the signature block file
-            if (signingMechanism == null) {
-                signingMechanism = new TimestampedSigner();
-            }
-            URI tsaUri = null;
-            try {
-                if (tsaUrl != null) {
-                    tsaUri = new URI(tsaUrl);
-                }
-            } catch (URISyntaxException e) {
-                throw new IOException(e);
-            }
-
-            // Assemble parameters for the signing mechanism
-            ContentSignerParameters params =
-                new JarSignerParameters(args, tsaUri, tsaCert, signature,
-                    signatureAlgorithm, certChain, content, zipFile);
-
-            // Generate the signature block
-            block = signingMechanism.generateSignedData(
-                    params, externalSF, (tsaUrl != null || tsaCert != null));
-        }
-
-        /*
-         * get block file name.
-         */
-        public String getMetaName()
-        {
-            return blockFileName;
-        }
-
-        /**
-         * Writes the block file to the specified OutputStream.
-         *
-         * @param out the output stream
-         * @exception IOException if an I/O error has occurred
-         */
-
-        public void write(OutputStream out) throws IOException
-        {
-            out.write(block);
-        }
-    }
-}
-
-
-/*
- * This object encapsulates the parameters used to perform content signing.
- */
-class JarSignerParameters implements ContentSignerParameters {
-
-    private String[] args;
-    private URI tsa;
-    private X509Certificate tsaCertificate;
-    private byte[] signature;
-    private String signatureAlgorithm;
-    private X509Certificate[] signerCertificateChain;
-    private byte[] content;
-    private ZipFile source;
-
-    /**
-     * Create a new object.
-     */
-    JarSignerParameters(String[] args, URI tsa, X509Certificate tsaCertificate,
-        byte[] signature, String signatureAlgorithm,
-        X509Certificate[] signerCertificateChain, byte[] content,
-        ZipFile source) {
-
-        if (signature == null || signatureAlgorithm == null ||
-            signerCertificateChain == null) {
-            throw new NullPointerException();
-        }
-        this.args = args;
-        this.tsa = tsa;
-        this.tsaCertificate = tsaCertificate;
-        this.signature = signature;
-        this.signatureAlgorithm = signatureAlgorithm;
-        this.signerCertificateChain = signerCertificateChain;
-        this.content = content;
-        this.source = source;
-    }
-
-    /**
-     * Retrieves the command-line arguments.
-     *
-     * @return The command-line arguments. May be null.
-     */
-    public String[] getCommandLine() {
-        return args;
-    }
-
-    /**
-     * Retrieves the identifier for a Timestamping Authority (TSA).
-     *
-     * @return The TSA identifier. May be null.
-     */
-    public URI getTimestampingAuthority() {
-        return tsa;
-    }
-
-    /**
-     * Retrieves the certificate for a Timestamping Authority (TSA).
-     *
-     * @return The TSA certificate. May be null.
-     */
-    public X509Certificate getTimestampingAuthorityCertificate() {
-        return tsaCertificate;
-    }
-
-    /**
-     * Retrieves the signature.
-     *
-     * @return The non-null signature bytes.
-     */
-    public byte[] getSignature() {
-        return signature;
-    }
-
-    /**
-     * Retrieves the name of the signature algorithm.
-     *
-     * @return The non-null string name of the signature algorithm.
-     */
-    public String getSignatureAlgorithm() {
-        return signatureAlgorithm;
-    }
-
-    /**
-     * Retrieves the signer's X.509 certificate chain.
-     *
-     * @return The non-null array of X.509 public-key certificates.
-     */
-    public X509Certificate[] getSignerCertificateChain() {
-        return signerCertificateChain;
-    }
-
-    /**
-     * Retrieves the content that was signed.
-     *
-     * @return The content bytes. May be null.
-     */
-    public byte[] getContent() {
-        return content;
-    }
-
-    /**
-     * Retrieves the original source ZIP file before it was signed.
-     *
-     * @return The original ZIP file. May be null.
-     */
-    public ZipFile getSource() {
-        return source;
-    }
-}
--- a/src/share/classes/sun/security/tools/JarSignerResources.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,242 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for JarSigner.
- *
- */
-public class JarSignerResources extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-
-        {"provName.not.a.provider", "{0} not a provider"},
-        {"signerClass.is.not.a.signing.mechanism", "{0} is not a signing mechanism"},
-        {"jarsigner.error.", "jarsigner error: "},
-        {"Illegal.option.", "Illegal option: "},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore must be NONE if -storetype is {0}"},
-        {".keypass.can.not.be.specified.if.storetype.is.{0}",
-                "-keypass can not be specified if -storetype is {0}"},
-        {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
-                "If -protected is specified, then -storepass and -keypass must not be specified"},
-        {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
-                 "If keystore is not password protected, then -storepass and -keypass must not be specified"},
-        {"Usage.jarsigner.options.jar.file.alias",
-                "Usage: jarsigner [options] jar-file alias"},
-        {".jarsigner.verify.options.jar.file.alias.",
-                "       jarsigner -verify [options] jar-file [alias...]"},
-        {".keystore.url.keystore.location",
-                "[-keystore <url>]           keystore location"},
-        {".storepass.password.password.for.keystore.integrity",
-            "[-storepass <password>]     password for keystore integrity"},
-        {".storetype.type.keystore.type",
-                "[-storetype <type>]         keystore type"},
-        {".keypass.password.password.for.private.key.if.different.",
-                "[-keypass <password>]       password for private key (if different)"},
-        {".certchain.file.name.of.alternative.certchain.file",
-                "[-certchain <file>]         name of alternative certchain file"},
-        {".sigfile.file.name.of.SF.DSA.file",
-                "[-sigfile <file>]           name of .SF/.DSA file"},
-        {".signedjar.file.name.of.signed.JAR.file",
-                "[-signedjar <file>]         name of signed JAR file"},
-        {".digestalg.algorithm.name.of.digest.algorithm",
-                "[-digestalg <algorithm>]    name of digest algorithm"},
-        {".sigalg.algorithm.name.of.signature.algorithm",
-                "[-sigalg <algorithm>]       name of signature algorithm"},
-        {".verify.verify.a.signed.JAR.file",
-                "[-verify]                   verify a signed JAR file"},
-        {".verbose.suboptions.verbose.output.when.signing.verifying.",
-                "[-verbose[:suboptions]]     verbose output when signing/verifying."},
-        {".suboptions.can.be.all.grouped.or.summary",
-                "                            suboptions can be all, grouped or summary"},
-        {".certs.display.certificates.when.verbose.and.verifying",
-                "[-certs]                    display certificates when verbose and verifying"},
-        {".tsa.url.location.of.the.Timestamping.Authority",
-                "[-tsa <url>]                location of the Timestamping Authority"},
-        {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
-                "[-tsacert <alias>]          public key certificate for Timestamping Authority"},
-        {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
-                "[-altsigner <class>]        class name of an alternative signing mechanism"},
-        {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
-                "[-altsignerpath <pathlist>] location of an alternative signing mechanism"},
-        {".internalsf.include.the.SF.file.inside.the.signature.block",
-                "[-internalsf]               include the .SF file inside the signature block"},
-        {".sectionsonly.don.t.compute.hash.of.entire.manifest",
-                "[-sectionsonly]             don't compute hash of entire manifest"},
-        {".protected.keystore.has.protected.authentication.path",
-                "[-protected]                keystore has protected authentication path"},
-        {".providerName.name.provider.name",
-                "[-providerName <name>]      provider name"},
-        {".providerClass.class.name.of.cryptographic.service.provider.s",
-                "[-providerClass <class>     name of cryptographic service provider's"},
-        {".providerArg.arg.master.class.file.and.constructor.argument",
-                "  [-providerArg <arg>]] ... master class file and constructor argument"},
-        {".strict.treat.warnings.as.errors",
-                "[-strict]                   treat warnings as errors"},
-        {"Option.lacks.argument", "Option lacks argument"},
-        {"Please.type.jarsigner.help.for.usage", "Please type jarsigner -help for usage"},
-        {"Please.specify.jarfile.name", "Please specify jarfile name"},
-        {"Please.specify.alias.name", "Please specify alias name"},
-        {"Only.one.alias.can.be.specified", "Only one alias can be specified"},
-        {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
-                 "This jar contains signed entries which is not signed by the specified alias(es)."},
-        {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
-                  "This jar contains signed entries that's not signed by alias in this keystore."},
-        {"s", "s"},
-        {"m", "m"},
-        {"k", "k"},
-        {"i", "i"},
-        {".and.d.more.", "(and %d more)"},
-        {".s.signature.was.verified.",
-                "  s = signature was verified "},
-        {".m.entry.is.listed.in.manifest",
-                "  m = entry is listed in manifest"},
-        {".k.at.least.one.certificate.was.found.in.keystore",
-                "  k = at least one certificate was found in keystore"},
-        {".i.at.least.one.certificate.was.found.in.identity.scope",
-                "  i = at least one certificate was found in identity scope"},
-        {".X.not.signed.by.specified.alias.es.",
-                "  X = not signed by specified alias(es)"},
-        {"no.manifest.", "no manifest."},
-        {".Signature.related.entries.","(Signature related entries)"},
-        {".Unsigned.entries.", "(Unsigned entries)"},
-        {"jar.is.unsigned.signatures.missing.or.not.parsable.",
-                "jar is unsigned. (signatures missing or not parsable)"},
-        {"jar.verified.", "jar verified."},
-        {"jarsigner.", "jarsigner: "},
-        {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
-                "signature filename must consist of the following characters: A-Z, 0-9, _ or -"},
-        {"unable.to.open.jar.file.", "unable to open jar file: "},
-        {"unable.to.create.", "unable to create: "},
-        {".adding.", "   adding: "},
-        {".updating.", " updating: "},
-        {".signing.", "  signing: "},
-        {"attempt.to.rename.signedJarFile.to.jarFile.failed",
-                "attempt to rename {0} to {1} failed"},
-        {"attempt.to.rename.jarFile.to.origJar.failed",
-                "attempt to rename {0} to {1} failed"},
-        {"unable.to.sign.jar.", "unable to sign jar: "},
-        {"Enter.Passphrase.for.keystore.", "Enter Passphrase for keystore: "},
-        {"keystore.load.", "keystore load: "},
-        {"certificate.exception.", "certificate exception: "},
-        {"unable.to.instantiate.keystore.class.",
-                "unable to instantiate keystore class: "},
-        {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
-                "Certificate chain not found for: {0}.  {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."},
-        {"File.specified.by.certchain.does.not.exist",
-                "File specified by -certchain does not exist"},
-        {"Cannot.restore.certchain.from.file.specified",
-                "Cannot restore certchain from file specified"},
-        {"Certificate.chain.not.found.in.the.file.specified.",
-                "Certificate chain not found in the file specified."},
-        {"found.non.X.509.certificate.in.signer.s.chain",
-                "found non-X.509 certificate in signer's chain"},
-        {"incomplete.certificate.chain", "incomplete certificate chain"},
-        {"Enter.key.password.for.alias.", "Enter key password for {0}: "},
-        {"unable.to.recover.key.from.keystore",
-                "unable to recover key from keystore"},
-        {"key.associated.with.alias.not.a.private.key",
-                "key associated with {0} not a private key"},
-        {"you.must.enter.key.password", "you must enter key password"},
-        {"unable.to.read.password.", "unable to read password: "},
-        {"certificate.is.valid.from", "certificate is valid from {0} to {1}"},
-        {"certificate.expired.on", "certificate expired on {0}"},
-        {"certificate.is.not.valid.until",
-                "certificate is not valid until {0}"},
-        {"certificate.will.expire.on", "certificate will expire on {0}"},
-        {".CertPath.not.validated.", "[CertPath not validated: "},
-        {"requesting.a.signature.timestamp",
-                "requesting a signature timestamp"},
-        {"TSA.location.", "TSA location: "},
-        {"TSA.certificate.", "TSA certificate: "},
-        {"no.response.from.the.Timestamping.Authority.",
-                "no response from the Timestamping Authority. When connecting"
-                + " from behind a firewall an HTTP or HTTPS proxy may need to"
-                + " be specified. Supply the following options to jarsigner:"},
-        {"or", "or"},
-        {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
-                "Certificate not found for: {0}.  {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."},
-        {"using.an.alternative.signing.mechanism",
-                "using an alternative signing mechanism"},
-        {"entry.was.signed.on", "entry was signed on {0}"},
-        {"Warning.", "Warning: "},
-        {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
-                "This jar contains unsigned entries which have not been integrity-checked. "},
-        {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
-                "This jar contains entries whose signer certificate has expired. "},
-        {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
-                "This jar contains entries whose signer certificate will expire within six months. "},
-        {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
-                "This jar contains entries whose signer certificate is not yet valid. "},
-        {"Re.run.with.the.verbose.option.for.more.details.",
-                "Re-run with the -verbose option for more details."},
-        {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
-                "Re-run with the -verbose and -certs options for more details."},
-        {"The.signer.certificate.has.expired.",
-                "The signer certificate has expired."},
-        {"The.signer.certificate.will.expire.within.six.months.",
-                "The signer certificate will expire within six months."},
-        {"The.signer.certificate.is.not.yet.valid.",
-                "The signer certificate is not yet valid."},
-        {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
-                 "The signer certificate's KeyUsage extension doesn't allow code signing."},
-        {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
-                 "The signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
-        {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
-                 "The signer certificate's NetscapeCertType extension doesn't allow code signing."},
-        {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
-                 "This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing."},
-        {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
-                 "This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
-        {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
-                 "This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing."},
-        {".{0}.extension.does.not.support.code.signing.",
-                 "[{0} extension does not support code signing]"},
-        {"The.signer.s.certificate.chain.is.not.validated.",
-                "The signer's certificate chain is not validated."},
-        {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
-                 "This jar contains entries whose certificate chain is not validated."},
-    };
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/src/share/classes/sun/security/tools/JarSignerResources_ja.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for JarSigner.
- *
- */
-public class JarSignerResources_ja extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-
-        {"provName.not.a.provider", "{0}\u306F\u30D7\u30ED\u30D0\u30A4\u30C0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"signerClass.is.not.a.signing.mechanism", "{0}\u306F\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"jarsigner.error.", "jarsigner\u30A8\u30E9\u30FC: "},
-        {"Illegal.option.", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: "},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keystore\u306FNONE\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {".keypass.can.not.be.specified.if.storetype.is.{0}",
-                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keypass\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
-                "-protected\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u306F\u3001-storepass\u304A\u3088\u3073-keypass\u3092\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044"},
-        {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
-                 "\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u4FDD\u8B77\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001-storepass\u304A\u3088\u3073-keypass\u3092\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044"},
-        {"Usage.jarsigner.options.jar.file.alias",
-                "\u4F7F\u7528\u65B9\u6CD5: jarsigner [options] jar-file alias"},
-        {".jarsigner.verify.options.jar.file.alias.",
-                "       jarsigner -verify [options] jar-file [alias...]"},
-        {".keystore.url.keystore.location",
-                "[-keystore <url>]       \u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u4F4D\u7F6E"},
-        {".storepass.password.password.for.keystore.integrity",
-            "[-storepass <password>]   \u30AD\u30FC\u30B9\u30C8\u30A2\u6574\u5408\u6027\u306E\u305F\u3081\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"},
-        {".storetype.type.keystore.type",
-                "[-storetype <type>]     \u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u578B"},
-        {".keypass.password.password.for.private.key.if.different.",
-                "[-keypass <password>]    \u79D8\u5BC6\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9(\u7570\u306A\u308B\u5834\u5408)"},
-        {".certchain.file.name.of.alternative.certchain.file",
-                "[-certchain <file>]         \u4EE3\u66FF\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
-        {".sigfile.file.name.of.SF.DSA.file",
-                "[-sigfile <file>]       .SF/.DSA\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
-        {".signedjar.file.name.of.signed.JAR.file",
-                "[-signedjar <file>]     \u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
-        {".digestalg.algorithm.name.of.digest.algorithm",
-                "[-digestalg <algorithm>]  \u30C0\u30A4\u30B8\u30A7\u30B9\u30C8\u30FB\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u306E\u540D\u524D"},
-        {".sigalg.algorithm.name.of.signature.algorithm",
-                "[-sigalg <algorithm>]    \u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u306E\u540D\u524D"},
-        {".verify.verify.a.signed.JAR.file",
-                "[-verify]            \u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB\u306E\u691C\u8A3C"},
-        {".verbose.suboptions.verbose.output.when.signing.verifying.",
-                "[-verbose[:suboptions]]     \u7F72\u540D/\u691C\u8A3C\u6642\u306E\u8A73\u7D30\u51FA\u529B\u3002"},
-        {".suboptions.can.be.all.grouped.or.summary",
-                "                            \u30B5\u30D6\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3057\u3066\u3001\u3059\u3079\u3066\u3001\u30B0\u30EB\u30FC\u30D7\u307E\u305F\u306F\u30B5\u30DE\u30EA\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059"},
-        {".certs.display.certificates.when.verbose.and.verifying",
-                "[-certs]             \u8A73\u7D30\u51FA\u529B\u304A\u3088\u3073\u691C\u8A3C\u6642\u306B\u8A3C\u660E\u66F8\u3092\u8868\u793A"},
-        {".tsa.url.location.of.the.Timestamping.Authority",
-                "[-tsa <url>]          \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u5834\u6240"},
-        {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
-                "[-tsacert <alias>]      \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u516C\u958B\u9375\u8A3C\u660E\u66F8"},
-        {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
-                "[-altsigner <class>]     \u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u30AF\u30E9\u30B9\u540D"},
-        {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
-                "[-altsignerpath <pathlist>]\u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u4F4D\u7F6E"},
-        {".internalsf.include.the.SF.file.inside.the.signature.block",
-                "[-internalsf]         \u7F72\u540D\u30D6\u30ED\u30C3\u30AF\u306B.SF\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B"},
-        {".sectionsonly.don.t.compute.hash.of.entire.manifest",
-                "[-sectionsonly]        \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5168\u4F53\u306E\u30CF\u30C3\u30B7\u30E5\u306F\u8A08\u7B97\u3057\u306A\u3044"},
-        {".protected.keystore.has.protected.authentication.path",
-                "[-protected]          \u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u306F\u4FDD\u8B77\u3055\u308C\u305F\u8A8D\u8A3C\u30D1\u30B9\u304C\u3042\u308B"},
-        {".providerName.name.provider.name",
-                "[-providerName <name>]   \u30D7\u30ED\u30D0\u30A4\u30C0\u540D"},
-        {".providerClass.class.name.of.cryptographic.service.provider.s",
-                "[-providerClass <class>   \u6697\u53F7\u5316\u30B5\u30FC\u30D3\u30B9\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u306E\u540D\u524D"},
-        {".providerArg.arg.master.class.file.and.constructor.argument",
-                "  [-providerArg <arg>]] ... \u30DE\u30B9\u30BF\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3068\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5F15\u6570"},
-        {".strict.treat.warnings.as.errors",
-                "[-strict]                   \u8B66\u544A\u3092\u30A8\u30E9\u30FC\u3068\u3057\u3066\u51E6\u7406"},
-        {"Option.lacks.argument", "\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"Please.type.jarsigner.help.for.usage", "\u4F7F\u7528\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306Fjarsigner -help\u3068\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Please.specify.jarfile.name", "jarfile\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Please.specify.alias.name", "\u5225\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Only.one.alias.can.be.specified", "\u5225\u540D\u306F1\u3064\u306E\u307F\u6307\u5B9A\u3067\u304D\u307E\u3059"},
-        {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
-                 "\u3053\u306Ejar\u306B\u542B\u307E\u308C\u308B\u7F72\u540D\u6E08\u30A8\u30F3\u30C8\u30EA\u306F\u3001\u6307\u5B9A\u3055\u308C\u305F\u5225\u540D\u306B\u3088\u3063\u3066\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-        {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
-                  "\u3053\u306Ejar\u306B\u542B\u307E\u308C\u308B\u7F72\u540D\u6E08\u30A8\u30F3\u30C8\u30EA\u306F\u3001\u3053\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u5225\u540D\u306B\u3088\u3063\u3066\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-        {"s", "s"},
-        {"m", "m"},
-        {"k", "k"},
-        {"i", "i"},
-        {".and.d.more.", "(\u4ED6\u306B\u3082%d\u500B)"},
-        {".s.signature.was.verified.",
-                "  s=\u7F72\u540D\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F "},
-        {".m.entry.is.listed.in.manifest",
-                "  m=\u30A8\u30F3\u30C8\u30EA\u304C\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5185\u306B\u30EA\u30B9\u30C8\u3055\u308C\u307E\u3059"},
-        {".k.at.least.one.certificate.was.found.in.keystore",
-                "  k=1\u3064\u4EE5\u4E0A\u306E\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-        {".i.at.least.one.certificate.was.found.in.identity.scope",
-                "  i=1\u3064\u4EE5\u4E0A\u306E\u8A3C\u660E\u66F8\u304C\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-        {".X.not.signed.by.specified.alias.es.",
-                "  X =\u6307\u5B9A\u3057\u305F\u5225\u540D\u3067\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"no.manifest.", "\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002"},
-        {".Signature.related.entries.","(\u7F72\u540D\u95A2\u9023\u30A8\u30F3\u30C8\u30EA)"},
-        {".Unsigned.entries.", "(\u672A\u7F72\u540D\u306E\u30A8\u30F3\u30C8\u30EA)"},
-        {"jar.is.unsigned.signatures.missing.or.not.parsable.",
-                "jar\u306F\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002(\u7F72\u540D\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u304B\u3001\u69CB\u6587\u89E3\u6790\u3067\u304D\u307E\u305B\u3093)"},
-        {"jar.verified.", "jar\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F\u3002"},
-        {"jarsigner.", "jarsigner: "},
-        {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
-                "\u7F72\u540D\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u306B\u4F7F\u7528\u3067\u304D\u308B\u6587\u5B57\u306F\u3001A-Z\u30010-9\u3001_\u3001- \u306E\u307F\u3067\u3059\u3002"},
-        {"unable.to.open.jar.file.", "\u6B21\u306Ejar\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093: "},
-        {"unable.to.create.", "\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093: "},
-        {".adding.", "   \u8FFD\u52A0\u4E2D: "},
-        {".updating.", " \u66F4\u65B0\u4E2D: "},
-        {".signing.", "  \u7F72\u540D\u4E2D: "},
-        {"attempt.to.rename.signedJarFile.to.jarFile.failed",
-                "{0}\u306E\u540D\u524D\u3092{1}\u306B\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u304C\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"attempt.to.rename.jarFile.to.origJar.failed",
-                "{0}\u306E\u540D\u524D\u3092{1}\u306B\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u304C\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"unable.to.sign.jar.", "jar\u306B\u7F72\u540D\u3067\u304D\u307E\u305B\u3093: "},
-        {"Enter.Passphrase.for.keystore.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
-        {"keystore.load.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30ED\u30FC\u30C9: "},
-        {"certificate.exception.", "\u8A3C\u660E\u66F8\u4F8B\u5916: "},
-        {"unable.to.instantiate.keystore.class.",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093: "},
-        {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
-                "\u6B21\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}\u3002{1}\u306F\u3001\u79D8\u5BC6\u9375\u304A\u3088\u3073\u5BFE\u5FDC\u3059\u308B\u516C\u958B\u9375\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u542B\u3080\u6709\u52B9\u306AKeyStore\u9375\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-        {"File.specified.by.certchain.does.not.exist",
-                "-certchain\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
-        {"Cannot.restore.certchain.from.file.specified",
-                "\u6307\u5B9A\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"},
-        {"Certificate.chain.not.found.in.the.file.specified.",
-                "\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u6307\u5B9A\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-        {"found.non.X.509.certificate.in.signer.s.chain",
-                "\u7F72\u540D\u8005\u306E\u9023\u9396\u5185\u3067\u975EX.509\u8A3C\u660E\u66F8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-        {"incomplete.certificate.chain", "\u4E0D\u5B8C\u5168\u306A\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3"},
-        {"Enter.key.password.for.alias.", "{0}\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
-        {"unable.to.recover.key.from.keystore",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u3089\u9375\u3092\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"},
-        {"key.associated.with.alias.not.a.private.key",
-                "{0}\u3068\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F\u9375\u306F\u3001\u79D8\u5BC6\u9375\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"you.must.enter.key.password", "\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"unable.to.read.password.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: "},
-        {"certificate.is.valid.from", "\u8A3C\u660E\u66F8\u306F{0}\u304B\u3089{1}\u307E\u3067\u6709\u52B9\u3067\u3059"},
-        {"certificate.expired.on", "\u8A3C\u660E\u66F8\u306F{0}\u306B\u5931\u52B9\u3057\u307E\u3057\u305F"},
-        {"certificate.is.not.valid.until",
-                "\u8A3C\u660E\u66F8\u306F{0}\u307E\u3067\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"certificate.will.expire.on", "\u8A3C\u660E\u66F8\u306F{0}\u306B\u5931\u52B9\u3057\u307E\u3059"},
-        {".CertPath.not.validated.", "[CertPath\u304C\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093: "},
-        {"requesting.a.signature.timestamp",
-                "\u7F72\u540D\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u306E\u30EA\u30AF\u30A8\u30B9\u30C8"},
-        {"TSA.location.", "TSA\u306E\u5834\u6240: "},
-        {"TSA.certificate.", "TSA\u8A3C\u660E\u66F8: "},
-        {"no.response.from.the.Timestamping.Authority.",
-                "\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u304B\u3089\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30A2\u30A6\u30A9\u30FC\u30EB\u3092\u4ECB\u3057\u3066\u63A5\u7D9A\u3059\u308B\u3068\u304D\u306F\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066HTTP\u307E\u305F\u306FHTTPS\u30D7\u30ED\u30AD\u30B7\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002jarsigner\u306B\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044:"},
-        {"or", "\u307E\u305F\u306F"},
-        {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
-                "\u8A3C\u660E\u66F8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}\u3002{1}\u306F\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306EX.509\u516C\u958B\u9375\u8A3C\u660E\u66F8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u6709\u52B9\u306AKeyStore\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-        {"using.an.alternative.signing.mechanism",
-                "\u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u4F7F\u7528"},
-        {"entry.was.signed.on", "\u30A8\u30F3\u30C8\u30EA\u306F{0}\u306B\u7F72\u540D\u3055\u308C\u307E\u3057\u305F"},
-        {"Warning.", "\u8B66\u544A: "},
-        {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
-                "\u3053\u306Ejar\u306B\u306F\u3001\u6574\u5408\u6027\u30C1\u30A7\u30C3\u30AF\u3092\u3057\u3066\u3044\u306A\u3044\u672A\u7F72\u540D\u306E\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
-        {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
-                "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u304C\u671F\u9650\u5207\u308C\u306E\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
-        {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
-                "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u304C6\u304B\u6708\u4EE5\u5185\u306B\u671F\u9650\u5207\u308C\u3068\u306A\u308B\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
-        {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
-                "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u304C\u307E\u3060\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
-        {"Re.run.with.the.verbose.option.for.more.details.",
-                "\u8A73\u7D30\u306F\u3001-verbose\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
-                "\u8A73\u7D30\u306F\u3001-verbose\u304A\u3088\u3073-certs\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"The.signer.certificate.has.expired.",
-                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u306F\u671F\u9650\u5207\u308C\u3067\u3059\u3002"},
-        {"The.signer.certificate.will.expire.within.six.months.",
-                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u306F6\u304B\u6708\u4EE5\u5185\u306B\u671F\u9650\u5207\u308C\u306B\u306A\u308A\u307E\u3059\u3002"},
-        {"The.signer.certificate.is.not.yet.valid.",
-                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u306F\u307E\u3060\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093\u3002"},
-        {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EKeyUsage\u62E1\u5F35\u6A5F\u80FD\u3067\u306F\u3001\u30B3\u30FC\u30C9\u7F72\u540D\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EExtendedKeyUsage\u62E1\u5F35\u6A5F\u80FD\u3067\u306F\u3001\u30B3\u30FC\u30C9\u7F72\u540D\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
-                 "\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306ENetscapeCertType\u62E1\u5F35\u6A5F\u80FD\u3067\u306F\u3001\u30B3\u30FC\u30C9\u7F72\u540D\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EKeyUsage\u62E1\u5F35\u6A5F\u80FD\u304C\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u8A31\u53EF\u3057\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
-        {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EExtendedKeyUsage\u62E1\u5F35\u6A5F\u80FD\u304C\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u8A31\u53EF\u3057\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
-        {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
-                 "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306ENetscapeCertType\u62E1\u5F35\u6A5F\u80FD\u304C\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u8A31\u53EF\u3057\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
-        {".{0}.extension.does.not.support.code.signing.",
-                 "[{0}\u62E1\u5F35\u6A5F\u80FD\u306F\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093]"},
-        {"The.signer.s.certificate.chain.is.not.validated.",
-                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u307E\u3060\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-        {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
-                 "\u3053\u306Ejar\u306B\u306F\u3001\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u307E\u3060\u691C\u8A3C\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
-    };
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/src/share/classes/sun/security/tools/JarSignerResources_zh_CN.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for JarSigner.
- *
- */
-public class JarSignerResources_zh_CN extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-
-        {"provName.not.a.provider", "{0}\u4E0D\u662F\u63D0\u4F9B\u65B9"},
-        {"signerClass.is.not.a.signing.mechanism", "{0}\u4E0D\u662F\u7B7E\u540D\u673A\u5236"},
-        {"jarsigner.error.", "jarsigner \u9519\u8BEF: "},
-        {"Illegal.option.", "\u975E\u6CD5\u9009\u9879: "},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u4E3A {0}, \u5219 -keystore \u5FC5\u987B\u4E3A NONE"},
-        {".keypass.can.not.be.specified.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u4E3A {0}, \u5219\u4E0D\u80FD\u6307\u5B9A -keypass"},
-        {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
-                "\u5982\u679C\u6307\u5B9A\u4E86 -protected, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass \u548C -keypass"},
-        {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
-                 "\u5982\u679C\u5BC6\u94A5\u5E93\u672A\u53D7\u53E3\u4EE4\u4FDD\u62A4, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass \u548C -keypass"},
-        {"Usage.jarsigner.options.jar.file.alias",
-                "\u7528\u6CD5: jarsigner [\u9009\u9879] jar\u6587\u4EF6 \u522B\u540D"},
-        {".jarsigner.verify.options.jar.file.alias.",
-                "       jarsigner -verify [\u9009\u9879] jar\u6587\u4EF6 [\u522B\u540D...]"},
-        {".keystore.url.keystore.location",
-                "[-keystore <url>]           \u5BC6\u94A5\u5E93\u4F4D\u7F6E"},
-        {".storepass.password.password.for.keystore.integrity",
-            "[-storepass <\u53E3\u4EE4>]         \u7528\u4E8E\u5BC6\u94A5\u5E93\u5B8C\u6574\u6027\u7684\u53E3\u4EE4"},
-        {".storetype.type.keystore.type",
-                "[-storetype <\u7C7B\u578B>]         \u5BC6\u94A5\u5E93\u7C7B\u578B"},
-        {".keypass.password.password.for.private.key.if.different.",
-                "[-keypass <\u53E3\u4EE4>]           \u79C1\u6709\u5BC6\u94A5\u7684\u53E3\u4EE4 (\u5982\u679C\u4E0D\u540C)"},
-        {".certchain.file.name.of.alternative.certchain.file",
-                "[-certchain <\u6587\u4EF6>]         \u66FF\u4EE3\u8BC1\u4E66\u94FE\u6587\u4EF6\u7684\u540D\u79F0"},
-        {".sigfile.file.name.of.SF.DSA.file",
-                "[-sigfile <\u6587\u4EF6>]           .SF/.DSA \u6587\u4EF6\u7684\u540D\u79F0"},
-        {".signedjar.file.name.of.signed.JAR.file",
-                "[-signedjar <\u6587\u4EF6>]         \u5DF2\u7B7E\u540D\u7684 JAR \u6587\u4EF6\u7684\u540D\u79F0"},
-        {".digestalg.algorithm.name.of.digest.algorithm",
-                "[-digestalg <\u7B97\u6CD5>]    \u6458\u8981\u7B97\u6CD5\u7684\u540D\u79F0"},
-        {".sigalg.algorithm.name.of.signature.algorithm",
-                "[-sigalg <\u7B97\u6CD5>]       \u7B7E\u540D\u7B97\u6CD5\u7684\u540D\u79F0"},
-        {".verify.verify.a.signed.JAR.file",
-                "[-verify]                   \u9A8C\u8BC1\u5DF2\u7B7E\u540D\u7684 JAR \u6587\u4EF6"},
-        {".verbose.suboptions.verbose.output.when.signing.verifying.",
-                "[-verbose[:\u5B50\u9009\u9879]]     \u7B7E\u540D/\u9A8C\u8BC1\u65F6\u8F93\u51FA\u8BE6\u7EC6\u4FE1\u606F\u3002"},
-        {".suboptions.can.be.all.grouped.or.summary",
-                "                            \u5B50\u9009\u9879\u53EF\u4EE5\u662F all, grouped \u6216 summary"},
-        {".certs.display.certificates.when.verbose.and.verifying",
-                "[-certs]                    \u8F93\u51FA\u8BE6\u7EC6\u4FE1\u606F\u548C\u9A8C\u8BC1\u65F6\u663E\u793A\u8BC1\u4E66"},
-        {".tsa.url.location.of.the.Timestamping.Authority",
-                "[-tsa <url>]                \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684\u4F4D\u7F6E"},
-        {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
-                "[-tsacert <\u522B\u540D>]           \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684\u516C\u5171\u5BC6\u94A5\u8BC1\u4E66"},
-        {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
-                "[-altsigner <\u7C7B>]           \u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236\u7684\u7C7B\u540D"},
-        {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
-                "[-altsignerpath <\u8DEF\u5F84\u5217\u8868>] \u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236\u7684\u4F4D\u7F6E"},
-        {".internalsf.include.the.SF.file.inside.the.signature.block",
-                "[-internalsf]               \u5728\u7B7E\u540D\u5757\u5185\u5305\u542B .SF \u6587\u4EF6"},
-        {".sectionsonly.don.t.compute.hash.of.entire.manifest",
-                "[-sectionsonly]             \u4E0D\u8BA1\u7B97\u6574\u4E2A\u6E05\u5355\u7684\u6563\u5217"},
-        {".protected.keystore.has.protected.authentication.path",
-                "[-protected]                \u5BC6\u94A5\u5E93\u5177\u6709\u53D7\u4FDD\u62A4\u9A8C\u8BC1\u8DEF\u5F84"},
-        {".providerName.name.provider.name",
-                "[-providerName <\u540D\u79F0>]      \u63D0\u4F9B\u65B9\u540D\u79F0"},
-        {".providerClass.class.name.of.cryptographic.service.provider.s",
-                "[-providerClass <\u7C7B>        \u52A0\u5BC6\u670D\u52A1\u63D0\u4F9B\u65B9\u7684\u540D\u79F0"},
-        {".providerArg.arg.master.class.file.and.constructor.argument",
-                "  [-providerArg <\u53C2\u6570>]]... \u4E3B\u7C7B\u6587\u4EF6\u548C\u6784\u9020\u5668\u53C2\u6570"},
-        {".strict.treat.warnings.as.errors",
-                "[-strict]                   \u5C06\u8B66\u544A\u89C6\u4E3A\u9519\u8BEF"},
-        {"Option.lacks.argument", "\u9009\u9879\u7F3A\u5C11\u53C2\u6570"},
-        {"Please.type.jarsigner.help.for.usage", "\u8BF7\u952E\u5165 jarsigner -help \u4EE5\u4E86\u89E3\u7528\u6CD5"},
-        {"Please.specify.jarfile.name", "\u8BF7\u6307\u5B9A jar \u6587\u4EF6\u7684\u540D\u79F0"},
-        {"Please.specify.alias.name", "\u8BF7\u6307\u5B9A\u522B\u540D"},
-        {"Only.one.alias.can.be.specified", "\u53EA\u80FD\u6307\u5B9A\u4E00\u4E2A\u522B\u540D"},
-        {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
-                 "\u6B64 jar \u5305\u542B\u672A\u7531\u6307\u5B9A\u522B\u540D\u7B7E\u540D\u7684\u5DF2\u7B7E\u540D\u6761\u76EE\u3002"},
-        {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
-                  "\u6B64 jar \u5305\u542B\u672A\u7531\u6B64\u5BC6\u94A5\u5E93\u4E2D\u7684\u522B\u540D\u7B7E\u540D\u7684\u5DF2\u7B7E\u540D\u6761\u76EE\u3002"},
-        {"s", "s"},
-        {"m", "m"},
-        {"k", "k"},
-        {"i", "i"},
-        {".and.d.more.", "(%d \u53CA\u4EE5\u4E0A)"},
-        {".s.signature.was.verified.",
-                "  s = \u5DF2\u9A8C\u8BC1\u7B7E\u540D "},
-        {".m.entry.is.listed.in.manifest",
-                "  m = \u5728\u6E05\u5355\u4E2D\u5217\u51FA\u6761\u76EE"},
-        {".k.at.least.one.certificate.was.found.in.keystore",
-                "  k = \u5728\u5BC6\u94A5\u5E93\u4E2D\u81F3\u5C11\u627E\u5230\u4E86\u4E00\u4E2A\u8BC1\u4E66"},
-        {".i.at.least.one.certificate.was.found.in.identity.scope",
-                "  i = \u5728\u8EAB\u4EFD\u4F5C\u7528\u57DF\u5185\u81F3\u5C11\u627E\u5230\u4E86\u4E00\u4E2A\u8BC1\u4E66"},
-        {".X.not.signed.by.specified.alias.es.",
-                "  X = \u672A\u7531\u6307\u5B9A\u522B\u540D\u7B7E\u540D"},
-        {"no.manifest.", "\u6CA1\u6709\u6E05\u5355\u3002"},
-        {".Signature.related.entries.","(\u4E0E\u7B7E\u540D\u76F8\u5173\u7684\u6761\u76EE)"},
-        {".Unsigned.entries.", "(\u672A\u7B7E\u540D\u6761\u76EE)"},
-        {"jar.is.unsigned.signatures.missing.or.not.parsable.",
-                "jar \u672A\u7B7E\u540D\u3002(\u7F3A\u5C11\u7B7E\u540D\u6216\u65E0\u6CD5\u5BF9\u7B7E\u540D\u8FDB\u884C\u8BED\u6CD5\u5206\u6790)"},
-        {"jar.verified.", "jar \u5DF2\u9A8C\u8BC1\u3002"},
-        {"jarsigner.", "jarsigner: "},
-        {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
-                "\u7B7E\u540D\u6587\u4EF6\u540D\u5FC5\u987B\u5305\u542B\u4EE5\u4E0B\u5B57\u7B26: A-Z, 0-9, _ \u6216 -"},
-        {"unable.to.open.jar.file.", "\u65E0\u6CD5\u6253\u5F00 jar \u6587\u4EF6: "},
-        {"unable.to.create.", "\u65E0\u6CD5\u521B\u5EFA: "},
-        {".adding.", "   \u6B63\u5728\u6DFB\u52A0: "},
-        {".updating.", " \u6B63\u5728\u66F4\u65B0: "},
-        {".signing.", "  \u6B63\u5728\u7B7E\u540D: "},
-        {"attempt.to.rename.signedJarFile.to.jarFile.failed",
-                "\u5C1D\u8BD5\u5C06{0}\u91CD\u547D\u540D\u4E3A{1}\u65F6\u5931\u8D25"},
-        {"attempt.to.rename.jarFile.to.origJar.failed",
-                "\u5C1D\u8BD5\u5C06{0}\u91CD\u547D\u540D\u4E3A{1}\u65F6\u5931\u8D25"},
-        {"unable.to.sign.jar.", "\u65E0\u6CD5\u5BF9 jar \u8FDB\u884C\u7B7E\u540D: "},
-        {"Enter.Passphrase.for.keystore.", "\u8F93\u5165\u5BC6\u94A5\u5E93\u7684\u5BC6\u7801\u77ED\u8BED: "},
-        {"keystore.load.", "\u5BC6\u94A5\u5E93\u52A0\u8F7D: "},
-        {"certificate.exception.", "\u8BC1\u4E66\u5F02\u5E38\u9519\u8BEF: "},
-        {"unable.to.instantiate.keystore.class.",
-                "\u65E0\u6CD5\u5B9E\u4F8B\u5316\u5BC6\u94A5\u5E93\u7C7B: "},
-        {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
-                "\u627E\u4E0D\u5230{0}\u7684\u8BC1\u4E66\u94FE\u3002{1}\u5FC5\u987B\u5F15\u7528\u5305\u542B\u79C1\u6709\u5BC6\u94A5\u548C\u76F8\u5E94\u7684\u516C\u5171\u5BC6\u94A5\u8BC1\u4E66\u94FE\u7684\u6709\u6548 KeyStore \u5BC6\u94A5\u6761\u76EE\u3002"},
-        {"File.specified.by.certchain.does.not.exist",
-                "\u7531 -certchain \u6307\u5B9A\u7684\u6587\u4EF6\u4E0D\u5B58\u5728"},
-        {"Cannot.restore.certchain.from.file.specified",
-                "\u65E0\u6CD5\u4ECE\u6307\u5B9A\u7684\u6587\u4EF6\u8FD8\u539F\u8BC1\u4E66\u94FE"},
-        {"Certificate.chain.not.found.in.the.file.specified.",
-                "\u5728\u6307\u5B9A\u7684\u6587\u4EF6\u4E2D\u627E\u4E0D\u5230\u8BC1\u4E66\u94FE\u3002"},
-        {"found.non.X.509.certificate.in.signer.s.chain",
-                "\u5728\u7B7E\u540D\u8005\u7684\u94FE\u4E2D\u627E\u5230\u975E X.509 \u8BC1\u4E66"},
-        {"incomplete.certificate.chain", "\u8BC1\u4E66\u94FE\u4E0D\u5B8C\u6574"},
-        {"Enter.key.password.for.alias.", "\u8F93\u5165{0}\u7684\u5BC6\u94A5\u53E3\u4EE4: "},
-        {"unable.to.recover.key.from.keystore",
-                "\u65E0\u6CD5\u4ECE\u5BC6\u94A5\u5E93\u4E2D\u6062\u590D\u5BC6\u94A5"},
-        {"key.associated.with.alias.not.a.private.key",
-                "\u4E0E{0}\u5173\u8054\u7684\u5BC6\u94A5\u4E0D\u662F\u79C1\u6709\u5BC6\u94A5"},
-        {"you.must.enter.key.password", "\u5FC5\u987B\u8F93\u5165\u5BC6\u94A5\u53E3\u4EE4"},
-        {"unable.to.read.password.", "\u65E0\u6CD5\u8BFB\u53D6\u53E3\u4EE4: "},
-        {"certificate.is.valid.from", "\u8BC1\u4E66\u7684\u6709\u6548\u671F\u4E3A{0}\u81F3{1}"},
-        {"certificate.expired.on", "\u8BC1\u4E66\u5230\u671F\u65E5\u671F\u4E3A {0}"},
-        {"certificate.is.not.valid.until",
-                "\u76F4\u5230{0}, \u8BC1\u4E66\u624D\u6709\u6548"},
-        {"certificate.will.expire.on", "\u8BC1\u4E66\u5C06\u5728{0}\u5230\u671F"},
-        {".CertPath.not.validated.", "[CertPath \u672A\u9A8C\u8BC1: "},
-        {"requesting.a.signature.timestamp",
-                "\u6B63\u5728\u8BF7\u6C42\u7B7E\u540D\u65F6\u95F4\u6233"},
-        {"TSA.location.", "TSA \u4F4D\u7F6E: "},
-        {"TSA.certificate.", "TSA \u8BC1\u4E66: "},
-        {"no.response.from.the.Timestamping.Authority.",
-                "\u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u6CA1\u6709\u54CD\u5E94\u3002\u5982\u679C\u8981\u4ECE\u9632\u706B\u5899\u540E\u9762\u8FDE\u63A5, \u5219\u53EF\u80FD\u9700\u8981\u6307\u5B9A HTTP \u6216 HTTPS \u4EE3\u7406\u3002\u8BF7\u4E3A jarsigner \u63D0\u4F9B\u4EE5\u4E0B\u9009\u9879: "},
-        {"or", "\u6216"},
-        {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
-                "\u627E\u4E0D\u5230{0}\u7684\u8BC1\u4E66\u3002{1}\u5FC5\u987B\u5F15\u7528\u5305\u542B\u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684 X.509 \u516C\u5171\u5BC6\u94A5\u8BC1\u4E66\u7684\u6709\u6548 KeyStore \u6761\u76EE\u3002"},
-        {"using.an.alternative.signing.mechanism",
-                "\u6B63\u5728\u4F7F\u7528\u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236"},
-        {"entry.was.signed.on", "\u6761\u76EE\u7684\u7B7E\u540D\u65E5\u671F\u4E3A {0}"},
-        {"Warning.", "\u8B66\u544A: "},
-        {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
-                "\u6B64 jar \u5305\u542B\u5C1A\u672A\u8FDB\u884C\u5B8C\u6574\u6027\u68C0\u67E5\u7684\u672A\u7B7E\u540D\u6761\u76EE\u3002 "},
-        {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
-                "\u6B64 jar \u5305\u542B\u7B7E\u540D\u8005\u8BC1\u4E66\u5DF2\u8FC7\u671F\u7684\u6761\u76EE\u3002 "},
-        {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
-                "\u6B64 jar \u5305\u542B\u7B7E\u540D\u8005\u8BC1\u4E66\u5C06\u5728\u516D\u4E2A\u6708\u5185\u8FC7\u671F\u7684\u6761\u76EE\u3002 "},
-        {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
-                "\u6B64 jar \u5305\u542B\u7B7E\u540D\u8005\u8BC1\u4E66\u4ECD\u65E0\u6548\u7684\u6761\u76EE\u3002 "},
-        {"Re.run.with.the.verbose.option.for.more.details.",
-                "\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -verbose \u9009\u9879\u91CD\u65B0\u8FD0\u884C\u3002"},
-        {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
-                "\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -verbose \u548C -certs \u9009\u9879\u91CD\u65B0\u8FD0\u884C\u3002"},
-        {"The.signer.certificate.has.expired.",
-                "\u7B7E\u540D\u8005\u8BC1\u4E66\u5DF2\u8FC7\u671F\u3002"},
-        {"The.signer.certificate.will.expire.within.six.months.",
-                "\u7B7E\u540D\u8005\u8BC1\u4E66\u5C06\u5728\u516D\u4E2A\u6708\u5185\u8FC7\u671F\u3002"},
-        {"The.signer.certificate.is.not.yet.valid.",
-                "\u7B7E\u540D\u8005\u8BC1\u4E66\u4ECD\u65E0\u6548\u3002"},
-        {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 KeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u3002"},
-        {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 ExtendedKeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u3002"},
-        {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
-                 "\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 NetscapeCertType \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u3002"},
-        {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u6B64 jar \u5305\u542B\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 KeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u7684\u6761\u76EE\u3002"},
-        {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
-                 "\u6B64 jar \u5305\u542B\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 ExtendedKeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u7684\u6761\u76EE\u3002"},
-        {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
-                 "\u6B64 jar \u5305\u542B\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 NetscapeCertType \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u7684\u6761\u76EE\u3002"},
-        {".{0}.extension.does.not.support.code.signing.",
-                 "[{0} \u6269\u5C55\u4E0D\u652F\u6301\u4EE3\u7801\u7B7E\u540D]"},
-        {"The.signer.s.certificate.chain.is.not.validated.",
-                "\u7B7E\u540D\u8005\u7684\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1\u3002"},
-        {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
-                 "\u6B64 jar \u5305\u542B\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1\u7684\u6761\u76EE\u3002"},
-    };
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/src/share/classes/sun/security/tools/KeyStoreUtil.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/tools/KeyStoreUtil.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,18 @@
 
 package sun.security.tools;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import java.net.URL;
+
+import java.security.KeyStore;
+
+import java.text.Collator;
+
 import java.util.Locale;
 
 /**
@@ -34,18 +46,17 @@
  */
 public class KeyStoreUtil {
 
-    // Class and methods marked as public so that they can be
-    // accessed by JarSigner, which although lies in a package
-    // with the same name, but bundled in tools.jar and loaded
-    // by another class loader, hence in a different *runtime*
-    // package.
-    //
-    // See JVM Spec, 5.3 and 5.4.4
-
     private KeyStoreUtil() {
         // this class is not meant to be instantiated
     }
 
+    private static final String JKS = "jks";
+
+    private static final Collator collator = Collator.getInstance();
+    static {
+        // this is for case insensitive string comparisons
+        collator.setStrength(Collator.PRIMARY);
+    };
 
     /**
      * Returns true if KeyStore has a password. This is true except for
@@ -68,4 +79,76 @@
             return storetype.toUpperCase(Locale.ENGLISH);
         }
     }
+
+    /**
+     * Returns the keystore with the configured CA certificates.
+     */
+    public static KeyStore getCacertsKeyStore()
+        throws Exception
+    {
+        String sep = File.separator;
+        File file = new File(System.getProperty("java.home") + sep
+                             + "lib" + sep + "security" + sep
+                             + "cacerts");
+        if (!file.exists()) {
+            return null;
+        }
+        KeyStore caks = null;
+        try (FileInputStream fis = new FileInputStream(file)) {
+            caks = KeyStore.getInstance(JKS);
+            caks.load(fis, null);
+        }
+        return caks;
+    }
+
+    public static char[] getPassWithModifier(String modifier, String arg,
+                                             java.util.ResourceBundle rb) {
+        if (modifier == null) {
+            return arg.toCharArray();
+        } else if (collator.compare(modifier, "env") == 0) {
+            String value = System.getenv(arg);
+            if (value == null) {
+                System.err.println(rb.getString(
+                        "Cannot.find.environment.variable.") + arg);
+                return null;
+            } else {
+                return value.toCharArray();
+            }
+        } else if (collator.compare(modifier, "file") == 0) {
+            try {
+                URL url = null;
+                try {
+                    url = new URL(arg);
+                } catch (java.net.MalformedURLException mue) {
+                    File f = new File(arg);
+                    if (f.exists()) {
+                        url = f.toURI().toURL();
+                    } else {
+                        System.err.println(rb.getString(
+                                "Cannot.find.file.") + arg);
+                        return null;
+                    }
+                }
+
+                try (BufferedReader br =
+                     new BufferedReader(new InputStreamReader(
+                         url.openStream()))) {
+                    String value = br.readLine();
+
+                    if (value == null) {
+                        return new char[0];
+                    }
+
+                    return value.toCharArray();
+                }
+            } catch (IOException ioe) {
+                System.err.println(ioe);
+                return null;
+            }
+        } else {
+            System.err.println(rb.getString("Unknown.password.type.") +
+                    modifier);
+            return null;
+        }
+    }
 }
--- a/src/share/classes/sun/security/tools/KeyTool.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4147 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-import java.io.*;
-import java.security.CodeSigner;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.MessageDigest;
-import java.security.Key;
-import java.security.PublicKey;
-import java.security.PrivateKey;
-import java.security.Security;
-import java.security.Signature;
-import java.security.Timestamp;
-import java.security.UnrecoverableEntryException;
-import java.security.UnrecoverableKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Principal;
-import java.security.Provider;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateFactory;
-import java.security.cert.CertStoreException;
-import java.security.cert.CRL;
-import java.security.cert.X509Certificate;
-import java.security.cert.CertificateException;
-import java.text.Collator;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.lang.reflect.Constructor;
-import java.math.BigInteger;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.cert.CertStore;
-
-import java.security.cert.X509CRL;
-import java.security.cert.X509CRLEntry;
-import java.security.cert.X509CRLSelector;
-import javax.security.auth.x500.X500Principal;
-import sun.misc.BASE64Encoder;
-import sun.security.util.ObjectIdentifier;
-import sun.security.pkcs10.PKCS10;
-import sun.security.pkcs10.PKCS10Attribute;
-import sun.security.provider.X509Factory;
-import sun.security.provider.certpath.CertStoreHelper;
-import sun.security.util.Password;
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-
-import sun.misc.BASE64Decoder;
-import sun.security.pkcs.PKCS9Attribute;
-import sun.security.util.DerValue;
-import sun.security.x509.*;
-
-import static java.security.KeyStore.*;
-import static sun.security.tools.KeyTool.Command.*;
-import static sun.security.tools.KeyTool.Option.*;
-
-/**
- * This tool manages keystores.
- *
- * @author Jan Luehe
- *
- *
- * @see java.security.KeyStore
- * @see sun.security.provider.KeyProtector
- * @see sun.security.provider.JavaKeyStore
- *
- * @since 1.2
- */
-public final class KeyTool {
-
-    private boolean debug = false;
-    private Command command = null;
-    private String sigAlgName = null;
-    private String keyAlgName = null;
-    private boolean verbose = false;
-    private int keysize = -1;
-    private boolean rfc = false;
-    private long validity = (long)90;
-    private String alias = null;
-    private String dname = null;
-    private String dest = null;
-    private String filename = null;
-    private String infilename = null;
-    private String outfilename = null;
-    private String srcksfname = null;
-
-    // User-specified providers are added before any command is called.
-    // However, they are not removed before the end of the main() method.
-    // If you're calling KeyTool.main() directly in your own Java program,
-    // please programtically add any providers you need and do not specify
-    // them through the command line.
-
-    private Set<Pair <String, String>> providers = null;
-    private String storetype = null;
-    private String srcProviderName = null;
-    private String providerName = null;
-    private String pathlist = null;
-    private char[] storePass = null;
-    private char[] storePassNew = null;
-    private char[] keyPass = null;
-    private char[] keyPassNew = null;
-    private char[] newPass = null;
-    private char[] destKeyPass = null;
-    private char[] srckeyPass = null;
-    private String ksfname = null;
-    private File ksfile = null;
-    private InputStream ksStream = null; // keystore stream
-    private String sslserver = null;
-    private String jarfile = null;
-    private KeyStore keyStore = null;
-    private boolean token = false;
-    private boolean nullStream = false;
-    private boolean kssave = false;
-    private boolean noprompt = false;
-    private boolean trustcacerts = false;
-    private boolean protectedPath = false;
-    private boolean srcprotectedPath = false;
-    private CertificateFactory cf = null;
-    private KeyStore caks = null; // "cacerts" keystore
-    private char[] srcstorePass = null;
-    private String srcstoretype = null;
-    private Set<char[]> passwords = new HashSet<>();
-    private String startDate = null;
-
-    private List<String> ids = new ArrayList<>();   // used in GENCRL
-    private List<String> v3ext = new ArrayList<>();
-
-    enum Command {
-        CERTREQ("Generates.a.certificate.request",
-            ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME,
-            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
-            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
-        CHANGEALIAS("Changes.an.entry.s.alias",
-            ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS,
-            STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
-            PROVIDERPATH, V, PROTECTED),
-        DELETE("Deletes.an.entry",
-            ALIAS, KEYSTORE, STOREPASS, STORETYPE,
-            PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
-            PROVIDERPATH, V, PROTECTED),
-        EXPORTCERT("Exports.certificate",
-            RFC, ALIAS, FILEOUT, KEYSTORE, STOREPASS,
-            STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
-            PROVIDERPATH, V, PROTECTED),
-        GENKEYPAIR("Generates.a.key.pair",
-            ALIAS, KEYALG, KEYSIZE, SIGALG, DESTALIAS, DNAME,
-            STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE,
-            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
-            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
-        GENSECKEY("Generates.a.secret.key",
-            ALIAS, KEYPASS, KEYALG, KEYSIZE, KEYSTORE,
-            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
-            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
-        GENCERT("Generates.certificate.from.a.certificate.request",
-            RFC, INFILE, OUTFILE, ALIAS, SIGALG, DNAME,
-            STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE,
-            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
-            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
-        IMPORTCERT("Imports.a.certificate.or.a.certificate.chain",
-            NOPROMPT, TRUSTCACERTS, PROTECTED, ALIAS, FILEIN,
-            KEYPASS, KEYSTORE, STOREPASS, STORETYPE,
-            PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
-            PROVIDERPATH, V),
-        IMPORTKEYSTORE("Imports.one.or.all.entries.from.another.keystore",
-            SRCKEYSTORE, DESTKEYSTORE, SRCSTORETYPE,
-            DESTSTORETYPE, SRCSTOREPASS, DESTSTOREPASS,
-            SRCPROTECTED, SRCPROVIDERNAME, DESTPROVIDERNAME,
-            SRCALIAS, DESTALIAS, SRCKEYPASS, DESTKEYPASS,
-            NOPROMPT, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH,
-            V),
-        KEYPASSWD("Changes.the.key.password.of.an.entry",
-            ALIAS, KEYPASS, NEW, KEYSTORE, STOREPASS,
-            STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
-            PROVIDERPATH, V),
-        LIST("Lists.entries.in.a.keystore",
-            RFC, ALIAS, KEYSTORE, STOREPASS, STORETYPE,
-            PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
-            PROVIDERPATH, V, PROTECTED),
-        PRINTCERT("Prints.the.content.of.a.certificate",
-            RFC, FILEIN, SSLSERVER, JARFILE, V),
-        PRINTCERTREQ("Prints.the.content.of.a.certificate.request",
-            FILEIN, V),
-        PRINTCRL("Prints.the.content.of.a.CRL.file",
-            FILEIN, V),
-        STOREPASSWD("Changes.the.store.password.of.a.keystore",
-            NEW, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME,
-            PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V),
-
-        // Undocumented start here, KEYCLONE is used a marker in -help;
-
-        KEYCLONE("Clones.a.key.entry",
-            ALIAS, DESTALIAS, KEYPASS, NEW, STORETYPE,
-            KEYSTORE, STOREPASS, PROVIDERNAME, PROVIDERCLASS,
-            PROVIDERARG, PROVIDERPATH, V),
-        SELFCERT("Generates.a.self.signed.certificate",
-            ALIAS, SIGALG, DNAME, STARTDATE, VALIDITY, KEYPASS,
-            STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME,
-            PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V),
-        GENCRL("Generates.CRL",
-            RFC, FILEOUT, ID,
-            ALIAS, SIGALG, EXT, KEYPASS, KEYSTORE,
-            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
-            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
-        IDENTITYDB("Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-            FILEIN, STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME,
-            PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V);
-
-        final String description;
-        final Option[] options;
-        Command(String d, Option... o) {
-            description = d;
-            options = o;
-        }
-        @Override
-        public String toString() {
-            return "-" + name().toLowerCase(Locale.ENGLISH);
-        }
-    };
-
-    enum Option {
-        ALIAS("alias", "<alias>", "alias.name.of.the.entry.to.process"),
-        DESTALIAS("destalias", "<destalias>", "destination.alias"),
-        DESTKEYPASS("destkeypass", "<arg>", "destination.key.password"),
-        DESTKEYSTORE("destkeystore", "<destkeystore>", "destination.keystore.name"),
-        DESTPROTECTED("destprotected", null, "destination.keystore.password.protected"),
-        DESTPROVIDERNAME("destprovidername", "<destprovidername>", "destination.keystore.provider.name"),
-        DESTSTOREPASS("deststorepass", "<arg>", "destination.keystore.password"),
-        DESTSTORETYPE("deststoretype", "<deststoretype>", "destination.keystore.type"),
-        DNAME("dname", "<dname>", "distinguished.name"),
-        EXT("ext", "<value>", "X.509.extension"),
-        FILEOUT("file", "<filename>", "output.file.name"),
-        FILEIN("file", "<filename>", "input.file.name"),
-        ID("id", "<id:reason>", "Serial.ID.of.cert.to.revoke"),
-        INFILE("infile", "<filename>", "input.file.name"),
-        KEYALG("keyalg", "<keyalg>", "key.algorithm.name"),
-        KEYPASS("keypass", "<arg>", "key.password"),
-        KEYSIZE("keysize", "<keysize>", "key.bit.size"),
-        KEYSTORE("keystore", "<keystore>", "keystore.name"),
-        NEW("new", "<arg>", "new.password"),
-        NOPROMPT("noprompt", null, "do.not.prompt"),
-        OUTFILE("outfile", "<filename>", "output.file.name"),
-        PROTECTED("protected", null, "password.through.protected.mechanism"),
-        PROVIDERARG("providerarg", "<arg>", "provider.argument"),
-        PROVIDERCLASS("providerclass", "<providerclass>", "provider.class.name"),
-        PROVIDERNAME("providername", "<providername>", "provider.name"),
-        PROVIDERPATH("providerpath", "<pathlist>", "provider.classpath"),
-        RFC("rfc", null, "output.in.RFC.style"),
-        SIGALG("sigalg", "<sigalg>", "signature.algorithm.name"),
-        SRCALIAS("srcalias", "<srcalias>", "source.alias"),
-        SRCKEYPASS("srckeypass", "<arg>", "source.key.password"),
-        SRCKEYSTORE("srckeystore", "<srckeystore>", "source.keystore.name"),
-        SRCPROTECTED("srcprotected", null, "source.keystore.password.protected"),
-        SRCPROVIDERNAME("srcprovidername", "<srcprovidername>", "source.keystore.provider.name"),
-        SRCSTOREPASS("srcstorepass", "<arg>", "source.keystore.password"),
-        SRCSTORETYPE("srcstoretype", "<srcstoretype>", "source.keystore.type"),
-        SSLSERVER("sslserver", "<server[:port]>", "SSL.server.host.and.port"),
-        JARFILE("jarfile", "<filename>", "signed.jar.file"),
-        STARTDATE("startdate", "<startdate>", "certificate.validity.start.date.time"),
-        STOREPASS("storepass", "<arg>", "keystore.password"),
-        STORETYPE("storetype", "<storetype>", "keystore.type"),
-        TRUSTCACERTS("trustcacerts", null, "trust.certificates.from.cacerts"),
-        V("v", null, "verbose.output"),
-        VALIDITY("validity", "<valDays>", "validity.number.of.days");
-
-        final String name, arg, description;
-        Option(String name, String arg, String description) {
-            this.name = name;
-            this.arg = arg;
-            this.description = description;
-        }
-        @Override
-        public String toString() {
-            return "-" + name;
-        }
-    };
-
-    private static final Class[] PARAM_STRING = { String.class };
-
-    private static final String JKS = "jks";
-    private static final String NONE = "NONE";
-    private static final String P11KEYSTORE = "PKCS11";
-    private static final String P12KEYSTORE = "PKCS12";
-    private final String keyAlias = "mykey";
-
-    // for i18n
-    private static final java.util.ResourceBundle rb =
-        java.util.ResourceBundle.getBundle("sun.security.util.Resources");
-    private static final Collator collator = Collator.getInstance();
-    static {
-        // this is for case insensitive string comparisons
-        collator.setStrength(Collator.PRIMARY);
-    };
-
-    private KeyTool() { }
-
-    public static void main(String[] args) throws Exception {
-        KeyTool kt = new KeyTool();
-        kt.run(args, System.out);
-    }
-
-    private void run(String[] args, PrintStream out) throws Exception {
-        try {
-            parseArgs(args);
-            if (command != null) {
-                doCommands(out);
-            }
-        } catch (Exception e) {
-            System.out.println(rb.getString("keytool.error.") + e);
-            if (verbose) {
-                e.printStackTrace(System.out);
-            }
-            if (!debug) {
-                System.exit(1);
-            } else {
-                throw e;
-            }
-        } finally {
-            for (char[] pass : passwords) {
-                if (pass != null) {
-                    Arrays.fill(pass, ' ');
-                    pass = null;
-                }
-            }
-
-            if (ksStream != null) {
-                ksStream.close();
-            }
-        }
-    }
-
-    /**
-     * Parse command line arguments.
-     */
-    void parseArgs(String[] args) {
-
-        int i=0;
-        boolean help = args.length == 0;
-
-        for (i=0; (i < args.length) && args[i].startsWith("-"); i++) {
-
-            String flags = args[i];
-
-            // Check if the last option needs an arg
-            if (i == args.length - 1) {
-                for (Option option: Option.values()) {
-                    // Only options with an arg need to be checked
-                    if (collator.compare(flags, option.toString()) == 0) {
-                        if (option.arg != null) errorNeedArgument(flags);
-                        break;
-                    }
-                }
-            }
-
-            /*
-             * Check modifiers
-             */
-            String modifier = null;
-            int pos = flags.indexOf(':');
-            if (pos > 0) {
-                modifier = flags.substring(pos+1);
-                flags = flags.substring(0, pos);
-            }
-            /*
-             * command modes
-             */
-            boolean isCommand = false;
-            for (Command c: Command.values()) {
-                if (collator.compare(flags, c.toString()) == 0) {
-                    command = c;
-                    isCommand = true;
-                    break;
-                }
-            }
-
-            if (isCommand) {
-                // already recognized as a command
-            } else if (collator.compare(flags, "-export") == 0) {
-                command = EXPORTCERT;
-            } else if (collator.compare(flags, "-genkey") == 0) {
-                command = GENKEYPAIR;
-            } else if (collator.compare(flags, "-import") == 0) {
-                command = IMPORTCERT;
-            }
-            /*
-             * Help
-             */
-            else if (collator.compare(flags, "-help") == 0) {
-                help = true;
-            }
-
-            /*
-             * specifiers
-             */
-            else if (collator.compare(flags, "-keystore") == 0 ||
-                    collator.compare(flags, "-destkeystore") == 0) {
-                ksfname = args[++i];
-            } else if (collator.compare(flags, "-storepass") == 0 ||
-                    collator.compare(flags, "-deststorepass") == 0) {
-                storePass = getPass(modifier, args[++i]);
-                passwords.add(storePass);
-            } else if (collator.compare(flags, "-storetype") == 0 ||
-                    collator.compare(flags, "-deststoretype") == 0) {
-                storetype = args[++i];
-            } else if (collator.compare(flags, "-srcstorepass") == 0) {
-                srcstorePass = getPass(modifier, args[++i]);
-                passwords.add(srcstorePass);
-            } else if (collator.compare(flags, "-srcstoretype") == 0) {
-                srcstoretype = args[++i];
-            } else if (collator.compare(flags, "-srckeypass") == 0) {
-                srckeyPass = getPass(modifier, args[++i]);
-                passwords.add(srckeyPass);
-            } else if (collator.compare(flags, "-srcprovidername") == 0) {
-                srcProviderName = args[++i];
-            } else if (collator.compare(flags, "-providername") == 0 ||
-                    collator.compare(flags, "-destprovidername") == 0) {
-                providerName = args[++i];
-            } else if (collator.compare(flags, "-providerpath") == 0) {
-                pathlist = args[++i];
-            } else if (collator.compare(flags, "-keypass") == 0) {
-                keyPass = getPass(modifier, args[++i]);
-                passwords.add(keyPass);
-            } else if (collator.compare(flags, "-new") == 0) {
-                newPass = getPass(modifier, args[++i]);
-                passwords.add(newPass);
-            } else if (collator.compare(flags, "-destkeypass") == 0) {
-                destKeyPass = getPass(modifier, args[++i]);
-                passwords.add(destKeyPass);
-            } else if (collator.compare(flags, "-alias") == 0 ||
-                    collator.compare(flags, "-srcalias") == 0) {
-                alias = args[++i];
-            } else if (collator.compare(flags, "-dest") == 0 ||
-                    collator.compare(flags, "-destalias") == 0) {
-                dest = args[++i];
-            } else if (collator.compare(flags, "-dname") == 0) {
-                dname = args[++i];
-            } else if (collator.compare(flags, "-keysize") == 0) {
-                keysize = Integer.parseInt(args[++i]);
-            } else if (collator.compare(flags, "-keyalg") == 0) {
-                keyAlgName = args[++i];
-            } else if (collator.compare(flags, "-sigalg") == 0) {
-                sigAlgName = args[++i];
-            } else if (collator.compare(flags, "-startdate") == 0) {
-                startDate = args[++i];
-            } else if (collator.compare(flags, "-validity") == 0) {
-                validity = Long.parseLong(args[++i]);
-            } else if (collator.compare(flags, "-ext") == 0) {
-                v3ext.add(args[++i]);
-            } else if (collator.compare(flags, "-id") == 0) {
-                ids.add(args[++i]);
-            } else if (collator.compare(flags, "-file") == 0) {
-                filename = args[++i];
-            } else if (collator.compare(flags, "-infile") == 0) {
-                infilename = args[++i];
-            } else if (collator.compare(flags, "-outfile") == 0) {
-                outfilename = args[++i];
-            } else if (collator.compare(flags, "-sslserver") == 0) {
-                sslserver = args[++i];
-            } else if (collator.compare(flags, "-jarfile") == 0) {
-                jarfile = args[++i];
-            } else if (collator.compare(flags, "-srckeystore") == 0) {
-                srcksfname = args[++i];
-            } else if ((collator.compare(flags, "-provider") == 0) ||
-                        (collator.compare(flags, "-providerclass") == 0)) {
-                if (providers == null) {
-                    providers = new HashSet<Pair <String, String>> (3);
-                }
-                String providerClass = args[++i];
-                String providerArg = null;
-
-                if (args.length > (i+1)) {
-                    flags = args[i+1];
-                    if (collator.compare(flags, "-providerarg") == 0) {
-                        if (args.length == (i+2)) errorNeedArgument(flags);
-                        providerArg = args[i+2];
-                        i += 2;
-                    }
-                }
-                providers.add(
-                        Pair.of(providerClass, providerArg));
-            }
-
-            /*
-             * options
-             */
-            else if (collator.compare(flags, "-v") == 0) {
-                verbose = true;
-            } else if (collator.compare(flags, "-debug") == 0) {
-                debug = true;
-            } else if (collator.compare(flags, "-rfc") == 0) {
-                rfc = true;
-            } else if (collator.compare(flags, "-noprompt") == 0) {
-                noprompt = true;
-            } else if (collator.compare(flags, "-trustcacerts") == 0) {
-                trustcacerts = true;
-            } else if (collator.compare(flags, "-protected") == 0 ||
-                    collator.compare(flags, "-destprotected") == 0) {
-                protectedPath = true;
-            } else if (collator.compare(flags, "-srcprotected") == 0) {
-                srcprotectedPath = true;
-            } else  {
-                System.err.println(rb.getString("Illegal.option.") + flags);
-                tinyHelp();
-            }
-        }
-
-        if (i<args.length) {
-            System.err.println(rb.getString("Illegal.option.") + args[i]);
-            tinyHelp();
-        }
-
-        if (command == null) {
-            if (help) {
-                usage();
-            } else {
-                System.err.println(rb.getString("Usage.error.no.command.provided"));
-                tinyHelp();
-            }
-        } else if (help) {
-            usage();
-            command = null;
-        }
-    }
-
-    boolean isKeyStoreRelated(Command cmd) {
-        return cmd != PRINTCERT && cmd != PRINTCERTREQ;
-    }
-
-    /**
-     * Execute the commands.
-     */
-    void doCommands(PrintStream out) throws Exception {
-
-        if (storetype == null) {
-            storetype = KeyStore.getDefaultType();
-        }
-        storetype = KeyStoreUtil.niceStoreTypeName(storetype);
-
-        if (srcstoretype == null) {
-            srcstoretype = KeyStore.getDefaultType();
-        }
-        srcstoretype = KeyStoreUtil.niceStoreTypeName(srcstoretype);
-
-        if (P11KEYSTORE.equalsIgnoreCase(storetype) ||
-                KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            token = true;
-            if (ksfname == null) {
-                ksfname = NONE;
-            }
-        }
-        if (NONE.equals(ksfname)) {
-            nullStream = true;
-        }
-
-        if (token && !nullStream) {
-            System.err.println(MessageFormat.format(rb.getString
-                (".keystore.must.be.NONE.if.storetype.is.{0}"), storetype));
-            System.err.println();
-            tinyHelp();
-        }
-
-        if (token &&
-            (command == KEYPASSWD || command == STOREPASSWD)) {
-            throw new UnsupportedOperationException(MessageFormat.format(rb.getString
-                        (".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}"), storetype));
-        }
-
-        if (P12KEYSTORE.equalsIgnoreCase(storetype) && command == KEYPASSWD) {
-            throw new UnsupportedOperationException(rb.getString
-                        (".keypasswd.commands.not.supported.if.storetype.is.PKCS12"));
-        }
-
-        if (token && (keyPass != null || newPass != null || destKeyPass != null)) {
-            throw new IllegalArgumentException(MessageFormat.format(rb.getString
-                (".keypass.and.new.can.not.be.specified.if.storetype.is.{0}"), storetype));
-        }
-
-        if (protectedPath) {
-            if (storePass != null || keyPass != null ||
-                    newPass != null || destKeyPass != null) {
-                throw new IllegalArgumentException(rb.getString
-                        ("if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified"));
-            }
-        }
-
-        if (srcprotectedPath) {
-            if (srcstorePass != null || srckeyPass != null) {
-                throw new IllegalArgumentException(rb.getString
-                        ("if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified"));
-            }
-        }
-
-        if (KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            if (storePass != null || keyPass != null ||
-                    newPass != null || destKeyPass != null) {
-                throw new IllegalArgumentException(rb.getString
-                        ("if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified"));
-            }
-        }
-
-        if (KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
-            if (srcstorePass != null || srckeyPass != null) {
-                throw new IllegalArgumentException(rb.getString
-                        ("if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified"));
-            }
-        }
-
-        if (validity <= (long)0) {
-            throw new Exception
-                (rb.getString("Validity.must.be.greater.than.zero"));
-        }
-
-        // Try to load and install specified provider
-        if (providers != null) {
-            ClassLoader cl = null;
-            if (pathlist != null) {
-                String path = null;
-                path = PathList.appendPath(
-                        path, System.getProperty("java.class.path"));
-                path = PathList.appendPath(
-                        path, System.getProperty("env.class.path"));
-                path = PathList.appendPath(path, pathlist);
-
-                URL[] urls = PathList.pathToURLs(path);
-                cl = new URLClassLoader(urls);
-            } else {
-                cl = ClassLoader.getSystemClassLoader();
-            }
-
-            for (Pair <String, String> provider: providers) {
-                String provName = provider.fst;
-                Class<?> provClass;
-                if (cl != null) {
-                    provClass = cl.loadClass(provName);
-                } else {
-                    provClass = Class.forName(provName);
-                }
-
-                String provArg = provider.snd;
-                Object obj;
-                if (provArg == null) {
-                    obj = provClass.newInstance();
-                } else {
-                    Constructor<?> c = provClass.getConstructor(PARAM_STRING);
-                    obj = c.newInstance(provArg);
-                }
-                if (!(obj instanceof Provider)) {
-                    MessageFormat form = new MessageFormat
-                        (rb.getString("provName.not.a.provider"));
-                    Object[] source = {provName};
-                    throw new Exception(form.format(source));
-                }
-                Security.addProvider((Provider)obj);
-            }
-        }
-
-        if (command == LIST && verbose && rfc) {
-            System.err.println(rb.getString
-                ("Must.not.specify.both.v.and.rfc.with.list.command"));
-            tinyHelp();
-        }
-
-        // Make sure provided passwords are at least 6 characters long
-        if (command == GENKEYPAIR && keyPass!=null && keyPass.length < 6) {
-            throw new Exception(rb.getString
-                ("Key.password.must.be.at.least.6.characters"));
-        }
-        if (newPass != null && newPass.length < 6) {
-            throw new Exception(rb.getString
-                ("New.password.must.be.at.least.6.characters"));
-        }
-        if (destKeyPass != null && destKeyPass.length < 6) {
-            throw new Exception(rb.getString
-                ("New.password.must.be.at.least.6.characters"));
-        }
-
-        // Check if keystore exists.
-        // If no keystore has been specified at the command line, try to use
-        // the default, which is located in $HOME/.keystore.
-        // If the command is "genkey", "identitydb", "import", or "printcert",
-        // it is OK not to have a keystore.
-        if (isKeyStoreRelated(command)) {
-            if (ksfname == null) {
-                ksfname = System.getProperty("user.home") + File.separator
-                    + ".keystore";
-            }
-
-            if (!nullStream) {
-                try {
-                    ksfile = new File(ksfname);
-                    // Check if keystore file is empty
-                    if (ksfile.exists() && ksfile.length() == 0) {
-                        throw new Exception(rb.getString
-                        ("Keystore.file.exists.but.is.empty.") + ksfname);
-                    }
-                    ksStream = new FileInputStream(ksfile);
-                } catch (FileNotFoundException e) {
-                    if (command != GENKEYPAIR &&
-                        command != GENSECKEY &&
-                        command != IDENTITYDB &&
-                        command != IMPORTCERT &&
-                        command != IMPORTKEYSTORE &&
-                        command != PRINTCRL) {
-                        throw new Exception(rb.getString
-                                ("Keystore.file.does.not.exist.") + ksfname);
-                    }
-                }
-            }
-        }
-
-        if ((command == KEYCLONE || command == CHANGEALIAS)
-                && dest == null) {
-            dest = getAlias("destination");
-            if ("".equals(dest)) {
-                throw new Exception(rb.getString
-                        ("Must.specify.destination.alias"));
-            }
-        }
-
-        if (command == DELETE && alias == null) {
-            alias = getAlias(null);
-            if ("".equals(alias)) {
-                throw new Exception(rb.getString("Must.specify.alias"));
-            }
-        }
-
-        // Create new keystore
-        if (providerName == null) {
-            keyStore = KeyStore.getInstance(storetype);
-        } else {
-            keyStore = KeyStore.getInstance(storetype, providerName);
-        }
-
-        /*
-         * Load the keystore data.
-         *
-         * At this point, it's OK if no keystore password has been provided.
-         * We want to make sure that we can load the keystore data, i.e.,
-         * the keystore data has the right format. If we cannot load the
-         * keystore, why bother asking the user for his or her password?
-         * Only if we were able to load the keystore, and no keystore
-         * password has been provided, will we prompt the user for the
-         * keystore password to verify the keystore integrity.
-         * This means that the keystore is loaded twice: first load operation
-         * checks the keystore format, second load operation verifies the
-         * keystore integrity.
-         *
-         * If the keystore password has already been provided (at the
-         * command line), however, the keystore is loaded only once, and the
-         * keystore format and integrity are checked "at the same time".
-         *
-         * Null stream keystores are loaded later.
-         */
-        if (!nullStream) {
-            keyStore.load(ksStream, storePass);
-            if (ksStream != null) {
-                ksStream.close();
-            }
-        }
-
-        // All commands that create or modify the keystore require a keystore
-        // password.
-
-        if (nullStream && storePass != null) {
-            keyStore.load(null, storePass);
-        } else if (!nullStream && storePass != null) {
-            // If we are creating a new non nullStream-based keystore,
-            // insist that the password be at least 6 characters
-            if (ksStream == null && storePass.length < 6) {
-                throw new Exception(rb.getString
-                        ("Keystore.password.must.be.at.least.6.characters"));
-            }
-        } else if (storePass == null) {
-
-            // only prompt if (protectedPath == false)
-
-            if (!protectedPath && !KeyStoreUtil.isWindowsKeyStore(storetype) &&
-                (command == CERTREQ ||
-                        command == DELETE ||
-                        command == GENKEYPAIR ||
-                        command == GENSECKEY ||
-                        command == IMPORTCERT ||
-                        command == IMPORTKEYSTORE ||
-                        command == KEYCLONE ||
-                        command == CHANGEALIAS ||
-                        command == SELFCERT ||
-                        command == STOREPASSWD ||
-                        command == KEYPASSWD ||
-                        command == IDENTITYDB)) {
-                int count = 0;
-                do {
-                    if (command == IMPORTKEYSTORE) {
-                        System.err.print
-                                (rb.getString("Enter.destination.keystore.password."));
-                    } else {
-                        System.err.print
-                                (rb.getString("Enter.keystore.password."));
-                    }
-                    System.err.flush();
-                    storePass = Password.readPassword(System.in);
-                    passwords.add(storePass);
-
-                    // If we are creating a new non nullStream-based keystore,
-                    // insist that the password be at least 6 characters
-                    if (!nullStream && (storePass == null || storePass.length < 6)) {
-                        System.err.println(rb.getString
-                                ("Keystore.password.is.too.short.must.be.at.least.6.characters"));
-                        storePass = null;
-                    }
-
-                    // If the keystore file does not exist and needs to be
-                    // created, the storepass should be prompted twice.
-                    if (storePass != null && !nullStream && ksStream == null) {
-                        System.err.print(rb.getString("Re.enter.new.password."));
-                        char[] storePassAgain = Password.readPassword(System.in);
-                        passwords.add(storePassAgain);
-                        if (!Arrays.equals(storePass, storePassAgain)) {
-                            System.err.println
-                                (rb.getString("They.don.t.match.Try.again"));
-                            storePass = null;
-                        }
-                    }
-
-                    count++;
-                } while ((storePass == null) && count < 3);
-
-
-                if (storePass == null) {
-                    System.err.println
-                        (rb.getString("Too.many.failures.try.later"));
-                    return;
-                }
-            } else if (!protectedPath
-                    && !KeyStoreUtil.isWindowsKeyStore(storetype)
-                    && isKeyStoreRelated(command)) {
-                // here we have EXPORTCERT and LIST (info valid until STOREPASSWD)
-                if (command != PRINTCRL) {
-                    System.err.print(rb.getString("Enter.keystore.password."));
-                    System.err.flush();
-                    storePass = Password.readPassword(System.in);
-                    passwords.add(storePass);
-                }
-            }
-
-            // Now load a nullStream-based keystore,
-            // or verify the integrity of an input stream-based keystore
-            if (nullStream) {
-                keyStore.load(null, storePass);
-            } else if (ksStream != null) {
-                ksStream = new FileInputStream(ksfile);
-                keyStore.load(ksStream, storePass);
-                ksStream.close();
-            }
-        }
-
-        if (storePass != null && P12KEYSTORE.equalsIgnoreCase(storetype)) {
-            MessageFormat form = new MessageFormat(rb.getString(
-                "Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value."));
-            if (keyPass != null && !Arrays.equals(storePass, keyPass)) {
-                Object[] source = {"-keypass"};
-                System.err.println(form.format(source));
-                keyPass = storePass;
-            }
-            if (newPass != null && !Arrays.equals(storePass, newPass)) {
-                Object[] source = {"-new"};
-                System.err.println(form.format(source));
-                newPass = storePass;
-            }
-            if (destKeyPass != null && !Arrays.equals(storePass, destKeyPass)) {
-                Object[] source = {"-destkeypass"};
-                System.err.println(form.format(source));
-                destKeyPass = storePass;
-            }
-        }
-
-        // Create a certificate factory
-        if (command == PRINTCERT || command == IMPORTCERT
-                || command == IDENTITYDB || command == PRINTCRL) {
-            cf = CertificateFactory.getInstance("X509");
-        }
-
-        if (trustcacerts) {
-            caks = getCacertsKeyStore();
-        }
-
-        // Perform the specified command
-        if (command == CERTREQ) {
-            if (filename != null) {
-                try (PrintStream ps = new PrintStream(new FileOutputStream
-                                                      (filename))) {
-                    doCertReq(alias, sigAlgName, ps);
-                }
-            } else {
-                doCertReq(alias, sigAlgName, out);
-            }
-            if (verbose && filename != null) {
-                MessageFormat form = new MessageFormat(rb.getString
-                        ("Certification.request.stored.in.file.filename."));
-                Object[] source = {filename};
-                System.err.println(form.format(source));
-                System.err.println(rb.getString("Submit.this.to.your.CA"));
-            }
-        } else if (command == DELETE) {
-            doDeleteEntry(alias);
-            kssave = true;
-        } else if (command == EXPORTCERT) {
-            if (filename != null) {
-                try (PrintStream ps = new PrintStream(new FileOutputStream
-                                                   (filename))) {
-                    doExportCert(alias, ps);
-                }
-            } else {
-                doExportCert(alias, out);
-            }
-            if (filename != null) {
-                MessageFormat form = new MessageFormat(rb.getString
-                        ("Certificate.stored.in.file.filename."));
-                Object[] source = {filename};
-                System.err.println(form.format(source));
-            }
-        } else if (command == GENKEYPAIR) {
-            if (keyAlgName == null) {
-                keyAlgName = "DSA";
-            }
-            doGenKeyPair(alias, dname, keyAlgName, keysize, sigAlgName);
-            kssave = true;
-        } else if (command == GENSECKEY) {
-            if (keyAlgName == null) {
-                keyAlgName = "DES";
-            }
-            doGenSecretKey(alias, keyAlgName, keysize);
-            kssave = true;
-        } else if (command == IDENTITYDB) {
-            if (filename != null) {
-                try (InputStream inStream = new FileInputStream(filename)) {
-                    doImportIdentityDatabase(inStream);
-                }
-            } else {
-                doImportIdentityDatabase(System.in);
-            }
-        } else if (command == IMPORTCERT) {
-            InputStream inStream = System.in;
-            if (filename != null) {
-                inStream = new FileInputStream(filename);
-            }
-            String importAlias = (alias!=null)?alias:keyAlias;
-            try {
-                if (keyStore.entryInstanceOf(
-                        importAlias, KeyStore.PrivateKeyEntry.class)) {
-                    kssave = installReply(importAlias, inStream);
-                    if (kssave) {
-                        System.err.println(rb.getString
-                            ("Certificate.reply.was.installed.in.keystore"));
-                    } else {
-                        System.err.println(rb.getString
-                            ("Certificate.reply.was.not.installed.in.keystore"));
-                    }
-                } else if (!keyStore.containsAlias(importAlias) ||
-                        keyStore.entryInstanceOf(importAlias,
-                            KeyStore.TrustedCertificateEntry.class)) {
-                    kssave = addTrustedCert(importAlias, inStream);
-                    if (kssave) {
-                        System.err.println(rb.getString
-                            ("Certificate.was.added.to.keystore"));
-                    } else {
-                        System.err.println(rb.getString
-                            ("Certificate.was.not.added.to.keystore"));
-                    }
-                }
-            } finally {
-                if (inStream != System.in) {
-                    inStream.close();
-                }
-            }
-        } else if (command == IMPORTKEYSTORE) {
-            doImportKeyStore();
-            kssave = true;
-        } else if (command == KEYCLONE) {
-            keyPassNew = newPass;
-
-            // added to make sure only key can go thru
-            if (alias == null) {
-                alias = keyAlias;
-            }
-            if (keyStore.containsAlias(alias) == false) {
-                MessageFormat form = new MessageFormat
-                    (rb.getString("Alias.alias.does.not.exist"));
-                Object[] source = {alias};
-                throw new Exception(form.format(source));
-            }
-            if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
-                MessageFormat form = new MessageFormat(rb.getString(
-                        "Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key"));
-                Object[] source = {alias};
-                throw new Exception(form.format(source));
-            }
-
-            doCloneEntry(alias, dest, true);  // Now everything can be cloned
-            kssave = true;
-        } else if (command == CHANGEALIAS) {
-            if (alias == null) {
-                alias = keyAlias;
-            }
-            doCloneEntry(alias, dest, false);
-            // in PKCS11, clone a PrivateKeyEntry will delete the old one
-            if (keyStore.containsAlias(alias)) {
-                doDeleteEntry(alias);
-            }
-            kssave = true;
-        } else if (command == KEYPASSWD) {
-            keyPassNew = newPass;
-            doChangeKeyPasswd(alias);
-            kssave = true;
-        } else if (command == LIST) {
-            if (alias != null) {
-                doPrintEntry(alias, out, true);
-            } else {
-                doPrintEntries(out);
-            }
-        } else if (command == PRINTCERT) {
-            doPrintCert(out);
-        } else if (command == SELFCERT) {
-            doSelfCert(alias, dname, sigAlgName);
-            kssave = true;
-        } else if (command == STOREPASSWD) {
-            storePassNew = newPass;
-            if (storePassNew == null) {
-                storePassNew = getNewPasswd("keystore password", storePass);
-            }
-            kssave = true;
-        } else if (command == GENCERT) {
-            if (alias == null) {
-                alias = keyAlias;
-            }
-            InputStream inStream = System.in;
-            if (infilename != null) {
-                inStream = new FileInputStream(infilename);
-            }
-            PrintStream ps = null;
-            if (outfilename != null) {
-                ps = new PrintStream(new FileOutputStream(outfilename));
-                out = ps;
-            }
-            try {
-                doGenCert(alias, sigAlgName, inStream, out);
-            } finally {
-                if (inStream != System.in) {
-                    inStream.close();
-                }
-                if (ps != null) {
-                    ps.close();
-                }
-            }
-        } else if (command == GENCRL) {
-            if (alias == null) {
-                alias = keyAlias;
-            }
-            if (filename != null) {
-                try (PrintStream ps =
-                         new PrintStream(new FileOutputStream(filename))) {
-                    doGenCRL(ps);
-                }
-            } else {
-                doGenCRL(out);
-            }
-        } else if (command == PRINTCERTREQ) {
-            if (filename != null) {
-                try (InputStream inStream = new FileInputStream(filename)) {
-                    doPrintCertReq(inStream, out);
-                }
-            } else {
-                doPrintCertReq(System.in, out);
-            }
-        } else if (command == PRINTCRL) {
-            doPrintCRL(filename, out);
-        }
-
-        // If we need to save the keystore, do so.
-        if (kssave) {
-            if (verbose) {
-                MessageFormat form = new MessageFormat
-                        (rb.getString(".Storing.ksfname."));
-                Object[] source = {nullStream ? "keystore" : ksfname};
-                System.err.println(form.format(source));
-            }
-
-            if (token) {
-                keyStore.store(null, null);
-            } else {
-                char[] pass = (storePassNew!=null) ? storePassNew : storePass;
-                if (nullStream) {
-                    keyStore.store(null, pass);
-                } else {
-                    ByteArrayOutputStream bout = new ByteArrayOutputStream();
-                    keyStore.store(bout, pass);
-                    try (FileOutputStream fout = new FileOutputStream(ksfname)) {
-                        fout.write(bout.toByteArray());
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Generate a certificate: Read PKCS10 request from in, and print
-     * certificate to out. Use alias as CA, sigAlgName as the signature
-     * type.
-     */
-    private void doGenCert(String alias, String sigAlgName, InputStream in, PrintStream out)
-            throws Exception {
-
-
-        Certificate signerCert = keyStore.getCertificate(alias);
-        byte[] encoded = signerCert.getEncoded();
-        X509CertImpl signerCertImpl = new X509CertImpl(encoded);
-        X509CertInfo signerCertInfo = (X509CertInfo)signerCertImpl.get(
-                X509CertImpl.NAME + "." + X509CertImpl.INFO);
-        X500Name issuer = (X500Name)signerCertInfo.get(X509CertInfo.SUBJECT + "." +
-                                           CertificateSubjectName.DN_NAME);
-
-        Date firstDate = getStartDate(startDate);
-        Date lastDate = new Date();
-        lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L);
-        CertificateValidity interval = new CertificateValidity(firstDate,
-                                                               lastDate);
-
-        PrivateKey privateKey =
-                (PrivateKey)recoverKey(alias, storePass, keyPass).fst;
-        if (sigAlgName == null) {
-            sigAlgName = getCompatibleSigAlgName(privateKey.getAlgorithm());
-        }
-        Signature signature = Signature.getInstance(sigAlgName);
-        signature.initSign(privateKey);
-
-        X509CertInfo info = new X509CertInfo();
-        info.set(X509CertInfo.VALIDITY, interval);
-        info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
-                    new java.util.Random().nextInt() & 0x7fffffff));
-        info.set(X509CertInfo.VERSION,
-                    new CertificateVersion(CertificateVersion.V3));
-        info.set(X509CertInfo.ALGORITHM_ID,
-                    new CertificateAlgorithmId(
-                        AlgorithmId.get(sigAlgName)));
-        info.set(X509CertInfo.ISSUER, new CertificateIssuerName(issuer));
-
-        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-        boolean canRead = false;
-        StringBuffer sb = new StringBuffer();
-        while (true) {
-            String s = reader.readLine();
-            if (s == null) break;
-            // OpenSSL does not use NEW
-            //if (s.startsWith("-----BEGIN NEW CERTIFICATE REQUEST-----")) {
-            if (s.startsWith("-----BEGIN") && s.indexOf("REQUEST") >= 0) {
-                canRead = true;
-            //} else if (s.startsWith("-----END NEW CERTIFICATE REQUEST-----")) {
-            } else if (s.startsWith("-----END") && s.indexOf("REQUEST") >= 0) {
-                break;
-            } else if (canRead) {
-                sb.append(s);
-            }
-        }
-        byte[] rawReq = new BASE64Decoder().decodeBuffer(new String(sb));
-        PKCS10 req = new PKCS10(rawReq);
-
-        info.set(X509CertInfo.KEY, new CertificateX509Key(req.getSubjectPublicKeyInfo()));
-        info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(
-                dname==null?req.getSubjectName():new X500Name(dname)));
-        CertificateExtensions reqex = null;
-        Iterator<PKCS10Attribute> attrs = req.getAttributes().getAttributes().iterator();
-        while (attrs.hasNext()) {
-            PKCS10Attribute attr = attrs.next();
-            if (attr.getAttributeId().equals((Object)PKCS9Attribute.EXTENSION_REQUEST_OID)) {
-                reqex = (CertificateExtensions)attr.getAttributeValue();
-            }
-        }
-        CertificateExtensions ext = createV3Extensions(
-                reqex,
-                null,
-                v3ext,
-                req.getSubjectPublicKeyInfo(),
-                signerCert.getPublicKey());
-        info.set(X509CertInfo.EXTENSIONS, ext);
-        X509CertImpl cert = new X509CertImpl(info);
-        cert.sign(privateKey, sigAlgName);
-        dumpCert(cert, out);
-        for (Certificate ca: keyStore.getCertificateChain(alias)) {
-            if (ca instanceof X509Certificate) {
-                X509Certificate xca = (X509Certificate)ca;
-                if (!isSelfSigned(xca)) {
-                    dumpCert(xca, out);
-                }
-            }
-        }
-    }
-
-    private void doGenCRL(PrintStream out)
-            throws Exception {
-        if (ids == null) {
-            throw new Exception("Must provide -id when -gencrl");
-        }
-        Certificate signerCert = keyStore.getCertificate(alias);
-        byte[] encoded = signerCert.getEncoded();
-        X509CertImpl signerCertImpl = new X509CertImpl(encoded);
-        X509CertInfo signerCertInfo = (X509CertInfo)signerCertImpl.get(
-                X509CertImpl.NAME + "." + X509CertImpl.INFO);
-        X500Name owner = (X500Name)signerCertInfo.get(X509CertInfo.SUBJECT + "." +
-                                           CertificateSubjectName.DN_NAME);
-
-        Date firstDate = getStartDate(startDate);
-        Date lastDate = (Date) firstDate.clone();
-        lastDate.setTime(lastDate.getTime() + validity*1000*24*60*60);
-        CertificateValidity interval = new CertificateValidity(firstDate,
-                                                               lastDate);
-
-
-        PrivateKey privateKey =
-                (PrivateKey)recoverKey(alias, storePass, keyPass).fst;
-        if (sigAlgName == null) {
-            sigAlgName = getCompatibleSigAlgName(privateKey.getAlgorithm());
-        }
-
-        X509CRLEntry[] badCerts = new X509CRLEntry[ids.size()];
-        for (int i=0; i<ids.size(); i++) {
-            String id = ids.get(i);
-            int d = id.indexOf(':');
-            if (d >= 0) {
-                CRLExtensions ext = new CRLExtensions();
-                ext.set("Reason", new CRLReasonCodeExtension(Integer.parseInt(id.substring(d+1))));
-                badCerts[i] = new X509CRLEntryImpl(new BigInteger(id.substring(0, d)),
-                        firstDate, ext);
-            } else {
-                badCerts[i] = new X509CRLEntryImpl(new BigInteger(ids.get(i)), firstDate);
-            }
-        }
-        X509CRLImpl crl = new X509CRLImpl(owner, firstDate, lastDate, badCerts);
-        crl.sign(privateKey, sigAlgName);
-        if (rfc) {
-            out.println("-----BEGIN X509 CRL-----");
-            new BASE64Encoder().encodeBuffer(crl.getEncodedInternal(), out);
-            out.println("-----END X509 CRL-----");
-        } else {
-            out.write(crl.getEncodedInternal());
-        }
-    }
-
-    /**
-     * Creates a PKCS#10 cert signing request, corresponding to the
-     * keys (and name) associated with a given alias.
-     */
-    private void doCertReq(String alias, String sigAlgName, PrintStream out)
-        throws Exception
-    {
-        if (alias == null) {
-            alias = keyAlias;
-        }
-
-        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
-        PrivateKey privKey = (PrivateKey)objs.fst;
-        if (keyPass == null) {
-            keyPass = objs.snd;
-        }
-
-        Certificate cert = keyStore.getCertificate(alias);
-        if (cert == null) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("alias.has.no.public.key.certificate."));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-        PKCS10 request = new PKCS10(cert.getPublicKey());
-        CertificateExtensions ext = createV3Extensions(null, null, v3ext, cert.getPublicKey(), null);
-        // Attribute name is not significant
-        request.getAttributes().setAttribute(X509CertInfo.EXTENSIONS,
-                new PKCS10Attribute(PKCS9Attribute.EXTENSION_REQUEST_OID, ext));
-
-        // Construct a Signature object, so that we can sign the request
-        if (sigAlgName == null) {
-            sigAlgName = getCompatibleSigAlgName(privKey.getAlgorithm());
-        }
-
-        Signature signature = Signature.getInstance(sigAlgName);
-        signature.initSign(privKey);
-        X500Name subject = dname == null?
-                new X500Name(((X509Certificate)cert).getSubjectDN().toString()):
-                new X500Name(dname);
-
-        // Sign the request and base-64 encode it
-        request.encodeAndSign(subject, signature);
-        request.print(out);
-    }
-
-    /**
-     * Deletes an entry from the keystore.
-     */
-    private void doDeleteEntry(String alias) throws Exception {
-        if (keyStore.containsAlias(alias) == false) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.does.not.exist"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-        keyStore.deleteEntry(alias);
-    }
-
-    /**
-     * Exports a certificate from the keystore.
-     */
-    private void doExportCert(String alias, PrintStream out)
-        throws Exception
-    {
-        if (storePass == null
-                && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            printWarning();
-        }
-        if (alias == null) {
-            alias = keyAlias;
-        }
-        if (keyStore.containsAlias(alias) == false) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.does.not.exist"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        X509Certificate cert = (X509Certificate)keyStore.getCertificate(alias);
-        if (cert == null) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.has.no.certificate"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-        dumpCert(cert, out);
-    }
-
-    /**
-     * Prompt the user for a keypass when generating a key entry.
-     * @param alias the entry we will set password for
-     * @param orig the original entry of doing a dup, null if generate new
-     * @param origPass the password to copy from if user press ENTER
-     */
-    private char[] promptForKeyPass(String alias, String orig, char[] origPass) throws Exception{
-        if (P12KEYSTORE.equalsIgnoreCase(storetype)) {
-            return origPass;
-        } else if (!token && !protectedPath) {
-            // Prompt for key password
-            int count;
-            for (count = 0; count < 3; count++) {
-                MessageFormat form = new MessageFormat(rb.getString
-                        ("Enter.key.password.for.alias."));
-                Object[] source = {alias};
-                System.err.println(form.format(source));
-                if (orig == null) {
-                    System.err.print(rb.getString
-                            (".RETURN.if.same.as.keystore.password."));
-                } else {
-                    form = new MessageFormat(rb.getString
-                            (".RETURN.if.same.as.for.otherAlias."));
-                    Object[] src = {orig};
-                    System.err.print(form.format(src));
-                }
-                System.err.flush();
-                char[] entered = Password.readPassword(System.in);
-                passwords.add(entered);
-                if (entered == null) {
-                    return origPass;
-                } else if (entered.length >= 6) {
-                    System.err.print(rb.getString("Re.enter.new.password."));
-                    char[] passAgain = Password.readPassword(System.in);
-                    passwords.add(passAgain);
-                    if (!Arrays.equals(entered, passAgain)) {
-                        System.err.println
-                            (rb.getString("They.don.t.match.Try.again"));
-                        continue;
-                    }
-                    return entered;
-                } else {
-                    System.err.println(rb.getString
-                        ("Key.password.is.too.short.must.be.at.least.6.characters"));
-                }
-            }
-            if (count == 3) {
-                if (command == KEYCLONE) {
-                    throw new Exception(rb.getString
-                        ("Too.many.failures.Key.entry.not.cloned"));
-                } else {
-                    throw new Exception(rb.getString
-                            ("Too.many.failures.key.not.added.to.keystore"));
-                }
-            }
-        }
-        return null;    // PKCS11, MSCAPI, or -protected
-    }
-    /**
-     * Creates a new secret key.
-     */
-    private void doGenSecretKey(String alias, String keyAlgName,
-                              int keysize)
-        throws Exception
-    {
-        if (alias == null) {
-            alias = keyAlias;
-        }
-        if (keyStore.containsAlias(alias)) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Secret.key.not.generated.alias.alias.already.exists"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        SecretKey secKey = null;
-        KeyGenerator keygen = KeyGenerator.getInstance(keyAlgName);
-        if (keysize != -1) {
-            keygen.init(keysize);
-        } else if ("DES".equalsIgnoreCase(keyAlgName)) {
-            keygen.init(56);
-        } else if ("DESede".equalsIgnoreCase(keyAlgName)) {
-            keygen.init(168);
-        } else {
-            throw new Exception(rb.getString
-                ("Please.provide.keysize.for.secret.key.generation"));
-        }
-
-        secKey = keygen.generateKey();
-        if (keyPass == null) {
-            keyPass = promptForKeyPass(alias, null, storePass);
-        }
-        keyStore.setKeyEntry(alias, secKey, keyPass, null);
-    }
-
-    /**
-     * If no signature algorithm was specified at the command line,
-     * we choose one that is compatible with the selected private key
-     */
-    private static String getCompatibleSigAlgName(String keyAlgName)
-            throws Exception {
-        if ("DSA".equalsIgnoreCase(keyAlgName)) {
-            return "SHA1WithDSA";
-        } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
-            return "SHA256WithRSA";
-        } else if ("EC".equalsIgnoreCase(keyAlgName)) {
-            return "SHA256withECDSA";
-        } else {
-            throw new Exception(rb.getString
-                    ("Cannot.derive.signature.algorithm"));
-        }
-    }
-    /**
-     * Creates a new key pair and self-signed certificate.
-     */
-    private void doGenKeyPair(String alias, String dname, String keyAlgName,
-                              int keysize, String sigAlgName)
-        throws Exception
-    {
-        if (keysize == -1) {
-            if ("EC".equalsIgnoreCase(keyAlgName)) {
-                keysize = 256;
-            } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
-                keysize = 2048;
-            } else {
-                keysize = 1024;
-            }
-        }
-
-        if (alias == null) {
-            alias = keyAlias;
-        }
-
-        if (keyStore.containsAlias(alias)) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Key.pair.not.generated.alias.alias.already.exists"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        if (sigAlgName == null) {
-            sigAlgName = getCompatibleSigAlgName(keyAlgName);
-        }
-        CertAndKeyGen keypair =
-                new CertAndKeyGen(keyAlgName, sigAlgName, providerName);
-
-
-        // If DN is provided, parse it. Otherwise, prompt the user for it.
-        X500Name x500Name;
-        if (dname == null) {
-            x500Name = getX500Name();
-        } else {
-            x500Name = new X500Name(dname);
-        }
-
-        keypair.generate(keysize);
-        PrivateKey privKey = keypair.getPrivateKey();
-
-        CertificateExtensions ext = createV3Extensions(
-                null,
-                null,
-                v3ext,
-                keypair.getPublicKeyAnyway(),
-                null);
-
-        X509Certificate[] chain = new X509Certificate[1];
-        chain[0] = keypair.getSelfCertificate(
-                x500Name, getStartDate(startDate), validity*24L*60L*60L, ext);
-
-        if (verbose) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for"));
-            Object[] source = {new Integer(keysize),
-                                privKey.getAlgorithm(),
-                                chain[0].getSigAlgName(),
-                                new Long(validity),
-                                x500Name};
-            System.err.println(form.format(source));
-        }
-
-        if (keyPass == null) {
-            keyPass = promptForKeyPass(alias, null, storePass);
-        }
-        keyStore.setKeyEntry(alias, privKey, keyPass, chain);
-    }
-
-    /**
-     * Clones an entry
-     * @param orig original alias
-     * @param dest destination alias
-     * @changePassword if the password can be changed
-     */
-    private void doCloneEntry(String orig, String dest, boolean changePassword)
-        throws Exception
-    {
-        if (orig == null) {
-            orig = keyAlias;
-        }
-
-        if (keyStore.containsAlias(dest)) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Destination.alias.dest.already.exists"));
-            Object[] source = {dest};
-            throw new Exception(form.format(source));
-        }
-
-        Pair<Entry,char[]> objs = recoverEntry(keyStore, orig, storePass, keyPass);
-        Entry entry = objs.fst;
-        keyPass = objs.snd;
-
-        PasswordProtection pp = null;
-
-        if (keyPass != null) {  // protected
-            if (!changePassword || P12KEYSTORE.equalsIgnoreCase(storetype)) {
-                keyPassNew = keyPass;
-            } else {
-                if (keyPassNew == null) {
-                    keyPassNew = promptForKeyPass(dest, orig, keyPass);
-                }
-            }
-            pp = new PasswordProtection(keyPassNew);
-        }
-        keyStore.setEntry(dest, entry, pp);
-    }
-
-    /**
-     * Changes a key password.
-     */
-    private void doChangeKeyPasswd(String alias) throws Exception
-    {
-
-        if (alias == null) {
-            alias = keyAlias;
-        }
-        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
-        Key privKey = objs.fst;
-        if (keyPass == null) {
-            keyPass = objs.snd;
-        }
-
-        if (keyPassNew == null) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("key.password.for.alias."));
-            Object[] source = {alias};
-            keyPassNew = getNewPasswd(form.format(source), keyPass);
-        }
-        keyStore.setKeyEntry(alias, privKey, keyPassNew,
-                             keyStore.getCertificateChain(alias));
-    }
-
-    /**
-     * Imports a JDK 1.1-style identity database. We can only store one
-     * certificate per identity, because we use the identity's name as the
-     * alias (which references a keystore entry), and aliases must be unique.
-     */
-    private void doImportIdentityDatabase(InputStream in)
-        throws Exception
-    {
-        System.err.println(rb.getString
-            ("No.entries.from.identity.database.added"));
-    }
-
-    /**
-     * Prints a single keystore entry.
-     */
-    private void doPrintEntry(String alias, PrintStream out,
-                              boolean printWarning)
-        throws Exception
-    {
-        if (storePass == null && printWarning
-                && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            printWarning();
-        }
-
-        if (keyStore.containsAlias(alias) == false) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.does.not.exist"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        if (verbose || rfc || debug) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.name.alias"));
-            Object[] source = {alias};
-            out.println(form.format(source));
-
-            if (!token) {
-                form = new MessageFormat(rb.getString
-                    ("Creation.date.keyStore.getCreationDate.alias."));
-                Object[] src = {keyStore.getCreationDate(alias)};
-                out.println(form.format(src));
-            }
-        } else {
-            if (!token) {
-                MessageFormat form = new MessageFormat
-                    (rb.getString("alias.keyStore.getCreationDate.alias."));
-                Object[] source = {alias, keyStore.getCreationDate(alias)};
-                out.print(form.format(source));
-            } else {
-                MessageFormat form = new MessageFormat
-                    (rb.getString("alias."));
-                Object[] source = {alias};
-                out.print(form.format(source));
-            }
-        }
-
-        if (keyStore.entryInstanceOf(alias, KeyStore.SecretKeyEntry.class)) {
-            if (verbose || rfc || debug) {
-                Object[] source = {"SecretKeyEntry"};
-                out.println(new MessageFormat(
-                        rb.getString("Entry.type.type.")).format(source));
-            } else {
-                out.println("SecretKeyEntry, ");
-            }
-        } else if (keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
-            if (verbose || rfc || debug) {
-                Object[] source = {"PrivateKeyEntry"};
-                out.println(new MessageFormat(
-                        rb.getString("Entry.type.type.")).format(source));
-            } else {
-                out.println("PrivateKeyEntry, ");
-            }
-
-            // Get the chain
-            Certificate[] chain = keyStore.getCertificateChain(alias);
-            if (chain != null) {
-                if (verbose || rfc || debug) {
-                    out.println(rb.getString
-                        ("Certificate.chain.length.") + chain.length);
-                    for (int i = 0; i < chain.length; i ++) {
-                        MessageFormat form = new MessageFormat
-                                (rb.getString("Certificate.i.1."));
-                        Object[] source = {new Integer((i + 1))};
-                        out.println(form.format(source));
-                        if (verbose && (chain[i] instanceof X509Certificate)) {
-                            printX509Cert((X509Certificate)(chain[i]), out);
-                        } else if (debug) {
-                            out.println(chain[i].toString());
-                        } else {
-                            dumpCert(chain[i], out);
-                        }
-                    }
-                } else {
-                    // Print the digest of the user cert only
-                    out.println
-                        (rb.getString("Certificate.fingerprint.SHA1.") +
-                        getCertFingerPrint("SHA1", chain[0]));
-                }
-            }
-        } else if (keyStore.entryInstanceOf(alias,
-                KeyStore.TrustedCertificateEntry.class)) {
-            // We have a trusted certificate entry
-            Certificate cert = keyStore.getCertificate(alias);
-            Object[] source = {"trustedCertEntry"};
-            String mf = new MessageFormat(
-                    rb.getString("Entry.type.type.")).format(source) + "\n";
-            if (verbose && (cert instanceof X509Certificate)) {
-                out.println(mf);
-                printX509Cert((X509Certificate)cert, out);
-            } else if (rfc) {
-                out.println(mf);
-                dumpCert(cert, out);
-            } else if (debug) {
-                out.println(cert.toString());
-            } else {
-                out.println("trustedCertEntry, ");
-                out.println(rb.getString("Certificate.fingerprint.SHA1.")
-                            + getCertFingerPrint("SHA1", cert));
-            }
-        } else {
-            out.println(rb.getString("Unknown.Entry.Type"));
-        }
-    }
-
-    /**
-     * Load the srckeystore from a stream, used in -importkeystore
-     * @returns the src KeyStore
-     */
-    KeyStore loadSourceKeyStore() throws Exception {
-        boolean isPkcs11 = false;
-
-        InputStream is = null;
-
-        if (P11KEYSTORE.equalsIgnoreCase(srcstoretype) ||
-                KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
-            if (!NONE.equals(srcksfname)) {
-                System.err.println(MessageFormat.format(rb.getString
-                    (".keystore.must.be.NONE.if.storetype.is.{0}"), srcstoretype));
-                System.err.println();
-                tinyHelp();
-            }
-            isPkcs11 = true;
-        } else {
-            if (srcksfname != null) {
-                File srcksfile = new File(srcksfname);
-                    if (srcksfile.exists() && srcksfile.length() == 0) {
-                        throw new Exception(rb.getString
-                                ("Source.keystore.file.exists.but.is.empty.") +
-                                srcksfname);
-                }
-                is = new FileInputStream(srcksfile);
-            } else {
-                throw new Exception(rb.getString
-                        ("Please.specify.srckeystore"));
-            }
-        }
-
-        KeyStore store;
-        try {
-            if (srcProviderName == null) {
-                store = KeyStore.getInstance(srcstoretype);
-            } else {
-                store = KeyStore.getInstance(srcstoretype, srcProviderName);
-            }
-
-            if (srcstorePass == null
-                    && !srcprotectedPath
-                    && !KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
-                System.err.print(rb.getString("Enter.source.keystore.password."));
-                System.err.flush();
-                srcstorePass = Password.readPassword(System.in);
-                passwords.add(srcstorePass);
-            }
-
-            // always let keypass be storepass when using pkcs12
-            if (P12KEYSTORE.equalsIgnoreCase(srcstoretype)) {
-                if (srckeyPass != null && srcstorePass != null &&
-                        !Arrays.equals(srcstorePass, srckeyPass)) {
-                    MessageFormat form = new MessageFormat(rb.getString(
-                        "Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value."));
-                    Object[] source = {"-srckeypass"};
-                    System.err.println(form.format(source));
-                    srckeyPass = srcstorePass;
-                }
-            }
-
-            store.load(is, srcstorePass);   // "is" already null in PKCS11
-        } finally {
-            if (is != null) {
-                is.close();
-            }
-        }
-
-        if (srcstorePass == null
-                && !KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
-            // anti refactoring, copied from printWarning(),
-            // but change 2 lines
-            System.err.println();
-            System.err.println(rb.getString
-                (".WARNING.WARNING.WARNING."));
-            System.err.println(rb.getString
-                (".The.integrity.of.the.information.stored.in.the.srckeystore."));
-            System.err.println(rb.getString
-                (".WARNING.WARNING.WARNING."));
-            System.err.println();
-        }
-
-        return store;
-    }
-
-    /**
-     * import all keys and certs from importkeystore.
-     * keep alias unchanged if no name conflict, otherwise, prompt.
-     * keep keypass unchanged for keys
-     */
-    private void doImportKeyStore() throws Exception {
-
-        if (alias != null) {
-            doImportKeyStoreSingle(loadSourceKeyStore(), alias);
-        } else {
-            if (dest != null || srckeyPass != null || destKeyPass != null) {
-                throw new Exception(rb.getString(
-                        "if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified"));
-            }
-            doImportKeyStoreAll(loadSourceKeyStore());
-        }
-        /*
-         * Information display rule of -importkeystore
-         * 1. inside single, shows failure
-         * 2. inside all, shows sucess
-         * 3. inside all where there is a failure, prompt for continue
-         * 4. at the final of all, shows summary
-         */
-    }
-
-    /**
-     * Import a single entry named alias from srckeystore
-     * @returns 1 if the import action succeed
-     *          0 if user choose to ignore an alias-dumplicated entry
-     *          2 if setEntry throws Exception
-     */
-    private int doImportKeyStoreSingle(KeyStore srckeystore, String alias)
-            throws Exception {
-
-        String newAlias = (dest==null) ? alias : dest;
-
-        if (keyStore.containsAlias(newAlias)) {
-            Object[] source = {alias};
-            if (noprompt) {
-                System.err.println(new MessageFormat(rb.getString(
-                        "Warning.Overwriting.existing.alias.alias.in.destination.keystore")).format(source));
-            } else {
-                String reply = getYesNoReply(new MessageFormat(rb.getString(
-                        "Existing.entry.alias.alias.exists.overwrite.no.")).format(source));
-                if ("NO".equals(reply)) {
-                    newAlias = inputStringFromStdin(rb.getString
-                            ("Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry."));
-                    if ("".equals(newAlias)) {
-                        System.err.println(new MessageFormat(rb.getString(
-                                "Entry.for.alias.alias.not.imported.")).format(
-                                source));
-                        return 0;
-                    }
-                }
-            }
-        }
-
-        Pair<Entry,char[]> objs = recoverEntry(srckeystore, alias, srcstorePass, srckeyPass);
-        Entry entry = objs.fst;
-
-        PasswordProtection pp = null;
-
-        // According to keytool.html, "The destination entry will be protected
-        // using destkeypass. If destkeypass is not provided, the destination
-        // entry will be protected with the source entry password."
-        // so always try to protect with destKeyPass.
-        if (destKeyPass != null) {
-            pp = new PasswordProtection(destKeyPass);
-        } else if (objs.snd != null) {
-            pp = new PasswordProtection(objs.snd);
-        }
-
-        try {
-            keyStore.setEntry(newAlias, entry, pp);
-            return 1;
-        } catch (KeyStoreException kse) {
-            Object[] source2 = {alias, kse.toString()};
-            MessageFormat form = new MessageFormat(rb.getString(
-                    "Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported."));
-            System.err.println(form.format(source2));
-            return 2;
-        }
-    }
-
-    private void doImportKeyStoreAll(KeyStore srckeystore) throws Exception {
-
-        int ok = 0;
-        int count = srckeystore.size();
-        for (Enumeration<String> e = srckeystore.aliases();
-                                        e.hasMoreElements(); ) {
-            String alias = e.nextElement();
-            int result = doImportKeyStoreSingle(srckeystore, alias);
-            if (result == 1) {
-                ok++;
-                Object[] source = {alias};
-                MessageFormat form = new MessageFormat(rb.getString("Entry.for.alias.alias.successfully.imported."));
-                System.err.println(form.format(source));
-            } else if (result == 2) {
-                if (!noprompt) {
-                    String reply = getYesNoReply("Do you want to quit the import process? [no]:  ");
-                    if ("YES".equals(reply)) {
-                        break;
-                    }
-                }
-            }
-        }
-        Object[] source = {ok, count-ok};
-        MessageFormat form = new MessageFormat(rb.getString(
-                "Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled"));
-        System.err.println(form.format(source));
-    }
-
-    /**
-     * Prints all keystore entries.
-     */
-    private void doPrintEntries(PrintStream out)
-        throws Exception
-    {
-        if (storePass == null
-                && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            printWarning();
-        } else {
-            out.println();
-        }
-
-        out.println(rb.getString("Keystore.type.") + keyStore.getType());
-        out.println(rb.getString("Keystore.provider.") +
-                keyStore.getProvider().getName());
-        out.println();
-
-        MessageFormat form;
-        form = (keyStore.size() == 1) ?
-                new MessageFormat(rb.getString
-                        ("Your.keystore.contains.keyStore.size.entry")) :
-                new MessageFormat(rb.getString
-                        ("Your.keystore.contains.keyStore.size.entries"));
-        Object[] source = {new Integer(keyStore.size())};
-        out.println(form.format(source));
-        out.println();
-
-        for (Enumeration<String> e = keyStore.aliases();
-                                        e.hasMoreElements(); ) {
-            String alias = e.nextElement();
-            doPrintEntry(alias, out, false);
-            if (verbose || rfc) {
-                out.println(rb.getString("NEWLINE"));
-                out.println(rb.getString
-                        ("STAR"));
-                out.println(rb.getString
-                        ("STARNN"));
-            }
-        }
-    }
-
-    private static <T> Iterable<T> e2i(final Enumeration<T> e) {
-        return new Iterable<T>() {
-            @Override
-            public Iterator<T> iterator() {
-                return new Iterator<T>() {
-                    @Override
-                    public boolean hasNext() {
-                        return e.hasMoreElements();
-                    }
-                    @Override
-                    public T next() {
-                        return e.nextElement();
-                    }
-                    public void remove() {
-                        throw new UnsupportedOperationException("Not supported yet.");
-                    }
-                };
-            }
-        };
-    }
-
-    /**
-     * Loads CRLs from a source. This method is also called in JarSigner.
-     * @param src the source, which means System.in if null, or a URI,
-     *        or a bare file path name
-     */
-    public static Collection<? extends CRL> loadCRLs(String src) throws Exception {
-        InputStream in = null;
-        URI uri = null;
-        if (src == null) {
-            in = System.in;
-        } else {
-            try {
-                uri = new URI(src);
-                if (uri.getScheme().equals("ldap")) {
-                    // No input stream for LDAP
-                } else {
-                    in = uri.toURL().openStream();
-                }
-            } catch (Exception e) {
-                try {
-                    in = new FileInputStream(src);
-                } catch (Exception e2) {
-                    if (uri == null || uri.getScheme() == null) {
-                        throw e2;   // More likely a bare file path
-                    } else {
-                        throw e;    // More likely a protocol or network problem
-                    }
-                }
-            }
-        }
-        if (in != null) {
-            try {
-                // Read the full stream before feeding to X509Factory,
-                // otherwise, keytool -gencrl | keytool -printcrl
-                // might not work properly, since -gencrl is slow
-                // and there's no data in the pipe at the beginning.
-                ByteArrayOutputStream bout = new ByteArrayOutputStream();
-                byte[] b = new byte[4096];
-                while (true) {
-                    int len = in.read(b);
-                    if (len < 0) break;
-                    bout.write(b, 0, len);
-                }
-                return CertificateFactory.getInstance("X509").generateCRLs(
-                        new ByteArrayInputStream(bout.toByteArray()));
-            } finally {
-                if (in != System.in) {
-                    in.close();
-                }
-            }
-        } else {    // must be LDAP, and uri is not null
-            // Lazily load LDAPCertStoreHelper if present
-            CertStoreHelper helper = CertStoreHelper.getInstance("LDAP");
-            String path = uri.getPath();
-            if (path.charAt(0) == '/') path = path.substring(1);
-            CertStore s = helper.getCertStore(uri);
-            X509CRLSelector sel =
-                    helper.wrap(new X509CRLSelector(), null, path);
-            return s.getCRLs(sel);
-        }
-    }
-
-    /**
-     * Returns CRLs described in a X509Certificate's CRLDistributionPoints
-     * Extension. Only those containing a general name of type URI are read.
-     */
-    public static List<CRL> readCRLsFromCert(X509Certificate cert)
-            throws Exception {
-        List<CRL> crls = new ArrayList<>();
-        CRLDistributionPointsExtension ext =
-                X509CertImpl.toImpl(cert).getCRLDistributionPointsExtension();
-        if (ext == null) return crls;
-        List<DistributionPoint> distPoints =
-                ext.get(CRLDistributionPointsExtension.POINTS);
-        for (DistributionPoint o: distPoints) {
-            GeneralNames names = o.getFullName();
-            if (names != null) {
-                for (GeneralName name: names.names()) {
-                    if (name.getType() == GeneralNameInterface.NAME_URI) {
-                        URIName uriName = (URIName)name.getName();
-                        for (CRL crl: KeyTool.loadCRLs(uriName.getName())) {
-                            if (crl instanceof X509CRL) {
-                                crls.add((X509CRL)crl);
-                            }
-                        }
-                        break;  // Different name should point to same CRL
-                    }
-                }
-            }
-        }
-        return crls;
-    }
-
-    private static String verifyCRL(KeyStore ks, CRL crl)
-            throws Exception {
-        X509CRLImpl xcrl = (X509CRLImpl)crl;
-        X500Principal issuer = xcrl.getIssuerX500Principal();
-        for (String s: e2i(ks.aliases())) {
-            Certificate cert = ks.getCertificate(s);
-            if (cert instanceof X509Certificate) {
-                X509Certificate xcert = (X509Certificate)cert;
-                if (xcert.getSubjectX500Principal().equals(issuer)) {
-                    try {
-                        ((X509CRLImpl)crl).verify(cert.getPublicKey());
-                        return s;
-                    } catch (Exception e) {
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    private void doPrintCRL(String src, PrintStream out)
-            throws Exception {
-        for (CRL crl: loadCRLs(src)) {
-            printCRL(crl, out);
-            String issuer = null;
-            if (caks != null) {
-                issuer = verifyCRL(caks, crl);
-                if (issuer != null) {
-                    out.printf(rb.getString(
-                            "verified.by.s.in.s"), issuer, "cacerts");
-                    out.println();
-                }
-            }
-            if (issuer == null && keyStore != null) {
-                issuer = verifyCRL(keyStore, crl);
-                if (issuer != null) {
-                    out.printf(rb.getString(
-                            "verified.by.s.in.s"), issuer, "keystore");
-                    out.println();
-                }
-            }
-            if (issuer == null) {
-                out.println(rb.getString
-                        ("STAR"));
-                out.println(rb.getString
-                        ("warning.not.verified.make.sure.keystore.is.correct"));
-                out.println(rb.getString
-                        ("STARNN"));
-            }
-        }
-    }
-
-    private void printCRL(CRL crl, PrintStream out)
-            throws Exception {
-        if (rfc) {
-            X509CRL xcrl = (X509CRL)crl;
-            out.println("-----BEGIN X509 CRL-----");
-            new BASE64Encoder().encodeBuffer(xcrl.getEncoded(), out);
-            out.println("-----END X509 CRL-----");
-        } else {
-            out.println(crl.toString());
-        }
-    }
-
-    private void doPrintCertReq(InputStream in, PrintStream out)
-            throws Exception {
-
-        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-        StringBuffer sb = new StringBuffer();
-        boolean started = false;
-        while (true) {
-            String s = reader.readLine();
-            if (s == null) break;
-            if (!started) {
-                if (s.startsWith("-----")) {
-                    started = true;
-                }
-            } else {
-                if (s.startsWith("-----")) {
-                    break;
-                }
-                sb.append(s);
-            }
-        }
-        PKCS10 req = new PKCS10(new BASE64Decoder().decodeBuffer(new String(sb)));
-
-        PublicKey pkey = req.getSubjectPublicKeyInfo();
-        out.printf(rb.getString("PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key."),
-                req.getSubjectName(), pkey.getFormat(), pkey.getAlgorithm());
-        for (PKCS10Attribute attr: req.getAttributes().getAttributes()) {
-            ObjectIdentifier oid = attr.getAttributeId();
-            if (oid.equals((Object)PKCS9Attribute.EXTENSION_REQUEST_OID)) {
-                CertificateExtensions exts = (CertificateExtensions)attr.getAttributeValue();
-                if (exts != null) {
-                    printExtensions(rb.getString("Extension.Request."), exts, out);
-                }
-            } else {
-                out.println(attr.getAttributeId());
-                out.println(attr.getAttributeValue());
-            }
-        }
-        if (debug) {
-            out.println(req);   // Just to see more, say, public key length...
-        }
-    }
-
-    /**
-     * Reads a certificate (or certificate chain) and prints its contents in
-     * a human readable format.
-     */
-    private void printCertFromStream(InputStream in, PrintStream out)
-        throws Exception
-    {
-        Collection<? extends Certificate> c = null;
-        try {
-            c = cf.generateCertificates(in);
-        } catch (CertificateException ce) {
-            throw new Exception(rb.getString("Failed.to.parse.input"), ce);
-        }
-        if (c.isEmpty()) {
-            throw new Exception(rb.getString("Empty.input"));
-        }
-        Certificate[] certs = c.toArray(new Certificate[c.size()]);
-        for (int i=0; i<certs.length; i++) {
-            X509Certificate x509Cert = null;
-            try {
-                x509Cert = (X509Certificate)certs[i];
-            } catch (ClassCastException cce) {
-                throw new Exception(rb.getString("Not.X.509.certificate"));
-            }
-            if (certs.length > 1) {
-                MessageFormat form = new MessageFormat
-                        (rb.getString("Certificate.i.1."));
-                Object[] source = {new Integer(i + 1)};
-                out.println(form.format(source));
-            }
-            if (rfc) dumpCert(x509Cert, out);
-            else printX509Cert(x509Cert, out);
-            if (i < (certs.length-1)) {
-                out.println();
-            }
-        }
-    }
-
-    private void doPrintCert(final PrintStream out) throws Exception {
-        if (jarfile != null) {
-            JarFile jf = new JarFile(jarfile, true);
-            Enumeration<JarEntry> entries = jf.entries();
-            Set<CodeSigner> ss = new HashSet<>();
-            byte[] buffer = new byte[8192];
-            int pos = 0;
-            while (entries.hasMoreElements()) {
-                JarEntry je = entries.nextElement();
-                try (InputStream is = jf.getInputStream(je)) {
-                    while (is.read(buffer) != -1) {
-                        // we just read. this will throw a SecurityException
-                        // if a signature/digest check fails. This also
-                        // populate the signers
-                    }
-                }
-                CodeSigner[] signers = je.getCodeSigners();
-                if (signers != null) {
-                    for (CodeSigner signer: signers) {
-                        if (!ss.contains(signer)) {
-                            ss.add(signer);
-                            out.printf(rb.getString("Signer.d."), ++pos);
-                            out.println();
-                            out.println();
-                            out.println(rb.getString("Signature."));
-                            out.println();
-                            for (Certificate cert: signer.getSignerCertPath().getCertificates()) {
-                                X509Certificate x = (X509Certificate)cert;
-                                if (rfc) {
-                                    out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n");
-                                    dumpCert(x, out);
-                                } else {
-                                    printX509Cert(x, out);
-                                }
-                                out.println();
-                            }
-                            Timestamp ts = signer.getTimestamp();
-                            if (ts != null) {
-                                out.println(rb.getString("Timestamp."));
-                                out.println();
-                                for (Certificate cert: ts.getSignerCertPath().getCertificates()) {
-                                    X509Certificate x = (X509Certificate)cert;
-                                    if (rfc) {
-                                        out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n");
-                                        dumpCert(x, out);
-                                    } else {
-                                        printX509Cert(x, out);
-                                    }
-                                    out.println();
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            jf.close();
-            if (ss.isEmpty()) {
-                out.println(rb.getString("Not.a.signed.jar.file"));
-            }
-        } else if (sslserver != null) {
-            // Lazily load SSLCertStoreHelper if present
-            CertStoreHelper helper = CertStoreHelper.getInstance("SSLServer");
-            CertStore cs = helper.getCertStore(new URI("https://" + sslserver));
-            Collection<? extends Certificate> chain;
-            try {
-                chain = cs.getCertificates(null);
-                if (chain.isEmpty()) {
-                    // If the certs are not retrieved, we consider it an error
-                    // even if the URL connection is successful.
-                    throw new Exception(rb.getString(
-                                        "No.certificate.from.the.SSL.server"));
-                }
-            } catch (CertStoreException cse) {
-                if (cse.getCause() instanceof IOException) {
-                    throw new Exception(rb.getString(
-                                        "No.certificate.from.the.SSL.server"),
-                                        cse.getCause());
-                } else {
-                    throw cse;
-                }
-            }
-
-            int i = 0;
-            for (Certificate cert : chain) {
-                try {
-                    if (rfc) {
-                        dumpCert(cert, out);
-                    } else {
-                        out.println("Certificate #" + i++);
-                        out.println("====================================");
-                        printX509Cert((X509Certificate)cert, out);
-                        out.println();
-                    }
-                } catch (Exception e) {
-                    if (debug) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        } else {
-            if (filename != null) {
-                try (FileInputStream inStream = new FileInputStream(filename)) {
-                    printCertFromStream(inStream, out);
-                }
-            } else {
-                printCertFromStream(System.in, out);
-            }
-        }
-    }
-    /**
-     * Creates a self-signed certificate, and stores it as a single-element
-     * certificate chain.
-     */
-    private void doSelfCert(String alias, String dname, String sigAlgName)
-        throws Exception
-    {
-        if (alias == null) {
-            alias = keyAlias;
-        }
-
-        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
-        PrivateKey privKey = (PrivateKey)objs.fst;
-        if (keyPass == null)
-            keyPass = objs.snd;
-
-        // Determine the signature algorithm
-        if (sigAlgName == null) {
-            sigAlgName = getCompatibleSigAlgName(privKey.getAlgorithm());
-        }
-
-        // Get the old certificate
-        Certificate oldCert = keyStore.getCertificate(alias);
-        if (oldCert == null) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("alias.has.no.public.key"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-        if (!(oldCert instanceof X509Certificate)) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("alias.has.no.X.509.certificate"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        // convert to X509CertImpl, so that we can modify selected fields
-        // (no public APIs available yet)
-        byte[] encoded = oldCert.getEncoded();
-        X509CertImpl certImpl = new X509CertImpl(encoded);
-        X509CertInfo certInfo = (X509CertInfo)certImpl.get(X509CertImpl.NAME
-                                                           + "." +
-                                                           X509CertImpl.INFO);
-
-        // Extend its validity
-        Date firstDate = getStartDate(startDate);
-        Date lastDate = new Date();
-        lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L);
-        CertificateValidity interval = new CertificateValidity(firstDate,
-                                                               lastDate);
-        certInfo.set(X509CertInfo.VALIDITY, interval);
-
-        // Make new serial number
-        certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
-                    new java.util.Random().nextInt() & 0x7fffffff));
-
-        // Set owner and issuer fields
-        X500Name owner;
-        if (dname == null) {
-            // Get the owner name from the certificate
-            owner = (X500Name)certInfo.get(X509CertInfo.SUBJECT + "." +
-                                           CertificateSubjectName.DN_NAME);
-        } else {
-            // Use the owner name specified at the command line
-            owner = new X500Name(dname);
-            certInfo.set(X509CertInfo.SUBJECT + "." +
-                         CertificateSubjectName.DN_NAME, owner);
-        }
-        // Make issuer same as owner (self-signed!)
-        certInfo.set(X509CertInfo.ISSUER + "." +
-                     CertificateIssuerName.DN_NAME, owner);
-
-        // The inner and outer signature algorithms have to match.
-        // The way we achieve that is really ugly, but there seems to be no
-        // other solution: We first sign the cert, then retrieve the
-        // outer sigalg and use it to set the inner sigalg
-        X509CertImpl newCert = new X509CertImpl(certInfo);
-        newCert.sign(privKey, sigAlgName);
-        AlgorithmId sigAlgid = (AlgorithmId)newCert.get(X509CertImpl.SIG_ALG);
-        certInfo.set(CertificateAlgorithmId.NAME + "." +
-                     CertificateAlgorithmId.ALGORITHM, sigAlgid);
-
-        certInfo.set(X509CertInfo.VERSION,
-                        new CertificateVersion(CertificateVersion.V3));
-
-        CertificateExtensions ext = createV3Extensions(
-                null,
-                (CertificateExtensions)certInfo.get(X509CertInfo.EXTENSIONS),
-                v3ext,
-                oldCert.getPublicKey(),
-                null);
-        certInfo.set(X509CertInfo.EXTENSIONS, ext);
-        // Sign the new certificate
-        newCert = new X509CertImpl(certInfo);
-        newCert.sign(privKey, sigAlgName);
-
-        // Store the new certificate as a single-element certificate chain
-        keyStore.setKeyEntry(alias, privKey,
-                             (keyPass != null) ? keyPass : storePass,
-                             new Certificate[] { newCert } );
-
-        if (verbose) {
-            System.err.println(rb.getString("New.certificate.self.signed."));
-            System.err.print(newCert.toString());
-            System.err.println();
-        }
-    }
-
-    /**
-     * Processes a certificate reply from a certificate authority.
-     *
-     * <p>Builds a certificate chain on top of the certificate reply,
-     * using trusted certificates from the keystore. The chain is complete
-     * after a self-signed certificate has been encountered. The self-signed
-     * certificate is considered a root certificate authority, and is stored
-     * at the end of the chain.
-     *
-     * <p>The newly generated chain replaces the old chain associated with the
-     * key entry.
-     *
-     * @return true if the certificate reply was installed, otherwise false.
-     */
-    private boolean installReply(String alias, InputStream in)
-        throws Exception
-    {
-        if (alias == null) {
-            alias = keyAlias;
-        }
-
-        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
-        PrivateKey privKey = (PrivateKey)objs.fst;
-        if (keyPass == null) {
-            keyPass = objs.snd;
-        }
-
-        Certificate userCert = keyStore.getCertificate(alias);
-        if (userCert == null) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("alias.has.no.public.key.certificate."));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        // Read the certificates in the reply
-        Collection<? extends Certificate> c = cf.generateCertificates(in);
-        if (c.isEmpty()) {
-            throw new Exception(rb.getString("Reply.has.no.certificates"));
-        }
-        Certificate[] replyCerts = c.toArray(new Certificate[c.size()]);
-        Certificate[] newChain;
-        if (replyCerts.length == 1) {
-            // single-cert reply
-            newChain = establishCertChain(userCert, replyCerts[0]);
-        } else {
-            // cert-chain reply (e.g., PKCS#7)
-            newChain = validateReply(alias, userCert, replyCerts);
-        }
-
-        // Now store the newly established chain in the keystore. The new
-        // chain replaces the old one.
-        if (newChain != null) {
-            keyStore.setKeyEntry(alias, privKey,
-                                 (keyPass != null) ? keyPass : storePass,
-                                 newChain);
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Imports a certificate and adds it to the list of trusted certificates.
-     *
-     * @return true if the certificate was added, otherwise false.
-     */
-    private boolean addTrustedCert(String alias, InputStream in)
-        throws Exception
-    {
-        if (alias == null) {
-            throw new Exception(rb.getString("Must.specify.alias"));
-        }
-        if (keyStore.containsAlias(alias)) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Certificate.not.imported.alias.alias.already.exists"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        // Read the certificate
-        X509Certificate cert = null;
-        try {
-            cert = (X509Certificate)cf.generateCertificate(in);
-        } catch (ClassCastException | CertificateException ce) {
-            throw new Exception(rb.getString("Input.not.an.X.509.certificate"));
-        }
-
-        // if certificate is self-signed, make sure it verifies
-        boolean selfSigned = false;
-        if (isSelfSigned(cert)) {
-            cert.verify(cert.getPublicKey());
-            selfSigned = true;
-        }
-
-        if (noprompt) {
-            keyStore.setCertificateEntry(alias, cert);
-            return true;
-        }
-
-        // check if cert already exists in keystore
-        String reply = null;
-        String trustalias = keyStore.getCertificateAlias(cert);
-        if (trustalias != null) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Certificate.already.exists.in.keystore.under.alias.trustalias."));
-            Object[] source = {trustalias};
-            System.err.println(form.format(source));
-            reply = getYesNoReply
-                (rb.getString("Do.you.still.want.to.add.it.no."));
-        } else if (selfSigned) {
-            if (trustcacerts && (caks != null) &&
-                    ((trustalias=caks.getCertificateAlias(cert)) != null)) {
-                MessageFormat form = new MessageFormat(rb.getString
-                        ("Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias."));
-                Object[] source = {trustalias};
-                System.err.println(form.format(source));
-                reply = getYesNoReply
-                        (rb.getString("Do.you.still.want.to.add.it.to.your.own.keystore.no."));
-            }
-            if (trustalias == null) {
-                // Print the cert and ask user if they really want to add
-                // it to their keystore
-                printX509Cert(cert, System.out);
-                reply = getYesNoReply
-                        (rb.getString("Trust.this.certificate.no."));
-            }
-        }
-        if (reply != null) {
-            if ("YES".equals(reply)) {
-                keyStore.setCertificateEntry(alias, cert);
-                return true;
-            } else {
-                return false;
-            }
-        }
-
-        // Try to establish trust chain
-        try {
-            Certificate[] chain = establishCertChain(null, cert);
-            if (chain != null) {
-                keyStore.setCertificateEntry(alias, cert);
-                return true;
-            }
-        } catch (Exception e) {
-            // Print the cert and ask user if they really want to add it to
-            // their keystore
-            printX509Cert(cert, System.out);
-            reply = getYesNoReply
-                (rb.getString("Trust.this.certificate.no."));
-            if ("YES".equals(reply)) {
-                keyStore.setCertificateEntry(alias, cert);
-                return true;
-            } else {
-                return false;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Prompts user for new password. New password must be different from
-     * old one.
-     *
-     * @param prompt the message that gets prompted on the screen
-     * @param oldPasswd the current (i.e., old) password
-     */
-    private char[] getNewPasswd(String prompt, char[] oldPasswd)
-        throws Exception
-    {
-        char[] entered = null;
-        char[] reentered = null;
-
-        for (int count = 0; count < 3; count++) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("New.prompt."));
-            Object[] source = {prompt};
-            System.err.print(form.format(source));
-            entered = Password.readPassword(System.in);
-            passwords.add(entered);
-            if (entered == null || entered.length < 6) {
-                System.err.println(rb.getString
-                    ("Password.is.too.short.must.be.at.least.6.characters"));
-            } else if (Arrays.equals(entered, oldPasswd)) {
-                System.err.println(rb.getString("Passwords.must.differ"));
-            } else {
-                form = new MessageFormat
-                        (rb.getString("Re.enter.new.prompt."));
-                Object[] src = {prompt};
-                System.err.print(form.format(src));
-                reentered = Password.readPassword(System.in);
-                passwords.add(reentered);
-                if (!Arrays.equals(entered, reentered)) {
-                    System.err.println
-                        (rb.getString("They.don.t.match.Try.again"));
-                } else {
-                    Arrays.fill(reentered, ' ');
-                    return entered;
-                }
-            }
-            if (entered != null) {
-                Arrays.fill(entered, ' ');
-                entered = null;
-            }
-            if (reentered != null) {
-                Arrays.fill(reentered, ' ');
-                reentered = null;
-            }
-        }
-        throw new Exception(rb.getString("Too.many.failures.try.later"));
-    }
-
-    /**
-     * Prompts user for alias name.
-     * @param prompt the {0} of "Enter {0} alias name:  " in prompt line
-     * @returns the string entered by the user, without the \n at the end
-     */
-    private String getAlias(String prompt) throws Exception {
-        if (prompt != null) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Enter.prompt.alias.name."));
-            Object[] source = {prompt};
-            System.err.print(form.format(source));
-        } else {
-            System.err.print(rb.getString("Enter.alias.name."));
-        }
-        return (new BufferedReader(new InputStreamReader(
-                                        System.in))).readLine();
-    }
-
-    /**
-     * Prompts user for an input string from the command line (System.in)
-     * @prompt the prompt string printed
-     * @returns the string entered by the user, without the \n at the end
-     */
-    private String inputStringFromStdin(String prompt) throws Exception {
-        System.err.print(prompt);
-        return (new BufferedReader(new InputStreamReader(
-                                        System.in))).readLine();
-    }
-
-    /**
-     * Prompts user for key password. User may select to choose the same
-     * password (<code>otherKeyPass</code>) as for <code>otherAlias</code>.
-     */
-    private char[] getKeyPasswd(String alias, String otherAlias,
-                                char[] otherKeyPass)
-        throws Exception
-    {
-        int count = 0;
-        char[] keyPass = null;
-
-        do {
-            if (otherKeyPass != null) {
-                MessageFormat form = new MessageFormat(rb.getString
-                        ("Enter.key.password.for.alias."));
-                Object[] source = {alias};
-                System.err.println(form.format(source));
-
-                form = new MessageFormat(rb.getString
-                        (".RETURN.if.same.as.for.otherAlias."));
-                Object[] src = {otherAlias};
-                System.err.print(form.format(src));
-            } else {
-                MessageFormat form = new MessageFormat(rb.getString
-                        ("Enter.key.password.for.alias."));
-                Object[] source = {alias};
-                System.err.print(form.format(source));
-            }
-            System.err.flush();
-            keyPass = Password.readPassword(System.in);
-            passwords.add(keyPass);
-            if (keyPass == null) {
-                keyPass = otherKeyPass;
-            }
-            count++;
-        } while ((keyPass == null) && count < 3);
-
-        if (keyPass == null) {
-            throw new Exception(rb.getString("Too.many.failures.try.later"));
-        }
-
-        return keyPass;
-    }
-
-    /**
-     * Prints a certificate in a human readable format.
-     */
-    private void printX509Cert(X509Certificate cert, PrintStream out)
-        throws Exception
-    {
-        /*
-        out.println("Owner: "
-                    + cert.getSubjectDN().toString()
-                    + "\n"
-                    + "Issuer: "
-                    + cert.getIssuerDN().toString()
-                    + "\n"
-                    + "Serial number: " + cert.getSerialNumber().toString(16)
-                    + "\n"
-                    + "Valid from: " + cert.getNotBefore().toString()
-                    + " until: " + cert.getNotAfter().toString()
-                    + "\n"
-                    + "Certificate fingerprints:\n"
-                    + "\t MD5:  " + getCertFingerPrint("MD5", cert)
-                    + "\n"
-                    + "\t SHA1: " + getCertFingerPrint("SHA1", cert));
-        */
-
-        MessageFormat form = new MessageFormat
-                (rb.getString(".PATTERN.printX509Cert"));
-        Object[] source = {cert.getSubjectDN().toString(),
-                        cert.getIssuerDN().toString(),
-                        cert.getSerialNumber().toString(16),
-                        cert.getNotBefore().toString(),
-                        cert.getNotAfter().toString(),
-                        getCertFingerPrint("MD5", cert),
-                        getCertFingerPrint("SHA1", cert),
-                        getCertFingerPrint("SHA-256", cert),
-                        cert.getSigAlgName(),
-                        cert.getVersion()
-                        };
-        out.println(form.format(source));
-
-        if (cert instanceof X509CertImpl) {
-            X509CertImpl impl = (X509CertImpl)cert;
-            X509CertInfo certInfo = (X509CertInfo)impl.get(X509CertImpl.NAME
-                                                           + "." +
-                                                           X509CertImpl.INFO);
-            CertificateExtensions exts = (CertificateExtensions)
-                    certInfo.get(X509CertInfo.EXTENSIONS);
-            if (exts != null) {
-                printExtensions(rb.getString("Extensions."), exts, out);
-            }
-        }
-    }
-
-    private static void printExtensions(String title, CertificateExtensions exts, PrintStream out)
-            throws Exception {
-        int extnum = 0;
-        Iterator<Extension> i1 = exts.getAllExtensions().iterator();
-        Iterator<Extension> i2 = exts.getUnparseableExtensions().values().iterator();
-        while (i1.hasNext() || i2.hasNext()) {
-            Extension ext = i1.hasNext()?i1.next():i2.next();
-            if (extnum == 0) {
-                out.println();
-                out.println(title);
-                out.println();
-            }
-            out.print("#"+(++extnum)+": "+ ext);
-            if (ext.getClass() == Extension.class) {
-                byte[] v = ext.getExtensionValue();
-                if (v.length == 0) {
-                    out.println(rb.getString(".Empty.value."));
-                } else {
-                    new sun.misc.HexDumpEncoder().encodeBuffer(ext.getExtensionValue(), out);
-                    out.println();
-                }
-            }
-            out.println();
-        }
-    }
-
-    /**
-     * Returns true if the certificate is self-signed, false otherwise.
-     */
-    private boolean isSelfSigned(X509Certificate cert) {
-        return signedBy(cert, cert);
-    }
-
-    private boolean signedBy(X509Certificate end, X509Certificate ca) {
-        if (!ca.getSubjectDN().equals(end.getIssuerDN())) {
-            return false;
-        }
-        try {
-            end.verify(ca.getPublicKey());
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    /**
-     * Locates a signer for a given certificate from a given keystore and
-     * returns the signer's certificate.
-     * @param cert the certificate whose signer is searched, not null
-     * @param ks the keystore to search with, not null
-     * @return <code>cert</code> itself if it's already inside <code>ks</code>,
-     * or a certificate inside <code>ks</code> who signs <code>cert</code>,
-     * or null otherwise.
-     */
-    private static Certificate getTrustedSigner(Certificate cert, KeyStore ks)
-            throws Exception {
-        if (ks.getCertificateAlias(cert) != null) {
-            return cert;
-        }
-        for (Enumeration<String> aliases = ks.aliases();
-                aliases.hasMoreElements(); ) {
-            String name = aliases.nextElement();
-            Certificate trustedCert = ks.getCertificate(name);
-            if (trustedCert != null) {
-                try {
-                    cert.verify(trustedCert.getPublicKey());
-                    return trustedCert;
-                } catch (Exception e) {
-                    // Not verified, skip to the next one
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Gets an X.500 name suitable for inclusion in a certification request.
-     */
-    private X500Name getX500Name() throws IOException {
-        BufferedReader in;
-        in = new BufferedReader(new InputStreamReader(System.in));
-        String commonName = "Unknown";
-        String organizationalUnit = "Unknown";
-        String organization = "Unknown";
-        String city = "Unknown";
-        String state = "Unknown";
-        String country = "Unknown";
-        X500Name name;
-        String userInput = null;
-
-        int maxRetry = 20;
-        do {
-            if (maxRetry-- < 0) {
-                throw new RuntimeException(rb.getString(
-                        "Too.many.retries.program.terminated"));
-            }
-            commonName = inputString(in,
-                    rb.getString("What.is.your.first.and.last.name."),
-                    commonName);
-            organizationalUnit = inputString(in,
-                    rb.getString
-                        ("What.is.the.name.of.your.organizational.unit."),
-                    organizationalUnit);
-            organization = inputString(in,
-                    rb.getString("What.is.the.name.of.your.organization."),
-                    organization);
-            city = inputString(in,
-                    rb.getString("What.is.the.name.of.your.City.or.Locality."),
-                    city);
-            state = inputString(in,
-                    rb.getString("What.is.the.name.of.your.State.or.Province."),
-                    state);
-            country = inputString(in,
-                    rb.getString
-                        ("What.is.the.two.letter.country.code.for.this.unit."),
-                    country);
-            name = new X500Name(commonName, organizationalUnit, organization,
-                                city, state, country);
-            MessageFormat form = new MessageFormat
-                (rb.getString("Is.name.correct."));
-            Object[] source = {name};
-            userInput = inputString
-                (in, form.format(source), rb.getString("no"));
-        } while (collator.compare(userInput, rb.getString("yes")) != 0 &&
-                 collator.compare(userInput, rb.getString("y")) != 0);
-
-        System.err.println();
-        return name;
-    }
-
-    private String inputString(BufferedReader in, String prompt,
-                               String defaultValue)
-        throws IOException
-    {
-        System.err.println(prompt);
-        MessageFormat form = new MessageFormat
-                (rb.getString(".defaultValue."));
-        Object[] source = {defaultValue};
-        System.err.print(form.format(source));
-        System.err.flush();
-
-        String value = in.readLine();
-        if (value == null || collator.compare(value, "") == 0) {
-            value = defaultValue;
-        }
-        return value;
-    }
-
-    /**
-     * Writes an X.509 certificate in base64 or binary encoding to an output
-     * stream.
-     */
-    private void dumpCert(Certificate cert, PrintStream out)
-        throws IOException, CertificateException
-    {
-        if (rfc) {
-            BASE64Encoder encoder = new BASE64Encoder();
-            out.println(X509Factory.BEGIN_CERT);
-            encoder.encodeBuffer(cert.getEncoded(), out);
-            out.println(X509Factory.END_CERT);
-        } else {
-            out.write(cert.getEncoded()); // binary
-        }
-    }
-
-    /**
-     * Converts a byte to hex digit and writes to the supplied buffer
-     */
-    private void byte2hex(byte b, StringBuffer buf) {
-        char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
-                            '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-        int high = ((b & 0xf0) >> 4);
-        int low = (b & 0x0f);
-        buf.append(hexChars[high]);
-        buf.append(hexChars[low]);
-    }
-
-    /**
-     * Converts a byte array to hex string
-     */
-    private String toHexString(byte[] block) {
-        StringBuffer buf = new StringBuffer();
-        int len = block.length;
-        for (int i = 0; i < len; i++) {
-             byte2hex(block[i], buf);
-             if (i < len-1) {
-                 buf.append(":");
-             }
-        }
-        return buf.toString();
-    }
-
-    /**
-     * Recovers (private) key associated with given alias.
-     *
-     * @return an array of objects, where the 1st element in the array is the
-     * recovered private key, and the 2nd element is the password used to
-     * recover it.
-     */
-    private Pair<Key,char[]> recoverKey(String alias, char[] storePass,
-                                       char[] keyPass)
-        throws Exception
-    {
-        Key key = null;
-
-        if (keyStore.containsAlias(alias) == false) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.does.not.exist"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-        if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class) &&
-                !keyStore.entryInstanceOf(alias, KeyStore.SecretKeyEntry.class)) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.has.no.key"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        if (keyPass == null) {
-            // Try to recover the key using the keystore password
-            try {
-                key = keyStore.getKey(alias, storePass);
-
-                keyPass = storePass;
-                passwords.add(keyPass);
-            } catch (UnrecoverableKeyException e) {
-                // Did not work out, so prompt user for key password
-                if (!token) {
-                    keyPass = getKeyPasswd(alias, null, null);
-                    key = keyStore.getKey(alias, keyPass);
-                } else {
-                    throw e;
-                }
-            }
-        } else {
-            key = keyStore.getKey(alias, keyPass);
-        }
-
-        return Pair.of(key, keyPass);
-    }
-
-    /**
-     * Recovers entry associated with given alias.
-     *
-     * @return an array of objects, where the 1st element in the array is the
-     * recovered entry, and the 2nd element is the password used to
-     * recover it (null if no password).
-     */
-    private Pair<Entry,char[]> recoverEntry(KeyStore ks,
-                            String alias,
-                            char[] pstore,
-                            char[] pkey) throws Exception {
-
-        if (ks.containsAlias(alias) == false) {
-            MessageFormat form = new MessageFormat
-                (rb.getString("Alias.alias.does.not.exist"));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        PasswordProtection pp = null;
-        Entry entry;
-
-        try {
-            // First attempt to access entry without key password
-            // (PKCS11 entry or trusted certificate entry, for example)
-
-            entry = ks.getEntry(alias, pp);
-            pkey = null;
-        } catch (UnrecoverableEntryException une) {
-
-            if(P11KEYSTORE.equalsIgnoreCase(ks.getType()) ||
-                KeyStoreUtil.isWindowsKeyStore(ks.getType())) {
-                // should not happen, but a possibility
-                throw une;
-            }
-
-            // entry is protected
-
-            if (pkey != null) {
-
-                // try provided key password
-
-                pp = new PasswordProtection(pkey);
-                entry = ks.getEntry(alias, pp);
-
-            } else {
-
-                // try store pass
-
-                try {
-                    pp = new PasswordProtection(pstore);
-                    entry = ks.getEntry(alias, pp);
-                    pkey = pstore;
-                } catch (UnrecoverableEntryException une2) {
-                    if (P12KEYSTORE.equalsIgnoreCase(ks.getType())) {
-
-                        // P12 keystore currently does not support separate
-                        // store and entry passwords
-
-                        throw une2;
-                    } else {
-
-                        // prompt for entry password
-
-                        pkey = getKeyPasswd(alias, null, null);
-                        pp = new PasswordProtection(pkey);
-                        entry = ks.getEntry(alias, pp);
-                    }
-                }
-            }
-        }
-
-        return Pair.of(entry, pkey);
-    }
-    /**
-     * Gets the requested finger print of the certificate.
-     */
-    private String getCertFingerPrint(String mdAlg, Certificate cert)
-        throws Exception
-    {
-        byte[] encCertInfo = cert.getEncoded();
-        MessageDigest md = MessageDigest.getInstance(mdAlg);
-        byte[] digest = md.digest(encCertInfo);
-        return toHexString(digest);
-    }
-
-    /**
-     * Prints warning about missing integrity check.
-     */
-    private void printWarning() {
-        System.err.println();
-        System.err.println(rb.getString
-            (".WARNING.WARNING.WARNING."));
-        System.err.println(rb.getString
-            (".The.integrity.of.the.information.stored.in.your.keystore."));
-        System.err.println(rb.getString
-            (".WARNING.WARNING.WARNING."));
-        System.err.println();
-    }
-
-    /**
-     * Validates chain in certification reply, and returns the ordered
-     * elements of the chain (with user certificate first, and root
-     * certificate last in the array).
-     *
-     * @param alias the alias name
-     * @param userCert the user certificate of the alias
-     * @param replyCerts the chain provided in the reply
-     */
-    private Certificate[] validateReply(String alias,
-                                        Certificate userCert,
-                                        Certificate[] replyCerts)
-        throws Exception
-    {
-        // order the certs in the reply (bottom-up).
-        // we know that all certs in the reply are of type X.509, because
-        // we parsed them using an X.509 certificate factory
-        int i;
-        PublicKey userPubKey = userCert.getPublicKey();
-        for (i=0; i<replyCerts.length; i++) {
-            if (userPubKey.equals(replyCerts[i].getPublicKey())) {
-                break;
-            }
-        }
-        if (i == replyCerts.length) {
-            MessageFormat form = new MessageFormat(rb.getString
-                ("Certificate.reply.does.not.contain.public.key.for.alias."));
-            Object[] source = {alias};
-            throw new Exception(form.format(source));
-        }
-
-        Certificate tmpCert = replyCerts[0];
-        replyCerts[0] = replyCerts[i];
-        replyCerts[i] = tmpCert;
-
-        X509Certificate thisCert = (X509Certificate)replyCerts[0];
-
-        for (i=1; i < replyCerts.length-1; i++) {
-            // find a cert in the reply who signs thisCert
-            int j;
-            for (j=i; j<replyCerts.length; j++) {
-                if (signedBy(thisCert, (X509Certificate)replyCerts[j])) {
-                    tmpCert = replyCerts[i];
-                    replyCerts[i] = replyCerts[j];
-                    replyCerts[j] = tmpCert;
-                    thisCert = (X509Certificate)replyCerts[i];
-                    break;
-                }
-            }
-            if (j == replyCerts.length) {
-                throw new Exception
-                    (rb.getString("Incomplete.certificate.chain.in.reply"));
-            }
-        }
-
-        if (noprompt) {
-            return replyCerts;
-        }
-
-        // do we trust the cert at the top?
-        Certificate topCert = replyCerts[replyCerts.length-1];
-        Certificate root = getTrustedSigner(topCert, keyStore);
-        if (root == null && trustcacerts && caks != null) {
-            root = getTrustedSigner(topCert, caks);
-        }
-        if (root == null) {
-            System.err.println();
-            System.err.println
-                    (rb.getString("Top.level.certificate.in.reply."));
-            printX509Cert((X509Certificate)topCert, System.out);
-            System.err.println();
-            System.err.print(rb.getString(".is.not.trusted."));
-            String reply = getYesNoReply
-                    (rb.getString("Install.reply.anyway.no."));
-            if ("NO".equals(reply)) {
-                return null;
-            }
-        } else {
-            if (root != topCert) {
-                // append the root CA cert to the chain
-                Certificate[] tmpCerts =
-                    new Certificate[replyCerts.length+1];
-                System.arraycopy(replyCerts, 0, tmpCerts, 0,
-                                 replyCerts.length);
-                tmpCerts[tmpCerts.length-1] = root;
-                replyCerts = tmpCerts;
-            }
-        }
-
-        return replyCerts;
-    }
-
-    /**
-     * Establishes a certificate chain (using trusted certificates in the
-     * keystore), starting with the user certificate
-     * and ending at a self-signed certificate found in the keystore.
-     *
-     * @param userCert the user certificate of the alias
-     * @param certToVerify the single certificate provided in the reply
-     */
-    private Certificate[] establishCertChain(Certificate userCert,
-                                             Certificate certToVerify)
-        throws Exception
-    {
-        if (userCert != null) {
-            // Make sure that the public key of the certificate reply matches
-            // the original public key in the keystore
-            PublicKey origPubKey = userCert.getPublicKey();
-            PublicKey replyPubKey = certToVerify.getPublicKey();
-            if (!origPubKey.equals(replyPubKey)) {
-                throw new Exception(rb.getString
-                        ("Public.keys.in.reply.and.keystore.don.t.match"));
-            }
-
-            // If the two certs are identical, we're done: no need to import
-            // anything
-            if (certToVerify.equals(userCert)) {
-                throw new Exception(rb.getString
-                        ("Certificate.reply.and.certificate.in.keystore.are.identical"));
-            }
-        }
-
-        // Build a hash table of all certificates in the keystore.
-        // Use the subject distinguished name as the key into the hash table.
-        // All certificates associated with the same subject distinguished
-        // name are stored in the same hash table entry as a vector.
-        Hashtable<Principal, Vector<Certificate>> certs = null;
-        if (keyStore.size() > 0) {
-            certs = new Hashtable<Principal, Vector<Certificate>>(11);
-            keystorecerts2Hashtable(keyStore, certs);
-        }
-        if (trustcacerts) {
-            if (caks!=null && caks.size()>0) {
-                if (certs == null) {
-                    certs = new Hashtable<Principal, Vector<Certificate>>(11);
-                }
-                keystorecerts2Hashtable(caks, certs);
-            }
-        }
-
-        // start building chain
-        Vector<Certificate> chain = new Vector<>(2);
-        if (buildChain((X509Certificate)certToVerify, chain, certs)) {
-            Certificate[] newChain = new Certificate[chain.size()];
-            // buildChain() returns chain with self-signed root-cert first and
-            // user-cert last, so we need to invert the chain before we store
-            // it
-            int j=0;
-            for (int i=chain.size()-1; i>=0; i--) {
-                newChain[j] = chain.elementAt(i);
-                j++;
-            }
-            return newChain;
-        } else {
-            throw new Exception
-                (rb.getString("Failed.to.establish.chain.from.reply"));
-        }
-    }
-
-    /**
-     * Recursively tries to establish chain from pool of trusted certs.
-     *
-     * @param certToVerify the cert that needs to be verified.
-     * @param chain the chain that's being built.
-     * @param certs the pool of trusted certs
-     *
-     * @return true if successful, false otherwise.
-     */
-    private boolean buildChain(X509Certificate certToVerify,
-                        Vector<Certificate> chain,
-                        Hashtable<Principal, Vector<Certificate>> certs) {
-        Principal issuer = certToVerify.getIssuerDN();
-        if (isSelfSigned(certToVerify)) {
-            // reached self-signed root cert;
-            // no verification needed because it's trusted.
-            chain.addElement(certToVerify);
-            return true;
-        }
-
-        // Get the issuer's certificate(s)
-        Vector<Certificate> vec = certs.get(issuer);
-        if (vec == null) {
-            return false;
-        }
-
-        // Try out each certificate in the vector, until we find one
-        // whose public key verifies the signature of the certificate
-        // in question.
-        for (Enumeration<Certificate> issuerCerts = vec.elements();
-             issuerCerts.hasMoreElements(); ) {
-            X509Certificate issuerCert
-                = (X509Certificate)issuerCerts.nextElement();
-            PublicKey issuerPubKey = issuerCert.getPublicKey();
-            try {
-                certToVerify.verify(issuerPubKey);
-            } catch (Exception e) {
-                continue;
-            }
-            if (buildChain(issuerCert, chain, certs)) {
-                chain.addElement(certToVerify);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Prompts user for yes/no decision.
-     *
-     * @return the user's decision, can only be "YES" or "NO"
-     */
-    private String getYesNoReply(String prompt)
-        throws IOException
-    {
-        String reply = null;
-        int maxRetry = 20;
-        do {
-            if (maxRetry-- < 0) {
-                throw new RuntimeException(rb.getString(
-                        "Too.many.retries.program.terminated"));
-            }
-            System.err.print(prompt);
-            System.err.flush();
-            reply = (new BufferedReader(new InputStreamReader
-                                        (System.in))).readLine();
-            if (collator.compare(reply, "") == 0 ||
-                collator.compare(reply, rb.getString("n")) == 0 ||
-                collator.compare(reply, rb.getString("no")) == 0) {
-                reply = "NO";
-            } else if (collator.compare(reply, rb.getString("y")) == 0 ||
-                       collator.compare(reply, rb.getString("yes")) == 0) {
-                reply = "YES";
-            } else {
-                System.err.println(rb.getString("Wrong.answer.try.again"));
-                reply = null;
-            }
-        } while (reply == null);
-        return reply;
-    }
-
-    /**
-     * Returns the keystore with the configured CA certificates.
-     */
-    public static KeyStore getCacertsKeyStore()
-        throws Exception
-    {
-        String sep = File.separator;
-        File file = new File(System.getProperty("java.home") + sep
-                             + "lib" + sep + "security" + sep
-                             + "cacerts");
-        if (!file.exists()) {
-            return null;
-        }
-        KeyStore caks = null;
-        try (FileInputStream fis = new FileInputStream(file)) {
-            caks = KeyStore.getInstance(JKS);
-            caks.load(fis, null);
-        }
-        return caks;
-    }
-
-    /**
-     * Stores the (leaf) certificates of a keystore in a hashtable.
-     * All certs belonging to the same CA are stored in a vector that
-     * in turn is stored in the hashtable, keyed by the CA's subject DN
-     */
-    private void keystorecerts2Hashtable(KeyStore ks,
-                Hashtable<Principal, Vector<Certificate>> hash)
-        throws Exception {
-
-        for (Enumeration<String> aliases = ks.aliases();
-                                        aliases.hasMoreElements(); ) {
-            String alias = aliases.nextElement();
-            Certificate cert = ks.getCertificate(alias);
-            if (cert != null) {
-                Principal subjectDN = ((X509Certificate)cert).getSubjectDN();
-                Vector<Certificate> vec = hash.get(subjectDN);
-                if (vec == null) {
-                    vec = new Vector<Certificate>();
-                    vec.addElement(cert);
-                } else {
-                    if (!vec.contains(cert)) {
-                        vec.addElement(cert);
-                    }
-                }
-                hash.put(subjectDN, vec);
-            }
-        }
-    }
-
-    /**
-     * Returns the issue time that's specified the -startdate option
-     * @param s the value of -startdate option
-     */
-    private static Date getStartDate(String s) throws IOException {
-        Calendar c = new GregorianCalendar();
-        if (s != null) {
-            IOException ioe = new IOException(
-                    rb.getString("Illegal.startdate.value"));
-            int len = s.length();
-            if (len == 0) {
-                throw ioe;
-            }
-            if (s.charAt(0) == '-' || s.charAt(0) == '+') {
-                // Form 1: ([+-]nnn[ymdHMS])+
-                int start = 0;
-                while (start < len) {
-                    int sign = 0;
-                    switch (s.charAt(start)) {
-                        case '+': sign = 1; break;
-                        case '-': sign = -1; break;
-                        default: throw ioe;
-                    }
-                    int i = start+1;
-                    for (; i<len; i++) {
-                        char ch = s.charAt(i);
-                        if (ch < '0' || ch > '9') break;
-                    }
-                    if (i == start+1) throw ioe;
-                    int number = Integer.parseInt(s.substring(start+1, i));
-                    if (i >= len) throw ioe;
-                    int unit = 0;
-                    switch (s.charAt(i)) {
-                        case 'y': unit = Calendar.YEAR; break;
-                        case 'm': unit = Calendar.MONTH; break;
-                        case 'd': unit = Calendar.DATE; break;
-                        case 'H': unit = Calendar.HOUR; break;
-                        case 'M': unit = Calendar.MINUTE; break;
-                        case 'S': unit = Calendar.SECOND; break;
-                        default: throw ioe;
-                    }
-                    c.add(unit, sign * number);
-                    start = i + 1;
-                }
-            } else  {
-                // Form 2: [yyyy/mm/dd] [HH:MM:SS]
-                String date = null, time = null;
-                if (len == 19) {
-                    date = s.substring(0, 10);
-                    time = s.substring(11);
-                    if (s.charAt(10) != ' ')
-                        throw ioe;
-                } else if (len == 10) {
-                    date = s;
-                } else if (len == 8) {
-                    time = s;
-                } else {
-                    throw ioe;
-                }
-                if (date != null) {
-                    if (date.matches("\\d\\d\\d\\d\\/\\d\\d\\/\\d\\d")) {
-                        c.set(Integer.valueOf(date.substring(0, 4)),
-                                Integer.valueOf(date.substring(5, 7))-1,
-                                Integer.valueOf(date.substring(8, 10)));
-                    } else {
-                        throw ioe;
-                    }
-                }
-                if (time != null) {
-                    if (time.matches("\\d\\d:\\d\\d:\\d\\d")) {
-                        c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(time.substring(0, 2)));
-                        c.set(Calendar.MINUTE, Integer.valueOf(time.substring(0, 2)));
-                        c.set(Calendar.SECOND, Integer.valueOf(time.substring(0, 2)));
-                        c.set(Calendar.MILLISECOND, 0);
-                    } else {
-                        throw ioe;
-                    }
-                }
-            }
-        }
-        return c.getTime();
-    }
-
-    /**
-     * Match a command (may be abbreviated) with a command set.
-     * @param s the command provided
-     * @param list the legal command set. If there is a null, commands after it
-     * are regarded experimental, which means they are supported but their
-     * existence should not be revealed to user.
-     * @return the position of a single match, or -1 if none matched
-     * @throws Exception if s is ambiguous
-     */
-    private static int oneOf(String s, String... list) throws Exception {
-        int[] match = new int[list.length];
-        int nmatch = 0;
-        int experiment = Integer.MAX_VALUE;
-        for (int i = 0; i<list.length; i++) {
-            String one = list[i];
-            if (one == null) {
-                experiment = i;
-                continue;
-            }
-            if (one.toLowerCase(Locale.ENGLISH)
-                    .startsWith(s.toLowerCase(Locale.ENGLISH))) {
-                match[nmatch++] = i;
-            } else {
-                StringBuffer sb = new StringBuffer();
-                boolean first = true;
-                for (char c: one.toCharArray()) {
-                    if (first) {
-                        sb.append(c);
-                        first = false;
-                    } else {
-                        if (!Character.isLowerCase(c)) {
-                            sb.append(c);
-                        }
-                    }
-                }
-                if (sb.toString().equalsIgnoreCase(s)) {
-                    match[nmatch++] = i;
-                }
-            }
-        }
-        if (nmatch == 0) {
-            return -1;
-        } else if (nmatch == 1) {
-            return match[0];
-        } else {
-            // If multiple matches is in experimental commands, ignore them
-            if (match[1] > experiment) {
-                return match[0];
-            }
-            StringBuffer sb = new StringBuffer();
-            MessageFormat form = new MessageFormat(rb.getString
-                ("command.{0}.is.ambiguous."));
-            Object[] source = {s};
-            sb.append(form.format(source));
-            sb.append("\n    ");
-            for (int i=0; i<nmatch && match[i]<experiment; i++) {
-                sb.append(' ');
-                sb.append(list[match[i]]);
-            }
-            throw new Exception(sb.toString());
-        }
-    }
-
-    /**
-     * Create a GeneralName object from known types
-     * @param t one of 5 known types
-     * @param v value
-     * @return which one
-     */
-    private GeneralName createGeneralName(String t, String v)
-            throws Exception {
-        GeneralNameInterface gn;
-        int p = oneOf(t, "EMAIL", "URI", "DNS", "IP", "OID");
-        if (p < 0) {
-            throw new Exception(rb.getString(
-                    "Unrecognized.GeneralName.type.") + t);
-        }
-        switch (p) {
-            case 0: gn = new RFC822Name(v); break;
-            case 1: gn = new URIName(v); break;
-            case 2: gn = new DNSName(v); break;
-            case 3: gn = new IPAddressName(v); break;
-            default: gn = new OIDName(v); break; //4
-        }
-        return new GeneralName(gn);
-    }
-
-    private static final String[] extSupported = {
-                        "BasicConstraints",
-                        "KeyUsage",
-                        "ExtendedKeyUsage",
-                        "SubjectAlternativeName",
-                        "IssuerAlternativeName",
-                        "SubjectInfoAccess",
-                        "AuthorityInfoAccess",
-                        null,
-                        "CRLDistributionPoints",
-    };
-
-    private ObjectIdentifier findOidForExtName(String type)
-            throws Exception {
-        switch (oneOf(type, extSupported)) {
-            case 0: return PKIXExtensions.BasicConstraints_Id;
-            case 1: return PKIXExtensions.KeyUsage_Id;
-            case 2: return PKIXExtensions.ExtendedKeyUsage_Id;
-            case 3: return PKIXExtensions.SubjectAlternativeName_Id;
-            case 4: return PKIXExtensions.IssuerAlternativeName_Id;
-            case 5: return PKIXExtensions.SubjectInfoAccess_Id;
-            case 6: return PKIXExtensions.AuthInfoAccess_Id;
-            case 8: return PKIXExtensions.CRLDistributionPoints_Id;
-            default: return new ObjectIdentifier(type);
-        }
-    }
-
-    /**
-     * Create X509v3 extensions from a string representation. Note that the
-     * SubjectKeyIdentifierExtension will always be created non-critical besides
-     * the extension requested in the <code>extstr</code> argument.
-     *
-     * @param reqex the requested extensions, can be null, used for -gencert
-     * @param ext the original extensions, can be null, used for -selfcert
-     * @param extstrs -ext values, Read keytool doc
-     * @param pkey the public key for the certificate
-     * @param akey the public key for the authority (issuer)
-     * @return the created CertificateExtensions
-     */
-    private CertificateExtensions createV3Extensions(
-            CertificateExtensions reqex,
-            CertificateExtensions ext,
-            List <String> extstrs,
-            PublicKey pkey,
-            PublicKey akey) throws Exception {
-
-        if (ext != null && reqex != null) {
-            // This should not happen
-            throw new Exception("One of request and original should be null.");
-        }
-        if (ext == null) ext = new CertificateExtensions();
-        try {
-            // name{:critical}{=value}
-            // Honoring requested extensions
-            if (reqex != null) {
-                for(String extstr: extstrs) {
-                    if (extstr.toLowerCase(Locale.ENGLISH).startsWith("honored=")) {
-                        List<String> list = Arrays.asList(
-                                extstr.toLowerCase(Locale.ENGLISH).substring(8).split(","));
-                        // First check existence of "all"
-                        if (list.contains("all")) {
-                            ext = reqex;    // we know ext was null
-                        }
-                        // one by one for others
-                        for (String item: list) {
-                            if (item.equals("all")) continue;
-
-                            // add or remove
-                            boolean add = true;
-                            // -1, unchanged, 0 crtical, 1 non-critical
-                            int action = -1;
-                            String type = null;
-                            if (item.startsWith("-")) {
-                                add = false;
-                                type = item.substring(1);
-                            } else {
-                                int colonpos = item.indexOf(':');
-                                if (colonpos >= 0) {
-                                    type = item.substring(0, colonpos);
-                                    action = oneOf(item.substring(colonpos+1),
-                                            "critical", "non-critical");
-                                    if (action == -1) {
-                                        throw new Exception(rb.getString
-                                            ("Illegal.value.") + item);
-                                    }
-                                }
-                            }
-                            String n = reqex.getNameByOid(findOidForExtName(type));
-                            if (add) {
-                                Extension e = reqex.get(n);
-                                if (!e.isCritical() && action == 0
-                                        || e.isCritical() && action == 1) {
-                                    e = Extension.newExtension(
-                                            e.getExtensionId(),
-                                            !e.isCritical(),
-                                            e.getExtensionValue());
-                                    ext.set(n, e);
-                                }
-                            } else {
-                                ext.delete(n);
-                            }
-                        }
-                        break;
-                    }
-                }
-            }
-            for(String extstr: extstrs) {
-                String name, value;
-                boolean isCritical = false;
-
-                int eqpos = extstr.indexOf('=');
-                if (eqpos >= 0) {
-                    name = extstr.substring(0, eqpos);
-                    value = extstr.substring(eqpos+1);
-                } else {
-                    name = extstr;
-                    value = null;
-                }
-
-                int colonpos = name.indexOf(':');
-                if (colonpos >= 0) {
-                    if (oneOf(name.substring(colonpos+1), "critical") == 0) {
-                        isCritical = true;
-                    }
-                    name = name.substring(0, colonpos);
-                }
-
-                if (name.equalsIgnoreCase("honored")) {
-                    continue;
-                }
-                int exttype = oneOf(name, extSupported);
-                switch (exttype) {
-                    case 0:     // BC
-                        int pathLen = -1;
-                        boolean isCA = false;
-                        if (value == null) {
-                            isCA = true;
-                        } else {
-                            try {   // the abbr format
-                                pathLen = Integer.parseInt(value);
-                                isCA = true;
-                            } catch (NumberFormatException ufe) {
-                                // ca:true,pathlen:1
-                                for (String part: value.split(",")) {
-                                    String[] nv = part.split(":");
-                                    if (nv.length != 2) {
-                                        throw new Exception(rb.getString
-                                                ("Illegal.value.") + extstr);
-                                    } else {
-                                        if (nv[0].equalsIgnoreCase("ca")) {
-                                            isCA = Boolean.parseBoolean(nv[1]);
-                                        } else if (nv[0].equalsIgnoreCase("pathlen")) {
-                                            pathLen = Integer.parseInt(nv[1]);
-                                        } else {
-                                            throw new Exception(rb.getString
-                                                ("Illegal.value.") + extstr);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                        ext.set(BasicConstraintsExtension.NAME,
-                                new BasicConstraintsExtension(isCritical, isCA,
-                                pathLen));
-                        break;
-                    case 1:     // KU
-                        if(value != null) {
-                            boolean[] ok = new boolean[9];
-                            for (String s: value.split(",")) {
-                                int p = oneOf(s,
-                                       "digitalSignature",  // (0),
-                                       "nonRepudiation",    // (1)
-                                       "keyEncipherment",   // (2),
-                                       "dataEncipherment",  // (3),
-                                       "keyAgreement",      // (4),
-                                       "keyCertSign",       // (5),
-                                       "cRLSign",           // (6),
-                                       "encipherOnly",      // (7),
-                                       "decipherOnly",      // (8)
-                                       "contentCommitment"  // also (1)
-                                       );
-                                if (p < 0) {
-                                    throw new Exception(rb.getString("Unknown.keyUsage.type.") + s);
-                                }
-                                if (p == 9) p = 1;
-                                ok[p] = true;
-                            }
-                            KeyUsageExtension kue = new KeyUsageExtension(ok);
-                            // The above KeyUsageExtension constructor does not
-                            // allow isCritical value, so...
-                            ext.set(KeyUsageExtension.NAME, Extension.newExtension(
-                                    kue.getExtensionId(),
-                                    isCritical,
-                                    kue.getExtensionValue()));
-                        } else {
-                            throw new Exception(rb.getString
-                                    ("Illegal.value.") + extstr);
-                        }
-                        break;
-                    case 2:     // EKU
-                        if(value != null) {
-                            Vector<ObjectIdentifier> v = new Vector<>();
-                            for (String s: value.split(",")) {
-                                int p = oneOf(s,
-                                        "anyExtendedKeyUsage",
-                                        "serverAuth",       //1
-                                        "clientAuth",       //2
-                                        "codeSigning",      //3
-                                        "emailProtection",  //4
-                                        "",                 //5
-                                        "",                 //6
-                                        "",                 //7
-                                        "timeStamping",     //8
-                                        "OCSPSigning"       //9
-                                       );
-                                if (p < 0) {
-                                    try {
-                                        v.add(new ObjectIdentifier(s));
-                                    } catch (Exception e) {
-                                        throw new Exception(rb.getString(
-                                                "Unknown.extendedkeyUsage.type.") + s);
-                                    }
-                                } else if (p == 0) {
-                                    v.add(new ObjectIdentifier("2.5.29.37.0"));
-                                } else {
-                                    v.add(new ObjectIdentifier("1.3.6.1.5.5.7.3." + p));
-                                }
-                            }
-                            ext.set(ExtendedKeyUsageExtension.NAME,
-                                    new ExtendedKeyUsageExtension(isCritical, v));
-                        } else {
-                            throw new Exception(rb.getString
-                                    ("Illegal.value.") + extstr);
-                        }
-                        break;
-                    case 3:     // SAN
-                    case 4:     // IAN
-                        if(value != null) {
-                            String[] ps = value.split(",");
-                            GeneralNames gnames = new GeneralNames();
-                            for(String item: ps) {
-                                colonpos = item.indexOf(':');
-                                if (colonpos < 0) {
-                                    throw new Exception("Illegal item " + item + " in " + extstr);
-                                }
-                                String t = item.substring(0, colonpos);
-                                String v = item.substring(colonpos+1);
-                                gnames.add(createGeneralName(t, v));
-                            }
-                            if (exttype == 3) {
-                                ext.set(SubjectAlternativeNameExtension.NAME,
-                                        new SubjectAlternativeNameExtension(
-                                            isCritical, gnames));
-                            } else {
-                                ext.set(IssuerAlternativeNameExtension.NAME,
-                                        new IssuerAlternativeNameExtension(
-                                            isCritical, gnames));
-                            }
-                        } else {
-                            throw new Exception(rb.getString
-                                    ("Illegal.value.") + extstr);
-                        }
-                        break;
-                    case 5:     // SIA, always non-critical
-                    case 6:     // AIA, always non-critical
-                        if (isCritical) {
-                            throw new Exception(rb.getString(
-                                    "This.extension.cannot.be.marked.as.critical.") + extstr);
-                        }
-                        if(value != null) {
-                            List<AccessDescription> accessDescriptions =
-                                    new ArrayList<>();
-                            String[] ps = value.split(",");
-                            for(String item: ps) {
-                                colonpos = item.indexOf(':');
-                                int colonpos2 = item.indexOf(':', colonpos+1);
-                                if (colonpos < 0 || colonpos2 < 0) {
-                                    throw new Exception(rb.getString
-                                            ("Illegal.value.") + extstr);
-                                }
-                                String m = item.substring(0, colonpos);
-                                String t = item.substring(colonpos+1, colonpos2);
-                                String v = item.substring(colonpos2+1);
-                                int p = oneOf(m,
-                                        "",
-                                        "ocsp",         //1
-                                        "caIssuers",    //2
-                                        "timeStamping", //3
-                                        "",
-                                        "caRepository"  //5
-                                        );
-                                ObjectIdentifier oid;
-                                if (p < 0) {
-                                    try {
-                                        oid = new ObjectIdentifier(m);
-                                    } catch (Exception e) {
-                                        throw new Exception(rb.getString(
-                                                "Unknown.AccessDescription.type.") + m);
-                                    }
-                                } else {
-                                    oid = new ObjectIdentifier("1.3.6.1.5.5.7.48." + p);
-                                }
-                                accessDescriptions.add(new AccessDescription(
-                                        oid, createGeneralName(t, v)));
-                            }
-                            if (exttype == 5) {
-                                ext.set(SubjectInfoAccessExtension.NAME,
-                                        new SubjectInfoAccessExtension(accessDescriptions));
-                            } else {
-                                ext.set(AuthorityInfoAccessExtension.NAME,
-                                        new AuthorityInfoAccessExtension(accessDescriptions));
-                            }
-                        } else {
-                            throw new Exception(rb.getString
-                                    ("Illegal.value.") + extstr);
-                        }
-                        break;
-                    case 8: // CRL, experimental, only support 1 distributionpoint
-                        if(value != null) {
-                            String[] ps = value.split(",");
-                            GeneralNames gnames = new GeneralNames();
-                            for(String item: ps) {
-                                colonpos = item.indexOf(':');
-                                if (colonpos < 0) {
-                                    throw new Exception("Illegal item " + item + " in " + extstr);
-                                }
-                                String t = item.substring(0, colonpos);
-                                String v = item.substring(colonpos+1);
-                                gnames.add(createGeneralName(t, v));
-                            }
-                            ext.set(CRLDistributionPointsExtension.NAME,
-                                    new CRLDistributionPointsExtension(
-                                        isCritical, Collections.singletonList(
-                                        new DistributionPoint(gnames, null, null))));
-                        } else {
-                            throw new Exception(rb.getString
-                                    ("Illegal.value.") + extstr);
-                        }
-                        break;
-                    case -1:
-                        ObjectIdentifier oid = new ObjectIdentifier(name);
-                        byte[] data = null;
-                        if (value != null) {
-                            data = new byte[value.length() / 2 + 1];
-                            int pos = 0;
-                            for (char c: value.toCharArray()) {
-                                int hex;
-                                if (c >= '0' && c <= '9') {
-                                    hex = c - '0' ;
-                                } else if (c >= 'A' && c <= 'F') {
-                                    hex = c - 'A' + 10;
-                                } else if (c >= 'a' && c <= 'f') {
-                                    hex = c - 'a' + 10;
-                                } else {
-                                    continue;
-                                }
-                                if (pos % 2 == 0) {
-                                    data[pos/2] = (byte)(hex << 4);
-                                } else {
-                                    data[pos/2] += hex;
-                                }
-                                pos++;
-                            }
-                            if (pos % 2 != 0) {
-                                throw new Exception(rb.getString(
-                                        "Odd.number.of.hex.digits.found.") + extstr);
-                            }
-                            data = Arrays.copyOf(data, pos/2);
-                        } else {
-                            data = new byte[0];
-                        }
-                        ext.set(oid.toString(), new Extension(oid, isCritical,
-                                new DerValue(DerValue.tag_OctetString, data)
-                                        .toByteArray()));
-                        break;
-                    default:
-                        throw new Exception(rb.getString(
-                                "Unknown.extension.type.") + extstr);
-                }
-            }
-            // always non-critical
-            ext.set(SubjectKeyIdentifierExtension.NAME,
-                    new SubjectKeyIdentifierExtension(
-                        new KeyIdentifier(pkey).getIdentifier()));
-            if (akey != null && !pkey.equals(akey)) {
-                ext.set(AuthorityKeyIdentifierExtension.NAME,
-                        new AuthorityKeyIdentifierExtension(
-                        new KeyIdentifier(akey), null, null));
-            }
-        } catch(IOException e) {
-            throw new RuntimeException(e);
-        }
-        return ext;
-    }
-
-    /**
-     * Prints the usage of this tool.
-     */
-    private void usage() {
-        if (command != null) {
-            System.err.println("keytool " + command +
-                    rb.getString(".OPTION."));
-            System.err.println();
-            System.err.println(rb.getString(command.description));
-            System.err.println();
-            System.err.println(rb.getString("Options."));
-            System.err.println();
-
-            // Left and right sides of the options list
-            String[] left = new String[command.options.length];
-            String[] right = new String[command.options.length];
-
-            // Check if there's an unknown option
-            boolean found = false;
-
-            // Length of left side of options list
-            int lenLeft = 0;
-            for (int j=0; j<left.length; j++) {
-                Option opt = command.options[j];
-                left[j] = opt.toString();
-                if (opt.arg != null) left[j] += " " + opt.arg;
-                if (left[j].length() > lenLeft) {
-                    lenLeft = left[j].length();
-                }
-                right[j] = rb.getString(opt.description);
-            }
-            for (int j=0; j<left.length; j++) {
-                System.err.printf(" %-" + lenLeft + "s  %s\n",
-                        left[j], right[j]);
-            }
-            System.err.println();
-            System.err.println(rb.getString(
-                    "Use.keytool.help.for.all.available.commands"));
-        } else {
-            System.err.println(rb.getString(
-                    "Key.and.Certificate.Management.Tool"));
-            System.err.println();
-            System.err.println(rb.getString("Commands."));
-            System.err.println();
-            for (Command c: Command.values()) {
-                if (c == KEYCLONE) break;
-                System.err.printf(" %-20s%s\n", c, rb.getString(c.description));
-            }
-            System.err.println();
-            System.err.println(rb.getString(
-                    "Use.keytool.command.name.help.for.usage.of.command.name"));
-        }
-    }
-
-    private void tinyHelp() {
-        usage();
-        if (debug) {
-            throw new RuntimeException("NO BIG ERROR, SORRY");
-        } else {
-            System.exit(1);
-        }
-    }
-
-    private void errorNeedArgument(String flag) {
-        Object[] source = {flag};
-        System.err.println(new MessageFormat(
-                rb.getString("Command.option.flag.needs.an.argument.")).format(source));
-        tinyHelp();
-    }
-
-    private char[] getPass(String modifier, String arg) {
-        char[] output = getPassWithModifier(modifier, arg);
-        if (output != null) return output;
-        tinyHelp();
-        return null;    // Useless, tinyHelp() already exits.
-    }
-
-    // This method also used by JarSigner
-    public static char[] getPassWithModifier(String modifier, String arg) {
-        if (modifier == null) {
-            return arg.toCharArray();
-        } else if (collator.compare(modifier, "env") == 0) {
-            String value = System.getenv(arg);
-            if (value == null) {
-                System.err.println(rb.getString(
-                        "Cannot.find.environment.variable.") + arg);
-                return null;
-            } else {
-                return value.toCharArray();
-            }
-        } else if (collator.compare(modifier, "file") == 0) {
-            try {
-                URL url = null;
-                try {
-                    url = new URL(arg);
-                } catch (java.net.MalformedURLException mue) {
-                    File f = new File(arg);
-                    if (f.exists()) {
-                        url = f.toURI().toURL();
-                    } else {
-                        System.err.println(rb.getString(
-                                "Cannot.find.file.") + arg);
-                        return null;
-                    }
-                }
-                BufferedReader br = new BufferedReader(new InputStreamReader(
-                            url.openStream()));
-                String value = br.readLine();
-                br.close();
-                if (value == null) {
-                    return new char[0];
-                } else {
-                    return value.toCharArray();
-                }
-            } catch (IOException ioe) {
-                System.err.println(ioe);
-                return null;
-            }
-        } else {
-            System.err.println(rb.getString("Unknown.password.type.") +
-                    modifier);
-            return null;
-        }
-    }
-}
-
-// This class is exactly the same as com.sun.tools.javac.util.Pair,
-// it's copied here since the original one is not included in JRE.
-class Pair<A, B> {
-
-    public final A fst;
-    public final B snd;
-
-    public Pair(A fst, B snd) {
-        this.fst = fst;
-        this.snd = snd;
-    }
-
-    public String toString() {
-        return "Pair[" + fst + "," + snd + "]";
-    }
-
-    public boolean equals(Object other) {
-        return
-            other instanceof Pair &&
-            Objects.equals(fst, ((Pair)other).fst) &&
-            Objects.equals(snd, ((Pair)other).snd);
-    }
-
-    public int hashCode() {
-        if (fst == null) return (snd == null) ? 0 : snd.hashCode() + 1;
-        else if (snd == null) return fst.hashCode() + 2;
-        else return fst.hashCode() * 17 + snd.hashCode();
-    }
-
-    public static <A,B> Pair<A,B> of(A a, B b) {
-        return new Pair<>(a,b);
-    }
-}
-
--- a/src/share/classes/sun/security/tools/TimestampedSigner.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.tools;
-
-import java.io.IOException;
-import java.net.URI;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import com.sun.jarsigner.*;
-import sun.security.pkcs.PKCS7;
-import sun.security.util.*;
-import sun.security.x509.*;
-
-/**
- * This class implements a content signing service.
- * It generates a timestamped signature for a given content according to
- * <a href="http://www.ietf.org/rfc/rfc3161.txt">RFC 3161</a>.
- * The signature along with a trusted timestamp and the signer's certificate
- * are all packaged into a standard PKCS #7 Signed Data message.
- *
- * @author Vincent Ryan
- */
-
-public final class TimestampedSigner extends ContentSigner {
-
-    /*
-     * Object identifier for the subject information access X.509 certificate
-     * extension.
-     */
-    private static final String SUBJECT_INFO_ACCESS_OID = "1.3.6.1.5.5.7.1.11";
-
-    /*
-     * Object identifier for the timestamping access descriptors.
-     */
-    private static final ObjectIdentifier AD_TIMESTAMPING_Id;
-    static {
-        ObjectIdentifier tmp = null;
-        try {
-            tmp = new ObjectIdentifier("1.3.6.1.5.5.7.48.3");
-        } catch (IOException e) {
-            // ignore
-        }
-        AD_TIMESTAMPING_Id = tmp;
-    }
-
-    /**
-     * Instantiates a content signer that supports timestamped signatures.
-     */
-    public TimestampedSigner() {
-    }
-
-    /**
-     * Generates a PKCS #7 signed data message that includes a signature
-     * timestamp.
-     * This method is used when a signature has already been generated.
-     * The signature, a signature timestamp, the signer's certificate chain,
-     * and optionally the content that was signed, are packaged into a PKCS #7
-     * signed data message.
-     *
-     * @param params The non-null input parameters.
-     * @param omitContent true if the content should be omitted from the
-     *        signed data message. Otherwise the content is included.
-     * @param applyTimestamp true if the signature should be timestamped.
-     *        Otherwise timestamping is not performed.
-     * @return A PKCS #7 signed data message including a signature timestamp.
-     * @throws NoSuchAlgorithmException The exception is thrown if the signature
-     *         algorithm is unrecognised.
-     * @throws CertificateException The exception is thrown if an error occurs
-     *         while processing the signer's certificate or the TSA's
-     *         certificate.
-     * @throws IOException The exception is thrown if an error occurs while
-     *         generating the signature timestamp or while generating the signed
-     *         data message.
-     * @throws NullPointerException The exception is thrown if parameters is
-     *         null.
-     */
-    public byte[] generateSignedData(ContentSignerParameters params,
-        boolean omitContent, boolean applyTimestamp)
-            throws NoSuchAlgorithmException, CertificateException, IOException {
-
-        if (params == null) {
-            throw new NullPointerException();
-        }
-
-        // Parse the signature algorithm to extract the digest
-        // algorithm. The expected format is:
-        //     "<digest>with<encryption>"
-        // or  "<digest>with<encryption>and<mgf>"
-        String signatureAlgorithm = params.getSignatureAlgorithm();
-
-        X509Certificate[] signerChain = params.getSignerCertificateChain();
-        byte[] signature = params.getSignature();
-
-        // Include or exclude content
-        byte[] content = (omitContent == true) ? null : params.getContent();
-
-        URI tsaURI = null;
-        if (applyTimestamp) {
-            tsaURI = params.getTimestampingAuthority();
-            if (tsaURI == null) {
-                // Examine TSA cert
-                tsaURI = getTimestampingURI(
-                    params.getTimestampingAuthorityCertificate());
-                if (tsaURI == null) {
-                    throw new CertificateException(
-                        "Subject Information Access extension not found");
-                }
-            }
-        }
-        return PKCS7.generateSignedData(signature, signerChain, content,
-                                        params.getSignatureAlgorithm(), tsaURI);
-    }
-
-    /**
-     * Examine the certificate for a Subject Information Access extension
-     * (<a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a>).
-     * The extension's <tt>accessMethod</tt> field should contain the object
-     * identifier defined for timestamping: 1.3.6.1.5.5.7.48.3 and its
-     * <tt>accessLocation</tt> field should contain an HTTP or HTTPS URL.
-     *
-     * @param tsaCertificate An X.509 certificate for the TSA.
-     * @return An HTTP or HTTPS URI or null if none was found.
-     */
-    public static URI getTimestampingURI(X509Certificate tsaCertificate) {
-
-        if (tsaCertificate == null) {
-            return null;
-        }
-        // Parse the extensions
-        try {
-            byte[] extensionValue =
-                tsaCertificate.getExtensionValue(SUBJECT_INFO_ACCESS_OID);
-            if (extensionValue == null) {
-                return null;
-            }
-            DerInputStream der = new DerInputStream(extensionValue);
-            der = new DerInputStream(der.getOctetString());
-            DerValue[] derValue = der.getSequence(5);
-            AccessDescription description;
-            GeneralName location;
-            URIName uri;
-            for (int i = 0; i < derValue.length; i++) {
-                description = new AccessDescription(derValue[i]);
-                if (description.getAccessMethod()
-                        .equals((Object)AD_TIMESTAMPING_Id)) {
-                    location = description.getAccessLocation();
-                    if (location.getType() == GeneralNameInterface.NAME_URI) {
-                        uri = (URIName) location.getName();
-                        if (uri.getScheme().equalsIgnoreCase("http") ||
-                                uri.getScheme().equalsIgnoreCase("https")) {
-                            return uri.getURI();
-                        }
-                    }
-                }
-            }
-        } catch (IOException ioe) {
-            // ignore
-        }
-        return null;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/jarsigner/Main.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,2469 @@
+/*
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.jarsigner;
+
+import java.io.*;
+import java.util.*;
+import java.util.zip.*;
+import java.util.jar.*;
+import java.math.BigInteger;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.Collator;
+import java.text.MessageFormat;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.security.cert.CertificateException;
+import java.security.*;
+import java.lang.reflect.Constructor;
+
+import com.sun.jarsigner.ContentSigner;
+import com.sun.jarsigner.ContentSignerParameters;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathValidator;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.PKIXParameters;
+import java.security.cert.TrustAnchor;
+import java.util.Map.Entry;
+import sun.security.tools.KeyStoreUtil;
+import sun.security.tools.PathList;
+import sun.security.x509.*;
+import sun.security.util.*;
+import sun.misc.BASE64Encoder;
+
+
+/**
+ * <p>The jarsigner utility.
+ *
+ * The exit codes for the main method are:
+ *
+ * 0: success
+ * 1: any error that the jar cannot be signed or verified, including:
+ *      keystore loading error
+ *      TSP communication error
+ *      jarsigner command line error...
+ * otherwise: error codes from -strict
+ *
+ * @author Roland Schemers
+ * @author Jan Luehe
+ */
+
+public class Main {
+
+    // for i18n
+    private static final java.util.ResourceBundle rb =
+        java.util.ResourceBundle.getBundle
+        ("sun.security.tools.jarsigner.Resources");
+    private static final Collator collator = Collator.getInstance();
+    static {
+        // this is for case insensitive string comparisions
+        collator.setStrength(Collator.PRIMARY);
+    }
+
+    private static final String META_INF = "META-INF/";
+
+    // prefix for new signature-related files in META-INF directory
+    private static final String SIG_PREFIX = META_INF + "SIG-";
+
+    private static final Class[] PARAM_STRING = { String.class };
+
+    private static final String NONE = "NONE";
+    private static final String P11KEYSTORE = "PKCS11";
+
+    private static final long SIX_MONTHS = 180*24*60*60*1000L; //milliseconds
+
+    // Attention:
+    // This is the entry that get launched by the security tool jarsigner.
+    public static void main(String args[]) throws Exception {
+        Main js = new Main();
+        js.run(args);
+    }
+
+    static final String VERSION = "1.0";
+
+    static final int IN_KEYSTORE = 0x01;        // signer is in keystore
+    static final int IN_SCOPE = 0x02;
+    static final int NOT_ALIAS = 0x04;          // alias list is NOT empty and
+                                                // signer is not in alias list
+    static final int SIGNED_BY_ALIAS = 0x08;    // signer is in alias list
+
+    X509Certificate[] certChain;    // signer's cert chain (when composing)
+    PrivateKey privateKey;          // private key
+    KeyStore store;                 // the keystore specified by -keystore
+                                    // or the default keystore, never null
+
+    String keystore; // key store file
+    boolean nullStream = false; // null keystore input stream (NONE)
+    boolean token = false; // token-based keystore
+    String jarfile;  // jar files to sign or verify
+    String alias;    // alias to sign jar with
+    List<String> ckaliases = new ArrayList<>(); // aliases in -verify
+    char[] storepass; // keystore password
+    boolean protectedPath; // protected authentication path
+    String storetype; // keystore type
+    String providerName; // provider name
+    Vector<String> providers = null; // list of providers
+    // arguments for provider constructors
+    HashMap<String,String> providerArgs = new HashMap<>();
+    char[] keypass; // private key password
+    String sigfile; // name of .SF file
+    String sigalg; // name of signature algorithm
+    String digestalg = "SHA-256"; // name of digest algorithm
+    String signedjar; // output filename
+    String tsaUrl; // location of the Timestamping Authority
+    String tsaAlias; // alias for the Timestamping Authority's certificate
+    String altCertChain; // file to read alternative cert chain from
+    boolean verify = false; // verify the jar
+    String verbose = null; // verbose output when signing/verifying
+    boolean showcerts = false; // show certs when verifying
+    boolean debug = false; // debug
+    boolean signManifest = true; // "sign" the whole manifest
+    boolean externalSF = true; // leave the .SF out of the PKCS7 block
+    boolean strict = false;  // treat warnings as error
+
+    // read zip entry raw bytes
+    private ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
+    private byte[] buffer = new byte[8192];
+    private ContentSigner signingMechanism = null;
+    private String altSignerClass = null;
+    private String altSignerClasspath = null;
+    private ZipFile zipFile = null;
+
+    private boolean hasExpiredCert = false;
+    private boolean hasExpiringCert = false;
+    private boolean notYetValidCert = false;
+    private boolean chainNotValidated = false;
+    private boolean notSignedByAlias = false;
+    private boolean aliasNotInStore = false;
+    private boolean hasUnsignedEntry = false;
+    private boolean badKeyUsage = false;
+    private boolean badExtendedKeyUsage = false;
+    private boolean badNetscapeCertType = false;
+
+    CertificateFactory certificateFactory;
+    CertPathValidator validator;
+    PKIXParameters pkixParameters;
+
+    public void run(String args[]) {
+        try {
+            parseArgs(args);
+
+            // Try to load and install the specified providers
+            if (providers != null) {
+                ClassLoader cl = ClassLoader.getSystemClassLoader();
+                Enumeration<String> e = providers.elements();
+                while (e.hasMoreElements()) {
+                    String provName = e.nextElement();
+                    Class<?> provClass;
+                    if (cl != null) {
+                        provClass = cl.loadClass(provName);
+                    } else {
+                        provClass = Class.forName(provName);
+                    }
+
+                    String provArg = providerArgs.get(provName);
+                    Object obj;
+                    if (provArg == null) {
+                        obj = provClass.newInstance();
+                    } else {
+                        Constructor<?> c =
+                                provClass.getConstructor(PARAM_STRING);
+                        obj = c.newInstance(provArg);
+                    }
+
+                    if (!(obj instanceof Provider)) {
+                        MessageFormat form = new MessageFormat(rb.getString
+                            ("provName.not.a.provider"));
+                        Object[] source = {provName};
+                        throw new Exception(form.format(source));
+                    }
+                    Security.addProvider((Provider)obj);
+                }
+            }
+
+            if (verify) {
+                try {
+                    loadKeyStore(keystore, false);
+                } catch (Exception e) {
+                    if ((keystore != null) || (storepass != null)) {
+                        System.out.println(rb.getString("jarsigner.error.") +
+                                        e.getMessage());
+                        System.exit(1);
+                    }
+                }
+                /*              if (debug) {
+                    SignatureFileVerifier.setDebug(true);
+                    ManifestEntryVerifier.setDebug(true);
+                }
+                */
+                verifyJar(jarfile);
+            } else {
+                loadKeyStore(keystore, true);
+                getAliasInfo(alias);
+
+                // load the alternative signing mechanism
+                if (altSignerClass != null) {
+                    signingMechanism = loadSigningMechanism(altSignerClass,
+                        altSignerClasspath);
+                }
+                signJar(jarfile, alias, args);
+            }
+        } catch (Exception e) {
+            System.out.println(rb.getString("jarsigner.error.") + e);
+            if (debug) {
+                e.printStackTrace();
+            }
+            System.exit(1);
+        } finally {
+            // zero-out private key password
+            if (keypass != null) {
+                Arrays.fill(keypass, ' ');
+                keypass = null;
+            }
+            // zero-out keystore password
+            if (storepass != null) {
+                Arrays.fill(storepass, ' ');
+                storepass = null;
+            }
+        }
+
+        if (strict) {
+            int exitCode = 0;
+            if (hasExpiringCert) {
+                exitCode |= 2;
+            }
+            if (chainNotValidated || hasExpiredCert || notYetValidCert) {
+                exitCode |= 4;
+            }
+            if (badKeyUsage || badExtendedKeyUsage || badNetscapeCertType) {
+                exitCode |= 8;
+            }
+            if (hasUnsignedEntry) {
+                exitCode |= 16;
+            }
+            if (notSignedByAlias || aliasNotInStore) {
+                exitCode |= 32;
+            }
+            if (exitCode != 0) {
+                System.exit(exitCode);
+            }
+        }
+    }
+
+    /*
+     * Parse command line arguments.
+     */
+    void parseArgs(String args[]) {
+        /* parse flags */
+        int n = 0;
+
+        if (args.length == 0) fullusage();
+        for (n=0; n < args.length; n++) {
+
+            String flags = args[n];
+            String modifier = null;
+            if (flags.charAt(0) == '-') {
+                int pos = flags.indexOf(':');
+                if (pos > 0) {
+                    modifier = flags.substring(pos+1);
+                    flags = flags.substring(0, pos);
+                }
+            }
+
+            if (collator.compare(flags, "-keystore") == 0) {
+                if (++n == args.length) usageNoArg();
+                keystore = args[n];
+            } else if (collator.compare(flags, "-storepass") ==0) {
+                if (++n == args.length) usageNoArg();
+                storepass = getPass(modifier, args[n]);
+            } else if (collator.compare(flags, "-storetype") ==0) {
+                if (++n == args.length) usageNoArg();
+                storetype = args[n];
+            } else if (collator.compare(flags, "-providerName") ==0) {
+                if (++n == args.length) usageNoArg();
+                providerName = args[n];
+            } else if ((collator.compare(flags, "-provider") == 0) ||
+                        (collator.compare(flags, "-providerClass") == 0)) {
+                if (++n == args.length) usageNoArg();
+                if (providers == null) {
+                    providers = new Vector<String>(3);
+                }
+                providers.add(args[n]);
+
+                if (args.length > (n+1)) {
+                    flags = args[n+1];
+                    if (collator.compare(flags, "-providerArg") == 0) {
+                        if (args.length == (n+2)) usageNoArg();
+                        providerArgs.put(args[n], args[n+2]);
+                        n += 2;
+                    }
+                }
+            } else if (collator.compare(flags, "-protected") ==0) {
+                protectedPath = true;
+            } else if (collator.compare(flags, "-certchain") ==0) {
+                if (++n == args.length) usageNoArg();
+                altCertChain = args[n];
+            } else if (collator.compare(flags, "-debug") ==0) {
+                debug = true;
+            } else if (collator.compare(flags, "-keypass") ==0) {
+                if (++n == args.length) usageNoArg();
+                keypass = getPass(modifier, args[n]);
+            } else if (collator.compare(flags, "-sigfile") ==0) {
+                if (++n == args.length) usageNoArg();
+                sigfile = args[n];
+            } else if (collator.compare(flags, "-signedjar") ==0) {
+                if (++n == args.length) usageNoArg();
+                signedjar = args[n];
+            } else if (collator.compare(flags, "-tsa") ==0) {
+                if (++n == args.length) usageNoArg();
+                tsaUrl = args[n];
+            } else if (collator.compare(flags, "-tsacert") ==0) {
+                if (++n == args.length) usageNoArg();
+                tsaAlias = args[n];
+            } else if (collator.compare(flags, "-altsigner") ==0) {
+                if (++n == args.length) usageNoArg();
+                altSignerClass = args[n];
+            } else if (collator.compare(flags, "-altsignerpath") ==0) {
+                if (++n == args.length) usageNoArg();
+                altSignerClasspath = args[n];
+            } else if (collator.compare(flags, "-sectionsonly") ==0) {
+                signManifest = false;
+            } else if (collator.compare(flags, "-internalsf") ==0) {
+                externalSF = false;
+            } else if (collator.compare(flags, "-verify") ==0) {
+                verify = true;
+            } else if (collator.compare(flags, "-verbose") ==0) {
+                verbose = (modifier != null) ? modifier : "all";
+            } else if (collator.compare(flags, "-sigalg") ==0) {
+                if (++n == args.length) usageNoArg();
+                sigalg = args[n];
+            } else if (collator.compare(flags, "-digestalg") ==0) {
+                if (++n == args.length) usageNoArg();
+                digestalg = args[n];
+            } else if (collator.compare(flags, "-certs") ==0) {
+                showcerts = true;
+            } else if (collator.compare(flags, "-strict") ==0) {
+                strict = true;
+            } else if (collator.compare(flags, "-h") == 0 ||
+                        collator.compare(flags, "-help") == 0) {
+                fullusage();
+            } else {
+                if (!flags.startsWith("-")) {
+                    if (jarfile == null) {
+                        jarfile = flags;
+                    } else {
+                        alias = flags;
+                        ckaliases.add(alias);
+                    }
+                } else {
+                    System.err.println(
+                            rb.getString("Illegal.option.") + flags);
+                    usage();
+                }
+            }
+        }
+
+        // -certs must always be specified with -verbose
+        if (verbose == null) showcerts = false;
+
+        if (jarfile == null) {
+            System.err.println(rb.getString("Please.specify.jarfile.name"));
+            usage();
+        }
+        if (!verify && alias == null) {
+            System.err.println(rb.getString("Please.specify.alias.name"));
+            usage();
+        }
+        if (!verify && ckaliases.size() > 1) {
+            System.err.println(rb.getString("Only.one.alias.can.be.specified"));
+            usage();
+        }
+
+        if (storetype == null) {
+            storetype = KeyStore.getDefaultType();
+        }
+        storetype = KeyStoreUtil.niceStoreTypeName(storetype);
+
+        try {
+            if (signedjar != null && new File(signedjar).getCanonicalPath().equals(
+                    new File(jarfile).getCanonicalPath())) {
+                signedjar = null;
+            }
+        } catch (IOException ioe) {
+            // File system error?
+            // Just ignore it.
+        }
+
+        if (P11KEYSTORE.equalsIgnoreCase(storetype) ||
+                KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            token = true;
+            if (keystore == null) {
+                keystore = NONE;
+            }
+        }
+
+        if (NONE.equals(keystore)) {
+            nullStream = true;
+        }
+
+        if (token && !nullStream) {
+            System.err.println(MessageFormat.format(rb.getString
+                (".keystore.must.be.NONE.if.storetype.is.{0}"), storetype));
+            usage();
+        }
+
+        if (token && keypass != null) {
+            System.err.println(MessageFormat.format(rb.getString
+                (".keypass.can.not.be.specified.if.storetype.is.{0}"), storetype));
+            usage();
+        }
+
+        if (protectedPath) {
+            if (storepass != null || keypass != null) {
+                System.err.println(rb.getString
+                        ("If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified"));
+                usage();
+            }
+        }
+        if (KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            if (storepass != null || keypass != null) {
+                System.err.println(rb.getString
+                        ("If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified"));
+                usage();
+            }
+        }
+    }
+
+    static char[] getPass(String modifier, String arg) {
+        char[] output = KeyStoreUtil.getPassWithModifier(modifier, arg, rb);
+        if (output != null) return output;
+        usage();
+        return null;    // Useless, usage() already exit
+    }
+
+    static void usageNoArg() {
+        System.out.println(rb.getString("Option.lacks.argument"));
+        usage();
+    }
+
+    static void usage() {
+        System.out.println();
+        System.out.println(rb.getString("Please.type.jarsigner.help.for.usage"));
+        System.exit(1);
+    }
+
+    static void fullusage() {
+        System.out.println(rb.getString
+                ("Usage.jarsigner.options.jar.file.alias"));
+        System.out.println(rb.getString
+                (".jarsigner.verify.options.jar.file.alias."));
+        System.out.println();
+        System.out.println(rb.getString
+                (".keystore.url.keystore.location"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".storepass.password.password.for.keystore.integrity"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".storetype.type.keystore.type"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".keypass.password.password.for.private.key.if.different."));
+        System.out.println();
+        System.out.println(rb.getString
+                (".certchain.file.name.of.alternative.certchain.file"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".sigfile.file.name.of.SF.DSA.file"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".signedjar.file.name.of.signed.JAR.file"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".digestalg.algorithm.name.of.digest.algorithm"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".sigalg.algorithm.name.of.signature.algorithm"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".verify.verify.a.signed.JAR.file"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".verbose.suboptions.verbose.output.when.signing.verifying."));
+        System.out.println(rb.getString
+                (".suboptions.can.be.all.grouped.or.summary"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".certs.display.certificates.when.verbose.and.verifying"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".tsa.url.location.of.the.Timestamping.Authority"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".tsacert.alias.public.key.certificate.for.Timestamping.Authority"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".altsigner.class.class.name.of.an.alternative.signing.mechanism"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".internalsf.include.the.SF.file.inside.the.signature.block"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".sectionsonly.don.t.compute.hash.of.entire.manifest"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".protected.keystore.has.protected.authentication.path"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".providerName.name.provider.name"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".providerClass.class.name.of.cryptographic.service.provider.s"));
+        System.out.println(rb.getString
+                (".providerArg.arg.master.class.file.and.constructor.argument"));
+        System.out.println();
+        System.out.println(rb.getString
+                (".strict.treat.warnings.as.errors"));
+        System.out.println();
+
+        System.exit(0);
+    }
+
+    void verifyJar(String jarName)
+        throws Exception
+    {
+        boolean anySigned = false;  // if there exists entry inside jar signed
+        JarFile jf = null;
+
+        try {
+            jf = new JarFile(jarName, true);
+            Vector<JarEntry> entriesVec = new Vector<>();
+            byte[] buffer = new byte[8192];
+
+            Enumeration<JarEntry> entries = jf.entries();
+            while (entries.hasMoreElements()) {
+                JarEntry je = entries.nextElement();
+                entriesVec.addElement(je);
+                InputStream is = null;
+                try {
+                    is = jf.getInputStream(je);
+                    int n;
+                    while ((n = is.read(buffer, 0, buffer.length)) != -1) {
+                        // we just read. this will throw a SecurityException
+                        // if  a signature/digest check fails.
+                    }
+                } finally {
+                    if (is != null) {
+                        is.close();
+                    }
+                }
+            }
+
+            Manifest man = jf.getManifest();
+
+            // The map to record display info, only used when -verbose provided
+            //      key: signer info string
+            //      value: the list of files with common key
+            Map<String,List<String>> output = new LinkedHashMap<>();
+
+            if (man != null) {
+                if (verbose != null) System.out.println();
+                Enumeration<JarEntry> e = entriesVec.elements();
+
+                String tab = rb.getString("6SPACE");
+
+                while (e.hasMoreElements()) {
+                    JarEntry je = e.nextElement();
+                    String name = je.getName();
+                    CodeSigner[] signers = je.getCodeSigners();
+                    boolean isSigned = (signers != null);
+                    anySigned |= isSigned;
+                    hasUnsignedEntry |= !je.isDirectory() && !isSigned
+                                        && !signatureRelated(name);
+
+                    int inStoreOrScope = inKeyStore(signers);
+
+                    boolean inStore = (inStoreOrScope & IN_KEYSTORE) != 0;
+                    boolean inScope = (inStoreOrScope & IN_SCOPE) != 0;
+
+                    notSignedByAlias |= (inStoreOrScope & NOT_ALIAS) != 0;
+                    if (keystore != null) {
+                        aliasNotInStore |= isSigned && (!inStore && !inScope);
+                    }
+
+                    // Only used when -verbose provided
+                    StringBuffer sb = null;
+                    if (verbose != null) {
+                        sb = new StringBuffer();
+                        boolean inManifest =
+                            ((man.getAttributes(name) != null) ||
+                             (man.getAttributes("./"+name) != null) ||
+                             (man.getAttributes("/"+name) != null));
+                        sb.append(
+                          (isSigned ? rb.getString("s") : rb.getString("SPACE")) +
+                          (inManifest ? rb.getString("m") : rb.getString("SPACE")) +
+                          (inStore ? rb.getString("k") : rb.getString("SPACE")) +
+                          (inScope ? rb.getString("i") : rb.getString("SPACE")) +
+                          ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") +
+                          rb.getString("SPACE"));
+                        sb.append("|");
+                    }
+
+                    // When -certs provided, display info has extra empty
+                    // lines at the beginning and end.
+                    if (isSigned) {
+                        if (showcerts) sb.append('\n');
+                        for (CodeSigner signer: signers) {
+                            // signerInfo() must be called even if -verbose
+                            // not provided. The method updates various
+                            // warning flags.
+                            String si = signerInfo(signer, tab);
+                            if (showcerts) {
+                                sb.append(si);
+                                sb.append('\n');
+                            }
+                        }
+                    } else if (showcerts && !verbose.equals("all")) {
+                        // Print no info for unsigned entries when -verbose:all,
+                        // to be consistent with old behavior.
+                        if (signatureRelated(name)) {
+                            sb.append("\n" + tab + rb.getString(
+                                    ".Signature.related.entries.") + "\n\n");
+                        } else {
+                            sb.append("\n" + tab + rb.getString(
+                                    ".Unsigned.entries.") + "\n\n");
+                        }
+                    }
+
+                    if (verbose != null) {
+                        String label = sb.toString();
+                        if (signatureRelated(name)) {
+                            // Entries inside META-INF and other unsigned
+                            // entries are grouped separately.
+                            label = "-" + label;
+                        }
+
+                        // The label finally contains 2 parts separated by '|':
+                        // The legend displayed before the entry names, and
+                        // the cert info (if -certs specfied).
+
+                        if (!output.containsKey(label)) {
+                            output.put(label, new ArrayList<String>());
+                        }
+
+                        StringBuffer fb = new StringBuffer();
+                        String s = Long.toString(je.getSize());
+                        for (int i = 6 - s.length(); i > 0; --i) {
+                            fb.append(' ');
+                        }
+                        fb.append(s).append(' ').
+                                append(new Date(je.getTime()).toString());
+                        fb.append(' ').append(name);
+
+                        output.get(label).add(fb.toString());
+                    }
+                }
+            }
+            if (verbose != null) {
+                for (Entry<String,List<String>> s: output.entrySet()) {
+                    List<String> files = s.getValue();
+                    String key = s.getKey();
+                    if (key.charAt(0) == '-') { // the signature-related group
+                        key = key.substring(1);
+                    }
+                    int pipe = key.indexOf('|');
+                    if (verbose.equals("all")) {
+                        for (String f: files) {
+                            System.out.println(key.substring(0, pipe) + f);
+                            System.out.printf(key.substring(pipe+1));
+                        }
+                    } else {
+                        if (verbose.equals("grouped")) {
+                            for (String f: files) {
+                                System.out.println(key.substring(0, pipe) + f);
+                            }
+                        } else if (verbose.equals("summary")) {
+                            System.out.print(key.substring(0, pipe));
+                            if (files.size() > 1) {
+                                System.out.println(files.get(0) + " " +
+                                        String.format(rb.getString(
+                                        ".and.d.more."), files.size()-1));
+                            } else {
+                                System.out.println(files.get(0));
+                            }
+                        }
+                        System.out.printf(key.substring(pipe+1));
+                    }
+                }
+                System.out.println();
+                System.out.println(rb.getString(
+                    ".s.signature.was.verified."));
+                System.out.println(rb.getString(
+                    ".m.entry.is.listed.in.manifest"));
+                System.out.println(rb.getString(
+                    ".k.at.least.one.certificate.was.found.in.keystore"));
+                System.out.println(rb.getString(
+                    ".i.at.least.one.certificate.was.found.in.identity.scope"));
+                if (ckaliases.size() > 0) {
+                    System.out.println(rb.getString(
+                        ".X.not.signed.by.specified.alias.es."));
+                }
+                System.out.println();
+            }
+            if (man == null)
+                System.out.println(rb.getString("no.manifest."));
+
+            if (!anySigned) {
+                System.out.println(rb.getString(
+                      "jar.is.unsigned.signatures.missing.or.not.parsable."));
+            } else {
+                System.out.println(rb.getString("jar.verified."));
+                if (hasUnsignedEntry || hasExpiredCert || hasExpiringCert ||
+                    badKeyUsage || badExtendedKeyUsage || badNetscapeCertType ||
+                    notYetValidCert || chainNotValidated ||
+                    aliasNotInStore || notSignedByAlias) {
+
+                    System.out.println();
+                    System.out.println(rb.getString("Warning."));
+                    if (badKeyUsage) {
+                        System.out.println(
+                            rb.getString("This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing."));
+                    }
+
+                    if (badExtendedKeyUsage) {
+                        System.out.println(
+                            rb.getString("This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing."));
+                    }
+
+                    if (badNetscapeCertType) {
+                        System.out.println(
+                            rb.getString("This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing."));
+                    }
+
+                    if (hasUnsignedEntry) {
+                        System.out.println(rb.getString(
+                            "This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked."));
+                    }
+                    if (hasExpiredCert) {
+                        System.out.println(rb.getString(
+                            "This.jar.contains.entries.whose.signer.certificate.has.expired."));
+                    }
+                    if (hasExpiringCert) {
+                        System.out.println(rb.getString(
+                            "This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months."));
+                    }
+                    if (notYetValidCert) {
+                        System.out.println(rb.getString(
+                            "This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid."));
+                    }
+
+                    if (chainNotValidated) {
+                        System.out.println(
+                                rb.getString("This.jar.contains.entries.whose.certificate.chain.is.not.validated."));
+                    }
+
+                    if (notSignedByAlias) {
+                        System.out.println(
+                                rb.getString("This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es."));
+                    }
+
+                    if (aliasNotInStore) {
+                        System.out.println(rb.getString("This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore."));
+                    }
+                    if (! (verbose != null && showcerts)) {
+                        System.out.println();
+                        System.out.println(rb.getString(
+                            "Re.run.with.the.verbose.and.certs.options.for.more.details."));
+                    }
+                }
+            }
+            return;
+        } catch (Exception e) {
+            System.out.println(rb.getString("jarsigner.") + e);
+            if (debug) {
+                e.printStackTrace();
+            }
+        } finally { // close the resource
+            if (jf != null) {
+                jf.close();
+            }
+        }
+
+        System.exit(1);
+    }
+
+    private static MessageFormat validityTimeForm = null;
+    private static MessageFormat notYetTimeForm = null;
+    private static MessageFormat expiredTimeForm = null;
+    private static MessageFormat expiringTimeForm = null;
+
+    /*
+     * Display some details about a certificate:
+     *
+     * [<tab>] <cert-type> [", " <subject-DN>] [" (" <keystore-entry-alias> ")"]
+     * [<validity-period> | <expiry-warning>]
+     *
+     * Note: no newline character at the end
+     */
+    String printCert(String tab, Certificate c, boolean checkValidityPeriod,
+        Date timestamp, boolean checkUsage) {
+
+        StringBuilder certStr = new StringBuilder();
+        String space = rb.getString("SPACE");
+        X509Certificate x509Cert = null;
+
+        if (c instanceof X509Certificate) {
+            x509Cert = (X509Certificate) c;
+            certStr.append(tab).append(x509Cert.getType())
+                .append(rb.getString("COMMA"))
+                .append(x509Cert.getSubjectDN().getName());
+        } else {
+            certStr.append(tab).append(c.getType());
+        }
+
+        String alias = storeHash.get(c);
+        if (alias != null) {
+            certStr.append(space).append(alias);
+        }
+
+        if (checkValidityPeriod && x509Cert != null) {
+
+            certStr.append("\n").append(tab).append("[");
+            Date notAfter = x509Cert.getNotAfter();
+            try {
+                boolean printValidity = true;
+                if (timestamp == null) {
+                    x509Cert.checkValidity();
+                    // test if cert will expire within six months
+                    if (notAfter.getTime() < System.currentTimeMillis() + SIX_MONTHS) {
+                        hasExpiringCert = true;
+                        if (expiringTimeForm == null) {
+                            expiringTimeForm = new MessageFormat(
+                                rb.getString("certificate.will.expire.on"));
+                        }
+                        Object[] source = { notAfter };
+                        certStr.append(expiringTimeForm.format(source));
+                        printValidity = false;
+                    }
+                } else {
+                    x509Cert.checkValidity(timestamp);
+                }
+                if (printValidity) {
+                    if (validityTimeForm == null) {
+                        validityTimeForm = new MessageFormat(
+                            rb.getString("certificate.is.valid.from"));
+                    }
+                    Object[] source = { x509Cert.getNotBefore(), notAfter };
+                    certStr.append(validityTimeForm.format(source));
+                }
+            } catch (CertificateExpiredException cee) {
+                hasExpiredCert = true;
+
+                if (expiredTimeForm == null) {
+                    expiredTimeForm = new MessageFormat(
+                        rb.getString("certificate.expired.on"));
+                }
+                Object[] source = { notAfter };
+                certStr.append(expiredTimeForm.format(source));
+
+            } catch (CertificateNotYetValidException cnyve) {
+                notYetValidCert = true;
+
+                if (notYetTimeForm == null) {
+                    notYetTimeForm = new MessageFormat(
+                        rb.getString("certificate.is.not.valid.until"));
+                }
+                Object[] source = { x509Cert.getNotBefore() };
+                certStr.append(notYetTimeForm.format(source));
+            }
+            certStr.append("]");
+
+            if (checkUsage) {
+                boolean[] bad = new boolean[3];
+                checkCertUsage(x509Cert, bad);
+                if (bad[0] || bad[1] || bad[2]) {
+                    String x = "";
+                    if (bad[0]) {
+                        x ="KeyUsage";
+                    }
+                    if (bad[1]) {
+                        if (x.length() > 0) x = x + ", ";
+                        x = x + "ExtendedKeyUsage";
+                    }
+                    if (bad[2]) {
+                        if (x.length() > 0) x = x + ", ";
+                        x = x + "NetscapeCertType";
+                    }
+                    certStr.append("\n").append(tab)
+                        .append(MessageFormat.format(rb.getString(
+                        ".{0}.extension.does.not.support.code.signing."), x));
+                }
+            }
+        }
+        return certStr.toString();
+    }
+
+    private static MessageFormat signTimeForm = null;
+
+    private String printTimestamp(String tab, Timestamp timestamp) {
+
+        if (signTimeForm == null) {
+            signTimeForm =
+                new MessageFormat(rb.getString("entry.was.signed.on"));
+        }
+        Object[] source = { timestamp.getTimestamp() };
+
+        return new StringBuilder().append(tab).append("[")
+            .append(signTimeForm.format(source)).append("]").toString();
+    }
+
+    private Map<CodeSigner,Integer> cacheForInKS = new IdentityHashMap<>();
+
+    private int inKeyStoreForOneSigner(CodeSigner signer) {
+        if (cacheForInKS.containsKey(signer)) {
+            return cacheForInKS.get(signer);
+        }
+
+        boolean found = false;
+        int result = 0;
+        List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();
+        for (Certificate c : certs) {
+            String alias = storeHash.get(c);
+            if (alias != null) {
+                if (alias.startsWith("(")) {
+                    result |= IN_KEYSTORE;
+                } else if (alias.startsWith("[")) {
+                    result |= IN_SCOPE;
+                }
+                if (ckaliases.contains(alias.substring(1, alias.length() - 1))) {
+                    result |= SIGNED_BY_ALIAS;
+                }
+            } else {
+                if (store != null) {
+                    try {
+                        alias = store.getCertificateAlias(c);
+                    } catch (KeyStoreException kse) {
+                        // never happens, because keystore has been loaded
+                    }
+                    if (alias != null) {
+                        storeHash.put(c, "(" + alias + ")");
+                        found = true;
+                        result |= IN_KEYSTORE;
+                    }
+                }
+                if (ckaliases.contains(alias)) {
+                    result |= SIGNED_BY_ALIAS;
+                }
+            }
+        }
+        cacheForInKS.put(signer, result);
+        return result;
+    }
+
+    Hashtable<Certificate, String> storeHash = new Hashtable<>();
+
+    int inKeyStore(CodeSigner[] signers) {
+
+        if (signers == null)
+            return 0;
+
+        int output = 0;
+
+        for (CodeSigner signer: signers) {
+            int result = inKeyStoreForOneSigner(signer);
+            output |= result;
+        }
+        if (ckaliases.size() > 0 && (output & SIGNED_BY_ALIAS) == 0) {
+            output |= NOT_ALIAS;
+        }
+        return output;
+    }
+
+    void signJar(String jarName, String alias, String[] args)
+        throws Exception {
+        boolean aliasUsed = false;
+        X509Certificate tsaCert = null;
+
+        if (sigfile == null) {
+            sigfile = alias;
+            aliasUsed = true;
+        }
+
+        if (sigfile.length() > 8) {
+            sigfile = sigfile.substring(0, 8).toUpperCase(Locale.ENGLISH);
+        } else {
+            sigfile = sigfile.toUpperCase(Locale.ENGLISH);
+        }
+
+        StringBuilder tmpSigFile = new StringBuilder(sigfile.length());
+        for (int j = 0; j < sigfile.length(); j++) {
+            char c = sigfile.charAt(j);
+            if (!
+                ((c>= 'A' && c<= 'Z') ||
+                (c>= '0' && c<= '9') ||
+                (c == '-') ||
+                (c == '_'))) {
+                if (aliasUsed) {
+                    // convert illegal characters from the alias to be _'s
+                    c = '_';
+                } else {
+                 throw new
+                   RuntimeException(rb.getString
+                        ("signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or."));
+                }
+            }
+            tmpSigFile.append(c);
+        }
+
+        sigfile = tmpSigFile.toString();
+
+        String tmpJarName;
+        if (signedjar == null) tmpJarName = jarName+".sig";
+        else tmpJarName = signedjar;
+
+        File jarFile = new File(jarName);
+        File signedJarFile = new File(tmpJarName);
+
+        // Open the jar (zip) file
+        try {
+            zipFile = new ZipFile(jarName);
+        } catch (IOException ioe) {
+            error(rb.getString("unable.to.open.jar.file.")+jarName, ioe);
+        }
+
+        FileOutputStream fos = null;
+        try {
+            fos = new FileOutputStream(signedJarFile);
+        } catch (IOException ioe) {
+            error(rb.getString("unable.to.create.")+tmpJarName, ioe);
+        }
+
+        PrintStream ps = new PrintStream(fos);
+        ZipOutputStream zos = new ZipOutputStream(ps);
+
+        /* First guess at what they might be - we don't xclude RSA ones. */
+        String sfFilename = (META_INF + sigfile + ".SF").toUpperCase(Locale.ENGLISH);
+        String bkFilename = (META_INF + sigfile + ".DSA").toUpperCase(Locale.ENGLISH);
+
+        Manifest manifest = new Manifest();
+        Map<String,Attributes> mfEntries = manifest.getEntries();
+
+        // The Attributes of manifest before updating
+        Attributes oldAttr = null;
+
+        boolean mfModified = false;
+        boolean mfCreated = false;
+        byte[] mfRawBytes = null;
+
+        try {
+            MessageDigest digests[] = { MessageDigest.getInstance(digestalg) };
+
+            // Check if manifest exists
+            ZipEntry mfFile;
+            if ((mfFile = getManifestFile(zipFile)) != null) {
+                // Manifest exists. Read its raw bytes.
+                mfRawBytes = getBytes(zipFile, mfFile);
+                manifest.read(new ByteArrayInputStream(mfRawBytes));
+                oldAttr = (Attributes)(manifest.getMainAttributes().clone());
+            } else {
+                // Create new manifest
+                Attributes mattr = manifest.getMainAttributes();
+                mattr.putValue(Attributes.Name.MANIFEST_VERSION.toString(),
+                               "1.0");
+                String javaVendor = System.getProperty("java.vendor");
+                String jdkVersion = System.getProperty("java.version");
+                mattr.putValue("Created-By", jdkVersion + " (" +javaVendor
+                               + ")");
+                mfFile = new ZipEntry(JarFile.MANIFEST_NAME);
+                mfCreated = true;
+            }
+
+            /*
+             * For each entry in jar
+             * (except for signature-related META-INF entries),
+             * do the following:
+             *
+             * - if entry is not contained in manifest, add it to manifest;
+             * - if entry is contained in manifest, calculate its hash and
+             *   compare it with the one in the manifest; if they are
+             *   different, replace the hash in the manifest with the newly
+             *   generated one. (This may invalidate existing signatures!)
+             */
+            BASE64Encoder encoder = new JarBASE64Encoder();
+            Vector<ZipEntry> mfFiles = new Vector<>();
+
+            boolean wasSigned = false;
+
+            for (Enumeration<? extends ZipEntry> enum_=zipFile.entries();
+                        enum_.hasMoreElements();) {
+                ZipEntry ze = enum_.nextElement();
+
+                if (ze.getName().startsWith(META_INF)) {
+                    // Store META-INF files in vector, so they can be written
+                    // out first
+                    mfFiles.addElement(ze);
+
+                    if (SignatureFileVerifier.isBlockOrSF(
+                            ze.getName().toUpperCase(Locale.ENGLISH))) {
+                        wasSigned = true;
+                    }
+
+                    if (signatureRelated(ze.getName())) {
+                        // ignore signature-related and manifest files
+                        continue;
+                    }
+                }
+
+                if (manifest.getAttributes(ze.getName()) != null) {
+                    // jar entry is contained in manifest, check and
+                    // possibly update its digest attributes
+                    if (updateDigests(ze, zipFile, digests, encoder,
+                                      manifest) == true) {
+                        mfModified = true;
+                    }
+                } else if (!ze.isDirectory()) {
+                    // Add entry to manifest
+                    Attributes attrs = getDigestAttributes(ze, zipFile,
+                                                           digests,
+                                                           encoder);
+                    mfEntries.put(ze.getName(), attrs);
+                    mfModified = true;
+                }
+            }
+
+            // Recalculate the manifest raw bytes if necessary
+            if (mfModified) {
+                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                manifest.write(baos);
+                if (wasSigned) {
+                    byte[] newBytes = baos.toByteArray();
+                    if (mfRawBytes != null
+                            && oldAttr.equals(manifest.getMainAttributes())) {
+
+                        /*
+                         * Note:
+                         *
+                         * The Attributes object is based on HashMap and can handle
+                         * continuation columns. Therefore, even if the contents are
+                         * not changed (in a Map view), the bytes that it write()
+                         * may be different from the original bytes that it read()
+                         * from. Since the signature on the main attributes is based
+                         * on raw bytes, we must retain the exact bytes.
+                         */
+
+                        int newPos = findHeaderEnd(newBytes);
+                        int oldPos = findHeaderEnd(mfRawBytes);
+
+                        if (newPos == oldPos) {
+                            System.arraycopy(mfRawBytes, 0, newBytes, 0, oldPos);
+                        } else {
+                            // cat oldHead newTail > newBytes
+                            byte[] lastBytes = new byte[oldPos +
+                                    newBytes.length - newPos];
+                            System.arraycopy(mfRawBytes, 0, lastBytes, 0, oldPos);
+                            System.arraycopy(newBytes, newPos, lastBytes, oldPos,
+                                    newBytes.length - newPos);
+                            newBytes = lastBytes;
+                        }
+                    }
+                    mfRawBytes = newBytes;
+                } else {
+                    mfRawBytes = baos.toByteArray();
+                }
+            }
+
+            // Write out the manifest
+            if (mfModified) {
+                // manifest file has new length
+                mfFile = new ZipEntry(JarFile.MANIFEST_NAME);
+            }
+            if (verbose != null) {
+                if (mfCreated) {
+                    System.out.println(rb.getString(".adding.") +
+                                        mfFile.getName());
+                } else if (mfModified) {
+                    System.out.println(rb.getString(".updating.") +
+                                        mfFile.getName());
+                }
+            }
+            zos.putNextEntry(mfFile);
+            zos.write(mfRawBytes);
+
+            // Calculate SignatureFile (".SF") and SignatureBlockFile
+            ManifestDigester manDig = new ManifestDigester(mfRawBytes);
+            SignatureFile sf = new SignatureFile(digests, manifest, manDig,
+                                                 sigfile, signManifest);
+
+            if (tsaAlias != null) {
+                tsaCert = getTsaCert(tsaAlias);
+            }
+
+            SignatureFile.Block block = null;
+
+            try {
+                block =
+                    sf.generateBlock(privateKey, sigalg, certChain,
+                        externalSF, tsaUrl, tsaCert, signingMechanism, args,
+                        zipFile);
+            } catch (SocketTimeoutException e) {
+                // Provide a helpful message when TSA is beyond a firewall
+                error(rb.getString("unable.to.sign.jar.") +
+                rb.getString("no.response.from.the.Timestamping.Authority.") +
+                "\n  -J-Dhttp.proxyHost=<hostname>" +
+                "\n  -J-Dhttp.proxyPort=<portnumber>\n" +
+                rb.getString("or") +
+                "\n  -J-Dhttps.proxyHost=<hostname> " +
+                "\n  -J-Dhttps.proxyPort=<portnumber> ", e);
+            }
+
+            sfFilename = sf.getMetaName();
+            bkFilename = block.getMetaName();
+
+            ZipEntry sfFile = new ZipEntry(sfFilename);
+            ZipEntry bkFile = new ZipEntry(bkFilename);
+
+            long time = System.currentTimeMillis();
+            sfFile.setTime(time);
+            bkFile.setTime(time);
+
+            // signature file
+            zos.putNextEntry(sfFile);
+            sf.write(zos);
+            if (verbose != null) {
+                if (zipFile.getEntry(sfFilename) != null) {
+                    System.out.println(rb.getString(".updating.") +
+                                sfFilename);
+                } else {
+                    System.out.println(rb.getString(".adding.") +
+                                sfFilename);
+                }
+            }
+
+            if (verbose != null) {
+                if (tsaUrl != null || tsaCert != null) {
+                    System.out.println(
+                        rb.getString("requesting.a.signature.timestamp"));
+                }
+                if (tsaUrl != null) {
+                    System.out.println(rb.getString("TSA.location.") + tsaUrl);
+                }
+                if (tsaCert != null) {
+                    URI tsaURI = TimestampedSigner.getTimestampingURI(tsaCert);
+                    if (tsaURI != null) {
+                        System.out.println(rb.getString("TSA.location.") +
+                            tsaURI);
+                    }
+                    System.out.println(rb.getString("TSA.certificate.") +
+                        printCert("", tsaCert, false, null, false));
+                }
+                if (signingMechanism != null) {
+                    System.out.println(
+                        rb.getString("using.an.alternative.signing.mechanism"));
+                }
+            }
+
+            // signature block file
+            zos.putNextEntry(bkFile);
+            block.write(zos);
+            if (verbose != null) {
+                if (zipFile.getEntry(bkFilename) != null) {
+                    System.out.println(rb.getString(".updating.") +
+                        bkFilename);
+                } else {
+                    System.out.println(rb.getString(".adding.") +
+                        bkFilename);
+                }
+            }
+
+            // Write out all other META-INF files that we stored in the
+            // vector
+            for (int i=0; i<mfFiles.size(); i++) {
+                ZipEntry ze = mfFiles.elementAt(i);
+                if (!ze.getName().equalsIgnoreCase(JarFile.MANIFEST_NAME)
+                    && !ze.getName().equalsIgnoreCase(sfFilename)
+                    && !ze.getName().equalsIgnoreCase(bkFilename)) {
+                    writeEntry(zipFile, zos, ze);
+                }
+            }
+
+            // Write out all other files
+            for (Enumeration<? extends ZipEntry> enum_=zipFile.entries();
+                        enum_.hasMoreElements();) {
+                ZipEntry ze = enum_.nextElement();
+
+                if (!ze.getName().startsWith(META_INF)) {
+                    if (verbose != null) {
+                        if (manifest.getAttributes(ze.getName()) != null)
+                          System.out.println(rb.getString(".signing.") +
+                                ze.getName());
+                        else
+                          System.out.println(rb.getString(".adding.") +
+                                ze.getName());
+                    }
+                    writeEntry(zipFile, zos, ze);
+                }
+            }
+        } catch(IOException ioe) {
+            error(rb.getString("unable.to.sign.jar.")+ioe, ioe);
+        } finally {
+            // close the resouces
+            if (zipFile != null) {
+                zipFile.close();
+                zipFile = null;
+            }
+
+            if (zos != null) {
+                zos.close();
+            }
+        }
+
+        // no IOException thrown in the follow try clause, so disable
+        // the try clause.
+        // try {
+            if (signedjar == null) {
+                // attempt an atomic rename. If that fails,
+                // rename the original jar file, then the signed
+                // one, then delete the original.
+                if (!signedJarFile.renameTo(jarFile)) {
+                    File origJar = new File(jarName+".orig");
+
+                    if (jarFile.renameTo(origJar)) {
+                        if (signedJarFile.renameTo(jarFile)) {
+                            origJar.delete();
+                        } else {
+                            MessageFormat form = new MessageFormat(rb.getString
+                        ("attempt.to.rename.signedJarFile.to.jarFile.failed"));
+                            Object[] source = {signedJarFile, jarFile};
+                            error(form.format(source));
+                        }
+                    } else {
+                        MessageFormat form = new MessageFormat(rb.getString
+                            ("attempt.to.rename.jarFile.to.origJar.failed"));
+                        Object[] source = {jarFile, origJar};
+                        error(form.format(source));
+                    }
+                }
+            }
+
+            if (hasExpiredCert || hasExpiringCert || notYetValidCert
+                    || badKeyUsage || badExtendedKeyUsage
+                    || badNetscapeCertType || chainNotValidated) {
+                System.out.println();
+
+                System.out.println(rb.getString("Warning."));
+                if (badKeyUsage) {
+                    System.out.println(
+                        rb.getString("The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing."));
+                }
+
+                if (badExtendedKeyUsage) {
+                    System.out.println(
+                        rb.getString("The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing."));
+                }
+
+                if (badNetscapeCertType) {
+                    System.out.println(
+                        rb.getString("The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing."));
+                }
+
+                if (hasExpiredCert) {
+                    System.out.println(
+                        rb.getString("The.signer.certificate.has.expired."));
+                } else if (hasExpiringCert) {
+                    System.out.println(
+                        rb.getString("The.signer.certificate.will.expire.within.six.months."));
+                } else if (notYetValidCert) {
+                    System.out.println(
+                        rb.getString("The.signer.certificate.is.not.yet.valid."));
+                }
+
+                if (chainNotValidated) {
+                    System.out.println(
+                            rb.getString("The.signer.s.certificate.chain.is.not.validated."));
+                }
+            }
+
+        // no IOException thrown in the above try clause, so disable
+        // the catch clause.
+        // } catch(IOException ioe) {
+        //     error(rb.getString("unable.to.sign.jar.")+ioe, ioe);
+        // }
+    }
+
+    /**
+     * Find the length of header inside bs. The header is a multiple (>=0)
+     * 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
+        int len = bs.length;
+        for (int i=0; i<len; i++) {
+            switch (bs[i]) {
+                case '\r':
+                    if (i < len - 1 && bs[i+1] == '\n') i++;
+                    // fallthrough
+                case '\n':
+                    if (newline) return i+1;    //+1 to get length
+                    newline = true;
+                    break;
+                default:
+                    newline = false;
+            }
+        }
+        // If header end is not found, it means the MANIFEST.MF has only
+        // the main attributes section and it does not end with 2 newlines.
+        // Returns the whole length so that it can be completely replaced.
+        return len;
+    }
+
+    /**
+     * signature-related files include:
+     * . META-INF/MANIFEST.MF
+     * . META-INF/SIG-*
+     * . META-INF/*.SF
+     * . META-INF/*.DSA
+     * . META-INF/*.RSA
+     * . META-INF/*.EC
+     */
+    private boolean signatureRelated(String name) {
+        String ucName = name.toUpperCase(Locale.ENGLISH);
+        if (ucName.equals(JarFile.MANIFEST_NAME) ||
+            ucName.equals(META_INF) ||
+            (ucName.startsWith(SIG_PREFIX) &&
+                ucName.indexOf("/") == ucName.lastIndexOf("/"))) {
+            return true;
+        }
+
+        if (ucName.startsWith(META_INF) &&
+            SignatureFileVerifier.isBlockOrSF(ucName)) {
+            // .SF/.DSA/.RSA/.EC files in META-INF subdirs
+            // are not considered signature-related
+            return (ucName.indexOf("/") == ucName.lastIndexOf("/"));
+        }
+
+        return false;
+    }
+
+    Map<CodeSigner,String> cacheForSignerInfo = new IdentityHashMap<>();
+
+    /**
+     * Returns a string of singer info, with a newline at the end
+     */
+    private String signerInfo(CodeSigner signer, String tab) {
+        if (cacheForSignerInfo.containsKey(signer)) {
+            return cacheForSignerInfo.get(signer);
+        }
+        StringBuffer s = new StringBuffer();
+        List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();
+        // display the signature timestamp, if present
+        Date timestamp;
+        Timestamp ts = signer.getTimestamp();
+        if (ts != null) {
+            s.append(printTimestamp(tab, ts));
+            s.append('\n');
+            timestamp = ts.getTimestamp();
+        } else {
+            timestamp = null;
+        }
+        // display the certificate(s). The first one is end-entity cert and
+        // its KeyUsage should be checked.
+        boolean first = true;
+        for (Certificate c : certs) {
+            s.append(printCert(tab, c, true, timestamp, first));
+            s.append('\n');
+            first = false;
+        }
+        try {
+            CertPath cp = certificateFactory.generateCertPath(certs);
+            validator.validate(cp, pkixParameters);
+        } catch (Exception e) {
+            if (debug) {
+                e.printStackTrace();
+            }
+            if (e.getCause() != null &&
+                    (e.getCause() instanceof CertificateExpiredException ||
+                     e.getCause() instanceof CertificateNotYetValidException)) {
+                // No more warning, we alreay have hasExpiredCert or notYetValidCert
+            } else {
+                chainNotValidated = true;
+                s.append(tab + rb.getString(".CertPath.not.validated.") +
+                        e.getLocalizedMessage() + "]\n");   // TODO
+            }
+        }
+        String result = s.toString();
+        cacheForSignerInfo.put(signer, result);
+        return result;
+    }
+
+    private void writeEntry(ZipFile zf, ZipOutputStream os, ZipEntry ze)
+    throws IOException
+    {
+        ZipEntry ze2 = new ZipEntry(ze.getName());
+        ze2.setMethod(ze.getMethod());
+        ze2.setTime(ze.getTime());
+        ze2.setComment(ze.getComment());
+        ze2.setExtra(ze.getExtra());
+        if (ze.getMethod() == ZipEntry.STORED) {
+            ze2.setSize(ze.getSize());
+            ze2.setCrc(ze.getCrc());
+        }
+        os.putNextEntry(ze2);
+        writeBytes(zf, ze, os);
+    }
+
+    /**
+     * Writes all the bytes for a given entry to the specified output stream.
+     */
+    private synchronized void writeBytes
+        (ZipFile zf, ZipEntry ze, ZipOutputStream os) throws IOException {
+        int n;
+
+        InputStream is = null;
+        try {
+            is = zf.getInputStream(ze);
+            long left = ze.getSize();
+
+            while((left > 0) && (n = is.read(buffer, 0, buffer.length)) != -1) {
+                os.write(buffer, 0, n);
+                left -= n;
+            }
+        } finally {
+            if (is != null) {
+                is.close();
+            }
+        }
+    }
+
+    void loadKeyStore(String keyStoreName, boolean prompt) {
+
+        if (!nullStream && keyStoreName == null) {
+            keyStoreName = System.getProperty("user.home") + File.separator
+                + ".keystore";
+        }
+
+        try {
+
+            certificateFactory = CertificateFactory.getInstance("X.509");
+            validator = CertPathValidator.getInstance("PKIX");
+            Set<TrustAnchor> tas = new HashSet<>();
+            try {
+                KeyStore caks = KeyStoreUtil.getCacertsKeyStore();
+                if (caks != null) {
+                    Enumeration<String> aliases = caks.aliases();
+                    while (aliases.hasMoreElements()) {
+                        String a = aliases.nextElement();
+                        try {
+                            tas.add(new TrustAnchor((X509Certificate)caks.getCertificate(a), null));
+                        } catch (Exception e2) {
+                            // ignore, when a SecretkeyEntry does not include a cert
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                // Ignore, if cacerts cannot be loaded
+            }
+
+            if (providerName == null) {
+                store = KeyStore.getInstance(storetype);
+            } else {
+                store = KeyStore.getInstance(storetype, providerName);
+            }
+
+            // Get pass phrase
+            // XXX need to disable echo; on UNIX, call getpass(char *prompt)Z
+            // and on NT call ??
+            if (token && storepass == null && !protectedPath
+                    && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
+                storepass = getPass
+                        (rb.getString("Enter.Passphrase.for.keystore."));
+            } else if (!token && storepass == null && prompt) {
+                storepass = getPass
+                        (rb.getString("Enter.Passphrase.for.keystore."));
+            }
+
+            try {
+                if (nullStream) {
+                    store.load(null, storepass);
+                } else {
+                    keyStoreName = keyStoreName.replace(File.separatorChar, '/');
+                    URL url = null;
+                    try {
+                        url = new URL(keyStoreName);
+                    } catch (java.net.MalformedURLException e) {
+                        // try as file
+                        url = new File(keyStoreName).toURI().toURL();
+                    }
+                    InputStream is = null;
+                    try {
+                        is = url.openStream();
+                        store.load(is, storepass);
+                    } finally {
+                        if (is != null) {
+                            is.close();
+                        }
+                    }
+                }
+                Enumeration<String> aliases = store.aliases();
+                while (aliases.hasMoreElements()) {
+                    String a = aliases.nextElement();
+                    try {
+                        X509Certificate c = (X509Certificate)store.getCertificate(a);
+                        // Only add TrustedCertificateEntry and self-signed
+                        // PrivateKeyEntry
+                        if (store.isCertificateEntry(a) ||
+                                c.getSubjectDN().equals(c.getIssuerDN())) {
+                            tas.add(new TrustAnchor(c, null));
+                        }
+                    } catch (Exception e2) {
+                        // ignore, when a SecretkeyEntry does not include a cert
+                    }
+                }
+            } finally {
+                try {
+                    pkixParameters = new PKIXParameters(tas);
+                    pkixParameters.setRevocationEnabled(false);
+                } catch (InvalidAlgorithmParameterException ex) {
+                    // Only if tas is empty
+                }
+            }
+        } catch (IOException ioe) {
+            throw new RuntimeException(rb.getString("keystore.load.") +
+                                        ioe.getMessage());
+        } catch (java.security.cert.CertificateException ce) {
+            throw new RuntimeException(rb.getString("certificate.exception.") +
+                                        ce.getMessage());
+        } catch (NoSuchProviderException pe) {
+            throw new RuntimeException(rb.getString("keystore.load.") +
+                                        pe.getMessage());
+        } catch (NoSuchAlgorithmException nsae) {
+            throw new RuntimeException(rb.getString("keystore.load.") +
+                                        nsae.getMessage());
+        } catch (KeyStoreException kse) {
+            throw new RuntimeException
+                (rb.getString("unable.to.instantiate.keystore.class.") +
+                kse.getMessage());
+        }
+    }
+
+    X509Certificate getTsaCert(String alias) {
+
+        java.security.cert.Certificate cs = null;
+
+        try {
+            cs = store.getCertificate(alias);
+        } catch (KeyStoreException kse) {
+            // this never happens, because keystore has been loaded
+        }
+        if (cs == null || (!(cs instanceof X509Certificate))) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the"));
+            Object[] source = {alias, alias};
+            error(form.format(source));
+        }
+        return (X509Certificate) cs;
+    }
+
+    /**
+     * Check if userCert is designed to be a code signer
+     * @param userCert the certificate to be examined
+     * @param bad 3 booleans to show if the KeyUsage, ExtendedKeyUsage,
+     *            NetscapeCertType has codeSigning flag turned on.
+     *            If null, the class field badKeyUsage, badExtendedKeyUsage,
+     *            badNetscapeCertType will be set.
+     */
+    void checkCertUsage(X509Certificate userCert, boolean[] bad) {
+
+        // Can act as a signer?
+        // 1. if KeyUsage, then [0:digitalSignature] or
+        //    [1:nonRepudiation] should be true
+        // 2. if ExtendedKeyUsage, then should contains ANY or CODE_SIGNING
+        // 3. if NetscapeCertType, then should contains OBJECT_SIGNING
+        // 1,2,3 must be true
+
+        if (bad != null) {
+            bad[0] = bad[1] = bad[2] = false;
+        }
+
+        boolean[] keyUsage = userCert.getKeyUsage();
+        if (keyUsage != null) {
+            keyUsage = Arrays.copyOf(keyUsage, 9);
+            if (!keyUsage[0] && !keyUsage[1]) {
+                if (bad != null) {
+                    bad[0] = true;
+                    badKeyUsage = true;
+                }
+            }
+        }
+
+        try {
+            List<String> xKeyUsage = userCert.getExtendedKeyUsage();
+            if (xKeyUsage != null) {
+                if (!xKeyUsage.contains("2.5.29.37.0") // anyExtendedKeyUsage
+                        && !xKeyUsage.contains("1.3.6.1.5.5.7.3.3")) {  // codeSigning
+                    if (bad != null) {
+                        bad[1] = true;
+                        badExtendedKeyUsage = true;
+                    }
+                }
+            }
+        } catch (java.security.cert.CertificateParsingException e) {
+            // shouldn't happen
+        }
+
+        try {
+            // OID_NETSCAPE_CERT_TYPE
+            byte[] netscapeEx = userCert.getExtensionValue
+                    ("2.16.840.1.113730.1.1");
+            if (netscapeEx != null) {
+                DerInputStream in = new DerInputStream(netscapeEx);
+                byte[] encoded = in.getOctetString();
+                encoded = new DerValue(encoded).getUnalignedBitString()
+                        .toByteArray();
+
+                NetscapeCertTypeExtension extn =
+                        new NetscapeCertTypeExtension(encoded);
+
+                Boolean val = extn.get(NetscapeCertTypeExtension.OBJECT_SIGNING);
+                if (!val) {
+                    if (bad != null) {
+                        bad[2] = true;
+                        badNetscapeCertType = true;
+                    }
+                }
+            }
+        } catch (IOException e) {
+            //
+        }
+    }
+
+    void getAliasInfo(String alias) {
+
+        Key key = null;
+
+        try {
+            java.security.cert.Certificate[] cs = null;
+            if (altCertChain != null) {
+                try {
+                    cs = CertificateFactory.getInstance("X.509").
+                            generateCertificates(new FileInputStream(altCertChain)).
+                            toArray(new Certificate[0]);
+                } catch (CertificateException ex) {
+                    error(rb.getString("Cannot.restore.certchain.from.file.specified"));
+                } catch (FileNotFoundException ex) {
+                    error(rb.getString("File.specified.by.certchain.does.not.exist"));
+                }
+            } else {
+                try {
+                    cs = store.getCertificateChain(alias);
+                } catch (KeyStoreException kse) {
+                    // this never happens, because keystore has been loaded
+                }
+            }
+            if (cs == null || cs.length == 0) {
+                if (altCertChain != null) {
+                    error(rb.getString
+                            ("Certificate.chain.not.found.in.the.file.specified."));
+                } else {
+                    MessageFormat form = new MessageFormat(rb.getString
+                        ("Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and"));
+                    Object[] source = {alias, alias};
+                    error(form.format(source));
+                }
+            }
+
+            certChain = new X509Certificate[cs.length];
+            for (int i=0; i<cs.length; i++) {
+                if (!(cs[i] instanceof X509Certificate)) {
+                    error(rb.getString
+                        ("found.non.X.509.certificate.in.signer.s.chain"));
+                }
+                certChain[i] = (X509Certificate)cs[i];
+            }
+
+            // We don't meant to print anything, the next call
+            // checks validity and keyUsage etc
+            printCert("", certChain[0], true, null, true);
+
+            try {
+                CertPath cp = certificateFactory.generateCertPath(Arrays.asList(certChain));
+                validator.validate(cp, pkixParameters);
+            } catch (Exception e) {
+                if (debug) {
+                    e.printStackTrace();
+                }
+                if (e.getCause() != null &&
+                        (e.getCause() instanceof CertificateExpiredException ||
+                        e.getCause() instanceof CertificateNotYetValidException)) {
+                    // No more warning, we alreay have hasExpiredCert or notYetValidCert
+                } else {
+                    chainNotValidated = true;
+                }
+            }
+
+            try {
+                if (!token && keypass == null)
+                    key = store.getKey(alias, storepass);
+                else
+                    key = store.getKey(alias, keypass);
+            } catch (UnrecoverableKeyException e) {
+                if (token) {
+                    throw e;
+                } else if (keypass == null) {
+                    // Did not work out, so prompt user for key password
+                    MessageFormat form = new MessageFormat(rb.getString
+                        ("Enter.key.password.for.alias."));
+                    Object[] source = {alias};
+                    keypass = getPass(form.format(source));
+                    key = store.getKey(alias, keypass);
+                }
+            }
+        } catch (NoSuchAlgorithmException e) {
+            error(e.getMessage());
+        } catch (UnrecoverableKeyException e) {
+            error(rb.getString("unable.to.recover.key.from.keystore"));
+        } catch (KeyStoreException kse) {
+            // this never happens, because keystore has been loaded
+        }
+
+        if (!(key instanceof PrivateKey)) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("key.associated.with.alias.not.a.private.key"));
+            Object[] source = {alias};
+            error(form.format(source));
+        } else {
+            privateKey = (PrivateKey)key;
+        }
+    }
+
+    void error(String message)
+    {
+        System.out.println(rb.getString("jarsigner.")+message);
+        System.exit(1);
+    }
+
+
+    void error(String message, Exception e)
+    {
+        System.out.println(rb.getString("jarsigner.")+message);
+        if (debug) {
+            e.printStackTrace();
+        }
+        System.exit(1);
+    }
+
+    char[] getPass(String prompt)
+    {
+        System.err.print(prompt);
+        System.err.flush();
+        try {
+            char[] pass = Password.readPassword(System.in);
+
+            if (pass == null) {
+                error(rb.getString("you.must.enter.key.password"));
+            } else {
+                return pass;
+            }
+        } catch (IOException ioe) {
+            error(rb.getString("unable.to.read.password.")+ioe.getMessage());
+        }
+        // this shouldn't happen
+        return null;
+    }
+
+    /*
+     * Reads all the bytes for a given zip entry.
+     */
+    private synchronized byte[] getBytes(ZipFile zf,
+                                         ZipEntry ze) throws IOException {
+        int n;
+
+        InputStream is = null;
+        try {
+            is = zf.getInputStream(ze);
+            baos.reset();
+            long left = ze.getSize();
+
+            while((left > 0) && (n = is.read(buffer, 0, buffer.length)) != -1) {
+                baos.write(buffer, 0, n);
+                left -= n;
+            }
+        } finally {
+            if (is != null) {
+                is.close();
+            }
+        }
+
+        return baos.toByteArray();
+    }
+
+    /*
+     * Returns manifest entry from given jar file, or null if given jar file
+     * does not have a manifest entry.
+     */
+    private ZipEntry getManifestFile(ZipFile zf) {
+        ZipEntry ze = zf.getEntry(JarFile.MANIFEST_NAME);
+        if (ze == null) {
+            // Check all entries for matching name
+            Enumeration<? extends ZipEntry> enum_ = zf.entries();
+            while (enum_.hasMoreElements() && ze == null) {
+                ze = enum_.nextElement();
+                if (!JarFile.MANIFEST_NAME.equalsIgnoreCase
+                    (ze.getName())) {
+                    ze = null;
+                }
+            }
+        }
+        return ze;
+    }
+
+    /*
+     * Computes the digests of a zip entry, and returns them as an array
+     * of base64-encoded strings.
+     */
+    private synchronized String[] getDigests(ZipEntry ze, ZipFile zf,
+                                             MessageDigest[] digests,
+                                             BASE64Encoder encoder)
+        throws IOException {
+
+        int n, i;
+        InputStream is = null;
+        try {
+            is = zf.getInputStream(ze);
+            long left = ze.getSize();
+            while((left > 0)
+                && (n = is.read(buffer, 0, buffer.length)) != -1) {
+                for (i=0; i<digests.length; i++) {
+                    digests[i].update(buffer, 0, n);
+                }
+                left -= n;
+            }
+        } finally {
+            if (is != null) {
+                is.close();
+            }
+        }
+
+        // complete the digests
+        String[] base64Digests = new String[digests.length];
+        for (i=0; i<digests.length; i++) {
+            base64Digests[i] = encoder.encode(digests[i].digest());
+        }
+        return base64Digests;
+    }
+
+    /*
+     * Computes the digests of a zip entry, and returns them as a list of
+     * attributes
+     */
+    private Attributes getDigestAttributes(ZipEntry ze, ZipFile zf,
+                                           MessageDigest[] digests,
+                                           BASE64Encoder encoder)
+        throws IOException {
+
+        String[] base64Digests = getDigests(ze, zf, digests, encoder);
+        Attributes attrs = new Attributes();
+
+        for (int i=0; i<digests.length; i++) {
+            attrs.putValue(digests[i].getAlgorithm()+"-Digest",
+                           base64Digests[i]);
+        }
+        return attrs;
+    }
+
+    /*
+     * Updates the digest attributes of a manifest entry, by adding or
+     * replacing digest values.
+     * A digest value is added if the manifest entry does not contain a digest
+     * for that particular algorithm.
+     * A digest value is replaced if it is obsolete.
+     *
+     * Returns true if the manifest entry has been changed, and false
+     * otherwise.
+     */
+    private boolean updateDigests(ZipEntry ze, ZipFile zf,
+                                  MessageDigest[] digests,
+                                  BASE64Encoder encoder,
+                                  Manifest mf) throws IOException {
+        boolean update = false;
+
+        Attributes attrs = mf.getAttributes(ze.getName());
+        String[] base64Digests = getDigests(ze, zf, digests, encoder);
+
+        for (int i=0; i<digests.length; i++) {
+            // The entry name to be written into attrs
+            String name = null;
+            try {
+                // Find if the digest already exists
+                AlgorithmId aid = AlgorithmId.get(digests[i].getAlgorithm());
+                for (Object key: attrs.keySet()) {
+                    if (key instanceof Attributes.Name) {
+                        String n = ((Attributes.Name)key).toString();
+                        if (n.toUpperCase(Locale.ENGLISH).endsWith("-DIGEST")) {
+                            String tmp = n.substring(0, n.length() - 7);
+                            if (AlgorithmId.get(tmp).equals(aid)) {
+                                name = n;
+                                break;
+                            }
+                        }
+                    }
+                }
+            } catch (NoSuchAlgorithmException nsae) {
+                // Ignored. Writing new digest entry.
+            }
+
+            if (name == null) {
+                name = digests[i].getAlgorithm()+"-Digest";
+                attrs.putValue(name, base64Digests[i]);
+                update=true;
+            } else {
+                // compare digests, and replace the one in the manifest
+                // if they are different
+                String mfDigest = attrs.getValue(name);
+                if (!mfDigest.equalsIgnoreCase(base64Digests[i])) {
+                    attrs.putValue(name, base64Digests[i]);
+                    update=true;
+                }
+            }
+        }
+        return update;
+    }
+
+    /*
+     * Try to load the specified signing mechanism.
+     * The URL class loader is used.
+     */
+    private ContentSigner loadSigningMechanism(String signerClassName,
+        String signerClassPath) throws Exception {
+
+        // construct class loader
+        String cpString = null;   // make sure env.class.path defaults to dot
+
+        // do prepends to get correct ordering
+        cpString = PathList.appendPath(System.getProperty("env.class.path"), cpString);
+        cpString = PathList.appendPath(System.getProperty("java.class.path"), cpString);
+        cpString = PathList.appendPath(signerClassPath, cpString);
+        URL[] urls = PathList.pathToURLs(cpString);
+        ClassLoader appClassLoader = new URLClassLoader(urls);
+
+        // attempt to find signer
+        Class<?> signerClass = appClassLoader.loadClass(signerClassName);
+
+        // Check that it implements ContentSigner
+        Object signer = signerClass.newInstance();
+        if (!(signer instanceof ContentSigner)) {
+            MessageFormat form = new MessageFormat(
+                rb.getString("signerClass.is.not.a.signing.mechanism"));
+            Object[] source = {signerClass.getName()};
+            throw new IllegalArgumentException(form.format(source));
+        }
+        return (ContentSigner)signer;
+    }
+}
+
+/**
+ * This is a BASE64Encoder that does not insert a default newline at the end of
+ * every output line. This is necessary because java.util.jar does its own
+ * line management (see Manifest.make72Safe()). Inserting additional new lines
+ * can cause line-wrapping problems (see CR 6219522).
+ */
+class JarBASE64Encoder extends BASE64Encoder {
+    /**
+     * Encode the suffix that ends every output line.
+     */
+    protected void encodeLineSuffix(OutputStream aStream) throws IOException { }
+}
+
+class SignatureFile {
+
+    /** SignatureFile */
+    Manifest sf;
+
+    /** .SF base name */
+    String baseName;
+
+    public SignatureFile(MessageDigest digests[],
+                         Manifest mf,
+                         ManifestDigester md,
+                         String baseName,
+                         boolean signManifest)
+
+    {
+        this.baseName = baseName;
+
+        String version = System.getProperty("java.version");
+        String javaVendor = System.getProperty("java.vendor");
+
+        sf = new Manifest();
+        Attributes mattr = sf.getMainAttributes();
+        BASE64Encoder encoder = new JarBASE64Encoder();
+
+        mattr.putValue(Attributes.Name.SIGNATURE_VERSION.toString(), "1.0");
+        mattr.putValue("Created-By", version + " (" + javaVendor + ")");
+
+        if (signManifest) {
+            // sign the whole manifest
+            for (int i=0; i < digests.length; i++) {
+                mattr.putValue(digests[i].getAlgorithm()+"-Digest-Manifest",
+                               encoder.encode(md.manifestDigest(digests[i])));
+            }
+        }
+
+        // create digest of the manifest main attributes
+        ManifestDigester.Entry mde =
+                md.get(ManifestDigester.MF_MAIN_ATTRS, false);
+        if (mde != null) {
+            for (int i=0; i < digests.length; i++) {
+                mattr.putValue(digests[i].getAlgorithm() +
+                        "-Digest-" + ManifestDigester.MF_MAIN_ATTRS,
+                        encoder.encode(mde.digest(digests[i])));
+            }
+        } else {
+            throw new IllegalStateException
+                ("ManifestDigester failed to create " +
+                "Manifest-Main-Attribute entry");
+        }
+
+        /* go through the manifest entries and create the digests */
+
+        Map<String,Attributes> entries = sf.getEntries();
+        Iterator<Map.Entry<String,Attributes>> mit =
+                                mf.getEntries().entrySet().iterator();
+        while(mit.hasNext()) {
+            Map.Entry<String,Attributes> e = mit.next();
+            String name = e.getKey();
+            mde = md.get(name, false);
+            if (mde != null) {
+                Attributes attr = new Attributes();
+                for (int i=0; i < digests.length; i++) {
+                    attr.putValue(digests[i].getAlgorithm()+"-Digest",
+                                  encoder.encode(mde.digest(digests[i])));
+                }
+                entries.put(name, attr);
+            }
+        }
+    }
+
+    /**
+     * Writes the SignatureFile to the specified OutputStream.
+     *
+     * @param out the output stream
+     * @exception IOException if an I/O error has occurred
+     */
+
+    public void write(OutputStream out) throws IOException
+    {
+        sf.write(out);
+    }
+
+    /**
+     * get .SF file name
+     */
+    public String getMetaName()
+    {
+        return "META-INF/"+ baseName + ".SF";
+    }
+
+    /**
+     * get base file name
+     */
+    public String getBaseName()
+    {
+        return baseName;
+    }
+
+    /*
+     * Generate a signed data block.
+     * If a URL or a certificate (containing a URL) for a Timestamping
+     * Authority is supplied then a signature timestamp is generated and
+     * inserted into the signed data block.
+     *
+     * @param sigalg signature algorithm to use, or null to use default
+     * @param tsaUrl The location of the Timestamping Authority. If null
+     *               then no timestamp is requested.
+     * @param tsaCert The certificate for the Timestamping Authority. If null
+     *               then no timestamp is requested.
+     * @param signingMechanism The signing mechanism to use.
+     * @param args The command-line arguments to jarsigner.
+     * @param zipFile The original source Zip file.
+     */
+    public Block generateBlock(PrivateKey privateKey,
+                               String sigalg,
+                               X509Certificate[] certChain,
+                               boolean externalSF, String tsaUrl,
+                               X509Certificate tsaCert,
+                               ContentSigner signingMechanism,
+                               String[] args, ZipFile zipFile)
+        throws NoSuchAlgorithmException, InvalidKeyException, IOException,
+            SignatureException, CertificateException
+    {
+        return new Block(this, privateKey, sigalg, certChain, externalSF,
+                tsaUrl, tsaCert, signingMechanism, args, zipFile);
+    }
+
+
+    public static class Block {
+
+        private byte[] block;
+        private String blockFileName;
+
+        /*
+         * Construct a new signature block.
+         */
+        Block(SignatureFile sfg, PrivateKey privateKey, String sigalg,
+            X509Certificate[] certChain, boolean externalSF, String tsaUrl,
+            X509Certificate tsaCert, ContentSigner signingMechanism,
+            String[] args, ZipFile zipFile)
+            throws NoSuchAlgorithmException, InvalidKeyException, IOException,
+            SignatureException, CertificateException {
+
+            Principal issuerName = certChain[0].getIssuerDN();
+            if (!(issuerName instanceof X500Name)) {
+                // must extract the original encoded form of DN for subsequent
+                // name comparison checks (converting to a String and back to
+                // an encoded DN could cause the types of String attribute
+                // values to be changed)
+                X509CertInfo tbsCert = new
+                    X509CertInfo(certChain[0].getTBSCertificate());
+                issuerName = (Principal)
+                    tbsCert.get(CertificateIssuerName.NAME + "." +
+                                CertificateIssuerName.DN_NAME);
+            }
+            BigInteger serial = certChain[0].getSerialNumber();
+
+            String signatureAlgorithm;
+            String keyAlgorithm = privateKey.getAlgorithm();
+            /*
+             * If no signature algorithm was specified, we choose a
+             * default that is compatible with the private key algorithm.
+             */
+            if (sigalg == null) {
+
+                if (keyAlgorithm.equalsIgnoreCase("DSA"))
+                    signatureAlgorithm = "SHA1withDSA";
+                else if (keyAlgorithm.equalsIgnoreCase("RSA"))
+                    signatureAlgorithm = "SHA256withRSA";
+                else if (keyAlgorithm.equalsIgnoreCase("EC"))
+                    signatureAlgorithm = "SHA256withECDSA";
+                else
+                    throw new RuntimeException("private key is not a DSA or "
+                                               + "RSA key");
+            } else {
+                signatureAlgorithm = sigalg;
+            }
+
+            // check common invalid key/signature algorithm combinations
+            String sigAlgUpperCase = signatureAlgorithm.toUpperCase(Locale.ENGLISH);
+            if ((sigAlgUpperCase.endsWith("WITHRSA") &&
+                !keyAlgorithm.equalsIgnoreCase("RSA")) ||
+                (sigAlgUpperCase.endsWith("WITHECDSA") &&
+                !keyAlgorithm.equalsIgnoreCase("EC")) ||
+                (sigAlgUpperCase.endsWith("WITHDSA") &&
+                !keyAlgorithm.equalsIgnoreCase("DSA"))) {
+                throw new SignatureException
+                    ("private key algorithm is not compatible with signature algorithm");
+            }
+
+            blockFileName = "META-INF/"+sfg.getBaseName()+"."+keyAlgorithm;
+
+            AlgorithmId sigAlg = AlgorithmId.get(signatureAlgorithm);
+            AlgorithmId digEncrAlg = AlgorithmId.get(keyAlgorithm);
+
+            Signature sig = Signature.getInstance(signatureAlgorithm);
+            sig.initSign(privateKey);
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            sfg.write(baos);
+
+            byte[] content = baos.toByteArray();
+
+            sig.update(content);
+            byte[] signature = sig.sign();
+
+            // Timestamp the signature and generate the signature block file
+            if (signingMechanism == null) {
+                signingMechanism = new TimestampedSigner();
+            }
+            URI tsaUri = null;
+            try {
+                if (tsaUrl != null) {
+                    tsaUri = new URI(tsaUrl);
+                }
+            } catch (URISyntaxException e) {
+                throw new IOException(e);
+            }
+
+            // Assemble parameters for the signing mechanism
+            ContentSignerParameters params =
+                new JarSignerParameters(args, tsaUri, tsaCert, signature,
+                    signatureAlgorithm, certChain, content, zipFile);
+
+            // Generate the signature block
+            block = signingMechanism.generateSignedData(
+                    params, externalSF, (tsaUrl != null || tsaCert != null));
+        }
+
+        /*
+         * get block file name.
+         */
+        public String getMetaName()
+        {
+            return blockFileName;
+        }
+
+        /**
+         * Writes the block file to the specified OutputStream.
+         *
+         * @param out the output stream
+         * @exception IOException if an I/O error has occurred
+         */
+
+        public void write(OutputStream out) throws IOException
+        {
+            out.write(block);
+        }
+    }
+}
+
+
+/*
+ * This object encapsulates the parameters used to perform content signing.
+ */
+class JarSignerParameters implements ContentSignerParameters {
+
+    private String[] args;
+    private URI tsa;
+    private X509Certificate tsaCertificate;
+    private byte[] signature;
+    private String signatureAlgorithm;
+    private X509Certificate[] signerCertificateChain;
+    private byte[] content;
+    private ZipFile source;
+
+    /**
+     * Create a new object.
+     */
+    JarSignerParameters(String[] args, URI tsa, X509Certificate tsaCertificate,
+        byte[] signature, String signatureAlgorithm,
+        X509Certificate[] signerCertificateChain, byte[] content,
+        ZipFile source) {
+
+        if (signature == null || signatureAlgorithm == null ||
+            signerCertificateChain == null) {
+            throw new NullPointerException();
+        }
+        this.args = args;
+        this.tsa = tsa;
+        this.tsaCertificate = tsaCertificate;
+        this.signature = signature;
+        this.signatureAlgorithm = signatureAlgorithm;
+        this.signerCertificateChain = signerCertificateChain;
+        this.content = content;
+        this.source = source;
+    }
+
+    /**
+     * Retrieves the command-line arguments.
+     *
+     * @return The command-line arguments. May be null.
+     */
+    public String[] getCommandLine() {
+        return args;
+    }
+
+    /**
+     * Retrieves the identifier for a Timestamping Authority (TSA).
+     *
+     * @return The TSA identifier. May be null.
+     */
+    public URI getTimestampingAuthority() {
+        return tsa;
+    }
+
+    /**
+     * Retrieves the certificate for a Timestamping Authority (TSA).
+     *
+     * @return The TSA certificate. May be null.
+     */
+    public X509Certificate getTimestampingAuthorityCertificate() {
+        return tsaCertificate;
+    }
+
+    /**
+     * Retrieves the signature.
+     *
+     * @return The non-null signature bytes.
+     */
+    public byte[] getSignature() {
+        return signature;
+    }
+
+    /**
+     * Retrieves the name of the signature algorithm.
+     *
+     * @return The non-null string name of the signature algorithm.
+     */
+    public String getSignatureAlgorithm() {
+        return signatureAlgorithm;
+    }
+
+    /**
+     * Retrieves the signer's X.509 certificate chain.
+     *
+     * @return The non-null array of X.509 public-key certificates.
+     */
+    public X509Certificate[] getSignerCertificateChain() {
+        return signerCertificateChain;
+    }
+
+    /**
+     * Retrieves the content that was signed.
+     *
+     * @return The content bytes. May be null.
+     */
+    public byte[] getContent() {
+        return content;
+    }
+
+    /**
+     * Retrieves the original source ZIP file before it was signed.
+     *
+     * @return The original ZIP file. May be null.
+     */
+    public ZipFile getSource() {
+        return source;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/jarsigner/Resources.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.jarsigner;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for JarSigner.
+ *
+ */
+public class Resources extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+
+        // shared (from jarsigner)
+        {"SPACE", " "},
+        {"2SPACE", "  "},
+        {"6SPACE", "      "},
+        {"COMMA", ", "},
+
+        {"provName.not.a.provider", "{0} not a provider"},
+        {"signerClass.is.not.a.signing.mechanism", "{0} is not a signing mechanism"},
+        {"jarsigner.error.", "jarsigner error: "},
+        {"Illegal.option.", "Illegal option: "},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore must be NONE if -storetype is {0}"},
+        {".keypass.can.not.be.specified.if.storetype.is.{0}",
+                "-keypass can not be specified if -storetype is {0}"},
+        {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
+                "If -protected is specified, then -storepass and -keypass must not be specified"},
+        {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
+                 "If keystore is not password protected, then -storepass and -keypass must not be specified"},
+        {"Usage.jarsigner.options.jar.file.alias",
+                "Usage: jarsigner [options] jar-file alias"},
+        {".jarsigner.verify.options.jar.file.alias.",
+                "       jarsigner -verify [options] jar-file [alias...]"},
+        {".keystore.url.keystore.location",
+                "[-keystore <url>]           keystore location"},
+        {".storepass.password.password.for.keystore.integrity",
+            "[-storepass <password>]     password for keystore integrity"},
+        {".storetype.type.keystore.type",
+                "[-storetype <type>]         keystore type"},
+        {".keypass.password.password.for.private.key.if.different.",
+                "[-keypass <password>]       password for private key (if different)"},
+        {".certchain.file.name.of.alternative.certchain.file",
+                "[-certchain <file>]         name of alternative certchain file"},
+        {".sigfile.file.name.of.SF.DSA.file",
+                "[-sigfile <file>]           name of .SF/.DSA file"},
+        {".signedjar.file.name.of.signed.JAR.file",
+                "[-signedjar <file>]         name of signed JAR file"},
+        {".digestalg.algorithm.name.of.digest.algorithm",
+                "[-digestalg <algorithm>]    name of digest algorithm"},
+        {".sigalg.algorithm.name.of.signature.algorithm",
+                "[-sigalg <algorithm>]       name of signature algorithm"},
+        {".verify.verify.a.signed.JAR.file",
+                "[-verify]                   verify a signed JAR file"},
+        {".verbose.suboptions.verbose.output.when.signing.verifying.",
+                "[-verbose[:suboptions]]     verbose output when signing/verifying."},
+        {".suboptions.can.be.all.grouped.or.summary",
+                "                            suboptions can be all, grouped or summary"},
+        {".certs.display.certificates.when.verbose.and.verifying",
+                "[-certs]                    display certificates when verbose and verifying"},
+        {".tsa.url.location.of.the.Timestamping.Authority",
+                "[-tsa <url>]                location of the Timestamping Authority"},
+        {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
+                "[-tsacert <alias>]          public key certificate for Timestamping Authority"},
+        {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
+                "[-altsigner <class>]        class name of an alternative signing mechanism"},
+        {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
+                "[-altsignerpath <pathlist>] location of an alternative signing mechanism"},
+        {".internalsf.include.the.SF.file.inside.the.signature.block",
+                "[-internalsf]               include the .SF file inside the signature block"},
+        {".sectionsonly.don.t.compute.hash.of.entire.manifest",
+                "[-sectionsonly]             don't compute hash of entire manifest"},
+        {".protected.keystore.has.protected.authentication.path",
+                "[-protected]                keystore has protected authentication path"},
+        {".providerName.name.provider.name",
+                "[-providerName <name>]      provider name"},
+        {".providerClass.class.name.of.cryptographic.service.provider.s",
+                "[-providerClass <class>     name of cryptographic service provider's"},
+        {".providerArg.arg.master.class.file.and.constructor.argument",
+                "  [-providerArg <arg>]] ... master class file and constructor argument"},
+        {".strict.treat.warnings.as.errors",
+                "[-strict]                   treat warnings as errors"},
+        {"Option.lacks.argument", "Option lacks argument"},
+        {"Please.type.jarsigner.help.for.usage", "Please type jarsigner -help for usage"},
+        {"Please.specify.jarfile.name", "Please specify jarfile name"},
+        {"Please.specify.alias.name", "Please specify alias name"},
+        {"Only.one.alias.can.be.specified", "Only one alias can be specified"},
+        {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
+                 "This jar contains signed entries which is not signed by the specified alias(es)."},
+        {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
+                  "This jar contains signed entries that's not signed by alias in this keystore."},
+        {"s", "s"},
+        {"m", "m"},
+        {"k", "k"},
+        {"i", "i"},
+        {".and.d.more.", "(and %d more)"},
+        {".s.signature.was.verified.",
+                "  s = signature was verified "},
+        {".m.entry.is.listed.in.manifest",
+                "  m = entry is listed in manifest"},
+        {".k.at.least.one.certificate.was.found.in.keystore",
+                "  k = at least one certificate was found in keystore"},
+        {".i.at.least.one.certificate.was.found.in.identity.scope",
+                "  i = at least one certificate was found in identity scope"},
+        {".X.not.signed.by.specified.alias.es.",
+                "  X = not signed by specified alias(es)"},
+        {"no.manifest.", "no manifest."},
+        {".Signature.related.entries.","(Signature related entries)"},
+        {".Unsigned.entries.", "(Unsigned entries)"},
+        {"jar.is.unsigned.signatures.missing.or.not.parsable.",
+                "jar is unsigned. (signatures missing or not parsable)"},
+        {"jar.verified.", "jar verified."},
+        {"jarsigner.", "jarsigner: "},
+        {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
+                "signature filename must consist of the following characters: A-Z, 0-9, _ or -"},
+        {"unable.to.open.jar.file.", "unable to open jar file: "},
+        {"unable.to.create.", "unable to create: "},
+        {".adding.", "   adding: "},
+        {".updating.", " updating: "},
+        {".signing.", "  signing: "},
+        {"attempt.to.rename.signedJarFile.to.jarFile.failed",
+                "attempt to rename {0} to {1} failed"},
+        {"attempt.to.rename.jarFile.to.origJar.failed",
+                "attempt to rename {0} to {1} failed"},
+        {"unable.to.sign.jar.", "unable to sign jar: "},
+        {"Enter.Passphrase.for.keystore.", "Enter Passphrase for keystore: "},
+        {"keystore.load.", "keystore load: "},
+        {"certificate.exception.", "certificate exception: "},
+        {"unable.to.instantiate.keystore.class.",
+                "unable to instantiate keystore class: "},
+        {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
+                "Certificate chain not found for: {0}.  {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."},
+        {"File.specified.by.certchain.does.not.exist",
+                "File specified by -certchain does not exist"},
+        {"Cannot.restore.certchain.from.file.specified",
+                "Cannot restore certchain from file specified"},
+        {"Certificate.chain.not.found.in.the.file.specified.",
+                "Certificate chain not found in the file specified."},
+        {"found.non.X.509.certificate.in.signer.s.chain",
+                "found non-X.509 certificate in signer's chain"},
+        {"incomplete.certificate.chain", "incomplete certificate chain"},
+        {"Enter.key.password.for.alias.", "Enter key password for {0}: "},
+        {"unable.to.recover.key.from.keystore",
+                "unable to recover key from keystore"},
+        {"key.associated.with.alias.not.a.private.key",
+                "key associated with {0} not a private key"},
+        {"you.must.enter.key.password", "you must enter key password"},
+        {"unable.to.read.password.", "unable to read password: "},
+        {"certificate.is.valid.from", "certificate is valid from {0} to {1}"},
+        {"certificate.expired.on", "certificate expired on {0}"},
+        {"certificate.is.not.valid.until",
+                "certificate is not valid until {0}"},
+        {"certificate.will.expire.on", "certificate will expire on {0}"},
+        {".CertPath.not.validated.", "[CertPath not validated: "},
+        {"requesting.a.signature.timestamp",
+                "requesting a signature timestamp"},
+        {"TSA.location.", "TSA location: "},
+        {"TSA.certificate.", "TSA certificate: "},
+        {"no.response.from.the.Timestamping.Authority.",
+                "no response from the Timestamping Authority. When connecting"
+                + " from behind a firewall an HTTP or HTTPS proxy may need to"
+                + " be specified. Supply the following options to jarsigner:"},
+        {"or", "or"},
+        {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
+                "Certificate not found for: {0}.  {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."},
+        {"using.an.alternative.signing.mechanism",
+                "using an alternative signing mechanism"},
+        {"entry.was.signed.on", "entry was signed on {0}"},
+        {"Warning.", "Warning: "},
+        {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
+                "This jar contains unsigned entries which have not been integrity-checked. "},
+        {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
+                "This jar contains entries whose signer certificate has expired. "},
+        {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
+                "This jar contains entries whose signer certificate will expire within six months. "},
+        {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
+                "This jar contains entries whose signer certificate is not yet valid. "},
+        {"Re.run.with.the.verbose.option.for.more.details.",
+                "Re-run with the -verbose option for more details."},
+        {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
+                "Re-run with the -verbose and -certs options for more details."},
+        {"The.signer.certificate.has.expired.",
+                "The signer certificate has expired."},
+        {"The.signer.certificate.will.expire.within.six.months.",
+                "The signer certificate will expire within six months."},
+        {"The.signer.certificate.is.not.yet.valid.",
+                "The signer certificate is not yet valid."},
+        {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
+                 "The signer certificate's KeyUsage extension doesn't allow code signing."},
+        {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
+                 "The signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
+        {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
+                 "The signer certificate's NetscapeCertType extension doesn't allow code signing."},
+        {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
+                 "This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing."},
+        {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
+                 "This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
+        {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
+                 "This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing."},
+        {".{0}.extension.does.not.support.code.signing.",
+                 "[{0} extension does not support code signing]"},
+        {"The.signer.s.certificate.chain.is.not.validated.",
+                "The signer's certificate chain is not validated."},
+        {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
+                 "This jar contains entries whose certificate chain is not validated."},
+        {"Unknown.password.type.", "Unknown password type: "},
+        {"Cannot.find.environment.variable.",
+                "Cannot find environment variable: "},
+        {"Cannot.find.file.", "Cannot find file: "},
+    };
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/jarsigner/Resources_ja.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.jarsigner;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for JarSigner.
+ *
+ */
+public class Resources_ja extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+
+        // shared (from jarsigner)
+        {"SPACE", " "},
+        {"2SPACE", "  "},
+        {"6SPACE", "      "},
+        {"COMMA", ", "},
+
+        {"provName.not.a.provider", "{0}\u306F\u30D7\u30ED\u30D0\u30A4\u30C0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"signerClass.is.not.a.signing.mechanism", "{0}\u306F\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"jarsigner.error.", "jarsigner\u30A8\u30E9\u30FC: "},
+        {"Illegal.option.", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: "},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keystore\u306FNONE\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {".keypass.can.not.be.specified.if.storetype.is.{0}",
+                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keypass\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
+                "-protected\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u306F\u3001-storepass\u304A\u3088\u3073-keypass\u3092\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044"},
+        {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
+                 "\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u4FDD\u8B77\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001-storepass\u304A\u3088\u3073-keypass\u3092\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044"},
+        {"Usage.jarsigner.options.jar.file.alias",
+                "\u4F7F\u7528\u65B9\u6CD5: jarsigner [options] jar-file alias"},
+        {".jarsigner.verify.options.jar.file.alias.",
+                "       jarsigner -verify [options] jar-file [alias...]"},
+        {".keystore.url.keystore.location",
+                "[-keystore <url>]       \u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u4F4D\u7F6E"},
+        {".storepass.password.password.for.keystore.integrity",
+            "[-storepass <password>]   \u30AD\u30FC\u30B9\u30C8\u30A2\u6574\u5408\u6027\u306E\u305F\u3081\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"},
+        {".storetype.type.keystore.type",
+                "[-storetype <type>]     \u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u578B"},
+        {".keypass.password.password.for.private.key.if.different.",
+                "[-keypass <password>]    \u79D8\u5BC6\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9(\u7570\u306A\u308B\u5834\u5408)"},
+        {".certchain.file.name.of.alternative.certchain.file",
+                "[-certchain <file>]         \u4EE3\u66FF\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
+        {".sigfile.file.name.of.SF.DSA.file",
+                "[-sigfile <file>]       .SF/.DSA\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
+        {".signedjar.file.name.of.signed.JAR.file",
+                "[-signedjar <file>]     \u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D"},
+        {".digestalg.algorithm.name.of.digest.algorithm",
+                "[-digestalg <algorithm>]  \u30C0\u30A4\u30B8\u30A7\u30B9\u30C8\u30FB\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u306E\u540D\u524D"},
+        {".sigalg.algorithm.name.of.signature.algorithm",
+                "[-sigalg <algorithm>]    \u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u306E\u540D\u524D"},
+        {".verify.verify.a.signed.JAR.file",
+                "[-verify]            \u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB\u306E\u691C\u8A3C"},
+        {".verbose.suboptions.verbose.output.when.signing.verifying.",
+                "[-verbose[:suboptions]]     \u7F72\u540D/\u691C\u8A3C\u6642\u306E\u8A73\u7D30\u51FA\u529B\u3002"},
+        {".suboptions.can.be.all.grouped.or.summary",
+                "                            \u30B5\u30D6\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3057\u3066\u3001\u3059\u3079\u3066\u3001\u30B0\u30EB\u30FC\u30D7\u307E\u305F\u306F\u30B5\u30DE\u30EA\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059"},
+        {".certs.display.certificates.when.verbose.and.verifying",
+                "[-certs]             \u8A73\u7D30\u51FA\u529B\u304A\u3088\u3073\u691C\u8A3C\u6642\u306B\u8A3C\u660E\u66F8\u3092\u8868\u793A"},
+        {".tsa.url.location.of.the.Timestamping.Authority",
+                "[-tsa <url>]          \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u5834\u6240"},
+        {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
+                "[-tsacert <alias>]      \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306E\u516C\u958B\u9375\u8A3C\u660E\u66F8"},
+        {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
+                "[-altsigner <class>]     \u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u30AF\u30E9\u30B9\u540D"},
+        {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
+                "[-altsignerpath <pathlist>]\u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u4F4D\u7F6E"},
+        {".internalsf.include.the.SF.file.inside.the.signature.block",
+                "[-internalsf]         \u7F72\u540D\u30D6\u30ED\u30C3\u30AF\u306B.SF\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B"},
+        {".sectionsonly.don.t.compute.hash.of.entire.manifest",
+                "[-sectionsonly]        \u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5168\u4F53\u306E\u30CF\u30C3\u30B7\u30E5\u306F\u8A08\u7B97\u3057\u306A\u3044"},
+        {".protected.keystore.has.protected.authentication.path",
+                "[-protected]          \u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u306F\u4FDD\u8B77\u3055\u308C\u305F\u8A8D\u8A3C\u30D1\u30B9\u304C\u3042\u308B"},
+        {".providerName.name.provider.name",
+                "[-providerName <name>]   \u30D7\u30ED\u30D0\u30A4\u30C0\u540D"},
+        {".providerClass.class.name.of.cryptographic.service.provider.s",
+                "[-providerClass <class>   \u6697\u53F7\u5316\u30B5\u30FC\u30D3\u30B9\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u306E\u540D\u524D"},
+        {".providerArg.arg.master.class.file.and.constructor.argument",
+                "  [-providerArg <arg>]] ... \u30DE\u30B9\u30BF\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3068\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5F15\u6570"},
+        {".strict.treat.warnings.as.errors",
+                "[-strict]                   \u8B66\u544A\u3092\u30A8\u30E9\u30FC\u3068\u3057\u3066\u51E6\u7406"},
+        {"Option.lacks.argument", "\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"Please.type.jarsigner.help.for.usage", "\u4F7F\u7528\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306Fjarsigner -help\u3068\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Please.specify.jarfile.name", "jarfile\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Please.specify.alias.name", "\u5225\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Only.one.alias.can.be.specified", "\u5225\u540D\u306F1\u3064\u306E\u307F\u6307\u5B9A\u3067\u304D\u307E\u3059"},
+        {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
+                 "\u3053\u306Ejar\u306B\u542B\u307E\u308C\u308B\u7F72\u540D\u6E08\u30A8\u30F3\u30C8\u30EA\u306F\u3001\u6307\u5B9A\u3055\u308C\u305F\u5225\u540D\u306B\u3088\u3063\u3066\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
+        {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
+                  "\u3053\u306Ejar\u306B\u542B\u307E\u308C\u308B\u7F72\u540D\u6E08\u30A8\u30F3\u30C8\u30EA\u306F\u3001\u3053\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u5225\u540D\u306B\u3088\u3063\u3066\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
+        {"s", "s"},
+        {"m", "m"},
+        {"k", "k"},
+        {"i", "i"},
+        {".and.d.more.", "(\u4ED6\u306B\u3082%d\u500B)"},
+        {".s.signature.was.verified.",
+                "  s=\u7F72\u540D\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F "},
+        {".m.entry.is.listed.in.manifest",
+                "  m=\u30A8\u30F3\u30C8\u30EA\u304C\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5185\u306B\u30EA\u30B9\u30C8\u3055\u308C\u307E\u3059"},
+        {".k.at.least.one.certificate.was.found.in.keystore",
+                "  k=1\u3064\u4EE5\u4E0A\u306E\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
+        {".i.at.least.one.certificate.was.found.in.identity.scope",
+                "  i=1\u3064\u4EE5\u4E0A\u306E\u8A3C\u660E\u66F8\u304C\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
+        {".X.not.signed.by.specified.alias.es.",
+                "  X =\u6307\u5B9A\u3057\u305F\u5225\u540D\u3067\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"no.manifest.", "\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002"},
+        {".Signature.related.entries.","(\u7F72\u540D\u95A2\u9023\u30A8\u30F3\u30C8\u30EA)"},
+        {".Unsigned.entries.", "(\u672A\u7F72\u540D\u306E\u30A8\u30F3\u30C8\u30EA)"},
+        {"jar.is.unsigned.signatures.missing.or.not.parsable.",
+                "jar\u306F\u7F72\u540D\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002(\u7F72\u540D\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u304B\u3001\u69CB\u6587\u89E3\u6790\u3067\u304D\u307E\u305B\u3093)"},
+        {"jar.verified.", "jar\u304C\u691C\u8A3C\u3055\u308C\u307E\u3057\u305F\u3002"},
+        {"jarsigner.", "jarsigner: "},
+        {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
+                "\u7F72\u540D\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u306B\u4F7F\u7528\u3067\u304D\u308B\u6587\u5B57\u306F\u3001A-Z\u30010-9\u3001_\u3001- \u306E\u307F\u3067\u3059\u3002"},
+        {"unable.to.open.jar.file.", "\u6B21\u306Ejar\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093: "},
+        {"unable.to.create.", "\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093: "},
+        {".adding.", "   \u8FFD\u52A0\u4E2D: "},
+        {".updating.", " \u66F4\u65B0\u4E2D: "},
+        {".signing.", "  \u7F72\u540D\u4E2D: "},
+        {"attempt.to.rename.signedJarFile.to.jarFile.failed",
+                "{0}\u306E\u540D\u524D\u3092{1}\u306B\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u304C\u5931\u6557\u3057\u307E\u3057\u305F"},
+        {"attempt.to.rename.jarFile.to.origJar.failed",
+                "{0}\u306E\u540D\u524D\u3092{1}\u306B\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u304C\u5931\u6557\u3057\u307E\u3057\u305F"},
+        {"unable.to.sign.jar.", "jar\u306B\u7F72\u540D\u3067\u304D\u307E\u305B\u3093: "},
+        {"Enter.Passphrase.for.keystore.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+        {"keystore.load.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30ED\u30FC\u30C9: "},
+        {"certificate.exception.", "\u8A3C\u660E\u66F8\u4F8B\u5916: "},
+        {"unable.to.instantiate.keystore.class.",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093: "},
+        {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
+                "\u6B21\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}\u3002{1}\u306F\u3001\u79D8\u5BC6\u9375\u304A\u3088\u3073\u5BFE\u5FDC\u3059\u308B\u516C\u958B\u9375\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u542B\u3080\u6709\u52B9\u306AKeyStore\u9375\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
+        {"File.specified.by.certchain.does.not.exist",
+                "-certchain\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
+        {"Cannot.restore.certchain.from.file.specified",
+                "\u6307\u5B9A\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"},
+        {"Certificate.chain.not.found.in.the.file.specified.",
+                "\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u6307\u5B9A\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
+        {"found.non.X.509.certificate.in.signer.s.chain",
+                "\u7F72\u540D\u8005\u306E\u9023\u9396\u5185\u3067\u975EX.509\u8A3C\u660E\u66F8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
+        {"incomplete.certificate.chain", "\u4E0D\u5B8C\u5168\u306A\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3"},
+        {"Enter.key.password.for.alias.", "{0}\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+        {"unable.to.recover.key.from.keystore",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u3089\u9375\u3092\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093"},
+        {"key.associated.with.alias.not.a.private.key",
+                "{0}\u3068\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F\u9375\u306F\u3001\u79D8\u5BC6\u9375\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"you.must.enter.key.password", "\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"unable.to.read.password.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: "},
+        {"certificate.is.valid.from", "\u8A3C\u660E\u66F8\u306F{0}\u304B\u3089{1}\u307E\u3067\u6709\u52B9\u3067\u3059"},
+        {"certificate.expired.on", "\u8A3C\u660E\u66F8\u306F{0}\u306B\u5931\u52B9\u3057\u307E\u3057\u305F"},
+        {"certificate.is.not.valid.until",
+                "\u8A3C\u660E\u66F8\u306F{0}\u307E\u3067\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"certificate.will.expire.on", "\u8A3C\u660E\u66F8\u306F{0}\u306B\u5931\u52B9\u3057\u307E\u3059"},
+        {".CertPath.not.validated.", "[CertPath\u304C\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093: "},
+        {"requesting.a.signature.timestamp",
+                "\u7F72\u540D\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u306E\u30EA\u30AF\u30A8\u30B9\u30C8"},
+        {"TSA.location.", "TSA\u306E\u5834\u6240: "},
+        {"TSA.certificate.", "TSA\u8A3C\u660E\u66F8: "},
+        {"no.response.from.the.Timestamping.Authority.",
+                "\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u304B\u3089\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30A2\u30A6\u30A9\u30FC\u30EB\u3092\u4ECB\u3057\u3066\u63A5\u7D9A\u3059\u308B\u3068\u304D\u306F\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066HTTP\u307E\u305F\u306FHTTPS\u30D7\u30ED\u30AD\u30B7\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002jarsigner\u306B\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044:"},
+        {"or", "\u307E\u305F\u306F"},
+        {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
+                "\u8A3C\u660E\u66F8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}\u3002{1}\u306F\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u5C40\u306EX.509\u516C\u958B\u9375\u8A3C\u660E\u66F8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u6709\u52B9\u306AKeyStore\u30A8\u30F3\u30C8\u30EA\u3092\u53C2\u7167\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
+        {"using.an.alternative.signing.mechanism",
+                "\u4EE3\u66FF\u7F72\u540D\u30E1\u30AB\u30CB\u30BA\u30E0\u306E\u4F7F\u7528"},
+        {"entry.was.signed.on", "\u30A8\u30F3\u30C8\u30EA\u306F{0}\u306B\u7F72\u540D\u3055\u308C\u307E\u3057\u305F"},
+        {"Warning.", "\u8B66\u544A: "},
+        {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
+                "\u3053\u306Ejar\u306B\u306F\u3001\u6574\u5408\u6027\u30C1\u30A7\u30C3\u30AF\u3092\u3057\u3066\u3044\u306A\u3044\u672A\u7F72\u540D\u306E\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
+        {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
+                "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u304C\u671F\u9650\u5207\u308C\u306E\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
+        {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
+                "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u304C6\u304B\u6708\u4EE5\u5185\u306B\u671F\u9650\u5207\u308C\u3068\u306A\u308B\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
+        {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
+                "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u304C\u307E\u3060\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 "},
+        {"Re.run.with.the.verbose.option.for.more.details.",
+                "\u8A73\u7D30\u306F\u3001-verbose\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
+                "\u8A73\u7D30\u306F\u3001-verbose\u304A\u3088\u3073-certs\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"The.signer.certificate.has.expired.",
+                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u306F\u671F\u9650\u5207\u308C\u3067\u3059\u3002"},
+        {"The.signer.certificate.will.expire.within.six.months.",
+                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u306F6\u304B\u6708\u4EE5\u5185\u306B\u671F\u9650\u5207\u308C\u306B\u306A\u308A\u307E\u3059\u3002"},
+        {"The.signer.certificate.is.not.yet.valid.",
+                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u306F\u307E\u3060\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093\u3002"},
+        {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EKeyUsage\u62E1\u5F35\u6A5F\u80FD\u3067\u306F\u3001\u30B3\u30FC\u30C9\u7F72\u540D\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
+        {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EExtendedKeyUsage\u62E1\u5F35\u6A5F\u80FD\u3067\u306F\u3001\u30B3\u30FC\u30C9\u7F72\u540D\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
+        {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
+                 "\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306ENetscapeCertType\u62E1\u5F35\u6A5F\u80FD\u3067\u306F\u3001\u30B3\u30FC\u30C9\u7F72\u540D\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
+        {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EKeyUsage\u62E1\u5F35\u6A5F\u80FD\u304C\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u8A31\u53EF\u3057\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
+        {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306EExtendedKeyUsage\u62E1\u5F35\u6A5F\u80FD\u304C\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u8A31\u53EF\u3057\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
+        {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
+                 "\u3053\u306Ejar\u306B\u306F\u3001\u7F72\u540D\u8005\u8A3C\u660E\u66F8\u306ENetscapeCertType\u62E1\u5F35\u6A5F\u80FD\u304C\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u8A31\u53EF\u3057\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
+        {".{0}.extension.does.not.support.code.signing.",
+                 "[{0}\u62E1\u5F35\u6A5F\u80FD\u306F\u30B3\u30FC\u30C9\u7F72\u540D\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093]"},
+        {"The.signer.s.certificate.chain.is.not.validated.",
+                "\u7F72\u540D\u8005\u306E\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u307E\u3060\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
+        {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
+                 "\u3053\u306Ejar\u306B\u306F\u3001\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u304C\u307E\u3060\u691C\u8A3C\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002"},
+        {"Unknown.password.type.", "\u4E0D\u660E\u306A\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30BF\u30A4\u30D7: "},
+        {"Cannot.find.environment.variable.",
+                "\u74B0\u5883\u5909\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
+        {"Cannot.find.file.", "\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
+    };
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/jarsigner/Resources_zh_CN.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.jarsigner;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for JarSigner.
+ *
+ */
+public class Resources_zh_CN extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+
+        // shared (from jarsigner)
+        {"SPACE", " "},
+        {"2SPACE", "  "},
+        {"6SPACE", "      "},
+        {"COMMA", ", "},
+
+        {"provName.not.a.provider", "{0}\u4E0D\u662F\u63D0\u4F9B\u65B9"},
+        {"signerClass.is.not.a.signing.mechanism", "{0}\u4E0D\u662F\u7B7E\u540D\u673A\u5236"},
+        {"jarsigner.error.", "jarsigner \u9519\u8BEF: "},
+        {"Illegal.option.", "\u975E\u6CD5\u9009\u9879: "},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u4E3A {0}, \u5219 -keystore \u5FC5\u987B\u4E3A NONE"},
+        {".keypass.can.not.be.specified.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u4E3A {0}, \u5219\u4E0D\u80FD\u6307\u5B9A -keypass"},
+        {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A\u4E86 -protected, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass \u548C -keypass"},
+        {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
+                 "\u5982\u679C\u5BC6\u94A5\u5E93\u672A\u53D7\u53E3\u4EE4\u4FDD\u62A4, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass \u548C -keypass"},
+        {"Usage.jarsigner.options.jar.file.alias",
+                "\u7528\u6CD5: jarsigner [\u9009\u9879] jar\u6587\u4EF6 \u522B\u540D"},
+        {".jarsigner.verify.options.jar.file.alias.",
+                "       jarsigner -verify [\u9009\u9879] jar\u6587\u4EF6 [\u522B\u540D...]"},
+        {".keystore.url.keystore.location",
+                "[-keystore <url>]           \u5BC6\u94A5\u5E93\u4F4D\u7F6E"},
+        {".storepass.password.password.for.keystore.integrity",
+            "[-storepass <\u53E3\u4EE4>]         \u7528\u4E8E\u5BC6\u94A5\u5E93\u5B8C\u6574\u6027\u7684\u53E3\u4EE4"},
+        {".storetype.type.keystore.type",
+                "[-storetype <\u7C7B\u578B>]         \u5BC6\u94A5\u5E93\u7C7B\u578B"},
+        {".keypass.password.password.for.private.key.if.different.",
+                "[-keypass <\u53E3\u4EE4>]           \u79C1\u6709\u5BC6\u94A5\u7684\u53E3\u4EE4 (\u5982\u679C\u4E0D\u540C)"},
+        {".certchain.file.name.of.alternative.certchain.file",
+                "[-certchain <\u6587\u4EF6>]         \u66FF\u4EE3\u8BC1\u4E66\u94FE\u6587\u4EF6\u7684\u540D\u79F0"},
+        {".sigfile.file.name.of.SF.DSA.file",
+                "[-sigfile <\u6587\u4EF6>]           .SF/.DSA \u6587\u4EF6\u7684\u540D\u79F0"},
+        {".signedjar.file.name.of.signed.JAR.file",
+                "[-signedjar <\u6587\u4EF6>]         \u5DF2\u7B7E\u540D\u7684 JAR \u6587\u4EF6\u7684\u540D\u79F0"},
+        {".digestalg.algorithm.name.of.digest.algorithm",
+                "[-digestalg <\u7B97\u6CD5>]    \u6458\u8981\u7B97\u6CD5\u7684\u540D\u79F0"},
+        {".sigalg.algorithm.name.of.signature.algorithm",
+                "[-sigalg <\u7B97\u6CD5>]       \u7B7E\u540D\u7B97\u6CD5\u7684\u540D\u79F0"},
+        {".verify.verify.a.signed.JAR.file",
+                "[-verify]                   \u9A8C\u8BC1\u5DF2\u7B7E\u540D\u7684 JAR \u6587\u4EF6"},
+        {".verbose.suboptions.verbose.output.when.signing.verifying.",
+                "[-verbose[:\u5B50\u9009\u9879]]     \u7B7E\u540D/\u9A8C\u8BC1\u65F6\u8F93\u51FA\u8BE6\u7EC6\u4FE1\u606F\u3002"},
+        {".suboptions.can.be.all.grouped.or.summary",
+                "                            \u5B50\u9009\u9879\u53EF\u4EE5\u662F all, grouped \u6216 summary"},
+        {".certs.display.certificates.when.verbose.and.verifying",
+                "[-certs]                    \u8F93\u51FA\u8BE6\u7EC6\u4FE1\u606F\u548C\u9A8C\u8BC1\u65F6\u663E\u793A\u8BC1\u4E66"},
+        {".tsa.url.location.of.the.Timestamping.Authority",
+                "[-tsa <url>]                \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684\u4F4D\u7F6E"},
+        {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
+                "[-tsacert <\u522B\u540D>]           \u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684\u516C\u5171\u5BC6\u94A5\u8BC1\u4E66"},
+        {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
+                "[-altsigner <\u7C7B>]           \u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236\u7684\u7C7B\u540D"},
+        {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
+                "[-altsignerpath <\u8DEF\u5F84\u5217\u8868>] \u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236\u7684\u4F4D\u7F6E"},
+        {".internalsf.include.the.SF.file.inside.the.signature.block",
+                "[-internalsf]               \u5728\u7B7E\u540D\u5757\u5185\u5305\u542B .SF \u6587\u4EF6"},
+        {".sectionsonly.don.t.compute.hash.of.entire.manifest",
+                "[-sectionsonly]             \u4E0D\u8BA1\u7B97\u6574\u4E2A\u6E05\u5355\u7684\u6563\u5217"},
+        {".protected.keystore.has.protected.authentication.path",
+                "[-protected]                \u5BC6\u94A5\u5E93\u5177\u6709\u53D7\u4FDD\u62A4\u9A8C\u8BC1\u8DEF\u5F84"},
+        {".providerName.name.provider.name",
+                "[-providerName <\u540D\u79F0>]      \u63D0\u4F9B\u65B9\u540D\u79F0"},
+        {".providerClass.class.name.of.cryptographic.service.provider.s",
+                "[-providerClass <\u7C7B>        \u52A0\u5BC6\u670D\u52A1\u63D0\u4F9B\u65B9\u7684\u540D\u79F0"},
+        {".providerArg.arg.master.class.file.and.constructor.argument",
+                "  [-providerArg <\u53C2\u6570>]]... \u4E3B\u7C7B\u6587\u4EF6\u548C\u6784\u9020\u5668\u53C2\u6570"},
+        {".strict.treat.warnings.as.errors",
+                "[-strict]                   \u5C06\u8B66\u544A\u89C6\u4E3A\u9519\u8BEF"},
+        {"Option.lacks.argument", "\u9009\u9879\u7F3A\u5C11\u53C2\u6570"},
+        {"Please.type.jarsigner.help.for.usage", "\u8BF7\u952E\u5165 jarsigner -help \u4EE5\u4E86\u89E3\u7528\u6CD5"},
+        {"Please.specify.jarfile.name", "\u8BF7\u6307\u5B9A jar \u6587\u4EF6\u7684\u540D\u79F0"},
+        {"Please.specify.alias.name", "\u8BF7\u6307\u5B9A\u522B\u540D"},
+        {"Only.one.alias.can.be.specified", "\u53EA\u80FD\u6307\u5B9A\u4E00\u4E2A\u522B\u540D"},
+        {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
+                 "\u6B64 jar \u5305\u542B\u672A\u7531\u6307\u5B9A\u522B\u540D\u7B7E\u540D\u7684\u5DF2\u7B7E\u540D\u6761\u76EE\u3002"},
+        {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
+                  "\u6B64 jar \u5305\u542B\u672A\u7531\u6B64\u5BC6\u94A5\u5E93\u4E2D\u7684\u522B\u540D\u7B7E\u540D\u7684\u5DF2\u7B7E\u540D\u6761\u76EE\u3002"},
+        {"s", "s"},
+        {"m", "m"},
+        {"k", "k"},
+        {"i", "i"},
+        {".and.d.more.", "(%d \u53CA\u4EE5\u4E0A)"},
+        {".s.signature.was.verified.",
+                "  s = \u5DF2\u9A8C\u8BC1\u7B7E\u540D "},
+        {".m.entry.is.listed.in.manifest",
+                "  m = \u5728\u6E05\u5355\u4E2D\u5217\u51FA\u6761\u76EE"},
+        {".k.at.least.one.certificate.was.found.in.keystore",
+                "  k = \u5728\u5BC6\u94A5\u5E93\u4E2D\u81F3\u5C11\u627E\u5230\u4E86\u4E00\u4E2A\u8BC1\u4E66"},
+        {".i.at.least.one.certificate.was.found.in.identity.scope",
+                "  i = \u5728\u8EAB\u4EFD\u4F5C\u7528\u57DF\u5185\u81F3\u5C11\u627E\u5230\u4E86\u4E00\u4E2A\u8BC1\u4E66"},
+        {".X.not.signed.by.specified.alias.es.",
+                "  X = \u672A\u7531\u6307\u5B9A\u522B\u540D\u7B7E\u540D"},
+        {"no.manifest.", "\u6CA1\u6709\u6E05\u5355\u3002"},
+        {".Signature.related.entries.","(\u4E0E\u7B7E\u540D\u76F8\u5173\u7684\u6761\u76EE)"},
+        {".Unsigned.entries.", "(\u672A\u7B7E\u540D\u6761\u76EE)"},
+        {"jar.is.unsigned.signatures.missing.or.not.parsable.",
+                "jar \u672A\u7B7E\u540D\u3002(\u7F3A\u5C11\u7B7E\u540D\u6216\u65E0\u6CD5\u5BF9\u7B7E\u540D\u8FDB\u884C\u8BED\u6CD5\u5206\u6790)"},
+        {"jar.verified.", "jar \u5DF2\u9A8C\u8BC1\u3002"},
+        {"jarsigner.", "jarsigner: "},
+        {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
+                "\u7B7E\u540D\u6587\u4EF6\u540D\u5FC5\u987B\u5305\u542B\u4EE5\u4E0B\u5B57\u7B26: A-Z, 0-9, _ \u6216 -"},
+        {"unable.to.open.jar.file.", "\u65E0\u6CD5\u6253\u5F00 jar \u6587\u4EF6: "},
+        {"unable.to.create.", "\u65E0\u6CD5\u521B\u5EFA: "},
+        {".adding.", "   \u6B63\u5728\u6DFB\u52A0: "},
+        {".updating.", " \u6B63\u5728\u66F4\u65B0: "},
+        {".signing.", "  \u6B63\u5728\u7B7E\u540D: "},
+        {"attempt.to.rename.signedJarFile.to.jarFile.failed",
+                "\u5C1D\u8BD5\u5C06{0}\u91CD\u547D\u540D\u4E3A{1}\u65F6\u5931\u8D25"},
+        {"attempt.to.rename.jarFile.to.origJar.failed",
+                "\u5C1D\u8BD5\u5C06{0}\u91CD\u547D\u540D\u4E3A{1}\u65F6\u5931\u8D25"},
+        {"unable.to.sign.jar.", "\u65E0\u6CD5\u5BF9 jar \u8FDB\u884C\u7B7E\u540D: "},
+        {"Enter.Passphrase.for.keystore.", "\u8F93\u5165\u5BC6\u94A5\u5E93\u7684\u5BC6\u7801\u77ED\u8BED: "},
+        {"keystore.load.", "\u5BC6\u94A5\u5E93\u52A0\u8F7D: "},
+        {"certificate.exception.", "\u8BC1\u4E66\u5F02\u5E38\u9519\u8BEF: "},
+        {"unable.to.instantiate.keystore.class.",
+                "\u65E0\u6CD5\u5B9E\u4F8B\u5316\u5BC6\u94A5\u5E93\u7C7B: "},
+        {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
+                "\u627E\u4E0D\u5230{0}\u7684\u8BC1\u4E66\u94FE\u3002{1}\u5FC5\u987B\u5F15\u7528\u5305\u542B\u79C1\u6709\u5BC6\u94A5\u548C\u76F8\u5E94\u7684\u516C\u5171\u5BC6\u94A5\u8BC1\u4E66\u94FE\u7684\u6709\u6548 KeyStore \u5BC6\u94A5\u6761\u76EE\u3002"},
+        {"File.specified.by.certchain.does.not.exist",
+                "\u7531 -certchain \u6307\u5B9A\u7684\u6587\u4EF6\u4E0D\u5B58\u5728"},
+        {"Cannot.restore.certchain.from.file.specified",
+                "\u65E0\u6CD5\u4ECE\u6307\u5B9A\u7684\u6587\u4EF6\u8FD8\u539F\u8BC1\u4E66\u94FE"},
+        {"Certificate.chain.not.found.in.the.file.specified.",
+                "\u5728\u6307\u5B9A\u7684\u6587\u4EF6\u4E2D\u627E\u4E0D\u5230\u8BC1\u4E66\u94FE\u3002"},
+        {"found.non.X.509.certificate.in.signer.s.chain",
+                "\u5728\u7B7E\u540D\u8005\u7684\u94FE\u4E2D\u627E\u5230\u975E X.509 \u8BC1\u4E66"},
+        {"incomplete.certificate.chain", "\u8BC1\u4E66\u94FE\u4E0D\u5B8C\u6574"},
+        {"Enter.key.password.for.alias.", "\u8F93\u5165{0}\u7684\u5BC6\u94A5\u53E3\u4EE4: "},
+        {"unable.to.recover.key.from.keystore",
+                "\u65E0\u6CD5\u4ECE\u5BC6\u94A5\u5E93\u4E2D\u6062\u590D\u5BC6\u94A5"},
+        {"key.associated.with.alias.not.a.private.key",
+                "\u4E0E{0}\u5173\u8054\u7684\u5BC6\u94A5\u4E0D\u662F\u79C1\u6709\u5BC6\u94A5"},
+        {"you.must.enter.key.password", "\u5FC5\u987B\u8F93\u5165\u5BC6\u94A5\u53E3\u4EE4"},
+        {"unable.to.read.password.", "\u65E0\u6CD5\u8BFB\u53D6\u53E3\u4EE4: "},
+        {"certificate.is.valid.from", "\u8BC1\u4E66\u7684\u6709\u6548\u671F\u4E3A{0}\u81F3{1}"},
+        {"certificate.expired.on", "\u8BC1\u4E66\u5230\u671F\u65E5\u671F\u4E3A {0}"},
+        {"certificate.is.not.valid.until",
+                "\u76F4\u5230{0}, \u8BC1\u4E66\u624D\u6709\u6548"},
+        {"certificate.will.expire.on", "\u8BC1\u4E66\u5C06\u5728{0}\u5230\u671F"},
+        {".CertPath.not.validated.", "[CertPath \u672A\u9A8C\u8BC1: "},
+        {"requesting.a.signature.timestamp",
+                "\u6B63\u5728\u8BF7\u6C42\u7B7E\u540D\u65F6\u95F4\u6233"},
+        {"TSA.location.", "TSA \u4F4D\u7F6E: "},
+        {"TSA.certificate.", "TSA \u8BC1\u4E66: "},
+        {"no.response.from.the.Timestamping.Authority.",
+                "\u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u6CA1\u6709\u54CD\u5E94\u3002\u5982\u679C\u8981\u4ECE\u9632\u706B\u5899\u540E\u9762\u8FDE\u63A5, \u5219\u53EF\u80FD\u9700\u8981\u6307\u5B9A HTTP \u6216 HTTPS \u4EE3\u7406\u3002\u8BF7\u4E3A jarsigner \u63D0\u4F9B\u4EE5\u4E0B\u9009\u9879: "},
+        {"or", "\u6216"},
+        {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
+                "\u627E\u4E0D\u5230{0}\u7684\u8BC1\u4E66\u3002{1}\u5FC5\u987B\u5F15\u7528\u5305\u542B\u65F6\u95F4\u6233\u9881\u53D1\u673A\u6784\u7684 X.509 \u516C\u5171\u5BC6\u94A5\u8BC1\u4E66\u7684\u6709\u6548 KeyStore \u6761\u76EE\u3002"},
+        {"using.an.alternative.signing.mechanism",
+                "\u6B63\u5728\u4F7F\u7528\u66FF\u4EE3\u7684\u7B7E\u540D\u673A\u5236"},
+        {"entry.was.signed.on", "\u6761\u76EE\u7684\u7B7E\u540D\u65E5\u671F\u4E3A {0}"},
+        {"Warning.", "\u8B66\u544A: "},
+        {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
+                "\u6B64 jar \u5305\u542B\u5C1A\u672A\u8FDB\u884C\u5B8C\u6574\u6027\u68C0\u67E5\u7684\u672A\u7B7E\u540D\u6761\u76EE\u3002 "},
+        {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
+                "\u6B64 jar \u5305\u542B\u7B7E\u540D\u8005\u8BC1\u4E66\u5DF2\u8FC7\u671F\u7684\u6761\u76EE\u3002 "},
+        {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
+                "\u6B64 jar \u5305\u542B\u7B7E\u540D\u8005\u8BC1\u4E66\u5C06\u5728\u516D\u4E2A\u6708\u5185\u8FC7\u671F\u7684\u6761\u76EE\u3002 "},
+        {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
+                "\u6B64 jar \u5305\u542B\u7B7E\u540D\u8005\u8BC1\u4E66\u4ECD\u65E0\u6548\u7684\u6761\u76EE\u3002 "},
+        {"Re.run.with.the.verbose.option.for.more.details.",
+                "\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -verbose \u9009\u9879\u91CD\u65B0\u8FD0\u884C\u3002"},
+        {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
+                "\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -verbose \u548C -certs \u9009\u9879\u91CD\u65B0\u8FD0\u884C\u3002"},
+        {"The.signer.certificate.has.expired.",
+                "\u7B7E\u540D\u8005\u8BC1\u4E66\u5DF2\u8FC7\u671F\u3002"},
+        {"The.signer.certificate.will.expire.within.six.months.",
+                "\u7B7E\u540D\u8005\u8BC1\u4E66\u5C06\u5728\u516D\u4E2A\u6708\u5185\u8FC7\u671F\u3002"},
+        {"The.signer.certificate.is.not.yet.valid.",
+                "\u7B7E\u540D\u8005\u8BC1\u4E66\u4ECD\u65E0\u6548\u3002"},
+        {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 KeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u3002"},
+        {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 ExtendedKeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u3002"},
+        {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
+                 "\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 NetscapeCertType \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u3002"},
+        {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u6B64 jar \u5305\u542B\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 KeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u7684\u6761\u76EE\u3002"},
+        {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
+                 "\u6B64 jar \u5305\u542B\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 ExtendedKeyUsage \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u7684\u6761\u76EE\u3002"},
+        {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
+                 "\u6B64 jar \u5305\u542B\u7531\u4E8E\u7B7E\u540D\u8005\u8BC1\u4E66\u7684 NetscapeCertType \u6269\u5C55\u800C\u65E0\u6CD5\u8FDB\u884C\u4EE3\u7801\u7B7E\u540D\u7684\u6761\u76EE\u3002"},
+        {".{0}.extension.does.not.support.code.signing.",
+                 "[{0} \u6269\u5C55\u4E0D\u652F\u6301\u4EE3\u7801\u7B7E\u540D]"},
+        {"The.signer.s.certificate.chain.is.not.validated.",
+                "\u7B7E\u540D\u8005\u7684\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1\u3002"},
+        {"This.jar.contains.entries.whose.certificate.chain.is.not.validated.",
+                 "\u6B64 jar \u5305\u542B\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1\u7684\u6761\u76EE\u3002"},
+        {"Unknown.password.type.", "\u672A\u77E5\u53E3\u4EE4\u7C7B\u578B: "},
+        {"Cannot.find.environment.variable.",
+                "\u627E\u4E0D\u5230\u73AF\u5883\u53D8\u91CF: "},
+        {"Cannot.find.file.", "\u627E\u4E0D\u5230\u6587\u4EF6: "},
+        {"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9009\u9879{0}\u9700\u8981\u4E00\u4E2A\u53C2\u6570\u3002"},
+    };
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/jarsigner/TimestampedSigner.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.jarsigner;
+
+import java.io.IOException;
+import java.net.URI;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import com.sun.jarsigner.*;
+import sun.security.pkcs.PKCS7;
+import sun.security.util.*;
+import sun.security.x509.*;
+
+/**
+ * This class implements a content signing service.
+ * It generates a timestamped signature for a given content according to
+ * <a href="http://www.ietf.org/rfc/rfc3161.txt">RFC 3161</a>.
+ * The signature along with a trusted timestamp and the signer's certificate
+ * are all packaged into a standard PKCS #7 Signed Data message.
+ *
+ * @author Vincent Ryan
+ */
+
+public final class TimestampedSigner extends ContentSigner {
+
+    /*
+     * Object identifier for the subject information access X.509 certificate
+     * extension.
+     */
+    private static final String SUBJECT_INFO_ACCESS_OID = "1.3.6.1.5.5.7.1.11";
+
+    /*
+     * Object identifier for the timestamping access descriptors.
+     */
+    private static final ObjectIdentifier AD_TIMESTAMPING_Id;
+    static {
+        ObjectIdentifier tmp = null;
+        try {
+            tmp = new ObjectIdentifier("1.3.6.1.5.5.7.48.3");
+        } catch (IOException e) {
+            // ignore
+        }
+        AD_TIMESTAMPING_Id = tmp;
+    }
+
+    /**
+     * Instantiates a content signer that supports timestamped signatures.
+     */
+    public TimestampedSigner() {
+    }
+
+    /**
+     * Generates a PKCS #7 signed data message that includes a signature
+     * timestamp.
+     * This method is used when a signature has already been generated.
+     * The signature, a signature timestamp, the signer's certificate chain,
+     * and optionally the content that was signed, are packaged into a PKCS #7
+     * signed data message.
+     *
+     * @param params The non-null input parameters.
+     * @param omitContent true if the content should be omitted from the
+     *        signed data message. Otherwise the content is included.
+     * @param applyTimestamp true if the signature should be timestamped.
+     *        Otherwise timestamping is not performed.
+     * @return A PKCS #7 signed data message including a signature timestamp.
+     * @throws NoSuchAlgorithmException The exception is thrown if the signature
+     *         algorithm is unrecognised.
+     * @throws CertificateException The exception is thrown if an error occurs
+     *         while processing the signer's certificate or the TSA's
+     *         certificate.
+     * @throws IOException The exception is thrown if an error occurs while
+     *         generating the signature timestamp or while generating the signed
+     *         data message.
+     * @throws NullPointerException The exception is thrown if parameters is
+     *         null.
+     */
+    public byte[] generateSignedData(ContentSignerParameters params,
+        boolean omitContent, boolean applyTimestamp)
+            throws NoSuchAlgorithmException, CertificateException, IOException {
+
+        if (params == null) {
+            throw new NullPointerException();
+        }
+
+        // Parse the signature algorithm to extract the digest
+        // algorithm. The expected format is:
+        //     "<digest>with<encryption>"
+        // or  "<digest>with<encryption>and<mgf>"
+        String signatureAlgorithm = params.getSignatureAlgorithm();
+
+        X509Certificate[] signerChain = params.getSignerCertificateChain();
+        byte[] signature = params.getSignature();
+
+        // Include or exclude content
+        byte[] content = (omitContent == true) ? null : params.getContent();
+
+        URI tsaURI = null;
+        if (applyTimestamp) {
+            tsaURI = params.getTimestampingAuthority();
+            if (tsaURI == null) {
+                // Examine TSA cert
+                tsaURI = getTimestampingURI(
+                    params.getTimestampingAuthorityCertificate());
+                if (tsaURI == null) {
+                    throw new CertificateException(
+                        "Subject Information Access extension not found");
+                }
+            }
+        }
+        return PKCS7.generateSignedData(signature, signerChain, content,
+                                        params.getSignatureAlgorithm(), tsaURI);
+    }
+
+    /**
+     * Examine the certificate for a Subject Information Access extension
+     * (<a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a>).
+     * The extension's <tt>accessMethod</tt> field should contain the object
+     * identifier defined for timestamping: 1.3.6.1.5.5.7.48.3 and its
+     * <tt>accessLocation</tt> field should contain an HTTP or HTTPS URL.
+     *
+     * @param tsaCertificate An X.509 certificate for the TSA.
+     * @return An HTTP or HTTPS URI or null if none was found.
+     */
+    public static URI getTimestampingURI(X509Certificate tsaCertificate) {
+
+        if (tsaCertificate == null) {
+            return null;
+        }
+        // Parse the extensions
+        try {
+            byte[] extensionValue =
+                tsaCertificate.getExtensionValue(SUBJECT_INFO_ACCESS_OID);
+            if (extensionValue == null) {
+                return null;
+            }
+            DerInputStream der = new DerInputStream(extensionValue);
+            der = new DerInputStream(der.getOctetString());
+            DerValue[] derValue = der.getSequence(5);
+            AccessDescription description;
+            GeneralName location;
+            URIName uri;
+            for (int i = 0; i < derValue.length; i++) {
+                description = new AccessDescription(derValue[i]);
+                if (description.getAccessMethod()
+                        .equals((Object)AD_TIMESTAMPING_Id)) {
+                    location = description.getAccessLocation();
+                    if (location.getType() == GeneralNameInterface.NAME_URI) {
+                        uri = (URIName) location.getName();
+                        if (uri.getScheme().equalsIgnoreCase("http") ||
+                                uri.getScheme().equalsIgnoreCase("https")) {
+                            return uri.getURI();
+                        }
+                    }
+                }
+            }
+        } catch (IOException ioe) {
+            // ignore
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/CertAndKeyGen.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+import java.io.IOException;
+import java.security.cert.X509Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateEncodingException;
+import java.security.*;
+import java.util.Date;
+
+import sun.security.pkcs10.PKCS10;
+import sun.security.x509.*;
+
+
+/**
+ * Generate a pair of keys, and provide access to them.  This class is
+ * provided primarily for ease of use.
+ *
+ * <P>This provides some simple certificate management functionality.
+ * Specifically, it allows you to create self-signed X.509 certificates
+ * as well as PKCS 10 based certificate signing requests.
+ *
+ * <P>Keys for some public key signature algorithms have algorithm
+ * parameters, such as DSS/DSA.  Some sites' Certificate Authorities
+ * adopt fixed algorithm parameters, which speeds up some operations
+ * including key generation and signing.  <em>At this time, this interface
+ * does not provide a way to provide such algorithm parameters, e.g.
+ * by providing the CA certificate which includes those parameters.</em>
+ *
+ * <P>Also, note that at this time only signature-capable keys may be
+ * acquired through this interface.  Diffie-Hellman keys, used for secure
+ * key exchange, may be supported later.
+ *
+ * @author David Brownell
+ * @author Hemma Prafullchandra
+ * @see PKCS10
+ * @see X509CertImpl
+ */
+public final class CertAndKeyGen {
+    /**
+     * Creates a CertAndKeyGen object for a particular key type
+     * and signature algorithm.
+     *
+     * @param keyType type of key, e.g. "RSA", "DSA"
+     * @param sigAlg name of the signature algorithm, e.g. "MD5WithRSA",
+     *          "MD2WithRSA", "SHAwithDSA".
+     * @exception NoSuchAlgorithmException on unrecognized algorithms.
+     */
+    public CertAndKeyGen (String keyType, String sigAlg)
+    throws NoSuchAlgorithmException
+    {
+        keyGen = KeyPairGenerator.getInstance(keyType);
+        this.sigAlg = sigAlg;
+    }
+
+    /**
+     * Creates a CertAndKeyGen object for a particular key type,
+     * signature algorithm, and provider.
+     *
+     * @param keyType type of key, e.g. "RSA", "DSA"
+     * @param sigAlg name of the signature algorithm, e.g. "MD5WithRSA",
+     *          "MD2WithRSA", "SHAwithDSA".
+     * @param providerName name of the provider
+     * @exception NoSuchAlgorithmException on unrecognized algorithms.
+     * @exception NoSuchProviderException on unrecognized providers.
+     */
+    public CertAndKeyGen (String keyType, String sigAlg, String providerName)
+    throws NoSuchAlgorithmException, NoSuchProviderException
+    {
+        if (providerName == null) {
+            keyGen = KeyPairGenerator.getInstance(keyType);
+        } else {
+            try {
+                keyGen = KeyPairGenerator.getInstance(keyType, providerName);
+            } catch (Exception e) {
+                // try first available provider instead
+                keyGen = KeyPairGenerator.getInstance(keyType);
+            }
+        }
+        this.sigAlg = sigAlg;
+    }
+
+    /**
+     * Sets the source of random numbers used when generating keys.
+     * If you do not provide one, a system default facility is used.
+     * You may wish to provide your own source of random numbers
+     * to get a reproducible sequence of keys and signatures, or
+     * because you may be able to take advantage of strong sources
+     * of randomness/entropy in your environment.
+     */
+    public void         setRandom (SecureRandom generator)
+    {
+        prng = generator;
+    }
+
+    // want "public void generate (X509Certificate)" ... inherit DSA/D-H param
+
+    /**
+     * Generates a random public/private key pair, with a given key
+     * size.  Different algorithms provide different degrees of security
+     * for the same key size, because of the "work factor" involved in
+     * brute force attacks.  As computers become faster, it becomes
+     * easier to perform such attacks.  Small keys are to be avoided.
+     *
+     * <P>Note that not all values of "keyBits" are valid for all
+     * algorithms, and not all public key algorithms are currently
+     * supported for use in X.509 certificates.  If the algorithm
+     * you specified does not produce X.509 compatible keys, an
+     * invalid key exception is thrown.
+     *
+     * @param keyBits the number of bits in the keys.
+     * @exception InvalidKeyException if the environment does not
+     *  provide X.509 public keys for this signature algorithm.
+     */
+    public void generate (int keyBits)
+    throws InvalidKeyException
+    {
+        KeyPair pair;
+
+        try {
+            if (prng == null) {
+                prng = new SecureRandom();
+            }
+            keyGen.initialize(keyBits, prng);
+            pair = keyGen.generateKeyPair();
+
+        } catch (Exception e) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+
+        publicKey = pair.getPublic();
+        privateKey = pair.getPrivate();
+
+        // publicKey's format must be X.509 otherwise
+        // the whole CertGen part of this class is broken.
+        if (!"X.509".equalsIgnoreCase(publicKey.getFormat())) {
+            throw new IllegalArgumentException("publicKey's is not X.509, but "
+                    + publicKey.getFormat());
+        }
+    }
+
+
+    /**
+     * Returns the public key of the generated key pair if it is of type
+     * <code>X509Key</code>, or null if the public key is of a different type.
+     *
+     * XXX Note: This behaviour is needed for backwards compatibility.
+     * What this method really should return is the public key of the
+     * generated key pair, regardless of whether or not it is an instance of
+     * <code>X509Key</code>. Accordingly, the return type of this method
+     * should be <code>PublicKey</code>.
+     */
+    public X509Key getPublicKey()
+    {
+        if (!(publicKey instanceof X509Key)) {
+            return null;
+        }
+        return (X509Key)publicKey;
+    }
+
+    /**
+     * Always returns the public key of the generated key pair. Used
+     * by KeyTool only.
+     *
+     * The publicKey is not necessarily to be an instance of
+     * X509Key in some JCA/JCE providers, for example SunPKCS11.
+     */
+    public PublicKey getPublicKeyAnyway() {
+        return publicKey;
+    }
+
+    /**
+     * Returns the private key of the generated key pair.
+     *
+     * <P><STRONG><em>Be extremely careful when handling private keys.
+     * When private keys are not kept secret, they lose their ability
+     * to securely authenticate specific entities ... that is a huge
+     * security risk!</em></STRONG>
+     */
+    public PrivateKey getPrivateKey ()
+    {
+        return privateKey;
+    }
+
+    /**
+     * Returns a self-signed X.509v3 certificate for the public key.
+     * The certificate is immediately valid. No extensions.
+     *
+     * <P>Such certificates normally are used to identify a "Certificate
+     * Authority" (CA).  Accordingly, they will not always be accepted by
+     * other parties.  However, such certificates are also useful when
+     * you are bootstrapping your security infrastructure, or deploying
+     * system prototypes.
+     *
+     * @param myname X.500 name of the subject (who is also the issuer)
+     * @param firstDate the issue time of the certificate
+     * @param validity how long the certificate should be valid, in seconds
+     * @exception CertificateException on certificate handling errors.
+     * @exception InvalidKeyException on key handling errors.
+     * @exception SignatureException on signature handling errors.
+     * @exception NoSuchAlgorithmException on unrecognized algorithms.
+     * @exception NoSuchProviderException on unrecognized providers.
+     */
+    public X509Certificate getSelfCertificate (
+            X500Name myname, Date firstDate, long validity)
+    throws CertificateException, InvalidKeyException, SignatureException,
+        NoSuchAlgorithmException, NoSuchProviderException
+    {
+        return getSelfCertificate(myname, firstDate, validity, null);
+    }
+
+    // Like above, plus a CertificateExtensions argument, which can be null.
+    public X509Certificate getSelfCertificate (X500Name myname, Date firstDate,
+            long validity, CertificateExtensions ext)
+    throws CertificateException, InvalidKeyException, SignatureException,
+        NoSuchAlgorithmException, NoSuchProviderException
+    {
+        X509CertImpl    cert;
+        Date            lastDate;
+
+        try {
+            lastDate = new Date ();
+            lastDate.setTime (firstDate.getTime () + validity * 1000);
+
+            CertificateValidity interval =
+                                   new CertificateValidity(firstDate,lastDate);
+
+            X509CertInfo info = new X509CertInfo();
+            // Add all mandatory attributes
+            info.set(X509CertInfo.VERSION,
+                     new CertificateVersion(CertificateVersion.V3));
+            info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
+                    new java.util.Random().nextInt() & 0x7fffffff));
+            AlgorithmId algID = AlgorithmId.get(sigAlg);
+            info.set(X509CertInfo.ALGORITHM_ID,
+                     new CertificateAlgorithmId(algID));
+            info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(myname));
+            info.set(X509CertInfo.KEY, new CertificateX509Key(publicKey));
+            info.set(X509CertInfo.VALIDITY, interval);
+            info.set(X509CertInfo.ISSUER, new CertificateIssuerName(myname));
+            if (ext != null) info.set(X509CertInfo.EXTENSIONS, ext);
+
+            cert = new X509CertImpl(info);
+            cert.sign(privateKey, this.sigAlg);
+
+            return (X509Certificate)cert;
+
+        } catch (IOException e) {
+             throw new CertificateEncodingException("getSelfCert: " +
+                                                    e.getMessage());
+        }
+    }
+
+    // Keep the old method
+    public X509Certificate getSelfCertificate (X500Name myname, long validity)
+    throws CertificateException, InvalidKeyException, SignatureException,
+        NoSuchAlgorithmException, NoSuchProviderException
+    {
+        return getSelfCertificate(myname, new Date(), validity);
+    }
+
+    /**
+     * Returns a PKCS #10 certificate request.  The caller uses either
+     * <code>PKCS10.print</code> or <code>PKCS10.toByteArray</code>
+     * operations on the result, to get the request in an appropriate
+     * transmission format.
+     *
+     * <P>PKCS #10 certificate requests are sent, along with some proof
+     * of identity, to Certificate Authorities (CAs) which then issue
+     * X.509 public key certificates.
+     *
+     * @param myname X.500 name of the subject
+     * @exception InvalidKeyException on key handling errors.
+     * @exception SignatureException on signature handling errors.
+     */
+    public PKCS10 getCertRequest (X500Name myname)
+    throws InvalidKeyException, SignatureException
+    {
+        PKCS10  req = new PKCS10 (publicKey);
+
+        try {
+            Signature signature = Signature.getInstance(sigAlg);
+            signature.initSign (privateKey);
+            req.encodeAndSign(myname, signature);
+
+        } catch (CertificateException e) {
+            throw new SignatureException (sigAlg + " CertificateException");
+
+        } catch (IOException e) {
+            throw new SignatureException (sigAlg + " IOException");
+
+        } catch (NoSuchAlgorithmException e) {
+            // "can't happen"
+            throw new SignatureException (sigAlg + " unavailable?");
+        }
+        return req;
+    }
+
+    private SecureRandom        prng;
+    private String              sigAlg;
+    private KeyPairGenerator    keyGen;
+    private PublicKey           publicKey;
+    private PrivateKey          privateKey;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Main.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,4080 @@
+/*
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+import java.io.*;
+import java.security.CodeSigner;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.MessageDigest;
+import java.security.Key;
+import java.security.PublicKey;
+import java.security.PrivateKey;
+import java.security.Security;
+import java.security.Signature;
+import java.security.Timestamp;
+import java.security.UnrecoverableEntryException;
+import java.security.UnrecoverableKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
+import java.security.Provider;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertStoreException;
+import java.security.cert.CRL;
+import java.security.cert.X509Certificate;
+import java.security.cert.CertificateException;
+import java.text.Collator;
+import java.text.MessageFormat;
+import java.util.*;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.lang.reflect.Constructor;
+import java.math.BigInteger;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.cert.CertStore;
+
+import java.security.cert.X509CRL;
+import java.security.cert.X509CRLEntry;
+import java.security.cert.X509CRLSelector;
+import javax.security.auth.x500.X500Principal;
+import sun.misc.BASE64Encoder;
+import sun.security.util.ObjectIdentifier;
+import sun.security.pkcs10.PKCS10;
+import sun.security.pkcs10.PKCS10Attribute;
+import sun.security.provider.X509Factory;
+import sun.security.provider.certpath.CertStoreHelper;
+import sun.security.util.Password;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+
+import sun.misc.BASE64Decoder;
+import sun.security.pkcs.PKCS9Attribute;
+import sun.security.tools.KeyStoreUtil;
+import sun.security.tools.PathList;
+import sun.security.util.DerValue;
+import sun.security.x509.*;
+
+import static java.security.KeyStore.*;
+import static sun.security.tools.keytool.Main.Command.*;
+import static sun.security.tools.keytool.Main.Option.*;
+
+/**
+ * This tool manages keystores.
+ *
+ * @author Jan Luehe
+ *
+ *
+ * @see java.security.KeyStore
+ * @see sun.security.provider.KeyProtector
+ * @see sun.security.provider.JavaKeyStore
+ *
+ * @since 1.2
+ */
+public final class Main {
+
+    private boolean debug = false;
+    private Command command = null;
+    private String sigAlgName = null;
+    private String keyAlgName = null;
+    private boolean verbose = false;
+    private int keysize = -1;
+    private boolean rfc = false;
+    private long validity = (long)90;
+    private String alias = null;
+    private String dname = null;
+    private String dest = null;
+    private String filename = null;
+    private String infilename = null;
+    private String outfilename = null;
+    private String srcksfname = null;
+
+    // User-specified providers are added before any command is called.
+    // However, they are not removed before the end of the main() method.
+    // If you're calling KeyTool.main() directly in your own Java program,
+    // please programtically add any providers you need and do not specify
+    // them through the command line.
+
+    private Set<Pair <String, String>> providers = null;
+    private String storetype = null;
+    private String srcProviderName = null;
+    private String providerName = null;
+    private String pathlist = null;
+    private char[] storePass = null;
+    private char[] storePassNew = null;
+    private char[] keyPass = null;
+    private char[] keyPassNew = null;
+    private char[] newPass = null;
+    private char[] destKeyPass = null;
+    private char[] srckeyPass = null;
+    private String ksfname = null;
+    private File ksfile = null;
+    private InputStream ksStream = null; // keystore stream
+    private String sslserver = null;
+    private String jarfile = null;
+    private KeyStore keyStore = null;
+    private boolean token = false;
+    private boolean nullStream = false;
+    private boolean kssave = false;
+    private boolean noprompt = false;
+    private boolean trustcacerts = false;
+    private boolean protectedPath = false;
+    private boolean srcprotectedPath = false;
+    private CertificateFactory cf = null;
+    private KeyStore caks = null; // "cacerts" keystore
+    private char[] srcstorePass = null;
+    private String srcstoretype = null;
+    private Set<char[]> passwords = new HashSet<>();
+    private String startDate = null;
+
+    private List<String> ids = new ArrayList<>();   // used in GENCRL
+    private List<String> v3ext = new ArrayList<>();
+
+    enum Command {
+        CERTREQ("Generates.a.certificate.request",
+            ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME,
+            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
+            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
+        CHANGEALIAS("Changes.an.entry.s.alias",
+            ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS,
+            STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
+            PROVIDERPATH, V, PROTECTED),
+        DELETE("Deletes.an.entry",
+            ALIAS, KEYSTORE, STOREPASS, STORETYPE,
+            PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
+            PROVIDERPATH, V, PROTECTED),
+        EXPORTCERT("Exports.certificate",
+            RFC, ALIAS, FILEOUT, KEYSTORE, STOREPASS,
+            STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
+            PROVIDERPATH, V, PROTECTED),
+        GENKEYPAIR("Generates.a.key.pair",
+            ALIAS, KEYALG, KEYSIZE, SIGALG, DESTALIAS, DNAME,
+            STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE,
+            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
+            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
+        GENSECKEY("Generates.a.secret.key",
+            ALIAS, KEYPASS, KEYALG, KEYSIZE, KEYSTORE,
+            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
+            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
+        GENCERT("Generates.certificate.from.a.certificate.request",
+            RFC, INFILE, OUTFILE, ALIAS, SIGALG, DNAME,
+            STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE,
+            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
+            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
+        IMPORTCERT("Imports.a.certificate.or.a.certificate.chain",
+            NOPROMPT, TRUSTCACERTS, PROTECTED, ALIAS, FILEIN,
+            KEYPASS, KEYSTORE, STOREPASS, STORETYPE,
+            PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
+            PROVIDERPATH, V),
+        IMPORTKEYSTORE("Imports.one.or.all.entries.from.another.keystore",
+            SRCKEYSTORE, DESTKEYSTORE, SRCSTORETYPE,
+            DESTSTORETYPE, SRCSTOREPASS, DESTSTOREPASS,
+            SRCPROTECTED, SRCPROVIDERNAME, DESTPROVIDERNAME,
+            SRCALIAS, DESTALIAS, SRCKEYPASS, DESTKEYPASS,
+            NOPROMPT, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH,
+            V),
+        KEYPASSWD("Changes.the.key.password.of.an.entry",
+            ALIAS, KEYPASS, NEW, KEYSTORE, STOREPASS,
+            STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
+            PROVIDERPATH, V),
+        LIST("Lists.entries.in.a.keystore",
+            RFC, ALIAS, KEYSTORE, STOREPASS, STORETYPE,
+            PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
+            PROVIDERPATH, V, PROTECTED),
+        PRINTCERT("Prints.the.content.of.a.certificate",
+            RFC, FILEIN, SSLSERVER, JARFILE, V),
+        PRINTCERTREQ("Prints.the.content.of.a.certificate.request",
+            FILEIN, V),
+        PRINTCRL("Prints.the.content.of.a.CRL.file",
+            FILEIN, V),
+        STOREPASSWD("Changes.the.store.password.of.a.keystore",
+            NEW, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME,
+            PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V),
+
+        // Undocumented start here, KEYCLONE is used a marker in -help;
+
+        KEYCLONE("Clones.a.key.entry",
+            ALIAS, DESTALIAS, KEYPASS, NEW, STORETYPE,
+            KEYSTORE, STOREPASS, PROVIDERNAME, PROVIDERCLASS,
+            PROVIDERARG, PROVIDERPATH, V),
+        SELFCERT("Generates.a.self.signed.certificate",
+            ALIAS, SIGALG, DNAME, STARTDATE, VALIDITY, KEYPASS,
+            STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME,
+            PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V),
+        GENCRL("Generates.CRL",
+            RFC, FILEOUT, ID,
+            ALIAS, SIGALG, EXT, KEYPASS, KEYSTORE,
+            STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
+            PROVIDERARG, PROVIDERPATH, V, PROTECTED),
+        IDENTITYDB("Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+            FILEIN, STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME,
+            PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V);
+
+        final String description;
+        final Option[] options;
+        Command(String d, Option... o) {
+            description = d;
+            options = o;
+        }
+        @Override
+        public String toString() {
+            return "-" + name().toLowerCase(Locale.ENGLISH);
+        }
+    };
+
+    enum Option {
+        ALIAS("alias", "<alias>", "alias.name.of.the.entry.to.process"),
+        DESTALIAS("destalias", "<destalias>", "destination.alias"),
+        DESTKEYPASS("destkeypass", "<arg>", "destination.key.password"),
+        DESTKEYSTORE("destkeystore", "<destkeystore>", "destination.keystore.name"),
+        DESTPROTECTED("destprotected", null, "destination.keystore.password.protected"),
+        DESTPROVIDERNAME("destprovidername", "<destprovidername>", "destination.keystore.provider.name"),
+        DESTSTOREPASS("deststorepass", "<arg>", "destination.keystore.password"),
+        DESTSTORETYPE("deststoretype", "<deststoretype>", "destination.keystore.type"),
+        DNAME("dname", "<dname>", "distinguished.name"),
+        EXT("ext", "<value>", "X.509.extension"),
+        FILEOUT("file", "<filename>", "output.file.name"),
+        FILEIN("file", "<filename>", "input.file.name"),
+        ID("id", "<id:reason>", "Serial.ID.of.cert.to.revoke"),
+        INFILE("infile", "<filename>", "input.file.name"),
+        KEYALG("keyalg", "<keyalg>", "key.algorithm.name"),
+        KEYPASS("keypass", "<arg>", "key.password"),
+        KEYSIZE("keysize", "<keysize>", "key.bit.size"),
+        KEYSTORE("keystore", "<keystore>", "keystore.name"),
+        NEW("new", "<arg>", "new.password"),
+        NOPROMPT("noprompt", null, "do.not.prompt"),
+        OUTFILE("outfile", "<filename>", "output.file.name"),
+        PROTECTED("protected", null, "password.through.protected.mechanism"),
+        PROVIDERARG("providerarg", "<arg>", "provider.argument"),
+        PROVIDERCLASS("providerclass", "<providerclass>", "provider.class.name"),
+        PROVIDERNAME("providername", "<providername>", "provider.name"),
+        PROVIDERPATH("providerpath", "<pathlist>", "provider.classpath"),
+        RFC("rfc", null, "output.in.RFC.style"),
+        SIGALG("sigalg", "<sigalg>", "signature.algorithm.name"),
+        SRCALIAS("srcalias", "<srcalias>", "source.alias"),
+        SRCKEYPASS("srckeypass", "<arg>", "source.key.password"),
+        SRCKEYSTORE("srckeystore", "<srckeystore>", "source.keystore.name"),
+        SRCPROTECTED("srcprotected", null, "source.keystore.password.protected"),
+        SRCPROVIDERNAME("srcprovidername", "<srcprovidername>", "source.keystore.provider.name"),
+        SRCSTOREPASS("srcstorepass", "<arg>", "source.keystore.password"),
+        SRCSTORETYPE("srcstoretype", "<srcstoretype>", "source.keystore.type"),
+        SSLSERVER("sslserver", "<server[:port]>", "SSL.server.host.and.port"),
+        JARFILE("jarfile", "<filename>", "signed.jar.file"),
+        STARTDATE("startdate", "<startdate>", "certificate.validity.start.date.time"),
+        STOREPASS("storepass", "<arg>", "keystore.password"),
+        STORETYPE("storetype", "<storetype>", "keystore.type"),
+        TRUSTCACERTS("trustcacerts", null, "trust.certificates.from.cacerts"),
+        V("v", null, "verbose.output"),
+        VALIDITY("validity", "<valDays>", "validity.number.of.days");
+
+        final String name, arg, description;
+        Option(String name, String arg, String description) {
+            this.name = name;
+            this.arg = arg;
+            this.description = description;
+        }
+        @Override
+        public String toString() {
+            return "-" + name;
+        }
+    };
+
+    private static final Class[] PARAM_STRING = { String.class };
+
+    private static final String NONE = "NONE";
+    private static final String P11KEYSTORE = "PKCS11";
+    private static final String P12KEYSTORE = "PKCS12";
+    private final String keyAlias = "mykey";
+
+    // for i18n
+    private static final java.util.ResourceBundle rb =
+        java.util.ResourceBundle.getBundle(
+            "sun.security.tools.keytool.Resources");
+    private static final Collator collator = Collator.getInstance();
+    static {
+        // this is for case insensitive string comparisons
+        collator.setStrength(Collator.PRIMARY);
+    };
+
+    private Main() { }
+
+    public static void main(String[] args) throws Exception {
+        Main kt = new Main();
+        kt.run(args, System.out);
+    }
+
+    private void run(String[] args, PrintStream out) throws Exception {
+        try {
+            parseArgs(args);
+            if (command != null) {
+                doCommands(out);
+            }
+        } catch (Exception e) {
+            System.out.println(rb.getString("keytool.error.") + e);
+            if (verbose) {
+                e.printStackTrace(System.out);
+            }
+            if (!debug) {
+                System.exit(1);
+            } else {
+                throw e;
+            }
+        } finally {
+            for (char[] pass : passwords) {
+                if (pass != null) {
+                    Arrays.fill(pass, ' ');
+                    pass = null;
+                }
+            }
+
+            if (ksStream != null) {
+                ksStream.close();
+            }
+        }
+    }
+
+    /**
+     * Parse command line arguments.
+     */
+    void parseArgs(String[] args) {
+
+        int i=0;
+        boolean help = args.length == 0;
+
+        for (i=0; (i < args.length) && args[i].startsWith("-"); i++) {
+
+            String flags = args[i];
+
+            // Check if the last option needs an arg
+            if (i == args.length - 1) {
+                for (Option option: Option.values()) {
+                    // Only options with an arg need to be checked
+                    if (collator.compare(flags, option.toString()) == 0) {
+                        if (option.arg != null) errorNeedArgument(flags);
+                        break;
+                    }
+                }
+            }
+
+            /*
+             * Check modifiers
+             */
+            String modifier = null;
+            int pos = flags.indexOf(':');
+            if (pos > 0) {
+                modifier = flags.substring(pos+1);
+                flags = flags.substring(0, pos);
+            }
+            /*
+             * command modes
+             */
+            boolean isCommand = false;
+            for (Command c: Command.values()) {
+                if (collator.compare(flags, c.toString()) == 0) {
+                    command = c;
+                    isCommand = true;
+                    break;
+                }
+            }
+
+            if (isCommand) {
+                // already recognized as a command
+            } else if (collator.compare(flags, "-export") == 0) {
+                command = EXPORTCERT;
+            } else if (collator.compare(flags, "-genkey") == 0) {
+                command = GENKEYPAIR;
+            } else if (collator.compare(flags, "-import") == 0) {
+                command = IMPORTCERT;
+            }
+            /*
+             * Help
+             */
+            else if (collator.compare(flags, "-help") == 0) {
+                help = true;
+            }
+
+            /*
+             * specifiers
+             */
+            else if (collator.compare(flags, "-keystore") == 0 ||
+                    collator.compare(flags, "-destkeystore") == 0) {
+                ksfname = args[++i];
+            } else if (collator.compare(flags, "-storepass") == 0 ||
+                    collator.compare(flags, "-deststorepass") == 0) {
+                storePass = getPass(modifier, args[++i]);
+                passwords.add(storePass);
+            } else if (collator.compare(flags, "-storetype") == 0 ||
+                    collator.compare(flags, "-deststoretype") == 0) {
+                storetype = args[++i];
+            } else if (collator.compare(flags, "-srcstorepass") == 0) {
+                srcstorePass = getPass(modifier, args[++i]);
+                passwords.add(srcstorePass);
+            } else if (collator.compare(flags, "-srcstoretype") == 0) {
+                srcstoretype = args[++i];
+            } else if (collator.compare(flags, "-srckeypass") == 0) {
+                srckeyPass = getPass(modifier, args[++i]);
+                passwords.add(srckeyPass);
+            } else if (collator.compare(flags, "-srcprovidername") == 0) {
+                srcProviderName = args[++i];
+            } else if (collator.compare(flags, "-providername") == 0 ||
+                    collator.compare(flags, "-destprovidername") == 0) {
+                providerName = args[++i];
+            } else if (collator.compare(flags, "-providerpath") == 0) {
+                pathlist = args[++i];
+            } else if (collator.compare(flags, "-keypass") == 0) {
+                keyPass = getPass(modifier, args[++i]);
+                passwords.add(keyPass);
+            } else if (collator.compare(flags, "-new") == 0) {
+                newPass = getPass(modifier, args[++i]);
+                passwords.add(newPass);
+            } else if (collator.compare(flags, "-destkeypass") == 0) {
+                destKeyPass = getPass(modifier, args[++i]);
+                passwords.add(destKeyPass);
+            } else if (collator.compare(flags, "-alias") == 0 ||
+                    collator.compare(flags, "-srcalias") == 0) {
+                alias = args[++i];
+            } else if (collator.compare(flags, "-dest") == 0 ||
+                    collator.compare(flags, "-destalias") == 0) {
+                dest = args[++i];
+            } else if (collator.compare(flags, "-dname") == 0) {
+                dname = args[++i];
+            } else if (collator.compare(flags, "-keysize") == 0) {
+                keysize = Integer.parseInt(args[++i]);
+            } else if (collator.compare(flags, "-keyalg") == 0) {
+                keyAlgName = args[++i];
+            } else if (collator.compare(flags, "-sigalg") == 0) {
+                sigAlgName = args[++i];
+            } else if (collator.compare(flags, "-startdate") == 0) {
+                startDate = args[++i];
+            } else if (collator.compare(flags, "-validity") == 0) {
+                validity = Long.parseLong(args[++i]);
+            } else if (collator.compare(flags, "-ext") == 0) {
+                v3ext.add(args[++i]);
+            } else if (collator.compare(flags, "-id") == 0) {
+                ids.add(args[++i]);
+            } else if (collator.compare(flags, "-file") == 0) {
+                filename = args[++i];
+            } else if (collator.compare(flags, "-infile") == 0) {
+                infilename = args[++i];
+            } else if (collator.compare(flags, "-outfile") == 0) {
+                outfilename = args[++i];
+            } else if (collator.compare(flags, "-sslserver") == 0) {
+                sslserver = args[++i];
+            } else if (collator.compare(flags, "-jarfile") == 0) {
+                jarfile = args[++i];
+            } else if (collator.compare(flags, "-srckeystore") == 0) {
+                srcksfname = args[++i];
+            } else if ((collator.compare(flags, "-provider") == 0) ||
+                        (collator.compare(flags, "-providerclass") == 0)) {
+                if (providers == null) {
+                    providers = new HashSet<Pair <String, String>> (3);
+                }
+                String providerClass = args[++i];
+                String providerArg = null;
+
+                if (args.length > (i+1)) {
+                    flags = args[i+1];
+                    if (collator.compare(flags, "-providerarg") == 0) {
+                        if (args.length == (i+2)) errorNeedArgument(flags);
+                        providerArg = args[i+2];
+                        i += 2;
+                    }
+                }
+                providers.add(
+                        Pair.of(providerClass, providerArg));
+            }
+
+            /*
+             * options
+             */
+            else if (collator.compare(flags, "-v") == 0) {
+                verbose = true;
+            } else if (collator.compare(flags, "-debug") == 0) {
+                debug = true;
+            } else if (collator.compare(flags, "-rfc") == 0) {
+                rfc = true;
+            } else if (collator.compare(flags, "-noprompt") == 0) {
+                noprompt = true;
+            } else if (collator.compare(flags, "-trustcacerts") == 0) {
+                trustcacerts = true;
+            } else if (collator.compare(flags, "-protected") == 0 ||
+                    collator.compare(flags, "-destprotected") == 0) {
+                protectedPath = true;
+            } else if (collator.compare(flags, "-srcprotected") == 0) {
+                srcprotectedPath = true;
+            } else  {
+                System.err.println(rb.getString("Illegal.option.") + flags);
+                tinyHelp();
+            }
+        }
+
+        if (i<args.length) {
+            System.err.println(rb.getString("Illegal.option.") + args[i]);
+            tinyHelp();
+        }
+
+        if (command == null) {
+            if (help) {
+                usage();
+            } else {
+                System.err.println(rb.getString("Usage.error.no.command.provided"));
+                tinyHelp();
+            }
+        } else if (help) {
+            usage();
+            command = null;
+        }
+    }
+
+    boolean isKeyStoreRelated(Command cmd) {
+        return cmd != PRINTCERT && cmd != PRINTCERTREQ;
+    }
+
+    /**
+     * Execute the commands.
+     */
+    void doCommands(PrintStream out) throws Exception {
+
+        if (storetype == null) {
+            storetype = KeyStore.getDefaultType();
+        }
+        storetype = KeyStoreUtil.niceStoreTypeName(storetype);
+
+        if (srcstoretype == null) {
+            srcstoretype = KeyStore.getDefaultType();
+        }
+        srcstoretype = KeyStoreUtil.niceStoreTypeName(srcstoretype);
+
+        if (P11KEYSTORE.equalsIgnoreCase(storetype) ||
+                KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            token = true;
+            if (ksfname == null) {
+                ksfname = NONE;
+            }
+        }
+        if (NONE.equals(ksfname)) {
+            nullStream = true;
+        }
+
+        if (token && !nullStream) {
+            System.err.println(MessageFormat.format(rb.getString
+                (".keystore.must.be.NONE.if.storetype.is.{0}"), storetype));
+            System.err.println();
+            tinyHelp();
+        }
+
+        if (token &&
+            (command == KEYPASSWD || command == STOREPASSWD)) {
+            throw new UnsupportedOperationException(MessageFormat.format(rb.getString
+                        (".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}"), storetype));
+        }
+
+        if (P12KEYSTORE.equalsIgnoreCase(storetype) && command == KEYPASSWD) {
+            throw new UnsupportedOperationException(rb.getString
+                        (".keypasswd.commands.not.supported.if.storetype.is.PKCS12"));
+        }
+
+        if (token && (keyPass != null || newPass != null || destKeyPass != null)) {
+            throw new IllegalArgumentException(MessageFormat.format(rb.getString
+                (".keypass.and.new.can.not.be.specified.if.storetype.is.{0}"), storetype));
+        }
+
+        if (protectedPath) {
+            if (storePass != null || keyPass != null ||
+                    newPass != null || destKeyPass != null) {
+                throw new IllegalArgumentException(rb.getString
+                        ("if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified"));
+            }
+        }
+
+        if (srcprotectedPath) {
+            if (srcstorePass != null || srckeyPass != null) {
+                throw new IllegalArgumentException(rb.getString
+                        ("if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified"));
+            }
+        }
+
+        if (KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            if (storePass != null || keyPass != null ||
+                    newPass != null || destKeyPass != null) {
+                throw new IllegalArgumentException(rb.getString
+                        ("if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified"));
+            }
+        }
+
+        if (KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
+            if (srcstorePass != null || srckeyPass != null) {
+                throw new IllegalArgumentException(rb.getString
+                        ("if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified"));
+            }
+        }
+
+        if (validity <= (long)0) {
+            throw new Exception
+                (rb.getString("Validity.must.be.greater.than.zero"));
+        }
+
+        // Try to load and install specified provider
+        if (providers != null) {
+            ClassLoader cl = null;
+            if (pathlist != null) {
+                String path = null;
+                path = PathList.appendPath(
+                        path, System.getProperty("java.class.path"));
+                path = PathList.appendPath(
+                        path, System.getProperty("env.class.path"));
+                path = PathList.appendPath(path, pathlist);
+
+                URL[] urls = PathList.pathToURLs(path);
+                cl = new URLClassLoader(urls);
+            } else {
+                cl = ClassLoader.getSystemClassLoader();
+            }
+
+            for (Pair <String, String> provider: providers) {
+                String provName = provider.fst;
+                Class<?> provClass;
+                if (cl != null) {
+                    provClass = cl.loadClass(provName);
+                } else {
+                    provClass = Class.forName(provName);
+                }
+
+                String provArg = provider.snd;
+                Object obj;
+                if (provArg == null) {
+                    obj = provClass.newInstance();
+                } else {
+                    Constructor<?> c = provClass.getConstructor(PARAM_STRING);
+                    obj = c.newInstance(provArg);
+                }
+                if (!(obj instanceof Provider)) {
+                    MessageFormat form = new MessageFormat
+                        (rb.getString("provName.not.a.provider"));
+                    Object[] source = {provName};
+                    throw new Exception(form.format(source));
+                }
+                Security.addProvider((Provider)obj);
+            }
+        }
+
+        if (command == LIST && verbose && rfc) {
+            System.err.println(rb.getString
+                ("Must.not.specify.both.v.and.rfc.with.list.command"));
+            tinyHelp();
+        }
+
+        // Make sure provided passwords are at least 6 characters long
+        if (command == GENKEYPAIR && keyPass!=null && keyPass.length < 6) {
+            throw new Exception(rb.getString
+                ("Key.password.must.be.at.least.6.characters"));
+        }
+        if (newPass != null && newPass.length < 6) {
+            throw new Exception(rb.getString
+                ("New.password.must.be.at.least.6.characters"));
+        }
+        if (destKeyPass != null && destKeyPass.length < 6) {
+            throw new Exception(rb.getString
+                ("New.password.must.be.at.least.6.characters"));
+        }
+
+        // Check if keystore exists.
+        // If no keystore has been specified at the command line, try to use
+        // the default, which is located in $HOME/.keystore.
+        // If the command is "genkey", "identitydb", "import", or "printcert",
+        // it is OK not to have a keystore.
+        if (isKeyStoreRelated(command)) {
+            if (ksfname == null) {
+                ksfname = System.getProperty("user.home") + File.separator
+                    + ".keystore";
+            }
+
+            if (!nullStream) {
+                try {
+                    ksfile = new File(ksfname);
+                    // Check if keystore file is empty
+                    if (ksfile.exists() && ksfile.length() == 0) {
+                        throw new Exception(rb.getString
+                        ("Keystore.file.exists.but.is.empty.") + ksfname);
+                    }
+                    ksStream = new FileInputStream(ksfile);
+                } catch (FileNotFoundException e) {
+                    if (command != GENKEYPAIR &&
+                        command != GENSECKEY &&
+                        command != IDENTITYDB &&
+                        command != IMPORTCERT &&
+                        command != IMPORTKEYSTORE &&
+                        command != PRINTCRL) {
+                        throw new Exception(rb.getString
+                                ("Keystore.file.does.not.exist.") + ksfname);
+                    }
+                }
+            }
+        }
+
+        if ((command == KEYCLONE || command == CHANGEALIAS)
+                && dest == null) {
+            dest = getAlias("destination");
+            if ("".equals(dest)) {
+                throw new Exception(rb.getString
+                        ("Must.specify.destination.alias"));
+            }
+        }
+
+        if (command == DELETE && alias == null) {
+            alias = getAlias(null);
+            if ("".equals(alias)) {
+                throw new Exception(rb.getString("Must.specify.alias"));
+            }
+        }
+
+        // Create new keystore
+        if (providerName == null) {
+            keyStore = KeyStore.getInstance(storetype);
+        } else {
+            keyStore = KeyStore.getInstance(storetype, providerName);
+        }
+
+        /*
+         * Load the keystore data.
+         *
+         * At this point, it's OK if no keystore password has been provided.
+         * We want to make sure that we can load the keystore data, i.e.,
+         * the keystore data has the right format. If we cannot load the
+         * keystore, why bother asking the user for his or her password?
+         * Only if we were able to load the keystore, and no keystore
+         * password has been provided, will we prompt the user for the
+         * keystore password to verify the keystore integrity.
+         * This means that the keystore is loaded twice: first load operation
+         * checks the keystore format, second load operation verifies the
+         * keystore integrity.
+         *
+         * If the keystore password has already been provided (at the
+         * command line), however, the keystore is loaded only once, and the
+         * keystore format and integrity are checked "at the same time".
+         *
+         * Null stream keystores are loaded later.
+         */
+        if (!nullStream) {
+            keyStore.load(ksStream, storePass);
+            if (ksStream != null) {
+                ksStream.close();
+            }
+        }
+
+        // All commands that create or modify the keystore require a keystore
+        // password.
+
+        if (nullStream && storePass != null) {
+            keyStore.load(null, storePass);
+        } else if (!nullStream && storePass != null) {
+            // If we are creating a new non nullStream-based keystore,
+            // insist that the password be at least 6 characters
+            if (ksStream == null && storePass.length < 6) {
+                throw new Exception(rb.getString
+                        ("Keystore.password.must.be.at.least.6.characters"));
+            }
+        } else if (storePass == null) {
+
+            // only prompt if (protectedPath == false)
+
+            if (!protectedPath && !KeyStoreUtil.isWindowsKeyStore(storetype) &&
+                (command == CERTREQ ||
+                        command == DELETE ||
+                        command == GENKEYPAIR ||
+                        command == GENSECKEY ||
+                        command == IMPORTCERT ||
+                        command == IMPORTKEYSTORE ||
+                        command == KEYCLONE ||
+                        command == CHANGEALIAS ||
+                        command == SELFCERT ||
+                        command == STOREPASSWD ||
+                        command == KEYPASSWD ||
+                        command == IDENTITYDB)) {
+                int count = 0;
+                do {
+                    if (command == IMPORTKEYSTORE) {
+                        System.err.print
+                                (rb.getString("Enter.destination.keystore.password."));
+                    } else {
+                        System.err.print
+                                (rb.getString("Enter.keystore.password."));
+                    }
+                    System.err.flush();
+                    storePass = Password.readPassword(System.in);
+                    passwords.add(storePass);
+
+                    // If we are creating a new non nullStream-based keystore,
+                    // insist that the password be at least 6 characters
+                    if (!nullStream && (storePass == null || storePass.length < 6)) {
+                        System.err.println(rb.getString
+                                ("Keystore.password.is.too.short.must.be.at.least.6.characters"));
+                        storePass = null;
+                    }
+
+                    // If the keystore file does not exist and needs to be
+                    // created, the storepass should be prompted twice.
+                    if (storePass != null && !nullStream && ksStream == null) {
+                        System.err.print(rb.getString("Re.enter.new.password."));
+                        char[] storePassAgain = Password.readPassword(System.in);
+                        passwords.add(storePassAgain);
+                        if (!Arrays.equals(storePass, storePassAgain)) {
+                            System.err.println
+                                (rb.getString("They.don.t.match.Try.again"));
+                            storePass = null;
+                        }
+                    }
+
+                    count++;
+                } while ((storePass == null) && count < 3);
+
+
+                if (storePass == null) {
+                    System.err.println
+                        (rb.getString("Too.many.failures.try.later"));
+                    return;
+                }
+            } else if (!protectedPath
+                    && !KeyStoreUtil.isWindowsKeyStore(storetype)
+                    && isKeyStoreRelated(command)) {
+                // here we have EXPORTCERT and LIST (info valid until STOREPASSWD)
+                if (command != PRINTCRL) {
+                    System.err.print(rb.getString("Enter.keystore.password."));
+                    System.err.flush();
+                    storePass = Password.readPassword(System.in);
+                    passwords.add(storePass);
+                }
+            }
+
+            // Now load a nullStream-based keystore,
+            // or verify the integrity of an input stream-based keystore
+            if (nullStream) {
+                keyStore.load(null, storePass);
+            } else if (ksStream != null) {
+                ksStream = new FileInputStream(ksfile);
+                keyStore.load(ksStream, storePass);
+                ksStream.close();
+            }
+        }
+
+        if (storePass != null && P12KEYSTORE.equalsIgnoreCase(storetype)) {
+            MessageFormat form = new MessageFormat(rb.getString(
+                "Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value."));
+            if (keyPass != null && !Arrays.equals(storePass, keyPass)) {
+                Object[] source = {"-keypass"};
+                System.err.println(form.format(source));
+                keyPass = storePass;
+            }
+            if (newPass != null && !Arrays.equals(storePass, newPass)) {
+                Object[] source = {"-new"};
+                System.err.println(form.format(source));
+                newPass = storePass;
+            }
+            if (destKeyPass != null && !Arrays.equals(storePass, destKeyPass)) {
+                Object[] source = {"-destkeypass"};
+                System.err.println(form.format(source));
+                destKeyPass = storePass;
+            }
+        }
+
+        // Create a certificate factory
+        if (command == PRINTCERT || command == IMPORTCERT
+                || command == IDENTITYDB || command == PRINTCRL) {
+            cf = CertificateFactory.getInstance("X509");
+        }
+
+        if (trustcacerts) {
+            caks = KeyStoreUtil.getCacertsKeyStore();
+        }
+
+        // Perform the specified command
+        if (command == CERTREQ) {
+            if (filename != null) {
+                try (PrintStream ps = new PrintStream(new FileOutputStream
+                                                      (filename))) {
+                    doCertReq(alias, sigAlgName, ps);
+                }
+            } else {
+                doCertReq(alias, sigAlgName, out);
+            }
+            if (verbose && filename != null) {
+                MessageFormat form = new MessageFormat(rb.getString
+                        ("Certification.request.stored.in.file.filename."));
+                Object[] source = {filename};
+                System.err.println(form.format(source));
+                System.err.println(rb.getString("Submit.this.to.your.CA"));
+            }
+        } else if (command == DELETE) {
+            doDeleteEntry(alias);
+            kssave = true;
+        } else if (command == EXPORTCERT) {
+            if (filename != null) {
+                try (PrintStream ps = new PrintStream(new FileOutputStream
+                                                   (filename))) {
+                    doExportCert(alias, ps);
+                }
+            } else {
+                doExportCert(alias, out);
+            }
+            if (filename != null) {
+                MessageFormat form = new MessageFormat(rb.getString
+                        ("Certificate.stored.in.file.filename."));
+                Object[] source = {filename};
+                System.err.println(form.format(source));
+            }
+        } else if (command == GENKEYPAIR) {
+            if (keyAlgName == null) {
+                keyAlgName = "DSA";
+            }
+            doGenKeyPair(alias, dname, keyAlgName, keysize, sigAlgName);
+            kssave = true;
+        } else if (command == GENSECKEY) {
+            if (keyAlgName == null) {
+                keyAlgName = "DES";
+            }
+            doGenSecretKey(alias, keyAlgName, keysize);
+            kssave = true;
+        } else if (command == IDENTITYDB) {
+            if (filename != null) {
+                try (InputStream inStream = new FileInputStream(filename)) {
+                    doImportIdentityDatabase(inStream);
+                }
+            } else {
+                doImportIdentityDatabase(System.in);
+            }
+        } else if (command == IMPORTCERT) {
+            InputStream inStream = System.in;
+            if (filename != null) {
+                inStream = new FileInputStream(filename);
+            }
+            String importAlias = (alias!=null)?alias:keyAlias;
+            try {
+                if (keyStore.entryInstanceOf(
+                        importAlias, KeyStore.PrivateKeyEntry.class)) {
+                    kssave = installReply(importAlias, inStream);
+                    if (kssave) {
+                        System.err.println(rb.getString
+                            ("Certificate.reply.was.installed.in.keystore"));
+                    } else {
+                        System.err.println(rb.getString
+                            ("Certificate.reply.was.not.installed.in.keystore"));
+                    }
+                } else if (!keyStore.containsAlias(importAlias) ||
+                        keyStore.entryInstanceOf(importAlias,
+                            KeyStore.TrustedCertificateEntry.class)) {
+                    kssave = addTrustedCert(importAlias, inStream);
+                    if (kssave) {
+                        System.err.println(rb.getString
+                            ("Certificate.was.added.to.keystore"));
+                    } else {
+                        System.err.println(rb.getString
+                            ("Certificate.was.not.added.to.keystore"));
+                    }
+                }
+            } finally {
+                if (inStream != System.in) {
+                    inStream.close();
+                }
+            }
+        } else if (command == IMPORTKEYSTORE) {
+            doImportKeyStore();
+            kssave = true;
+        } else if (command == KEYCLONE) {
+            keyPassNew = newPass;
+
+            // added to make sure only key can go thru
+            if (alias == null) {
+                alias = keyAlias;
+            }
+            if (keyStore.containsAlias(alias) == false) {
+                MessageFormat form = new MessageFormat
+                    (rb.getString("Alias.alias.does.not.exist"));
+                Object[] source = {alias};
+                throw new Exception(form.format(source));
+            }
+            if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
+                MessageFormat form = new MessageFormat(rb.getString(
+                        "Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key"));
+                Object[] source = {alias};
+                throw new Exception(form.format(source));
+            }
+
+            doCloneEntry(alias, dest, true);  // Now everything can be cloned
+            kssave = true;
+        } else if (command == CHANGEALIAS) {
+            if (alias == null) {
+                alias = keyAlias;
+            }
+            doCloneEntry(alias, dest, false);
+            // in PKCS11, clone a PrivateKeyEntry will delete the old one
+            if (keyStore.containsAlias(alias)) {
+                doDeleteEntry(alias);
+            }
+            kssave = true;
+        } else if (command == KEYPASSWD) {
+            keyPassNew = newPass;
+            doChangeKeyPasswd(alias);
+            kssave = true;
+        } else if (command == LIST) {
+            if (alias != null) {
+                doPrintEntry(alias, out, true);
+            } else {
+                doPrintEntries(out);
+            }
+        } else if (command == PRINTCERT) {
+            doPrintCert(out);
+        } else if (command == SELFCERT) {
+            doSelfCert(alias, dname, sigAlgName);
+            kssave = true;
+        } else if (command == STOREPASSWD) {
+            storePassNew = newPass;
+            if (storePassNew == null) {
+                storePassNew = getNewPasswd("keystore password", storePass);
+            }
+            kssave = true;
+        } else if (command == GENCERT) {
+            if (alias == null) {
+                alias = keyAlias;
+            }
+            InputStream inStream = System.in;
+            if (infilename != null) {
+                inStream = new FileInputStream(infilename);
+            }
+            PrintStream ps = null;
+            if (outfilename != null) {
+                ps = new PrintStream(new FileOutputStream(outfilename));
+                out = ps;
+            }
+            try {
+                doGenCert(alias, sigAlgName, inStream, out);
+            } finally {
+                if (inStream != System.in) {
+                    inStream.close();
+                }
+                if (ps != null) {
+                    ps.close();
+                }
+            }
+        } else if (command == GENCRL) {
+            if (alias == null) {
+                alias = keyAlias;
+            }
+            if (filename != null) {
+                try (PrintStream ps =
+                         new PrintStream(new FileOutputStream(filename))) {
+                    doGenCRL(ps);
+                }
+            } else {
+                doGenCRL(out);
+            }
+        } else if (command == PRINTCERTREQ) {
+            if (filename != null) {
+                try (InputStream inStream = new FileInputStream(filename)) {
+                    doPrintCertReq(inStream, out);
+                }
+            } else {
+                doPrintCertReq(System.in, out);
+            }
+        } else if (command == PRINTCRL) {
+            doPrintCRL(filename, out);
+        }
+
+        // If we need to save the keystore, do so.
+        if (kssave) {
+            if (verbose) {
+                MessageFormat form = new MessageFormat
+                        (rb.getString(".Storing.ksfname."));
+                Object[] source = {nullStream ? "keystore" : ksfname};
+                System.err.println(form.format(source));
+            }
+
+            if (token) {
+                keyStore.store(null, null);
+            } else {
+                char[] pass = (storePassNew!=null) ? storePassNew : storePass;
+                if (nullStream) {
+                    keyStore.store(null, pass);
+                } else {
+                    ByteArrayOutputStream bout = new ByteArrayOutputStream();
+                    keyStore.store(bout, pass);
+                    try (FileOutputStream fout = new FileOutputStream(ksfname)) {
+                        fout.write(bout.toByteArray());
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Generate a certificate: Read PKCS10 request from in, and print
+     * certificate to out. Use alias as CA, sigAlgName as the signature
+     * type.
+     */
+    private void doGenCert(String alias, String sigAlgName, InputStream in, PrintStream out)
+            throws Exception {
+
+
+        Certificate signerCert = keyStore.getCertificate(alias);
+        byte[] encoded = signerCert.getEncoded();
+        X509CertImpl signerCertImpl = new X509CertImpl(encoded);
+        X509CertInfo signerCertInfo = (X509CertInfo)signerCertImpl.get(
+                X509CertImpl.NAME + "." + X509CertImpl.INFO);
+        X500Name issuer = (X500Name)signerCertInfo.get(X509CertInfo.SUBJECT + "." +
+                                           CertificateSubjectName.DN_NAME);
+
+        Date firstDate = getStartDate(startDate);
+        Date lastDate = new Date();
+        lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L);
+        CertificateValidity interval = new CertificateValidity(firstDate,
+                                                               lastDate);
+
+        PrivateKey privateKey =
+                (PrivateKey)recoverKey(alias, storePass, keyPass).fst;
+        if (sigAlgName == null) {
+            sigAlgName = getCompatibleSigAlgName(privateKey.getAlgorithm());
+        }
+        Signature signature = Signature.getInstance(sigAlgName);
+        signature.initSign(privateKey);
+
+        X509CertInfo info = new X509CertInfo();
+        info.set(X509CertInfo.VALIDITY, interval);
+        info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
+                    new java.util.Random().nextInt() & 0x7fffffff));
+        info.set(X509CertInfo.VERSION,
+                    new CertificateVersion(CertificateVersion.V3));
+        info.set(X509CertInfo.ALGORITHM_ID,
+                    new CertificateAlgorithmId(
+                        AlgorithmId.get(sigAlgName)));
+        info.set(X509CertInfo.ISSUER, new CertificateIssuerName(issuer));
+
+        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+        boolean canRead = false;
+        StringBuffer sb = new StringBuffer();
+        while (true) {
+            String s = reader.readLine();
+            if (s == null) break;
+            // OpenSSL does not use NEW
+            //if (s.startsWith("-----BEGIN NEW CERTIFICATE REQUEST-----")) {
+            if (s.startsWith("-----BEGIN") && s.indexOf("REQUEST") >= 0) {
+                canRead = true;
+            //} else if (s.startsWith("-----END NEW CERTIFICATE REQUEST-----")) {
+            } else if (s.startsWith("-----END") && s.indexOf("REQUEST") >= 0) {
+                break;
+            } else if (canRead) {
+                sb.append(s);
+            }
+        }
+        byte[] rawReq = new BASE64Decoder().decodeBuffer(new String(sb));
+        PKCS10 req = new PKCS10(rawReq);
+
+        info.set(X509CertInfo.KEY, new CertificateX509Key(req.getSubjectPublicKeyInfo()));
+        info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(
+                dname==null?req.getSubjectName():new X500Name(dname)));
+        CertificateExtensions reqex = null;
+        Iterator<PKCS10Attribute> attrs = req.getAttributes().getAttributes().iterator();
+        while (attrs.hasNext()) {
+            PKCS10Attribute attr = attrs.next();
+            if (attr.getAttributeId().equals((Object)PKCS9Attribute.EXTENSION_REQUEST_OID)) {
+                reqex = (CertificateExtensions)attr.getAttributeValue();
+            }
+        }
+        CertificateExtensions ext = createV3Extensions(
+                reqex,
+                null,
+                v3ext,
+                req.getSubjectPublicKeyInfo(),
+                signerCert.getPublicKey());
+        info.set(X509CertInfo.EXTENSIONS, ext);
+        X509CertImpl cert = new X509CertImpl(info);
+        cert.sign(privateKey, sigAlgName);
+        dumpCert(cert, out);
+        for (Certificate ca: keyStore.getCertificateChain(alias)) {
+            if (ca instanceof X509Certificate) {
+                X509Certificate xca = (X509Certificate)ca;
+                if (!isSelfSigned(xca)) {
+                    dumpCert(xca, out);
+                }
+            }
+        }
+    }
+
+    private void doGenCRL(PrintStream out)
+            throws Exception {
+        if (ids == null) {
+            throw new Exception("Must provide -id when -gencrl");
+        }
+        Certificate signerCert = keyStore.getCertificate(alias);
+        byte[] encoded = signerCert.getEncoded();
+        X509CertImpl signerCertImpl = new X509CertImpl(encoded);
+        X509CertInfo signerCertInfo = (X509CertInfo)signerCertImpl.get(
+                X509CertImpl.NAME + "." + X509CertImpl.INFO);
+        X500Name owner = (X500Name)signerCertInfo.get(X509CertInfo.SUBJECT + "." +
+                                           CertificateSubjectName.DN_NAME);
+
+        Date firstDate = getStartDate(startDate);
+        Date lastDate = (Date) firstDate.clone();
+        lastDate.setTime(lastDate.getTime() + validity*1000*24*60*60);
+        CertificateValidity interval = new CertificateValidity(firstDate,
+                                                               lastDate);
+
+
+        PrivateKey privateKey =
+                (PrivateKey)recoverKey(alias, storePass, keyPass).fst;
+        if (sigAlgName == null) {
+            sigAlgName = getCompatibleSigAlgName(privateKey.getAlgorithm());
+        }
+
+        X509CRLEntry[] badCerts = new X509CRLEntry[ids.size()];
+        for (int i=0; i<ids.size(); i++) {
+            String id = ids.get(i);
+            int d = id.indexOf(':');
+            if (d >= 0) {
+                CRLExtensions ext = new CRLExtensions();
+                ext.set("Reason", new CRLReasonCodeExtension(Integer.parseInt(id.substring(d+1))));
+                badCerts[i] = new X509CRLEntryImpl(new BigInteger(id.substring(0, d)),
+                        firstDate, ext);
+            } else {
+                badCerts[i] = new X509CRLEntryImpl(new BigInteger(ids.get(i)), firstDate);
+            }
+        }
+        X509CRLImpl crl = new X509CRLImpl(owner, firstDate, lastDate, badCerts);
+        crl.sign(privateKey, sigAlgName);
+        if (rfc) {
+            out.println("-----BEGIN X509 CRL-----");
+            new BASE64Encoder().encodeBuffer(crl.getEncodedInternal(), out);
+            out.println("-----END X509 CRL-----");
+        } else {
+            out.write(crl.getEncodedInternal());
+        }
+    }
+
+    /**
+     * Creates a PKCS#10 cert signing request, corresponding to the
+     * keys (and name) associated with a given alias.
+     */
+    private void doCertReq(String alias, String sigAlgName, PrintStream out)
+        throws Exception
+    {
+        if (alias == null) {
+            alias = keyAlias;
+        }
+
+        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
+        PrivateKey privKey = (PrivateKey)objs.fst;
+        if (keyPass == null) {
+            keyPass = objs.snd;
+        }
+
+        Certificate cert = keyStore.getCertificate(alias);
+        if (cert == null) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("alias.has.no.public.key.certificate."));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+        PKCS10 request = new PKCS10(cert.getPublicKey());
+        CertificateExtensions ext = createV3Extensions(null, null, v3ext, cert.getPublicKey(), null);
+        // Attribute name is not significant
+        request.getAttributes().setAttribute(X509CertInfo.EXTENSIONS,
+                new PKCS10Attribute(PKCS9Attribute.EXTENSION_REQUEST_OID, ext));
+
+        // Construct a Signature object, so that we can sign the request
+        if (sigAlgName == null) {
+            sigAlgName = getCompatibleSigAlgName(privKey.getAlgorithm());
+        }
+
+        Signature signature = Signature.getInstance(sigAlgName);
+        signature.initSign(privKey);
+        X500Name subject = dname == null?
+                new X500Name(((X509Certificate)cert).getSubjectDN().toString()):
+                new X500Name(dname);
+
+        // Sign the request and base-64 encode it
+        request.encodeAndSign(subject, signature);
+        request.print(out);
+    }
+
+    /**
+     * Deletes an entry from the keystore.
+     */
+    private void doDeleteEntry(String alias) throws Exception {
+        if (keyStore.containsAlias(alias) == false) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.does.not.exist"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+        keyStore.deleteEntry(alias);
+    }
+
+    /**
+     * Exports a certificate from the keystore.
+     */
+    private void doExportCert(String alias, PrintStream out)
+        throws Exception
+    {
+        if (storePass == null
+                && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            printWarning();
+        }
+        if (alias == null) {
+            alias = keyAlias;
+        }
+        if (keyStore.containsAlias(alias) == false) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.does.not.exist"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        X509Certificate cert = (X509Certificate)keyStore.getCertificate(alias);
+        if (cert == null) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.has.no.certificate"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+        dumpCert(cert, out);
+    }
+
+    /**
+     * Prompt the user for a keypass when generating a key entry.
+     * @param alias the entry we will set password for
+     * @param orig the original entry of doing a dup, null if generate new
+     * @param origPass the password to copy from if user press ENTER
+     */
+    private char[] promptForKeyPass(String alias, String orig, char[] origPass) throws Exception{
+        if (P12KEYSTORE.equalsIgnoreCase(storetype)) {
+            return origPass;
+        } else if (!token && !protectedPath) {
+            // Prompt for key password
+            int count;
+            for (count = 0; count < 3; count++) {
+                MessageFormat form = new MessageFormat(rb.getString
+                        ("Enter.key.password.for.alias."));
+                Object[] source = {alias};
+                System.err.println(form.format(source));
+                if (orig == null) {
+                    System.err.print(rb.getString
+                            (".RETURN.if.same.as.keystore.password."));
+                } else {
+                    form = new MessageFormat(rb.getString
+                            (".RETURN.if.same.as.for.otherAlias."));
+                    Object[] src = {orig};
+                    System.err.print(form.format(src));
+                }
+                System.err.flush();
+                char[] entered = Password.readPassword(System.in);
+                passwords.add(entered);
+                if (entered == null) {
+                    return origPass;
+                } else if (entered.length >= 6) {
+                    System.err.print(rb.getString("Re.enter.new.password."));
+                    char[] passAgain = Password.readPassword(System.in);
+                    passwords.add(passAgain);
+                    if (!Arrays.equals(entered, passAgain)) {
+                        System.err.println
+                            (rb.getString("They.don.t.match.Try.again"));
+                        continue;
+                    }
+                    return entered;
+                } else {
+                    System.err.println(rb.getString
+                        ("Key.password.is.too.short.must.be.at.least.6.characters"));
+                }
+            }
+            if (count == 3) {
+                if (command == KEYCLONE) {
+                    throw new Exception(rb.getString
+                        ("Too.many.failures.Key.entry.not.cloned"));
+                } else {
+                    throw new Exception(rb.getString
+                            ("Too.many.failures.key.not.added.to.keystore"));
+                }
+            }
+        }
+        return null;    // PKCS11, MSCAPI, or -protected
+    }
+    /**
+     * Creates a new secret key.
+     */
+    private void doGenSecretKey(String alias, String keyAlgName,
+                              int keysize)
+        throws Exception
+    {
+        if (alias == null) {
+            alias = keyAlias;
+        }
+        if (keyStore.containsAlias(alias)) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Secret.key.not.generated.alias.alias.already.exists"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        SecretKey secKey = null;
+        KeyGenerator keygen = KeyGenerator.getInstance(keyAlgName);
+        if (keysize != -1) {
+            keygen.init(keysize);
+        } else if ("DES".equalsIgnoreCase(keyAlgName)) {
+            keygen.init(56);
+        } else if ("DESede".equalsIgnoreCase(keyAlgName)) {
+            keygen.init(168);
+        } else {
+            throw new Exception(rb.getString
+                ("Please.provide.keysize.for.secret.key.generation"));
+        }
+
+        secKey = keygen.generateKey();
+        if (keyPass == null) {
+            keyPass = promptForKeyPass(alias, null, storePass);
+        }
+        keyStore.setKeyEntry(alias, secKey, keyPass, null);
+    }
+
+    /**
+     * If no signature algorithm was specified at the command line,
+     * we choose one that is compatible with the selected private key
+     */
+    private static String getCompatibleSigAlgName(String keyAlgName)
+            throws Exception {
+        if ("DSA".equalsIgnoreCase(keyAlgName)) {
+            return "SHA1WithDSA";
+        } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
+            return "SHA256WithRSA";
+        } else if ("EC".equalsIgnoreCase(keyAlgName)) {
+            return "SHA256withECDSA";
+        } else {
+            throw new Exception(rb.getString
+                    ("Cannot.derive.signature.algorithm"));
+        }
+    }
+    /**
+     * Creates a new key pair and self-signed certificate.
+     */
+    private void doGenKeyPair(String alias, String dname, String keyAlgName,
+                              int keysize, String sigAlgName)
+        throws Exception
+    {
+        if (keysize == -1) {
+            if ("EC".equalsIgnoreCase(keyAlgName)) {
+                keysize = 256;
+            } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
+                keysize = 2048;
+            } else {
+                keysize = 1024;
+            }
+        }
+
+        if (alias == null) {
+            alias = keyAlias;
+        }
+
+        if (keyStore.containsAlias(alias)) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Key.pair.not.generated.alias.alias.already.exists"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        if (sigAlgName == null) {
+            sigAlgName = getCompatibleSigAlgName(keyAlgName);
+        }
+        CertAndKeyGen keypair =
+                new CertAndKeyGen(keyAlgName, sigAlgName, providerName);
+
+
+        // If DN is provided, parse it. Otherwise, prompt the user for it.
+        X500Name x500Name;
+        if (dname == null) {
+            x500Name = getX500Name();
+        } else {
+            x500Name = new X500Name(dname);
+        }
+
+        keypair.generate(keysize);
+        PrivateKey privKey = keypair.getPrivateKey();
+
+        CertificateExtensions ext = createV3Extensions(
+                null,
+                null,
+                v3ext,
+                keypair.getPublicKeyAnyway(),
+                null);
+
+        X509Certificate[] chain = new X509Certificate[1];
+        chain[0] = keypair.getSelfCertificate(
+                x500Name, getStartDate(startDate), validity*24L*60L*60L, ext);
+
+        if (verbose) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for"));
+            Object[] source = {new Integer(keysize),
+                                privKey.getAlgorithm(),
+                                chain[0].getSigAlgName(),
+                                new Long(validity),
+                                x500Name};
+            System.err.println(form.format(source));
+        }
+
+        if (keyPass == null) {
+            keyPass = promptForKeyPass(alias, null, storePass);
+        }
+        keyStore.setKeyEntry(alias, privKey, keyPass, chain);
+    }
+
+    /**
+     * Clones an entry
+     * @param orig original alias
+     * @param dest destination alias
+     * @changePassword if the password can be changed
+     */
+    private void doCloneEntry(String orig, String dest, boolean changePassword)
+        throws Exception
+    {
+        if (orig == null) {
+            orig = keyAlias;
+        }
+
+        if (keyStore.containsAlias(dest)) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Destination.alias.dest.already.exists"));
+            Object[] source = {dest};
+            throw new Exception(form.format(source));
+        }
+
+        Pair<Entry,char[]> objs = recoverEntry(keyStore, orig, storePass, keyPass);
+        Entry entry = objs.fst;
+        keyPass = objs.snd;
+
+        PasswordProtection pp = null;
+
+        if (keyPass != null) {  // protected
+            if (!changePassword || P12KEYSTORE.equalsIgnoreCase(storetype)) {
+                keyPassNew = keyPass;
+            } else {
+                if (keyPassNew == null) {
+                    keyPassNew = promptForKeyPass(dest, orig, keyPass);
+                }
+            }
+            pp = new PasswordProtection(keyPassNew);
+        }
+        keyStore.setEntry(dest, entry, pp);
+    }
+
+    /**
+     * Changes a key password.
+     */
+    private void doChangeKeyPasswd(String alias) throws Exception
+    {
+
+        if (alias == null) {
+            alias = keyAlias;
+        }
+        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
+        Key privKey = objs.fst;
+        if (keyPass == null) {
+            keyPass = objs.snd;
+        }
+
+        if (keyPassNew == null) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("key.password.for.alias."));
+            Object[] source = {alias};
+            keyPassNew = getNewPasswd(form.format(source), keyPass);
+        }
+        keyStore.setKeyEntry(alias, privKey, keyPassNew,
+                             keyStore.getCertificateChain(alias));
+    }
+
+    /**
+     * Imports a JDK 1.1-style identity database. We can only store one
+     * certificate per identity, because we use the identity's name as the
+     * alias (which references a keystore entry), and aliases must be unique.
+     */
+    private void doImportIdentityDatabase(InputStream in)
+        throws Exception
+    {
+        System.err.println(rb.getString
+            ("No.entries.from.identity.database.added"));
+    }
+
+    /**
+     * Prints a single keystore entry.
+     */
+    private void doPrintEntry(String alias, PrintStream out,
+                              boolean printWarning)
+        throws Exception
+    {
+        if (storePass == null && printWarning
+                && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            printWarning();
+        }
+
+        if (keyStore.containsAlias(alias) == false) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.does.not.exist"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        if (verbose || rfc || debug) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.name.alias"));
+            Object[] source = {alias};
+            out.println(form.format(source));
+
+            if (!token) {
+                form = new MessageFormat(rb.getString
+                    ("Creation.date.keyStore.getCreationDate.alias."));
+                Object[] src = {keyStore.getCreationDate(alias)};
+                out.println(form.format(src));
+            }
+        } else {
+            if (!token) {
+                MessageFormat form = new MessageFormat
+                    (rb.getString("alias.keyStore.getCreationDate.alias."));
+                Object[] source = {alias, keyStore.getCreationDate(alias)};
+                out.print(form.format(source));
+            } else {
+                MessageFormat form = new MessageFormat
+                    (rb.getString("alias."));
+                Object[] source = {alias};
+                out.print(form.format(source));
+            }
+        }
+
+        if (keyStore.entryInstanceOf(alias, KeyStore.SecretKeyEntry.class)) {
+            if (verbose || rfc || debug) {
+                Object[] source = {"SecretKeyEntry"};
+                out.println(new MessageFormat(
+                        rb.getString("Entry.type.type.")).format(source));
+            } else {
+                out.println("SecretKeyEntry, ");
+            }
+        } else if (keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
+            if (verbose || rfc || debug) {
+                Object[] source = {"PrivateKeyEntry"};
+                out.println(new MessageFormat(
+                        rb.getString("Entry.type.type.")).format(source));
+            } else {
+                out.println("PrivateKeyEntry, ");
+            }
+
+            // Get the chain
+            Certificate[] chain = keyStore.getCertificateChain(alias);
+            if (chain != null) {
+                if (verbose || rfc || debug) {
+                    out.println(rb.getString
+                        ("Certificate.chain.length.") + chain.length);
+                    for (int i = 0; i < chain.length; i ++) {
+                        MessageFormat form = new MessageFormat
+                                (rb.getString("Certificate.i.1."));
+                        Object[] source = {new Integer((i + 1))};
+                        out.println(form.format(source));
+                        if (verbose && (chain[i] instanceof X509Certificate)) {
+                            printX509Cert((X509Certificate)(chain[i]), out);
+                        } else if (debug) {
+                            out.println(chain[i].toString());
+                        } else {
+                            dumpCert(chain[i], out);
+                        }
+                    }
+                } else {
+                    // Print the digest of the user cert only
+                    out.println
+                        (rb.getString("Certificate.fingerprint.SHA1.") +
+                        getCertFingerPrint("SHA1", chain[0]));
+                }
+            }
+        } else if (keyStore.entryInstanceOf(alias,
+                KeyStore.TrustedCertificateEntry.class)) {
+            // We have a trusted certificate entry
+            Certificate cert = keyStore.getCertificate(alias);
+            Object[] source = {"trustedCertEntry"};
+            String mf = new MessageFormat(
+                    rb.getString("Entry.type.type.")).format(source) + "\n";
+            if (verbose && (cert instanceof X509Certificate)) {
+                out.println(mf);
+                printX509Cert((X509Certificate)cert, out);
+            } else if (rfc) {
+                out.println(mf);
+                dumpCert(cert, out);
+            } else if (debug) {
+                out.println(cert.toString());
+            } else {
+                out.println("trustedCertEntry, ");
+                out.println(rb.getString("Certificate.fingerprint.SHA1.")
+                            + getCertFingerPrint("SHA1", cert));
+            }
+        } else {
+            out.println(rb.getString("Unknown.Entry.Type"));
+        }
+    }
+
+    /**
+     * Load the srckeystore from a stream, used in -importkeystore
+     * @returns the src KeyStore
+     */
+    KeyStore loadSourceKeyStore() throws Exception {
+        boolean isPkcs11 = false;
+
+        InputStream is = null;
+
+        if (P11KEYSTORE.equalsIgnoreCase(srcstoretype) ||
+                KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
+            if (!NONE.equals(srcksfname)) {
+                System.err.println(MessageFormat.format(rb.getString
+                    (".keystore.must.be.NONE.if.storetype.is.{0}"), srcstoretype));
+                System.err.println();
+                tinyHelp();
+            }
+            isPkcs11 = true;
+        } else {
+            if (srcksfname != null) {
+                File srcksfile = new File(srcksfname);
+                    if (srcksfile.exists() && srcksfile.length() == 0) {
+                        throw new Exception(rb.getString
+                                ("Source.keystore.file.exists.but.is.empty.") +
+                                srcksfname);
+                }
+                is = new FileInputStream(srcksfile);
+            } else {
+                throw new Exception(rb.getString
+                        ("Please.specify.srckeystore"));
+            }
+        }
+
+        KeyStore store;
+        try {
+            if (srcProviderName == null) {
+                store = KeyStore.getInstance(srcstoretype);
+            } else {
+                store = KeyStore.getInstance(srcstoretype, srcProviderName);
+            }
+
+            if (srcstorePass == null
+                    && !srcprotectedPath
+                    && !KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
+                System.err.print(rb.getString("Enter.source.keystore.password."));
+                System.err.flush();
+                srcstorePass = Password.readPassword(System.in);
+                passwords.add(srcstorePass);
+            }
+
+            // always let keypass be storepass when using pkcs12
+            if (P12KEYSTORE.equalsIgnoreCase(srcstoretype)) {
+                if (srckeyPass != null && srcstorePass != null &&
+                        !Arrays.equals(srcstorePass, srckeyPass)) {
+                    MessageFormat form = new MessageFormat(rb.getString(
+                        "Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value."));
+                    Object[] source = {"-srckeypass"};
+                    System.err.println(form.format(source));
+                    srckeyPass = srcstorePass;
+                }
+            }
+
+            store.load(is, srcstorePass);   // "is" already null in PKCS11
+        } finally {
+            if (is != null) {
+                is.close();
+            }
+        }
+
+        if (srcstorePass == null
+                && !KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
+            // anti refactoring, copied from printWarning(),
+            // but change 2 lines
+            System.err.println();
+            System.err.println(rb.getString
+                (".WARNING.WARNING.WARNING."));
+            System.err.println(rb.getString
+                (".The.integrity.of.the.information.stored.in.the.srckeystore."));
+            System.err.println(rb.getString
+                (".WARNING.WARNING.WARNING."));
+            System.err.println();
+        }
+
+        return store;
+    }
+
+    /**
+     * import all keys and certs from importkeystore.
+     * keep alias unchanged if no name conflict, otherwise, prompt.
+     * keep keypass unchanged for keys
+     */
+    private void doImportKeyStore() throws Exception {
+
+        if (alias != null) {
+            doImportKeyStoreSingle(loadSourceKeyStore(), alias);
+        } else {
+            if (dest != null || srckeyPass != null || destKeyPass != null) {
+                throw new Exception(rb.getString(
+                        "if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified"));
+            }
+            doImportKeyStoreAll(loadSourceKeyStore());
+        }
+        /*
+         * Information display rule of -importkeystore
+         * 1. inside single, shows failure
+         * 2. inside all, shows sucess
+         * 3. inside all where there is a failure, prompt for continue
+         * 4. at the final of all, shows summary
+         */
+    }
+
+    /**
+     * Import a single entry named alias from srckeystore
+     * @returns 1 if the import action succeed
+     *          0 if user choose to ignore an alias-dumplicated entry
+     *          2 if setEntry throws Exception
+     */
+    private int doImportKeyStoreSingle(KeyStore srckeystore, String alias)
+            throws Exception {
+
+        String newAlias = (dest==null) ? alias : dest;
+
+        if (keyStore.containsAlias(newAlias)) {
+            Object[] source = {alias};
+            if (noprompt) {
+                System.err.println(new MessageFormat(rb.getString(
+                        "Warning.Overwriting.existing.alias.alias.in.destination.keystore")).format(source));
+            } else {
+                String reply = getYesNoReply(new MessageFormat(rb.getString(
+                        "Existing.entry.alias.alias.exists.overwrite.no.")).format(source));
+                if ("NO".equals(reply)) {
+                    newAlias = inputStringFromStdin(rb.getString
+                            ("Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry."));
+                    if ("".equals(newAlias)) {
+                        System.err.println(new MessageFormat(rb.getString(
+                                "Entry.for.alias.alias.not.imported.")).format(
+                                source));
+                        return 0;
+                    }
+                }
+            }
+        }
+
+        Pair<Entry,char[]> objs = recoverEntry(srckeystore, alias, srcstorePass, srckeyPass);
+        Entry entry = objs.fst;
+
+        PasswordProtection pp = null;
+
+        // According to keytool.html, "The destination entry will be protected
+        // using destkeypass. If destkeypass is not provided, the destination
+        // entry will be protected with the source entry password."
+        // so always try to protect with destKeyPass.
+        if (destKeyPass != null) {
+            pp = new PasswordProtection(destKeyPass);
+        } else if (objs.snd != null) {
+            pp = new PasswordProtection(objs.snd);
+        }
+
+        try {
+            keyStore.setEntry(newAlias, entry, pp);
+            return 1;
+        } catch (KeyStoreException kse) {
+            Object[] source2 = {alias, kse.toString()};
+            MessageFormat form = new MessageFormat(rb.getString(
+                    "Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported."));
+            System.err.println(form.format(source2));
+            return 2;
+        }
+    }
+
+    private void doImportKeyStoreAll(KeyStore srckeystore) throws Exception {
+
+        int ok = 0;
+        int count = srckeystore.size();
+        for (Enumeration<String> e = srckeystore.aliases();
+                                        e.hasMoreElements(); ) {
+            String alias = e.nextElement();
+            int result = doImportKeyStoreSingle(srckeystore, alias);
+            if (result == 1) {
+                ok++;
+                Object[] source = {alias};
+                MessageFormat form = new MessageFormat(rb.getString("Entry.for.alias.alias.successfully.imported."));
+                System.err.println(form.format(source));
+            } else if (result == 2) {
+                if (!noprompt) {
+                    String reply = getYesNoReply("Do you want to quit the import process? [no]:  ");
+                    if ("YES".equals(reply)) {
+                        break;
+                    }
+                }
+            }
+        }
+        Object[] source = {ok, count-ok};
+        MessageFormat form = new MessageFormat(rb.getString(
+                "Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled"));
+        System.err.println(form.format(source));
+    }
+
+    /**
+     * Prints all keystore entries.
+     */
+    private void doPrintEntries(PrintStream out)
+        throws Exception
+    {
+        if (storePass == null
+                && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
+            printWarning();
+        } else {
+            out.println();
+        }
+
+        out.println(rb.getString("Keystore.type.") + keyStore.getType());
+        out.println(rb.getString("Keystore.provider.") +
+                keyStore.getProvider().getName());
+        out.println();
+
+        MessageFormat form;
+        form = (keyStore.size() == 1) ?
+                new MessageFormat(rb.getString
+                        ("Your.keystore.contains.keyStore.size.entry")) :
+                new MessageFormat(rb.getString
+                        ("Your.keystore.contains.keyStore.size.entries"));
+        Object[] source = {new Integer(keyStore.size())};
+        out.println(form.format(source));
+        out.println();
+
+        for (Enumeration<String> e = keyStore.aliases();
+                                        e.hasMoreElements(); ) {
+            String alias = e.nextElement();
+            doPrintEntry(alias, out, false);
+            if (verbose || rfc) {
+                out.println(rb.getString("NEWLINE"));
+                out.println(rb.getString
+                        ("STAR"));
+                out.println(rb.getString
+                        ("STARNN"));
+            }
+        }
+    }
+
+    private static <T> Iterable<T> e2i(final Enumeration<T> e) {
+        return new Iterable<T>() {
+            @Override
+            public Iterator<T> iterator() {
+                return new Iterator<T>() {
+                    @Override
+                    public boolean hasNext() {
+                        return e.hasMoreElements();
+                    }
+                    @Override
+                    public T next() {
+                        return e.nextElement();
+                    }
+                    public void remove() {
+                        throw new UnsupportedOperationException("Not supported yet.");
+                    }
+                };
+            }
+        };
+    }
+
+    /**
+     * Loads CRLs from a source. This method is also called in JarSigner.
+     * @param src the source, which means System.in if null, or a URI,
+     *        or a bare file path name
+     */
+    public static Collection<? extends CRL> loadCRLs(String src) throws Exception {
+        InputStream in = null;
+        URI uri = null;
+        if (src == null) {
+            in = System.in;
+        } else {
+            try {
+                uri = new URI(src);
+                if (uri.getScheme().equals("ldap")) {
+                    // No input stream for LDAP
+                } else {
+                    in = uri.toURL().openStream();
+                }
+            } catch (Exception e) {
+                try {
+                    in = new FileInputStream(src);
+                } catch (Exception e2) {
+                    if (uri == null || uri.getScheme() == null) {
+                        throw e2;   // More likely a bare file path
+                    } else {
+                        throw e;    // More likely a protocol or network problem
+                    }
+                }
+            }
+        }
+        if (in != null) {
+            try {
+                // Read the full stream before feeding to X509Factory,
+                // otherwise, keytool -gencrl | keytool -printcrl
+                // might not work properly, since -gencrl is slow
+                // and there's no data in the pipe at the beginning.
+                ByteArrayOutputStream bout = new ByteArrayOutputStream();
+                byte[] b = new byte[4096];
+                while (true) {
+                    int len = in.read(b);
+                    if (len < 0) break;
+                    bout.write(b, 0, len);
+                }
+                return CertificateFactory.getInstance("X509").generateCRLs(
+                        new ByteArrayInputStream(bout.toByteArray()));
+            } finally {
+                if (in != System.in) {
+                    in.close();
+                }
+            }
+        } else {    // must be LDAP, and uri is not null
+            // Lazily load LDAPCertStoreHelper if present
+            CertStoreHelper helper = CertStoreHelper.getInstance("LDAP");
+            String path = uri.getPath();
+            if (path.charAt(0) == '/') path = path.substring(1);
+            CertStore s = helper.getCertStore(uri);
+            X509CRLSelector sel =
+                    helper.wrap(new X509CRLSelector(), null, path);
+            return s.getCRLs(sel);
+        }
+    }
+
+    /**
+     * Returns CRLs described in a X509Certificate's CRLDistributionPoints
+     * Extension. Only those containing a general name of type URI are read.
+     */
+    public static List<CRL> readCRLsFromCert(X509Certificate cert)
+            throws Exception {
+        List<CRL> crls = new ArrayList<>();
+        CRLDistributionPointsExtension ext =
+                X509CertImpl.toImpl(cert).getCRLDistributionPointsExtension();
+        if (ext == null) return crls;
+        List<DistributionPoint> distPoints =
+                ext.get(CRLDistributionPointsExtension.POINTS);
+        for (DistributionPoint o: distPoints) {
+            GeneralNames names = o.getFullName();
+            if (names != null) {
+                for (GeneralName name: names.names()) {
+                    if (name.getType() == GeneralNameInterface.NAME_URI) {
+                        URIName uriName = (URIName)name.getName();
+                        for (CRL crl: loadCRLs(uriName.getName())) {
+                            if (crl instanceof X509CRL) {
+                                crls.add((X509CRL)crl);
+                            }
+                        }
+                        break;  // Different name should point to same CRL
+                    }
+                }
+            }
+        }
+        return crls;
+    }
+
+    private static String verifyCRL(KeyStore ks, CRL crl)
+            throws Exception {
+        X509CRLImpl xcrl = (X509CRLImpl)crl;
+        X500Principal issuer = xcrl.getIssuerX500Principal();
+        for (String s: e2i(ks.aliases())) {
+            Certificate cert = ks.getCertificate(s);
+            if (cert instanceof X509Certificate) {
+                X509Certificate xcert = (X509Certificate)cert;
+                if (xcert.getSubjectX500Principal().equals(issuer)) {
+                    try {
+                        ((X509CRLImpl)crl).verify(cert.getPublicKey());
+                        return s;
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    private void doPrintCRL(String src, PrintStream out)
+            throws Exception {
+        for (CRL crl: loadCRLs(src)) {
+            printCRL(crl, out);
+            String issuer = null;
+            if (caks != null) {
+                issuer = verifyCRL(caks, crl);
+                if (issuer != null) {
+                    out.printf(rb.getString(
+                            "verified.by.s.in.s"), issuer, "cacerts");
+                    out.println();
+                }
+            }
+            if (issuer == null && keyStore != null) {
+                issuer = verifyCRL(keyStore, crl);
+                if (issuer != null) {
+                    out.printf(rb.getString(
+                            "verified.by.s.in.s"), issuer, "keystore");
+                    out.println();
+                }
+            }
+            if (issuer == null) {
+                out.println(rb.getString
+                        ("STAR"));
+                out.println(rb.getString
+                        ("warning.not.verified.make.sure.keystore.is.correct"));
+                out.println(rb.getString
+                        ("STARNN"));
+            }
+        }
+    }
+
+    private void printCRL(CRL crl, PrintStream out)
+            throws Exception {
+        if (rfc) {
+            X509CRL xcrl = (X509CRL)crl;
+            out.println("-----BEGIN X509 CRL-----");
+            new BASE64Encoder().encodeBuffer(xcrl.getEncoded(), out);
+            out.println("-----END X509 CRL-----");
+        } else {
+            out.println(crl.toString());
+        }
+    }
+
+    private void doPrintCertReq(InputStream in, PrintStream out)
+            throws Exception {
+
+        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+        StringBuffer sb = new StringBuffer();
+        boolean started = false;
+        while (true) {
+            String s = reader.readLine();
+            if (s == null) break;
+            if (!started) {
+                if (s.startsWith("-----")) {
+                    started = true;
+                }
+            } else {
+                if (s.startsWith("-----")) {
+                    break;
+                }
+                sb.append(s);
+            }
+        }
+        PKCS10 req = new PKCS10(new BASE64Decoder().decodeBuffer(new String(sb)));
+
+        PublicKey pkey = req.getSubjectPublicKeyInfo();
+        out.printf(rb.getString("PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key."),
+                req.getSubjectName(), pkey.getFormat(), pkey.getAlgorithm());
+        for (PKCS10Attribute attr: req.getAttributes().getAttributes()) {
+            ObjectIdentifier oid = attr.getAttributeId();
+            if (oid.equals((Object)PKCS9Attribute.EXTENSION_REQUEST_OID)) {
+                CertificateExtensions exts = (CertificateExtensions)attr.getAttributeValue();
+                if (exts != null) {
+                    printExtensions(rb.getString("Extension.Request."), exts, out);
+                }
+            } else {
+                out.println(attr.getAttributeId());
+                out.println(attr.getAttributeValue());
+            }
+        }
+        if (debug) {
+            out.println(req);   // Just to see more, say, public key length...
+        }
+    }
+
+    /**
+     * Reads a certificate (or certificate chain) and prints its contents in
+     * a human readable format.
+     */
+    private void printCertFromStream(InputStream in, PrintStream out)
+        throws Exception
+    {
+        Collection<? extends Certificate> c = null;
+        try {
+            c = cf.generateCertificates(in);
+        } catch (CertificateException ce) {
+            throw new Exception(rb.getString("Failed.to.parse.input"), ce);
+        }
+        if (c.isEmpty()) {
+            throw new Exception(rb.getString("Empty.input"));
+        }
+        Certificate[] certs = c.toArray(new Certificate[c.size()]);
+        for (int i=0; i<certs.length; i++) {
+            X509Certificate x509Cert = null;
+            try {
+                x509Cert = (X509Certificate)certs[i];
+            } catch (ClassCastException cce) {
+                throw new Exception(rb.getString("Not.X.509.certificate"));
+            }
+            if (certs.length > 1) {
+                MessageFormat form = new MessageFormat
+                        (rb.getString("Certificate.i.1."));
+                Object[] source = {new Integer(i + 1)};
+                out.println(form.format(source));
+            }
+            if (rfc) dumpCert(x509Cert, out);
+            else printX509Cert(x509Cert, out);
+            if (i < (certs.length-1)) {
+                out.println();
+            }
+        }
+    }
+
+    private void doPrintCert(final PrintStream out) throws Exception {
+        if (jarfile != null) {
+            JarFile jf = new JarFile(jarfile, true);
+            Enumeration<JarEntry> entries = jf.entries();
+            Set<CodeSigner> ss = new HashSet<>();
+            byte[] buffer = new byte[8192];
+            int pos = 0;
+            while (entries.hasMoreElements()) {
+                JarEntry je = entries.nextElement();
+                try (InputStream is = jf.getInputStream(je)) {
+                    while (is.read(buffer) != -1) {
+                        // we just read. this will throw a SecurityException
+                        // if a signature/digest check fails. This also
+                        // populate the signers
+                    }
+                }
+                CodeSigner[] signers = je.getCodeSigners();
+                if (signers != null) {
+                    for (CodeSigner signer: signers) {
+                        if (!ss.contains(signer)) {
+                            ss.add(signer);
+                            out.printf(rb.getString("Signer.d."), ++pos);
+                            out.println();
+                            out.println();
+                            out.println(rb.getString("Signature."));
+                            out.println();
+                            for (Certificate cert: signer.getSignerCertPath().getCertificates()) {
+                                X509Certificate x = (X509Certificate)cert;
+                                if (rfc) {
+                                    out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n");
+                                    dumpCert(x, out);
+                                } else {
+                                    printX509Cert(x, out);
+                                }
+                                out.println();
+                            }
+                            Timestamp ts = signer.getTimestamp();
+                            if (ts != null) {
+                                out.println(rb.getString("Timestamp."));
+                                out.println();
+                                for (Certificate cert: ts.getSignerCertPath().getCertificates()) {
+                                    X509Certificate x = (X509Certificate)cert;
+                                    if (rfc) {
+                                        out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n");
+                                        dumpCert(x, out);
+                                    } else {
+                                        printX509Cert(x, out);
+                                    }
+                                    out.println();
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            jf.close();
+            if (ss.isEmpty()) {
+                out.println(rb.getString("Not.a.signed.jar.file"));
+            }
+        } else if (sslserver != null) {
+            // Lazily load SSLCertStoreHelper if present
+            CertStoreHelper helper = CertStoreHelper.getInstance("SSLServer");
+            CertStore cs = helper.getCertStore(new URI("https://" + sslserver));
+            Collection<? extends Certificate> chain;
+            try {
+                chain = cs.getCertificates(null);
+                if (chain.isEmpty()) {
+                    // If the certs are not retrieved, we consider it an error
+                    // even if the URL connection is successful.
+                    throw new Exception(rb.getString(
+                                        "No.certificate.from.the.SSL.server"));
+                }
+            } catch (CertStoreException cse) {
+                if (cse.getCause() instanceof IOException) {
+                    throw new Exception(rb.getString(
+                                        "No.certificate.from.the.SSL.server"),
+                                        cse.getCause());
+                } else {
+                    throw cse;
+                }
+            }
+
+            int i = 0;
+            for (Certificate cert : chain) {
+                try {
+                    if (rfc) {
+                        dumpCert(cert, out);
+                    } else {
+                        out.println("Certificate #" + i++);
+                        out.println("====================================");
+                        printX509Cert((X509Certificate)cert, out);
+                        out.println();
+                    }
+                } catch (Exception e) {
+                    if (debug) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        } else {
+            if (filename != null) {
+                try (FileInputStream inStream = new FileInputStream(filename)) {
+                    printCertFromStream(inStream, out);
+                }
+            } else {
+                printCertFromStream(System.in, out);
+            }
+        }
+    }
+    /**
+     * Creates a self-signed certificate, and stores it as a single-element
+     * certificate chain.
+     */
+    private void doSelfCert(String alias, String dname, String sigAlgName)
+        throws Exception
+    {
+        if (alias == null) {
+            alias = keyAlias;
+        }
+
+        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
+        PrivateKey privKey = (PrivateKey)objs.fst;
+        if (keyPass == null)
+            keyPass = objs.snd;
+
+        // Determine the signature algorithm
+        if (sigAlgName == null) {
+            sigAlgName = getCompatibleSigAlgName(privKey.getAlgorithm());
+        }
+
+        // Get the old certificate
+        Certificate oldCert = keyStore.getCertificate(alias);
+        if (oldCert == null) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("alias.has.no.public.key"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+        if (!(oldCert instanceof X509Certificate)) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("alias.has.no.X.509.certificate"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        // convert to X509CertImpl, so that we can modify selected fields
+        // (no public APIs available yet)
+        byte[] encoded = oldCert.getEncoded();
+        X509CertImpl certImpl = new X509CertImpl(encoded);
+        X509CertInfo certInfo = (X509CertInfo)certImpl.get(X509CertImpl.NAME
+                                                           + "." +
+                                                           X509CertImpl.INFO);
+
+        // Extend its validity
+        Date firstDate = getStartDate(startDate);
+        Date lastDate = new Date();
+        lastDate.setTime(firstDate.getTime() + validity*1000L*24L*60L*60L);
+        CertificateValidity interval = new CertificateValidity(firstDate,
+                                                               lastDate);
+        certInfo.set(X509CertInfo.VALIDITY, interval);
+
+        // Make new serial number
+        certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
+                    new java.util.Random().nextInt() & 0x7fffffff));
+
+        // Set owner and issuer fields
+        X500Name owner;
+        if (dname == null) {
+            // Get the owner name from the certificate
+            owner = (X500Name)certInfo.get(X509CertInfo.SUBJECT + "." +
+                                           CertificateSubjectName.DN_NAME);
+        } else {
+            // Use the owner name specified at the command line
+            owner = new X500Name(dname);
+            certInfo.set(X509CertInfo.SUBJECT + "." +
+                         CertificateSubjectName.DN_NAME, owner);
+        }
+        // Make issuer same as owner (self-signed!)
+        certInfo.set(X509CertInfo.ISSUER + "." +
+                     CertificateIssuerName.DN_NAME, owner);
+
+        // The inner and outer signature algorithms have to match.
+        // The way we achieve that is really ugly, but there seems to be no
+        // other solution: We first sign the cert, then retrieve the
+        // outer sigalg and use it to set the inner sigalg
+        X509CertImpl newCert = new X509CertImpl(certInfo);
+        newCert.sign(privKey, sigAlgName);
+        AlgorithmId sigAlgid = (AlgorithmId)newCert.get(X509CertImpl.SIG_ALG);
+        certInfo.set(CertificateAlgorithmId.NAME + "." +
+                     CertificateAlgorithmId.ALGORITHM, sigAlgid);
+
+        certInfo.set(X509CertInfo.VERSION,
+                        new CertificateVersion(CertificateVersion.V3));
+
+        CertificateExtensions ext = createV3Extensions(
+                null,
+                (CertificateExtensions)certInfo.get(X509CertInfo.EXTENSIONS),
+                v3ext,
+                oldCert.getPublicKey(),
+                null);
+        certInfo.set(X509CertInfo.EXTENSIONS, ext);
+        // Sign the new certificate
+        newCert = new X509CertImpl(certInfo);
+        newCert.sign(privKey, sigAlgName);
+
+        // Store the new certificate as a single-element certificate chain
+        keyStore.setKeyEntry(alias, privKey,
+                             (keyPass != null) ? keyPass : storePass,
+                             new Certificate[] { newCert } );
+
+        if (verbose) {
+            System.err.println(rb.getString("New.certificate.self.signed."));
+            System.err.print(newCert.toString());
+            System.err.println();
+        }
+    }
+
+    /**
+     * Processes a certificate reply from a certificate authority.
+     *
+     * <p>Builds a certificate chain on top of the certificate reply,
+     * using trusted certificates from the keystore. The chain is complete
+     * after a self-signed certificate has been encountered. The self-signed
+     * certificate is considered a root certificate authority, and is stored
+     * at the end of the chain.
+     *
+     * <p>The newly generated chain replaces the old chain associated with the
+     * key entry.
+     *
+     * @return true if the certificate reply was installed, otherwise false.
+     */
+    private boolean installReply(String alias, InputStream in)
+        throws Exception
+    {
+        if (alias == null) {
+            alias = keyAlias;
+        }
+
+        Pair<Key,char[]> objs = recoverKey(alias, storePass, keyPass);
+        PrivateKey privKey = (PrivateKey)objs.fst;
+        if (keyPass == null) {
+            keyPass = objs.snd;
+        }
+
+        Certificate userCert = keyStore.getCertificate(alias);
+        if (userCert == null) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("alias.has.no.public.key.certificate."));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        // Read the certificates in the reply
+        Collection<? extends Certificate> c = cf.generateCertificates(in);
+        if (c.isEmpty()) {
+            throw new Exception(rb.getString("Reply.has.no.certificates"));
+        }
+        Certificate[] replyCerts = c.toArray(new Certificate[c.size()]);
+        Certificate[] newChain;
+        if (replyCerts.length == 1) {
+            // single-cert reply
+            newChain = establishCertChain(userCert, replyCerts[0]);
+        } else {
+            // cert-chain reply (e.g., PKCS#7)
+            newChain = validateReply(alias, userCert, replyCerts);
+        }
+
+        // Now store the newly established chain in the keystore. The new
+        // chain replaces the old one.
+        if (newChain != null) {
+            keyStore.setKeyEntry(alias, privKey,
+                                 (keyPass != null) ? keyPass : storePass,
+                                 newChain);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Imports a certificate and adds it to the list of trusted certificates.
+     *
+     * @return true if the certificate was added, otherwise false.
+     */
+    private boolean addTrustedCert(String alias, InputStream in)
+        throws Exception
+    {
+        if (alias == null) {
+            throw new Exception(rb.getString("Must.specify.alias"));
+        }
+        if (keyStore.containsAlias(alias)) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Certificate.not.imported.alias.alias.already.exists"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        // Read the certificate
+        X509Certificate cert = null;
+        try {
+            cert = (X509Certificate)cf.generateCertificate(in);
+        } catch (ClassCastException | CertificateException ce) {
+            throw new Exception(rb.getString("Input.not.an.X.509.certificate"));
+        }
+
+        // if certificate is self-signed, make sure it verifies
+        boolean selfSigned = false;
+        if (isSelfSigned(cert)) {
+            cert.verify(cert.getPublicKey());
+            selfSigned = true;
+        }
+
+        if (noprompt) {
+            keyStore.setCertificateEntry(alias, cert);
+            return true;
+        }
+
+        // check if cert already exists in keystore
+        String reply = null;
+        String trustalias = keyStore.getCertificateAlias(cert);
+        if (trustalias != null) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Certificate.already.exists.in.keystore.under.alias.trustalias."));
+            Object[] source = {trustalias};
+            System.err.println(form.format(source));
+            reply = getYesNoReply
+                (rb.getString("Do.you.still.want.to.add.it.no."));
+        } else if (selfSigned) {
+            if (trustcacerts && (caks != null) &&
+                    ((trustalias=caks.getCertificateAlias(cert)) != null)) {
+                MessageFormat form = new MessageFormat(rb.getString
+                        ("Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias."));
+                Object[] source = {trustalias};
+                System.err.println(form.format(source));
+                reply = getYesNoReply
+                        (rb.getString("Do.you.still.want.to.add.it.to.your.own.keystore.no."));
+            }
+            if (trustalias == null) {
+                // Print the cert and ask user if they really want to add
+                // it to their keystore
+                printX509Cert(cert, System.out);
+                reply = getYesNoReply
+                        (rb.getString("Trust.this.certificate.no."));
+            }
+        }
+        if (reply != null) {
+            if ("YES".equals(reply)) {
+                keyStore.setCertificateEntry(alias, cert);
+                return true;
+            } else {
+                return false;
+            }
+        }
+
+        // Try to establish trust chain
+        try {
+            Certificate[] chain = establishCertChain(null, cert);
+            if (chain != null) {
+                keyStore.setCertificateEntry(alias, cert);
+                return true;
+            }
+        } catch (Exception e) {
+            // Print the cert and ask user if they really want to add it to
+            // their keystore
+            printX509Cert(cert, System.out);
+            reply = getYesNoReply
+                (rb.getString("Trust.this.certificate.no."));
+            if ("YES".equals(reply)) {
+                keyStore.setCertificateEntry(alias, cert);
+                return true;
+            } else {
+                return false;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Prompts user for new password. New password must be different from
+     * old one.
+     *
+     * @param prompt the message that gets prompted on the screen
+     * @param oldPasswd the current (i.e., old) password
+     */
+    private char[] getNewPasswd(String prompt, char[] oldPasswd)
+        throws Exception
+    {
+        char[] entered = null;
+        char[] reentered = null;
+
+        for (int count = 0; count < 3; count++) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("New.prompt."));
+            Object[] source = {prompt};
+            System.err.print(form.format(source));
+            entered = Password.readPassword(System.in);
+            passwords.add(entered);
+            if (entered == null || entered.length < 6) {
+                System.err.println(rb.getString
+                    ("Password.is.too.short.must.be.at.least.6.characters"));
+            } else if (Arrays.equals(entered, oldPasswd)) {
+                System.err.println(rb.getString("Passwords.must.differ"));
+            } else {
+                form = new MessageFormat
+                        (rb.getString("Re.enter.new.prompt."));
+                Object[] src = {prompt};
+                System.err.print(form.format(src));
+                reentered = Password.readPassword(System.in);
+                passwords.add(reentered);
+                if (!Arrays.equals(entered, reentered)) {
+                    System.err.println
+                        (rb.getString("They.don.t.match.Try.again"));
+                } else {
+                    Arrays.fill(reentered, ' ');
+                    return entered;
+                }
+            }
+            if (entered != null) {
+                Arrays.fill(entered, ' ');
+                entered = null;
+            }
+            if (reentered != null) {
+                Arrays.fill(reentered, ' ');
+                reentered = null;
+            }
+        }
+        throw new Exception(rb.getString("Too.many.failures.try.later"));
+    }
+
+    /**
+     * Prompts user for alias name.
+     * @param prompt the {0} of "Enter {0} alias name:  " in prompt line
+     * @returns the string entered by the user, without the \n at the end
+     */
+    private String getAlias(String prompt) throws Exception {
+        if (prompt != null) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Enter.prompt.alias.name."));
+            Object[] source = {prompt};
+            System.err.print(form.format(source));
+        } else {
+            System.err.print(rb.getString("Enter.alias.name."));
+        }
+        return (new BufferedReader(new InputStreamReader(
+                                        System.in))).readLine();
+    }
+
+    /**
+     * Prompts user for an input string from the command line (System.in)
+     * @prompt the prompt string printed
+     * @returns the string entered by the user, without the \n at the end
+     */
+    private String inputStringFromStdin(String prompt) throws Exception {
+        System.err.print(prompt);
+        return (new BufferedReader(new InputStreamReader(
+                                        System.in))).readLine();
+    }
+
+    /**
+     * Prompts user for key password. User may select to choose the same
+     * password (<code>otherKeyPass</code>) as for <code>otherAlias</code>.
+     */
+    private char[] getKeyPasswd(String alias, String otherAlias,
+                                char[] otherKeyPass)
+        throws Exception
+    {
+        int count = 0;
+        char[] keyPass = null;
+
+        do {
+            if (otherKeyPass != null) {
+                MessageFormat form = new MessageFormat(rb.getString
+                        ("Enter.key.password.for.alias."));
+                Object[] source = {alias};
+                System.err.println(form.format(source));
+
+                form = new MessageFormat(rb.getString
+                        (".RETURN.if.same.as.for.otherAlias."));
+                Object[] src = {otherAlias};
+                System.err.print(form.format(src));
+            } else {
+                MessageFormat form = new MessageFormat(rb.getString
+                        ("Enter.key.password.for.alias."));
+                Object[] source = {alias};
+                System.err.print(form.format(source));
+            }
+            System.err.flush();
+            keyPass = Password.readPassword(System.in);
+            passwords.add(keyPass);
+            if (keyPass == null) {
+                keyPass = otherKeyPass;
+            }
+            count++;
+        } while ((keyPass == null) && count < 3);
+
+        if (keyPass == null) {
+            throw new Exception(rb.getString("Too.many.failures.try.later"));
+        }
+
+        return keyPass;
+    }
+
+    /**
+     * Prints a certificate in a human readable format.
+     */
+    private void printX509Cert(X509Certificate cert, PrintStream out)
+        throws Exception
+    {
+        /*
+        out.println("Owner: "
+                    + cert.getSubjectDN().toString()
+                    + "\n"
+                    + "Issuer: "
+                    + cert.getIssuerDN().toString()
+                    + "\n"
+                    + "Serial number: " + cert.getSerialNumber().toString(16)
+                    + "\n"
+                    + "Valid from: " + cert.getNotBefore().toString()
+                    + " until: " + cert.getNotAfter().toString()
+                    + "\n"
+                    + "Certificate fingerprints:\n"
+                    + "\t MD5:  " + getCertFingerPrint("MD5", cert)
+                    + "\n"
+                    + "\t SHA1: " + getCertFingerPrint("SHA1", cert));
+        */
+
+        MessageFormat form = new MessageFormat
+                (rb.getString(".PATTERN.printX509Cert"));
+        Object[] source = {cert.getSubjectDN().toString(),
+                        cert.getIssuerDN().toString(),
+                        cert.getSerialNumber().toString(16),
+                        cert.getNotBefore().toString(),
+                        cert.getNotAfter().toString(),
+                        getCertFingerPrint("MD5", cert),
+                        getCertFingerPrint("SHA1", cert),
+                        getCertFingerPrint("SHA-256", cert),
+                        cert.getSigAlgName(),
+                        cert.getVersion()
+                        };
+        out.println(form.format(source));
+
+        if (cert instanceof X509CertImpl) {
+            X509CertImpl impl = (X509CertImpl)cert;
+            X509CertInfo certInfo = (X509CertInfo)impl.get(X509CertImpl.NAME
+                                                           + "." +
+                                                           X509CertImpl.INFO);
+            CertificateExtensions exts = (CertificateExtensions)
+                    certInfo.get(X509CertInfo.EXTENSIONS);
+            if (exts != null) {
+                printExtensions(rb.getString("Extensions."), exts, out);
+            }
+        }
+    }
+
+    private static void printExtensions(String title, CertificateExtensions exts, PrintStream out)
+            throws Exception {
+        int extnum = 0;
+        Iterator<Extension> i1 = exts.getAllExtensions().iterator();
+        Iterator<Extension> i2 = exts.getUnparseableExtensions().values().iterator();
+        while (i1.hasNext() || i2.hasNext()) {
+            Extension ext = i1.hasNext()?i1.next():i2.next();
+            if (extnum == 0) {
+                out.println();
+                out.println(title);
+                out.println();
+            }
+            out.print("#"+(++extnum)+": "+ ext);
+            if (ext.getClass() == Extension.class) {
+                byte[] v = ext.getExtensionValue();
+                if (v.length == 0) {
+                    out.println(rb.getString(".Empty.value."));
+                } else {
+                    new sun.misc.HexDumpEncoder().encodeBuffer(ext.getExtensionValue(), out);
+                    out.println();
+                }
+            }
+            out.println();
+        }
+    }
+
+    /**
+     * Returns true if the certificate is self-signed, false otherwise.
+     */
+    private boolean isSelfSigned(X509Certificate cert) {
+        return signedBy(cert, cert);
+    }
+
+    private boolean signedBy(X509Certificate end, X509Certificate ca) {
+        if (!ca.getSubjectDN().equals(end.getIssuerDN())) {
+            return false;
+        }
+        try {
+            end.verify(ca.getPublicKey());
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     * Locates a signer for a given certificate from a given keystore and
+     * returns the signer's certificate.
+     * @param cert the certificate whose signer is searched, not null
+     * @param ks the keystore to search with, not null
+     * @return <code>cert</code> itself if it's already inside <code>ks</code>,
+     * or a certificate inside <code>ks</code> who signs <code>cert</code>,
+     * or null otherwise.
+     */
+    private static Certificate getTrustedSigner(Certificate cert, KeyStore ks)
+            throws Exception {
+        if (ks.getCertificateAlias(cert) != null) {
+            return cert;
+        }
+        for (Enumeration<String> aliases = ks.aliases();
+                aliases.hasMoreElements(); ) {
+            String name = aliases.nextElement();
+            Certificate trustedCert = ks.getCertificate(name);
+            if (trustedCert != null) {
+                try {
+                    cert.verify(trustedCert.getPublicKey());
+                    return trustedCert;
+                } catch (Exception e) {
+                    // Not verified, skip to the next one
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets an X.500 name suitable for inclusion in a certification request.
+     */
+    private X500Name getX500Name() throws IOException {
+        BufferedReader in;
+        in = new BufferedReader(new InputStreamReader(System.in));
+        String commonName = "Unknown";
+        String organizationalUnit = "Unknown";
+        String organization = "Unknown";
+        String city = "Unknown";
+        String state = "Unknown";
+        String country = "Unknown";
+        X500Name name;
+        String userInput = null;
+
+        int maxRetry = 20;
+        do {
+            if (maxRetry-- < 0) {
+                throw new RuntimeException(rb.getString(
+                        "Too.many.retries.program.terminated"));
+            }
+            commonName = inputString(in,
+                    rb.getString("What.is.your.first.and.last.name."),
+                    commonName);
+            organizationalUnit = inputString(in,
+                    rb.getString
+                        ("What.is.the.name.of.your.organizational.unit."),
+                    organizationalUnit);
+            organization = inputString(in,
+                    rb.getString("What.is.the.name.of.your.organization."),
+                    organization);
+            city = inputString(in,
+                    rb.getString("What.is.the.name.of.your.City.or.Locality."),
+                    city);
+            state = inputString(in,
+                    rb.getString("What.is.the.name.of.your.State.or.Province."),
+                    state);
+            country = inputString(in,
+                    rb.getString
+                        ("What.is.the.two.letter.country.code.for.this.unit."),
+                    country);
+            name = new X500Name(commonName, organizationalUnit, organization,
+                                city, state, country);
+            MessageFormat form = new MessageFormat
+                (rb.getString("Is.name.correct."));
+            Object[] source = {name};
+            userInput = inputString
+                (in, form.format(source), rb.getString("no"));
+        } while (collator.compare(userInput, rb.getString("yes")) != 0 &&
+                 collator.compare(userInput, rb.getString("y")) != 0);
+
+        System.err.println();
+        return name;
+    }
+
+    private String inputString(BufferedReader in, String prompt,
+                               String defaultValue)
+        throws IOException
+    {
+        System.err.println(prompt);
+        MessageFormat form = new MessageFormat
+                (rb.getString(".defaultValue."));
+        Object[] source = {defaultValue};
+        System.err.print(form.format(source));
+        System.err.flush();
+
+        String value = in.readLine();
+        if (value == null || collator.compare(value, "") == 0) {
+            value = defaultValue;
+        }
+        return value;
+    }
+
+    /**
+     * Writes an X.509 certificate in base64 or binary encoding to an output
+     * stream.
+     */
+    private void dumpCert(Certificate cert, PrintStream out)
+        throws IOException, CertificateException
+    {
+        if (rfc) {
+            BASE64Encoder encoder = new BASE64Encoder();
+            out.println(X509Factory.BEGIN_CERT);
+            encoder.encodeBuffer(cert.getEncoded(), out);
+            out.println(X509Factory.END_CERT);
+        } else {
+            out.write(cert.getEncoded()); // binary
+        }
+    }
+
+    /**
+     * Converts a byte to hex digit and writes to the supplied buffer
+     */
+    private void byte2hex(byte b, StringBuffer buf) {
+        char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
+                            '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+        int high = ((b & 0xf0) >> 4);
+        int low = (b & 0x0f);
+        buf.append(hexChars[high]);
+        buf.append(hexChars[low]);
+    }
+
+    /**
+     * Converts a byte array to hex string
+     */
+    private String toHexString(byte[] block) {
+        StringBuffer buf = new StringBuffer();
+        int len = block.length;
+        for (int i = 0; i < len; i++) {
+             byte2hex(block[i], buf);
+             if (i < len-1) {
+                 buf.append(":");
+             }
+        }
+        return buf.toString();
+    }
+
+    /**
+     * Recovers (private) key associated with given alias.
+     *
+     * @return an array of objects, where the 1st element in the array is the
+     * recovered private key, and the 2nd element is the password used to
+     * recover it.
+     */
+    private Pair<Key,char[]> recoverKey(String alias, char[] storePass,
+                                       char[] keyPass)
+        throws Exception
+    {
+        Key key = null;
+
+        if (keyStore.containsAlias(alias) == false) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.does.not.exist"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+        if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class) &&
+                !keyStore.entryInstanceOf(alias, KeyStore.SecretKeyEntry.class)) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.has.no.key"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        if (keyPass == null) {
+            // Try to recover the key using the keystore password
+            try {
+                key = keyStore.getKey(alias, storePass);
+
+                keyPass = storePass;
+                passwords.add(keyPass);
+            } catch (UnrecoverableKeyException e) {
+                // Did not work out, so prompt user for key password
+                if (!token) {
+                    keyPass = getKeyPasswd(alias, null, null);
+                    key = keyStore.getKey(alias, keyPass);
+                } else {
+                    throw e;
+                }
+            }
+        } else {
+            key = keyStore.getKey(alias, keyPass);
+        }
+
+        return Pair.of(key, keyPass);
+    }
+
+    /**
+     * Recovers entry associated with given alias.
+     *
+     * @return an array of objects, where the 1st element in the array is the
+     * recovered entry, and the 2nd element is the password used to
+     * recover it (null if no password).
+     */
+    private Pair<Entry,char[]> recoverEntry(KeyStore ks,
+                            String alias,
+                            char[] pstore,
+                            char[] pkey) throws Exception {
+
+        if (ks.containsAlias(alias) == false) {
+            MessageFormat form = new MessageFormat
+                (rb.getString("Alias.alias.does.not.exist"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        PasswordProtection pp = null;
+        Entry entry;
+
+        try {
+            // First attempt to access entry without key password
+            // (PKCS11 entry or trusted certificate entry, for example)
+
+            entry = ks.getEntry(alias, pp);
+            pkey = null;
+        } catch (UnrecoverableEntryException une) {
+
+            if(P11KEYSTORE.equalsIgnoreCase(ks.getType()) ||
+                KeyStoreUtil.isWindowsKeyStore(ks.getType())) {
+                // should not happen, but a possibility
+                throw une;
+            }
+
+            // entry is protected
+
+            if (pkey != null) {
+
+                // try provided key password
+
+                pp = new PasswordProtection(pkey);
+                entry = ks.getEntry(alias, pp);
+
+            } else {
+
+                // try store pass
+
+                try {
+                    pp = new PasswordProtection(pstore);
+                    entry = ks.getEntry(alias, pp);
+                    pkey = pstore;
+                } catch (UnrecoverableEntryException une2) {
+                    if (P12KEYSTORE.equalsIgnoreCase(ks.getType())) {
+
+                        // P12 keystore currently does not support separate
+                        // store and entry passwords
+
+                        throw une2;
+                    } else {
+
+                        // prompt for entry password
+
+                        pkey = getKeyPasswd(alias, null, null);
+                        pp = new PasswordProtection(pkey);
+                        entry = ks.getEntry(alias, pp);
+                    }
+                }
+            }
+        }
+
+        return Pair.of(entry, pkey);
+    }
+    /**
+     * Gets the requested finger print of the certificate.
+     */
+    private String getCertFingerPrint(String mdAlg, Certificate cert)
+        throws Exception
+    {
+        byte[] encCertInfo = cert.getEncoded();
+        MessageDigest md = MessageDigest.getInstance(mdAlg);
+        byte[] digest = md.digest(encCertInfo);
+        return toHexString(digest);
+    }
+
+    /**
+     * Prints warning about missing integrity check.
+     */
+    private void printWarning() {
+        System.err.println();
+        System.err.println(rb.getString
+            (".WARNING.WARNING.WARNING."));
+        System.err.println(rb.getString
+            (".The.integrity.of.the.information.stored.in.your.keystore."));
+        System.err.println(rb.getString
+            (".WARNING.WARNING.WARNING."));
+        System.err.println();
+    }
+
+    /**
+     * Validates chain in certification reply, and returns the ordered
+     * elements of the chain (with user certificate first, and root
+     * certificate last in the array).
+     *
+     * @param alias the alias name
+     * @param userCert the user certificate of the alias
+     * @param replyCerts the chain provided in the reply
+     */
+    private Certificate[] validateReply(String alias,
+                                        Certificate userCert,
+                                        Certificate[] replyCerts)
+        throws Exception
+    {
+        // order the certs in the reply (bottom-up).
+        // we know that all certs in the reply are of type X.509, because
+        // we parsed them using an X.509 certificate factory
+        int i;
+        PublicKey userPubKey = userCert.getPublicKey();
+        for (i=0; i<replyCerts.length; i++) {
+            if (userPubKey.equals(replyCerts[i].getPublicKey())) {
+                break;
+            }
+        }
+        if (i == replyCerts.length) {
+            MessageFormat form = new MessageFormat(rb.getString
+                ("Certificate.reply.does.not.contain.public.key.for.alias."));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
+
+        Certificate tmpCert = replyCerts[0];
+        replyCerts[0] = replyCerts[i];
+        replyCerts[i] = tmpCert;
+
+        X509Certificate thisCert = (X509Certificate)replyCerts[0];
+
+        for (i=1; i < replyCerts.length-1; i++) {
+            // find a cert in the reply who signs thisCert
+            int j;
+            for (j=i; j<replyCerts.length; j++) {
+                if (signedBy(thisCert, (X509Certificate)replyCerts[j])) {
+                    tmpCert = replyCerts[i];
+                    replyCerts[i] = replyCerts[j];
+                    replyCerts[j] = tmpCert;
+                    thisCert = (X509Certificate)replyCerts[i];
+                    break;
+                }
+            }
+            if (j == replyCerts.length) {
+                throw new Exception
+                    (rb.getString("Incomplete.certificate.chain.in.reply"));
+            }
+        }
+
+        if (noprompt) {
+            return replyCerts;
+        }
+
+        // do we trust the cert at the top?
+        Certificate topCert = replyCerts[replyCerts.length-1];
+        Certificate root = getTrustedSigner(topCert, keyStore);
+        if (root == null && trustcacerts && caks != null) {
+            root = getTrustedSigner(topCert, caks);
+        }
+        if (root == null) {
+            System.err.println();
+            System.err.println
+                    (rb.getString("Top.level.certificate.in.reply."));
+            printX509Cert((X509Certificate)topCert, System.out);
+            System.err.println();
+            System.err.print(rb.getString(".is.not.trusted."));
+            String reply = getYesNoReply
+                    (rb.getString("Install.reply.anyway.no."));
+            if ("NO".equals(reply)) {
+                return null;
+            }
+        } else {
+            if (root != topCert) {
+                // append the root CA cert to the chain
+                Certificate[] tmpCerts =
+                    new Certificate[replyCerts.length+1];
+                System.arraycopy(replyCerts, 0, tmpCerts, 0,
+                                 replyCerts.length);
+                tmpCerts[tmpCerts.length-1] = root;
+                replyCerts = tmpCerts;
+            }
+        }
+
+        return replyCerts;
+    }
+
+    /**
+     * Establishes a certificate chain (using trusted certificates in the
+     * keystore), starting with the user certificate
+     * and ending at a self-signed certificate found in the keystore.
+     *
+     * @param userCert the user certificate of the alias
+     * @param certToVerify the single certificate provided in the reply
+     */
+    private Certificate[] establishCertChain(Certificate userCert,
+                                             Certificate certToVerify)
+        throws Exception
+    {
+        if (userCert != null) {
+            // Make sure that the public key of the certificate reply matches
+            // the original public key in the keystore
+            PublicKey origPubKey = userCert.getPublicKey();
+            PublicKey replyPubKey = certToVerify.getPublicKey();
+            if (!origPubKey.equals(replyPubKey)) {
+                throw new Exception(rb.getString
+                        ("Public.keys.in.reply.and.keystore.don.t.match"));
+            }
+
+            // If the two certs are identical, we're done: no need to import
+            // anything
+            if (certToVerify.equals(userCert)) {
+                throw new Exception(rb.getString
+                        ("Certificate.reply.and.certificate.in.keystore.are.identical"));
+            }
+        }
+
+        // Build a hash table of all certificates in the keystore.
+        // Use the subject distinguished name as the key into the hash table.
+        // All certificates associated with the same subject distinguished
+        // name are stored in the same hash table entry as a vector.
+        Hashtable<Principal, Vector<Certificate>> certs = null;
+        if (keyStore.size() > 0) {
+            certs = new Hashtable<Principal, Vector<Certificate>>(11);
+            keystorecerts2Hashtable(keyStore, certs);
+        }
+        if (trustcacerts) {
+            if (caks!=null && caks.size()>0) {
+                if (certs == null) {
+                    certs = new Hashtable<Principal, Vector<Certificate>>(11);
+                }
+                keystorecerts2Hashtable(caks, certs);
+            }
+        }
+
+        // start building chain
+        Vector<Certificate> chain = new Vector<>(2);
+        if (buildChain((X509Certificate)certToVerify, chain, certs)) {
+            Certificate[] newChain = new Certificate[chain.size()];
+            // buildChain() returns chain with self-signed root-cert first and
+            // user-cert last, so we need to invert the chain before we store
+            // it
+            int j=0;
+            for (int i=chain.size()-1; i>=0; i--) {
+                newChain[j] = chain.elementAt(i);
+                j++;
+            }
+            return newChain;
+        } else {
+            throw new Exception
+                (rb.getString("Failed.to.establish.chain.from.reply"));
+        }
+    }
+
+    /**
+     * Recursively tries to establish chain from pool of trusted certs.
+     *
+     * @param certToVerify the cert that needs to be verified.
+     * @param chain the chain that's being built.
+     * @param certs the pool of trusted certs
+     *
+     * @return true if successful, false otherwise.
+     */
+    private boolean buildChain(X509Certificate certToVerify,
+                        Vector<Certificate> chain,
+                        Hashtable<Principal, Vector<Certificate>> certs) {
+        Principal issuer = certToVerify.getIssuerDN();
+        if (isSelfSigned(certToVerify)) {
+            // reached self-signed root cert;
+            // no verification needed because it's trusted.
+            chain.addElement(certToVerify);
+            return true;
+        }
+
+        // Get the issuer's certificate(s)
+        Vector<Certificate> vec = certs.get(issuer);
+        if (vec == null) {
+            return false;
+        }
+
+        // Try out each certificate in the vector, until we find one
+        // whose public key verifies the signature of the certificate
+        // in question.
+        for (Enumeration<Certificate> issuerCerts = vec.elements();
+             issuerCerts.hasMoreElements(); ) {
+            X509Certificate issuerCert
+                = (X509Certificate)issuerCerts.nextElement();
+            PublicKey issuerPubKey = issuerCert.getPublicKey();
+            try {
+                certToVerify.verify(issuerPubKey);
+            } catch (Exception e) {
+                continue;
+            }
+            if (buildChain(issuerCert, chain, certs)) {
+                chain.addElement(certToVerify);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Prompts user for yes/no decision.
+     *
+     * @return the user's decision, can only be "YES" or "NO"
+     */
+    private String getYesNoReply(String prompt)
+        throws IOException
+    {
+        String reply = null;
+        int maxRetry = 20;
+        do {
+            if (maxRetry-- < 0) {
+                throw new RuntimeException(rb.getString(
+                        "Too.many.retries.program.terminated"));
+            }
+            System.err.print(prompt);
+            System.err.flush();
+            reply = (new BufferedReader(new InputStreamReader
+                                        (System.in))).readLine();
+            if (collator.compare(reply, "") == 0 ||
+                collator.compare(reply, rb.getString("n")) == 0 ||
+                collator.compare(reply, rb.getString("no")) == 0) {
+                reply = "NO";
+            } else if (collator.compare(reply, rb.getString("y")) == 0 ||
+                       collator.compare(reply, rb.getString("yes")) == 0) {
+                reply = "YES";
+            } else {
+                System.err.println(rb.getString("Wrong.answer.try.again"));
+                reply = null;
+            }
+        } while (reply == null);
+        return reply;
+    }
+
+    /**
+     * Stores the (leaf) certificates of a keystore in a hashtable.
+     * All certs belonging to the same CA are stored in a vector that
+     * in turn is stored in the hashtable, keyed by the CA's subject DN
+     */
+    private void keystorecerts2Hashtable(KeyStore ks,
+                Hashtable<Principal, Vector<Certificate>> hash)
+        throws Exception {
+
+        for (Enumeration<String> aliases = ks.aliases();
+                                        aliases.hasMoreElements(); ) {
+            String alias = aliases.nextElement();
+            Certificate cert = ks.getCertificate(alias);
+            if (cert != null) {
+                Principal subjectDN = ((X509Certificate)cert).getSubjectDN();
+                Vector<Certificate> vec = hash.get(subjectDN);
+                if (vec == null) {
+                    vec = new Vector<Certificate>();
+                    vec.addElement(cert);
+                } else {
+                    if (!vec.contains(cert)) {
+                        vec.addElement(cert);
+                    }
+                }
+                hash.put(subjectDN, vec);
+            }
+        }
+    }
+
+    /**
+     * Returns the issue time that's specified the -startdate option
+     * @param s the value of -startdate option
+     */
+    private static Date getStartDate(String s) throws IOException {
+        Calendar c = new GregorianCalendar();
+        if (s != null) {
+            IOException ioe = new IOException(
+                    rb.getString("Illegal.startdate.value"));
+            int len = s.length();
+            if (len == 0) {
+                throw ioe;
+            }
+            if (s.charAt(0) == '-' || s.charAt(0) == '+') {
+                // Form 1: ([+-]nnn[ymdHMS])+
+                int start = 0;
+                while (start < len) {
+                    int sign = 0;
+                    switch (s.charAt(start)) {
+                        case '+': sign = 1; break;
+                        case '-': sign = -1; break;
+                        default: throw ioe;
+                    }
+                    int i = start+1;
+                    for (; i<len; i++) {
+                        char ch = s.charAt(i);
+                        if (ch < '0' || ch > '9') break;
+                    }
+                    if (i == start+1) throw ioe;
+                    int number = Integer.parseInt(s.substring(start+1, i));
+                    if (i >= len) throw ioe;
+                    int unit = 0;
+                    switch (s.charAt(i)) {
+                        case 'y': unit = Calendar.YEAR; break;
+                        case 'm': unit = Calendar.MONTH; break;
+                        case 'd': unit = Calendar.DATE; break;
+                        case 'H': unit = Calendar.HOUR; break;
+                        case 'M': unit = Calendar.MINUTE; break;
+                        case 'S': unit = Calendar.SECOND; break;
+                        default: throw ioe;
+                    }
+                    c.add(unit, sign * number);
+                    start = i + 1;
+                }
+            } else  {
+                // Form 2: [yyyy/mm/dd] [HH:MM:SS]
+                String date = null, time = null;
+                if (len == 19) {
+                    date = s.substring(0, 10);
+                    time = s.substring(11);
+                    if (s.charAt(10) != ' ')
+                        throw ioe;
+                } else if (len == 10) {
+                    date = s;
+                } else if (len == 8) {
+                    time = s;
+                } else {
+                    throw ioe;
+                }
+                if (date != null) {
+                    if (date.matches("\\d\\d\\d\\d\\/\\d\\d\\/\\d\\d")) {
+                        c.set(Integer.valueOf(date.substring(0, 4)),
+                                Integer.valueOf(date.substring(5, 7))-1,
+                                Integer.valueOf(date.substring(8, 10)));
+                    } else {
+                        throw ioe;
+                    }
+                }
+                if (time != null) {
+                    if (time.matches("\\d\\d:\\d\\d:\\d\\d")) {
+                        c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(time.substring(0, 2)));
+                        c.set(Calendar.MINUTE, Integer.valueOf(time.substring(0, 2)));
+                        c.set(Calendar.SECOND, Integer.valueOf(time.substring(0, 2)));
+                        c.set(Calendar.MILLISECOND, 0);
+                    } else {
+                        throw ioe;
+                    }
+                }
+            }
+        }
+        return c.getTime();
+    }
+
+    /**
+     * Match a command (may be abbreviated) with a command set.
+     * @param s the command provided
+     * @param list the legal command set. If there is a null, commands after it
+     * are regarded experimental, which means they are supported but their
+     * existence should not be revealed to user.
+     * @return the position of a single match, or -1 if none matched
+     * @throws Exception if s is ambiguous
+     */
+    private static int oneOf(String s, String... list) throws Exception {
+        int[] match = new int[list.length];
+        int nmatch = 0;
+        int experiment = Integer.MAX_VALUE;
+        for (int i = 0; i<list.length; i++) {
+            String one = list[i];
+            if (one == null) {
+                experiment = i;
+                continue;
+            }
+            if (one.toLowerCase(Locale.ENGLISH)
+                    .startsWith(s.toLowerCase(Locale.ENGLISH))) {
+                match[nmatch++] = i;
+            } else {
+                StringBuffer sb = new StringBuffer();
+                boolean first = true;
+                for (char c: one.toCharArray()) {
+                    if (first) {
+                        sb.append(c);
+                        first = false;
+                    } else {
+                        if (!Character.isLowerCase(c)) {
+                            sb.append(c);
+                        }
+                    }
+                }
+                if (sb.toString().equalsIgnoreCase(s)) {
+                    match[nmatch++] = i;
+                }
+            }
+        }
+        if (nmatch == 0) {
+            return -1;
+        } else if (nmatch == 1) {
+            return match[0];
+        } else {
+            // If multiple matches is in experimental commands, ignore them
+            if (match[1] > experiment) {
+                return match[0];
+            }
+            StringBuffer sb = new StringBuffer();
+            MessageFormat form = new MessageFormat(rb.getString
+                ("command.{0}.is.ambiguous."));
+            Object[] source = {s};
+            sb.append(form.format(source));
+            sb.append("\n    ");
+            for (int i=0; i<nmatch && match[i]<experiment; i++) {
+                sb.append(' ');
+                sb.append(list[match[i]]);
+            }
+            throw new Exception(sb.toString());
+        }
+    }
+
+    /**
+     * Create a GeneralName object from known types
+     * @param t one of 5 known types
+     * @param v value
+     * @return which one
+     */
+    private GeneralName createGeneralName(String t, String v)
+            throws Exception {
+        GeneralNameInterface gn;
+        int p = oneOf(t, "EMAIL", "URI", "DNS", "IP", "OID");
+        if (p < 0) {
+            throw new Exception(rb.getString(
+                    "Unrecognized.GeneralName.type.") + t);
+        }
+        switch (p) {
+            case 0: gn = new RFC822Name(v); break;
+            case 1: gn = new URIName(v); break;
+            case 2: gn = new DNSName(v); break;
+            case 3: gn = new IPAddressName(v); break;
+            default: gn = new OIDName(v); break; //4
+        }
+        return new GeneralName(gn);
+    }
+
+    private static final String[] extSupported = {
+                        "BasicConstraints",
+                        "KeyUsage",
+                        "ExtendedKeyUsage",
+                        "SubjectAlternativeName",
+                        "IssuerAlternativeName",
+                        "SubjectInfoAccess",
+                        "AuthorityInfoAccess",
+                        null,
+                        "CRLDistributionPoints",
+    };
+
+    private ObjectIdentifier findOidForExtName(String type)
+            throws Exception {
+        switch (oneOf(type, extSupported)) {
+            case 0: return PKIXExtensions.BasicConstraints_Id;
+            case 1: return PKIXExtensions.KeyUsage_Id;
+            case 2: return PKIXExtensions.ExtendedKeyUsage_Id;
+            case 3: return PKIXExtensions.SubjectAlternativeName_Id;
+            case 4: return PKIXExtensions.IssuerAlternativeName_Id;
+            case 5: return PKIXExtensions.SubjectInfoAccess_Id;
+            case 6: return PKIXExtensions.AuthInfoAccess_Id;
+            case 8: return PKIXExtensions.CRLDistributionPoints_Id;
+            default: return new ObjectIdentifier(type);
+        }
+    }
+
+    /**
+     * Create X509v3 extensions from a string representation. Note that the
+     * SubjectKeyIdentifierExtension will always be created non-critical besides
+     * the extension requested in the <code>extstr</code> argument.
+     *
+     * @param reqex the requested extensions, can be null, used for -gencert
+     * @param ext the original extensions, can be null, used for -selfcert
+     * @param extstrs -ext values, Read keytool doc
+     * @param pkey the public key for the certificate
+     * @param akey the public key for the authority (issuer)
+     * @return the created CertificateExtensions
+     */
+    private CertificateExtensions createV3Extensions(
+            CertificateExtensions reqex,
+            CertificateExtensions ext,
+            List <String> extstrs,
+            PublicKey pkey,
+            PublicKey akey) throws Exception {
+
+        if (ext != null && reqex != null) {
+            // This should not happen
+            throw new Exception("One of request and original should be null.");
+        }
+        if (ext == null) ext = new CertificateExtensions();
+        try {
+            // name{:critical}{=value}
+            // Honoring requested extensions
+            if (reqex != null) {
+                for(String extstr: extstrs) {
+                    if (extstr.toLowerCase(Locale.ENGLISH).startsWith("honored=")) {
+                        List<String> list = Arrays.asList(
+                                extstr.toLowerCase(Locale.ENGLISH).substring(8).split(","));
+                        // First check existence of "all"
+                        if (list.contains("all")) {
+                            ext = reqex;    // we know ext was null
+                        }
+                        // one by one for others
+                        for (String item: list) {
+                            if (item.equals("all")) continue;
+
+                            // add or remove
+                            boolean add = true;
+                            // -1, unchanged, 0 crtical, 1 non-critical
+                            int action = -1;
+                            String type = null;
+                            if (item.startsWith("-")) {
+                                add = false;
+                                type = item.substring(1);
+                            } else {
+                                int colonpos = item.indexOf(':');
+                                if (colonpos >= 0) {
+                                    type = item.substring(0, colonpos);
+                                    action = oneOf(item.substring(colonpos+1),
+                                            "critical", "non-critical");
+                                    if (action == -1) {
+                                        throw new Exception(rb.getString
+                                            ("Illegal.value.") + item);
+                                    }
+                                }
+                            }
+                            String n = reqex.getNameByOid(findOidForExtName(type));
+                            if (add) {
+                                Extension e = reqex.get(n);
+                                if (!e.isCritical() && action == 0
+                                        || e.isCritical() && action == 1) {
+                                    e = Extension.newExtension(
+                                            e.getExtensionId(),
+                                            !e.isCritical(),
+                                            e.getExtensionValue());
+                                    ext.set(n, e);
+                                }
+                            } else {
+                                ext.delete(n);
+                            }
+                        }
+                        break;
+                    }
+                }
+            }
+            for(String extstr: extstrs) {
+                String name, value;
+                boolean isCritical = false;
+
+                int eqpos = extstr.indexOf('=');
+                if (eqpos >= 0) {
+                    name = extstr.substring(0, eqpos);
+                    value = extstr.substring(eqpos+1);
+                } else {
+                    name = extstr;
+                    value = null;
+                }
+
+                int colonpos = name.indexOf(':');
+                if (colonpos >= 0) {
+                    if (oneOf(name.substring(colonpos+1), "critical") == 0) {
+                        isCritical = true;
+                    }
+                    name = name.substring(0, colonpos);
+                }
+
+                if (name.equalsIgnoreCase("honored")) {
+                    continue;
+                }
+                int exttype = oneOf(name, extSupported);
+                switch (exttype) {
+                    case 0:     // BC
+                        int pathLen = -1;
+                        boolean isCA = false;
+                        if (value == null) {
+                            isCA = true;
+                        } else {
+                            try {   // the abbr format
+                                pathLen = Integer.parseInt(value);
+                                isCA = true;
+                            } catch (NumberFormatException ufe) {
+                                // ca:true,pathlen:1
+                                for (String part: value.split(",")) {
+                                    String[] nv = part.split(":");
+                                    if (nv.length != 2) {
+                                        throw new Exception(rb.getString
+                                                ("Illegal.value.") + extstr);
+                                    } else {
+                                        if (nv[0].equalsIgnoreCase("ca")) {
+                                            isCA = Boolean.parseBoolean(nv[1]);
+                                        } else if (nv[0].equalsIgnoreCase("pathlen")) {
+                                            pathLen = Integer.parseInt(nv[1]);
+                                        } else {
+                                            throw new Exception(rb.getString
+                                                ("Illegal.value.") + extstr);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        ext.set(BasicConstraintsExtension.NAME,
+                                new BasicConstraintsExtension(isCritical, isCA,
+                                pathLen));
+                        break;
+                    case 1:     // KU
+                        if(value != null) {
+                            boolean[] ok = new boolean[9];
+                            for (String s: value.split(",")) {
+                                int p = oneOf(s,
+                                       "digitalSignature",  // (0),
+                                       "nonRepudiation",    // (1)
+                                       "keyEncipherment",   // (2),
+                                       "dataEncipherment",  // (3),
+                                       "keyAgreement",      // (4),
+                                       "keyCertSign",       // (5),
+                                       "cRLSign",           // (6),
+                                       "encipherOnly",      // (7),
+                                       "decipherOnly",      // (8)
+                                       "contentCommitment"  // also (1)
+                                       );
+                                if (p < 0) {
+                                    throw new Exception(rb.getString("Unknown.keyUsage.type.") + s);
+                                }
+                                if (p == 9) p = 1;
+                                ok[p] = true;
+                            }
+                            KeyUsageExtension kue = new KeyUsageExtension(ok);
+                            // The above KeyUsageExtension constructor does not
+                            // allow isCritical value, so...
+                            ext.set(KeyUsageExtension.NAME, Extension.newExtension(
+                                    kue.getExtensionId(),
+                                    isCritical,
+                                    kue.getExtensionValue()));
+                        } else {
+                            throw new Exception(rb.getString
+                                    ("Illegal.value.") + extstr);
+                        }
+                        break;
+                    case 2:     // EKU
+                        if(value != null) {
+                            Vector<ObjectIdentifier> v = new Vector<>();
+                            for (String s: value.split(",")) {
+                                int p = oneOf(s,
+                                        "anyExtendedKeyUsage",
+                                        "serverAuth",       //1
+                                        "clientAuth",       //2
+                                        "codeSigning",      //3
+                                        "emailProtection",  //4
+                                        "",                 //5
+                                        "",                 //6
+                                        "",                 //7
+                                        "timeStamping",     //8
+                                        "OCSPSigning"       //9
+                                       );
+                                if (p < 0) {
+                                    try {
+                                        v.add(new ObjectIdentifier(s));
+                                    } catch (Exception e) {
+                                        throw new Exception(rb.getString(
+                                                "Unknown.extendedkeyUsage.type.") + s);
+                                    }
+                                } else if (p == 0) {
+                                    v.add(new ObjectIdentifier("2.5.29.37.0"));
+                                } else {
+                                    v.add(new ObjectIdentifier("1.3.6.1.5.5.7.3." + p));
+                                }
+                            }
+                            ext.set(ExtendedKeyUsageExtension.NAME,
+                                    new ExtendedKeyUsageExtension(isCritical, v));
+                        } else {
+                            throw new Exception(rb.getString
+                                    ("Illegal.value.") + extstr);
+                        }
+                        break;
+                    case 3:     // SAN
+                    case 4:     // IAN
+                        if(value != null) {
+                            String[] ps = value.split(",");
+                            GeneralNames gnames = new GeneralNames();
+                            for(String item: ps) {
+                                colonpos = item.indexOf(':');
+                                if (colonpos < 0) {
+                                    throw new Exception("Illegal item " + item + " in " + extstr);
+                                }
+                                String t = item.substring(0, colonpos);
+                                String v = item.substring(colonpos+1);
+                                gnames.add(createGeneralName(t, v));
+                            }
+                            if (exttype == 3) {
+                                ext.set(SubjectAlternativeNameExtension.NAME,
+                                        new SubjectAlternativeNameExtension(
+                                            isCritical, gnames));
+                            } else {
+                                ext.set(IssuerAlternativeNameExtension.NAME,
+                                        new IssuerAlternativeNameExtension(
+                                            isCritical, gnames));
+                            }
+                        } else {
+                            throw new Exception(rb.getString
+                                    ("Illegal.value.") + extstr);
+                        }
+                        break;
+                    case 5:     // SIA, always non-critical
+                    case 6:     // AIA, always non-critical
+                        if (isCritical) {
+                            throw new Exception(rb.getString(
+                                    "This.extension.cannot.be.marked.as.critical.") + extstr);
+                        }
+                        if(value != null) {
+                            List<AccessDescription> accessDescriptions =
+                                    new ArrayList<>();
+                            String[] ps = value.split(",");
+                            for(String item: ps) {
+                                colonpos = item.indexOf(':');
+                                int colonpos2 = item.indexOf(':', colonpos+1);
+                                if (colonpos < 0 || colonpos2 < 0) {
+                                    throw new Exception(rb.getString
+                                            ("Illegal.value.") + extstr);
+                                }
+                                String m = item.substring(0, colonpos);
+                                String t = item.substring(colonpos+1, colonpos2);
+                                String v = item.substring(colonpos2+1);
+                                int p = oneOf(m,
+                                        "",
+                                        "ocsp",         //1
+                                        "caIssuers",    //2
+                                        "timeStamping", //3
+                                        "",
+                                        "caRepository"  //5
+                                        );
+                                ObjectIdentifier oid;
+                                if (p < 0) {
+                                    try {
+                                        oid = new ObjectIdentifier(m);
+                                    } catch (Exception e) {
+                                        throw new Exception(rb.getString(
+                                                "Unknown.AccessDescription.type.") + m);
+                                    }
+                                } else {
+                                    oid = new ObjectIdentifier("1.3.6.1.5.5.7.48." + p);
+                                }
+                                accessDescriptions.add(new AccessDescription(
+                                        oid, createGeneralName(t, v)));
+                            }
+                            if (exttype == 5) {
+                                ext.set(SubjectInfoAccessExtension.NAME,
+                                        new SubjectInfoAccessExtension(accessDescriptions));
+                            } else {
+                                ext.set(AuthorityInfoAccessExtension.NAME,
+                                        new AuthorityInfoAccessExtension(accessDescriptions));
+                            }
+                        } else {
+                            throw new Exception(rb.getString
+                                    ("Illegal.value.") + extstr);
+                        }
+                        break;
+                    case 8: // CRL, experimental, only support 1 distributionpoint
+                        if(value != null) {
+                            String[] ps = value.split(",");
+                            GeneralNames gnames = new GeneralNames();
+                            for(String item: ps) {
+                                colonpos = item.indexOf(':');
+                                if (colonpos < 0) {
+                                    throw new Exception("Illegal item " + item + " in " + extstr);
+                                }
+                                String t = item.substring(0, colonpos);
+                                String v = item.substring(colonpos+1);
+                                gnames.add(createGeneralName(t, v));
+                            }
+                            ext.set(CRLDistributionPointsExtension.NAME,
+                                    new CRLDistributionPointsExtension(
+                                        isCritical, Collections.singletonList(
+                                        new DistributionPoint(gnames, null, null))));
+                        } else {
+                            throw new Exception(rb.getString
+                                    ("Illegal.value.") + extstr);
+                        }
+                        break;
+                    case -1:
+                        ObjectIdentifier oid = new ObjectIdentifier(name);
+                        byte[] data = null;
+                        if (value != null) {
+                            data = new byte[value.length() / 2 + 1];
+                            int pos = 0;
+                            for (char c: value.toCharArray()) {
+                                int hex;
+                                if (c >= '0' && c <= '9') {
+                                    hex = c - '0' ;
+                                } else if (c >= 'A' && c <= 'F') {
+                                    hex = c - 'A' + 10;
+                                } else if (c >= 'a' && c <= 'f') {
+                                    hex = c - 'a' + 10;
+                                } else {
+                                    continue;
+                                }
+                                if (pos % 2 == 0) {
+                                    data[pos/2] = (byte)(hex << 4);
+                                } else {
+                                    data[pos/2] += hex;
+                                }
+                                pos++;
+                            }
+                            if (pos % 2 != 0) {
+                                throw new Exception(rb.getString(
+                                        "Odd.number.of.hex.digits.found.") + extstr);
+                            }
+                            data = Arrays.copyOf(data, pos/2);
+                        } else {
+                            data = new byte[0];
+                        }
+                        ext.set(oid.toString(), new Extension(oid, isCritical,
+                                new DerValue(DerValue.tag_OctetString, data)
+                                        .toByteArray()));
+                        break;
+                    default:
+                        throw new Exception(rb.getString(
+                                "Unknown.extension.type.") + extstr);
+                }
+            }
+            // always non-critical
+            ext.set(SubjectKeyIdentifierExtension.NAME,
+                    new SubjectKeyIdentifierExtension(
+                        new KeyIdentifier(pkey).getIdentifier()));
+            if (akey != null && !pkey.equals(akey)) {
+                ext.set(AuthorityKeyIdentifierExtension.NAME,
+                        new AuthorityKeyIdentifierExtension(
+                        new KeyIdentifier(akey), null, null));
+            }
+        } catch(IOException e) {
+            throw new RuntimeException(e);
+        }
+        return ext;
+    }
+
+    /**
+     * Prints the usage of this tool.
+     */
+    private void usage() {
+        if (command != null) {
+            System.err.println("keytool " + command +
+                    rb.getString(".OPTION."));
+            System.err.println();
+            System.err.println(rb.getString(command.description));
+            System.err.println();
+            System.err.println(rb.getString("Options."));
+            System.err.println();
+
+            // Left and right sides of the options list
+            String[] left = new String[command.options.length];
+            String[] right = new String[command.options.length];
+
+            // Check if there's an unknown option
+            boolean found = false;
+
+            // Length of left side of options list
+            int lenLeft = 0;
+            for (int j=0; j<left.length; j++) {
+                Option opt = command.options[j];
+                left[j] = opt.toString();
+                if (opt.arg != null) left[j] += " " + opt.arg;
+                if (left[j].length() > lenLeft) {
+                    lenLeft = left[j].length();
+                }
+                right[j] = rb.getString(opt.description);
+            }
+            for (int j=0; j<left.length; j++) {
+                System.err.printf(" %-" + lenLeft + "s  %s\n",
+                        left[j], right[j]);
+            }
+            System.err.println();
+            System.err.println(rb.getString(
+                    "Use.keytool.help.for.all.available.commands"));
+        } else {
+            System.err.println(rb.getString(
+                    "Key.and.Certificate.Management.Tool"));
+            System.err.println();
+            System.err.println(rb.getString("Commands."));
+            System.err.println();
+            for (Command c: Command.values()) {
+                if (c == KEYCLONE) break;
+                System.err.printf(" %-20s%s\n", c, rb.getString(c.description));
+            }
+            System.err.println();
+            System.err.println(rb.getString(
+                    "Use.keytool.command.name.help.for.usage.of.command.name"));
+        }
+    }
+
+    private void tinyHelp() {
+        usage();
+        if (debug) {
+            throw new RuntimeException("NO BIG ERROR, SORRY");
+        } else {
+            System.exit(1);
+        }
+    }
+
+    private void errorNeedArgument(String flag) {
+        Object[] source = {flag};
+        System.err.println(new MessageFormat(
+                rb.getString("Command.option.flag.needs.an.argument.")).format(source));
+        tinyHelp();
+    }
+
+    private char[] getPass(String modifier, String arg) {
+        char[] output = KeyStoreUtil.getPassWithModifier(modifier, arg, rb);
+        if (output != null) return output;
+        tinyHelp();
+        return null;    // Useless, tinyHelp() already exits.
+    }
+}
+
+// This class is exactly the same as com.sun.tools.javac.util.Pair,
+// it's copied here since the original one is not included in JRE.
+class Pair<A, B> {
+
+    public final A fst;
+    public final B snd;
+
+    public Pair(A fst, B snd) {
+        this.fst = fst;
+        this.snd = snd;
+    }
+
+    public String toString() {
+        return "Pair[" + fst + "," + snd + "]";
+    }
+
+    public boolean equals(Object other) {
+        return
+            other instanceof Pair &&
+            Objects.equals(fst, ((Pair)other).fst) &&
+            Objects.equals(snd, ((Pair)other).snd);
+    }
+
+    public int hashCode() {
+        if (fst == null) return (snd == null) ? 0 : snd.hashCode() + 1;
+        else if (snd == null) return fst.hashCode() + 2;
+        else return fst.hashCode() * 17 + snd.hashCode();
+    }
+
+    public static <A,B> Pair<A,B> of(A a, B b) {
+        return new Pair<>(a,b);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,438 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+        {".OPTION.", " [OPTION]..."},
+        {"Options.", "Options:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "Use \"keytool -help\" for all available commands"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Key and Certificate Management Tool"},
+        {"Commands.", "Commands:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "Use \"keytool -command_name -help\" for usage of command_name"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "Generates a certificate request"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "Changes an entry's alias"}, //-changealias
+        {"Deletes.an.entry",
+                "Deletes an entry"}, //-delete
+        {"Exports.certificate",
+                "Exports certificate"}, //-exportcert
+        {"Generates.a.key.pair",
+                "Generates a key pair"}, //-genkeypair
+        {"Generates.a.secret.key",
+                "Generates a secret key"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "Generates certificate from a certificate request"}, //-gencert
+        {"Generates.CRL", "Generates CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Imports entries from a JDK 1.1.x-style identity database"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Imports a certificate or a certificate chain"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Imports one or all entries from another keystore"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Clones a key entry"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "Changes the key password of an entry"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "Lists entries in a keystore"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Prints the content of a certificate"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Prints the content of a certificate request"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Prints the content of a CRL file"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "Generates a self-signed certificate"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "Changes the store password of a keystore"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "alias name of the entry to process"}, //-alias
+        {"destination.alias",
+                "destination alias"}, //-destalias
+        {"destination.key.password",
+                "destination key password"}, //-destkeypass
+        {"destination.keystore.name",
+                "destination keystore name"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "destination keystore password protected"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "destination keystore provider name"}, //-destprovidername
+        {"destination.keystore.password",
+                "destination keystore password"}, //-deststorepass
+        {"destination.keystore.type",
+                "destination keystore type"}, //-deststoretype
+        {"distinguished.name",
+                "distinguished name"}, //-dname
+        {"X.509.extension",
+                "X.509 extension"}, //-ext
+        {"output.file.name",
+                "output file name"}, //-file and -outfile
+        {"input.file.name",
+                "input file name"}, //-file and -infile
+        {"key.algorithm.name",
+                "key algorithm name"}, //-keyalg
+        {"key.password",
+                "key password"}, //-keypass
+        {"key.bit.size",
+                "key bit size"}, //-keysize
+        {"keystore.name",
+                "keystore name"}, //-keystore
+        {"new.password",
+                "new password"}, //-new
+        {"do.not.prompt",
+                "do not prompt"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "password through protected mechanism"}, //-protected
+        {"provider.argument",
+                "provider argument"}, //-providerarg
+        {"provider.class.name",
+                "provider class name"}, //-providerclass
+        {"provider.name",
+                "provider name"}, //-providername
+        {"provider.classpath",
+                "provider classpath"}, //-providerpath
+        {"output.in.RFC.style",
+                "output in RFC style"}, //-rfc
+        {"signature.algorithm.name",
+                "signature algorithm name"}, //-sigalg
+        {"source.alias",
+                "source alias"}, //-srcalias
+        {"source.key.password",
+                "source key password"}, //-srckeypass
+        {"source.keystore.name",
+                "source keystore name"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "source keystore password protected"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "source keystore provider name"}, //-srcprovidername
+        {"source.keystore.password",
+                "source keystore password"}, //-srcstorepass
+        {"source.keystore.type",
+                "source keystore type"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL server host and port"}, //-sslserver
+        {"signed.jar.file",
+                "signed jar file"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "certificate validity start date/time"}, //-startdate
+        {"keystore.password",
+                "keystore password"}, //-storepass
+        {"keystore.type",
+                "keystore type"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "trust certificates from cacerts"}, //-trustcacerts
+        {"verbose.output",
+                "verbose output"}, //-v
+        {"validity.number.of.days",
+                "validity number of days"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "Serial ID of cert to revoke"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "keytool error: "},
+        {"Illegal.option.", "Illegal option:  "},
+        {"Illegal.value.", "Illegal value: "},
+        {"Unknown.password.type.", "Unknown password type: "},
+        {"Cannot.find.environment.variable.",
+                "Cannot find environment variable: "},
+        {"Cannot.find.file.", "Cannot find file: "},
+        {"Command.option.flag.needs.an.argument.", "Command option {0} needs an argument."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Warning:  Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified {0} value."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore must be NONE if -storetype is {0}"},
+        {"Too.many.retries.program.terminated",
+                 "Too many retries, program terminated"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "-storepasswd and -keypasswd commands not supported if -storetype is {0}"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "-keypasswd commands not supported if -storetype is PKCS12"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-keypass and -new can not be specified if -storetype is {0}"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "if -protected is specified, then -storepass, -keypass, and -new must not be specified"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "if -srcprotected is specified, then -srcstorepass and -srckeypass must not be specified"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "if keystore is not password protected, then -storepass, -keypass, and -new must not be specified"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "if source keystore is not password protected, then -srcstorepass and -srckeypass must not be specified"},
+        {"Illegal.startdate.value", "Illegal startdate value"},
+        {"Validity.must.be.greater.than.zero",
+                "Validity must be greater than zero"},
+        {"provName.not.a.provider", "{0} not a provider"},
+        {"Usage.error.no.command.provided", "Usage error: no command provided"},
+        {"Source.keystore.file.exists.but.is.empty.", "Source keystore file exists, but is empty: "},
+        {"Please.specify.srckeystore", "Please specify -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "Must not specify both -v and -rfc with 'list' command"},
+        {"Key.password.must.be.at.least.6.characters",
+                "Key password must be at least 6 characters"},
+        {"New.password.must.be.at.least.6.characters",
+                "New password must be at least 6 characters"},
+        {"Keystore.file.exists.but.is.empty.",
+                "Keystore file exists, but is empty: "},
+        {"Keystore.file.does.not.exist.",
+                "Keystore file does not exist: "},
+        {"Must.specify.destination.alias", "Must specify destination alias"},
+        {"Must.specify.alias", "Must specify alias"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "Keystore password must be at least 6 characters"},
+        {"Enter.keystore.password.", "Enter keystore password:  "},
+        {"Enter.source.keystore.password.", "Enter source keystore password:  "},
+        {"Enter.destination.keystore.password.", "Enter destination keystore password:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "Keystore password is too short - must be at least 6 characters"},
+        {"Unknown.Entry.Type", "Unknown Entry Type"},
+        {"Too.many.failures.Alias.not.changed", "Too many failures. Alias not changed"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "Entry for alias {0} successfully imported."},
+        {"Entry.for.alias.alias.not.imported.", "Entry for alias {0} not imported."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Problem importing entry for alias {0}: {1}.\nEntry for alias {0} not imported."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Import command completed:  {0} entries successfully imported, {1} entries failed or cancelled"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Warning: Overwriting existing alias {0} in destination keystore"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "Existing entry alias {0} exists, overwrite? [no]:  "},
+        {"Too.many.failures.try.later", "Too many failures - try later"},
+        {"Certification.request.stored.in.file.filename.",
+                "Certification request stored in file <{0}>"},
+        {"Submit.this.to.your.CA", "Submit this to your CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "if alias not specified, destalias, srckeypass, and destkeypass must not be specified"},
+        {"Certificate.stored.in.file.filename.",
+                "Certificate stored in file <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "Certificate reply was installed in keystore"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "Certificate reply was not installed in keystore"},
+        {"Certificate.was.added.to.keystore",
+                "Certificate was added to keystore"},
+        {"Certificate.was.not.added.to.keystore",
+                "Certificate was not added to keystore"},
+        {".Storing.ksfname.", "[Storing {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} has no public key (certificate)"},
+        {"Cannot.derive.signature.algorithm",
+                "Cannot derive signature algorithm"},
+        {"Alias.alias.does.not.exist",
+                "Alias <{0}> does not exist"},
+        {"Alias.alias.has.no.certificate",
+                "Alias <{0}> has no certificate"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "Key pair not generated, alias <{0}> already exists"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "Generating {0} bit {1} key pair and self-signed certificate ({2}) with a validity of {3} days\n\tfor: {4}"},
+        {"Enter.key.password.for.alias.", "Enter key password for <{0}>"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(RETURN if same as keystore password):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "Key password is too short - must be at least 6 characters"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "Too many failures - key not added to keystore"},
+        {"Destination.alias.dest.already.exists",
+                "Destination alias <{0}> already exists"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "Password is too short - must be at least 6 characters"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "Too many failures. Key entry not cloned"},
+        {"key.password.for.alias.", "key password for <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "Keystore entry for <{0}> already exists"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Creating keystore entry for <{0}> ..."},
+        {"No.entries.from.identity.database.added",
+                "No entries from identity database added"},
+        {"Alias.name.alias", "Alias name: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Creation date: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Entry type: {0}"},
+        {"Certificate.chain.length.", "Certificate chain length: "},
+        {"Certificate.i.1.", "Certificate[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Certificate fingerprint (SHA1): "},
+        {"Keystore.type.", "Keystore type: "},
+        {"Keystore.provider.", "Keystore provider: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Your keystore contains {0,number,integer} entry"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Your keystore contains {0,number,integer} entries"},
+        {"Failed.to.parse.input", "Failed to parse input"},
+        {"Empty.input", "Empty input"},
+        {"Not.X.509.certificate", "Not X.509 certificate"},
+        {"alias.has.no.public.key", "{0} has no public key"},
+        {"alias.has.no.X.509.certificate", "{0} has no X.509 certificate"},
+        {"New.certificate.self.signed.", "New certificate (self-signed):"},
+        {"Reply.has.no.certificates", "Reply has no certificates"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Certificate not imported, alias <{0}> already exists"},
+        {"Input.not.an.X.509.certificate", "Input not an X.509 certificate"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "Certificate already exists in keystore under alias <{0}>"},
+        {"Do.you.still.want.to.add.it.no.",
+                "Do you still want to add it? [no]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "Certificate already exists in system-wide CA keystore under alias <{0}>"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "Do you still want to add it to your own keystore? [no]:  "},
+        {"Trust.this.certificate.no.", "Trust this certificate? [no]:  "},
+        {"YES", "YES"},
+        {"New.prompt.", "New {0}: "},
+        {"Passwords.must.differ", "Passwords must differ"},
+        {"Re.enter.new.prompt.", "Re-enter new {0}: "},
+        {"Re.enter.new.password.", "Re-enter new password: "},
+        {"They.don.t.match.Try.again", "They don't match. Try again"},
+        {"Enter.prompt.alias.name.", "Enter {0} alias name:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Enter new alias name\t(RETURN to cancel import for this entry):  "},
+        {"Enter.alias.name.", "Enter alias name:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(RETURN if same as for <{0}>)"},
+        {".PATTERN.printX509Cert",
+                "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Signature algorithm name: {8}\n\t Version: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "What is your first and last name?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "What is the name of your organizational unit?"},
+        {"What.is.the.name.of.your.organization.",
+                "What is the name of your organization?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "What is the name of your City or Locality?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "What is the name of your State or Province?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "What is the two-letter country code for this unit?"},
+        {"Is.name.correct.", "Is {0} correct?"},
+        {"no", "no"},
+        {"yes", "yes"},
+        {"y", "y"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "Alias <{0}> has no key"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "Alias <{0}> references an entry type that is not a private key entry.  The -keyclone command only supports cloning of private key entries"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  WARNING WARNING WARNING  *****************"},
+        {"Signer.d.", "Signer #%d:"},
+        {"Timestamp.", "Timestamp:"},
+        {"Signature.", "Signature:"},
+        {"CRLs.", "CRLs:"},
+        {"Certificate.owner.", "Certificate owner: "},
+        {"Not.a.signed.jar.file", "Not a signed jar file"},
+        {"No.certificate.from.the.SSL.server",
+                "No certificate from the SSL server"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* The integrity of the information stored in your keystore  *\n" +
+            "* has NOT been verified!  In order to verify its integrity, *\n" +
+            "* you must provide your keystore password.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* The integrity of the information stored in the srckeystore*\n" +
+            "* has NOT been verified!  In order to verify its integrity, *\n" +
+            "* you must provide the srckeystore password.                *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "Certificate reply does not contain public key for <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Incomplete certificate chain in reply"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "Certificate chain in reply does not verify: "},
+        {"Top.level.certificate.in.reply.",
+                "Top-level certificate in reply:\n"},
+        {".is.not.trusted.", "... is not trusted. "},
+        {"Install.reply.anyway.no.", "Install reply anyway? [no]:  "},
+        {"NO", "NO"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "Public keys in reply and keystore don't match"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "Certificate reply and certificate in keystore are identical"},
+        {"Failed.to.establish.chain.from.reply",
+                "Failed to establish chain from reply"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "Wrong answer, try again"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "Secret Key not generated, alias <{0}> already exists"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Please provide -keysize for secret key generation"},
+
+        {"verified.by.s.in.s", "Verified by %s in %s"},
+        {"warning.not.verified.make.sure.keystore.is.correct",
+            "WARNING: not verified. Make sure -keystore is correct."},
+
+        {"Extensions.", "Extensions: "},
+        {".Empty.value.", "(Empty value)"},
+        {"Extension.Request.", "Extension Request:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10 Certificate Request (Version 1.0)\n" +
+                "Subject: %s\nPublic Key: %s format %s key\n"},
+        {"Unknown.keyUsage.type.", "Unknown keyUsage type: "},
+        {"Unknown.extendedkeyUsage.type.", "Unknown extendedkeyUsage type: "},
+        {"Unknown.AccessDescription.type.", "Unknown AccessDescription type: "},
+        {"Unrecognized.GeneralName.type.", "Unrecognized GeneralName type: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "This extension cannot be marked as critical. "},
+        {"Odd.number.of.hex.digits.found.", "Odd number of hex digits found: "},
+        {"Unknown.extension.type.", "Unknown extension type: "},
+        {"command.{0}.is.ambiguous.", "command {0} is ambiguous:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_de.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_de extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [Option]..."},
+        {"Options.", "Optionen:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "\"keytool -help\" f\u00FCr alle verf\u00FCgbaren Befehle verwenden"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Schl\u00FCssel- und Zertifikatsverwaltungstool"},
+        {"Commands.", "Befehle:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "\"keytool -command_name -help\" f\u00FCr Verwendung von command_name verwenden"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "Generiert eine Zertifikatanforderung"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\u00C4ndert den Alias eines Eintrags"}, //-changealias
+        {"Deletes.an.entry",
+                "L\u00F6scht einen Eintrag"}, //-delete
+        {"Exports.certificate",
+                "Exportiert ein Zertifikat"}, //-exportcert
+        {"Generates.a.key.pair",
+                "Generiert ein Schl\u00FCsselpaar"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "Generiert einen Secret Key"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "Generiert ein Zertifikat aus einer Zertifikatanforderung"}, //-gencert
+        {"Generates.CRL", "Generiert eine CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Importiert Eintr\u00E4ge aus einer Identity-Datenbank im JDK 1.1.x-Stil"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Importiert ein Zertifikat oder eine Zertifikatkette"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Importiert einen oder alle Eintr\u00E4ge aus einem anderen Keystore"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Clont einen Schl\u00FCsseleintrag"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\u00C4ndert das Schl\u00FCsselkennwort eines Eintrags"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "Listet die Eintr\u00E4ge in einem Keystore auf"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Druckt den Content eines Zertifikats"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Druckt den Content einer Zertifikatanforderung"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Druckt den Content einer CRL-Datei"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "Generiert ein selbst signiertes Zertifikat"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\u00C4ndert das Speicherkennwort eines Keystores"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "Aliasname des zu verarbeitenden Eintrags"}, //-alias
+        {"destination.alias",
+                "Zielalias"}, //-destalias
+        {"destination.key.password",
+                "Zielschl\u00FCssel-Kennwort"}, //-destkeypass
+        {"destination.keystore.name",
+                "Ziel-Keystore-Name"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "Ziel-Keystore kennwortgesch\u00FCtzt"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "Ziel-Keystore-Providername"}, //-destprovidername
+        {"destination.keystore.password",
+                "Ziel-Keystore-Kennwort"}, //-deststorepass
+        {"destination.keystore.type",
+                "Ziel-Keystore-Typ"}, //-deststoretype
+        {"distinguished.name",
+                "Distinguished Name"}, //-dname
+        {"X.509.extension",
+                "X.509-Erweiterung"}, //-ext
+        {"output.file.name",
+                "Ausgabedateiname"}, //-file and -outfile
+        {"input.file.name",
+                "Eingabedateiname"}, //-file and -infile
+        {"key.algorithm.name",
+                "Schl\u00FCsselalgorithmusname"}, //-keyalg
+        {"key.password",
+                "Schl\u00FCsselkennwort"}, //-keypass
+        {"key.bit.size",
+                "Schl\u00FCsselbitgr\u00F6\u00DFe"}, //-keysize
+        {"keystore.name",
+                "Keystore-Name"}, //-keystore
+        {"new.password",
+                "Neues Kennwort"}, //-new
+        {"do.not.prompt",
+                "Kein Prompt"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "Kennwort \u00FCber gesch\u00FCtzten Mechanismus"}, //-protected
+        {"provider.argument",
+                "Providerargument"}, //-providerarg
+        {"provider.class.name",
+                "Providerklassenname"}, //-providerclass
+        {"provider.name",
+                "Providername"}, //-providername
+        {"provider.classpath",
+                "Provider-Classpath"}, //-providerpath
+        {"output.in.RFC.style",
+                "Ausgabe in RFC-Stil"}, //-rfc
+        {"signature.algorithm.name",
+                "Signaturalgorithmusname"}, //-sigalg
+        {"source.alias",
+                "Quellalias"}, //-srcalias
+        {"source.key.password",
+                "Quellschl\u00FCssel-Kennwort"}, //-srckeypass
+        {"source.keystore.name",
+                "Quell-Keystore-Name"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "Quell-Keystore kennwortgesch\u00FCtzt"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "Quell-Keystore-Providername"}, //-srcprovidername
+        {"source.keystore.password",
+                "Quell-Keystore-Kennwort"}, //-srcstorepass
+        {"source.keystore.type",
+                "Quell-Keystore-Typ"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL-Serverhost und -port"}, //-sslserver
+        {"signed.jar.file",
+                "Signierte JAR-Datei"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "Anfangsdatum/-zeit f\u00FCr Zertifikatsg\u00FCltigkeit"}, //-startdate
+        {"keystore.password",
+                "Keystore-Kennwort"}, //-storepass
+        {"keystore.type",
+                "Keystore-Typ"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "Zertifikaten aus cacerts vertrauen"}, //-trustcacerts
+        {"verbose.output",
+                "Verbose-Ausgabe"}, //-v
+        {"validity.number.of.days",
+                "G\u00FCltigkeitsdauer (Tage)"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "Serielle ID des zu entziehenden Certs"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "Keytool-Fehler: "},
+        {"Illegal.option.", "Ung\u00FCltige Option:  "},
+        {"Illegal.value.", "Ung\u00FCltiger Wert: "},
+        {"Unknown.password.type.", "Unbekannter Kennworttyp: "},
+        {"Cannot.find.environment.variable.",
+                "Umgebungsvariable kann nicht gefunden werden: "},
+        {"Cannot.find.file.", "Datei kann nicht gefunden werden: "},
+        {"Command.option.flag.needs.an.argument.", "Befehlsoption {0} ben\u00F6tigt ein Argument."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Warnung: Keine Unterst\u00FCtzung f\u00FCr unterschiedliche Speicher- und Schl\u00FCsselkennw\u00F6rter bei PKCS12 KeyStores. Der benutzerdefinierte Wert {0} wird ignoriert."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore muss NONE sein, wenn -storetype {0} ist"},
+        {"Too.many.retries.program.terminated",
+                 "Zu viele erneute Versuche. Programm wird beendet"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "Befehle -storepasswd und -keypasswd werden nicht unterst\u00FCtzt, wenn -storetype {0} ist"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "Befehle des Typs -keypasswd werden nicht unterst\u00FCtzt, wenn -storetype PKCS12 ist"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-keypass und -new k\u00F6nnen nicht angegeben werden, wenn -storetype {0} ist"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "Wenn -protected angegeben ist, d\u00FCrfen -storepass, -keypass und -new nicht angegeben werden"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Wenn -srcprotected angegeben ist, d\u00FCrfen -srcstorepass und -srckeypass nicht angegeben werden"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "Wenn der Keystore nicht kennwortgesch\u00FCtzt ist, d\u00FCrfen -storepass, -keypass und -new nicht angegeben werden"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Wenn der Quell-Keystore nicht kennwortgesch\u00FCtzt ist, d\u00FCrfen -srcstorepass und -srckeypass nicht angegeben werden"},
+        {"Illegal.startdate.value", "Ung\u00FCltiger Wert f\u00FCr Anfangsdatum"},
+        {"Validity.must.be.greater.than.zero",
+                "G\u00FCltigkeit muss gr\u00F6\u00DFer als null sein"},
+        {"provName.not.a.provider", "{0} kein Provider"},
+        {"Usage.error.no.command.provided", "Verwendungsfehler: Kein Befehl angegeben"},
+        {"Source.keystore.file.exists.but.is.empty.", "Quell-Keystore-Datei ist zwar vorhanden, ist aber leer: "},
+        {"Please.specify.srckeystore", "Geben Sie -srckeystore an"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "-v und -rfc d\u00FCrfen bei Befehl \"list\" nicht beide angegeben werden"},
+        {"Key.password.must.be.at.least.6.characters",
+                "Schl\u00FCsselkennwort muss mindestens sechs Zeichen lang sein"},
+        {"New.password.must.be.at.least.6.characters",
+                "Neues Kennwort muss mindestens sechs Zeichen lang sein"},
+        {"Keystore.file.exists.but.is.empty.",
+                "Keystore-Datei ist vorhanden, ist aber leer: "},
+        {"Keystore.file.does.not.exist.",
+                "Keystore-Datei ist nicht vorhanden: "},
+        {"Must.specify.destination.alias", "Sie m\u00FCssen einen Zielalias angeben"},
+        {"Must.specify.alias", "Sie m\u00FCssen einen Alias angeben"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "Keystore-Kennwort muss mindestens sechs Zeichen lang sein"},
+        {"Enter.keystore.password.", "Keystore-Kennwort eingeben:  "},
+        {"Enter.source.keystore.password.", "Quell-Keystore-Kennwort eingeben:  "},
+        {"Enter.destination.keystore.password.", "Ziel-Keystore-Kennwort eingeben:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "Keystore-Kennwort ist zu kurz. Es muss mindestens sechs Zeichen lang sein"},
+        {"Unknown.Entry.Type", "Unbekannter Eintragstyp"},
+        {"Too.many.failures.Alias.not.changed", "Zu viele Fehler. Alias nicht ge\u00E4ndert"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "Eintrag f\u00FCr Alias {0} erfolgreich importiert."},
+        {"Entry.for.alias.alias.not.imported.", "Eintrag f\u00FCr Alias {0} nicht importiert."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Problem beim Importieren des Eintrags f\u00FCr Alias {0}: {1}.\nEintrag f\u00FCr Alias {0} nicht importiert."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Importbefehl abgeschlossen: {0} Eintr\u00E4ge erfolgreich importiert, {1} Eintr\u00E4ge nicht erfolgreich oder abgebrochen"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Warnung: Vorhandener Alias {0} in Ziel-Keystore wird \u00FCberschrieben"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "Eintragsalias {0} ist bereits vorhanden. \u00DCberschreiben? [Nein]:  "},
+        {"Too.many.failures.try.later", "Zu viele Fehler. Versuchen Sie es sp\u00E4ter erneut"},
+        {"Certification.request.stored.in.file.filename.",
+                "Zertifizierungsanforderung in Datei <{0}> gespeichert"},
+        {"Submit.this.to.your.CA", "Leiten Sie dies an die CA weiter"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "Wenn kein Alias angegeben ist, d\u00FCrfen destalias, srckeypass und destkeypass nicht angegeben werden"},
+        {"Certificate.stored.in.file.filename.",
+                "Zertifikat in Datei <{0}> gespeichert"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "Zertifikatantwort wurde in Keystore installiert"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "Zertifikatantwort wurde nicht in Keystore installiert"},
+        {"Certificate.was.added.to.keystore",
+                "Zertifikat wurde Keystore hinzugef\u00FCgt"},
+        {"Certificate.was.not.added.to.keystore",
+                "Zertifikat wurde nicht zu Keystore hinzugef\u00FCgt"},
+        {".Storing.ksfname.", "[{0} wird gesichert]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} hat keinen Public Key (Zertifikat)"},
+        {"Cannot.derive.signature.algorithm",
+                "Signaturalgorithmus kann nicht abgeleitet werden"},
+        {"Alias.alias.does.not.exist",
+                "Alias <{0}> ist nicht vorhanden"},
+        {"Alias.alias.has.no.certificate",
+                "Alias <{0}> hat kein Zertifikat"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "Schl\u00FCsselpaar wurde nicht generiert. Alias <{0}> ist bereits vorhanden"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "Generieren von Schl\u00FCsselpaar (Typ {1}, {0} Bit) und selbst signiertem Zertifikat ({2}) mit einer G\u00FCltigkeit von {3} Tagen\n\tf\u00FCr: {4}"},
+        {"Enter.key.password.for.alias.", "Schl\u00FCsselkennwort f\u00FCr <{0}> eingeben"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(RETURN, wenn identisch mit Keystore-Kennwort):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "Schl\u00FCsselkennwort ist zu kurz. Es muss mindestens sechs Zeichen lang sein"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "Zu viele Fehler. Schl\u00FCssel wurde nicht zu Keystore hinzugef\u00FCgt"},
+        {"Destination.alias.dest.already.exists",
+                "Zielalias <{0}> bereits vorhanden"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "Kennwort ist zu kurz. Es muss mindestens sechs Zeichen lang sein"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "Zu viele Fehler. Schl\u00FCsseleintrag wurde nicht geclont"},
+        {"key.password.for.alias.", "Schl\u00FCsselkennwort f\u00FCr <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "Keystore-Eintrag f\u00FCr <{0}> bereits vorhanden"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Keystore-Eintrag f\u00FCr <{0}> wird erstellt..."},
+        {"No.entries.from.identity.database.added",
+                "Keine Eintr\u00E4ge aus Identity-Datenbank hinzugef\u00FCgt"},
+        {"Alias.name.alias", "Aliasname: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Erstellungsdatum: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Eintragstyp: {0}"},
+        {"Certificate.chain.length.", "Zertifikatkettenl\u00E4nge: "},
+        {"Certificate.i.1.", "Zertifikat[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Zertifikat-Fingerprint (SHA1): "},
+        {"Keystore.type.", "Keystore-Typ: "},
+        {"Keystore.provider.", "Keystore-Provider: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Keystore enth\u00E4lt {0,number,integer} Eintrag"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Keystore enth\u00E4lt {0,number,integer} Eintr\u00E4ge"},
+        {"Failed.to.parse.input", "Eingabe konnte nicht geparst werden"},
+        {"Empty.input", "Leere Eingabe"},
+        {"Not.X.509.certificate", "Kein X.509-Zertifikat"},
+        {"alias.has.no.public.key", "{0} hat keinen Public Key"},
+        {"alias.has.no.X.509.certificate", "{0} hat kein X.509-Zertifikat"},
+        {"New.certificate.self.signed.", "Neues Zertifikat (selbst signiert):"},
+        {"Reply.has.no.certificates", "Antwort hat keine Zertifikate"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Zertifikat nicht importiert. Alias <{0}> ist bereits vorhanden"},
+        {"Input.not.an.X.509.certificate", "Eingabe kein X.509-Zertifikat"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "Zertifikat ist bereits unter Alias <{0}> im Keystore vorhanden"},
+        {"Do.you.still.want.to.add.it.no.",
+                "M\u00F6chten Sie es trotzdem hinzuf\u00FCgen? [Nein]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "Zertifikat ist bereits unter Alias <{0}> im systemweiten CA-Keystore vorhanden"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "M\u00F6chten Sie es trotzdem zu Ihrem eigenen Keystore hinzuf\u00FCgen? [Nein]:  "},
+        {"Trust.this.certificate.no.", "Diesem Zertifikat vertrauen? [Nein]:  "},
+        {"YES", "Ja"},
+        {"New.prompt.", "Neues {0}: "},
+        {"Passwords.must.differ", "Kennw\u00F6rter m\u00FCssen sich unterscheiden"},
+        {"Re.enter.new.prompt.", "Neues {0} erneut eingeben: "},
+        {"Re.enter.new.password.", "Neues Kennwort erneut eingeben: "},
+        {"They.don.t.match.Try.again", "Keine \u00DCbereinstimmung. Wiederholen Sie den Vorgang"},
+        {"Enter.prompt.alias.name.", "{0}-Aliasnamen eingeben:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Geben Sie einen neuen Aliasnamen ein\t(RETURN, um den Import dieses Eintrags abzubrechen):  "},
+        {"Enter.alias.name.", "Aliasnamen eingeben:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(RETURN, wenn identisch mit <{0}>)"},
+        {".PATTERN.printX509Cert",
+                "Eigent\u00FCmer: {0}\nAussteller: {1}\nSeriennummer: {2}\nG\u00FCltig von: {3} bis: {4}\nZertifikat-Fingerprints:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Signaturalgorithmusname: {8}\n\t Version: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "Wie lautet Ihr Vor- und Nachname?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "Wie lautet der Name Ihrer organisatorischen Einheit?"},
+        {"What.is.the.name.of.your.organization.",
+                "Wie lautet der Name Ihrer Organisation?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "Wie lautet der Name Ihrer Stadt oder Gemeinde?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "Wie lautet der Name Ihres Bundeslands?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "Wie lautet der L\u00E4ndercode (zwei Buchstaben) f\u00FCr diese Einheit?"},
+        {"Is.name.correct.", "Ist {0} richtig?"},
+        {"no", "Nein"},
+        {"yes", "Ja"},
+        {"y", "J"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "Alias <{0}> verf\u00FCgt \u00FCber keinen Schl\u00FCssel"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "Alias <{0}> verweist auf einen Eintragstyp, der kein Private Key-Eintrag ist. Der Befehl -keyclone unterst\u00FCtzt nur das Clonen von Private Key-Eintr\u00E4gen"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  Warnung Warnung Warnung  *****************"},
+        {"Signer.d.", "Signaturgeber #%d:"},
+        {"Timestamp.", "Zeitstempel:"},
+        {"Signature.", "Signatur:"},
+        {"CRLs.", "CRLs:"},
+        {"Certificate.owner.", "Zertifikateigent\u00FCmer: "},
+        {"Not.a.signed.jar.file", "Keine signierte JAR-Datei"},
+        {"No.certificate.from.the.SSL.server",
+                "Kein Zertifikat vom SSL-Server"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* Die Integrit\u00E4t der Informationen, die in Ihrem Keystore gespeichert sind, *\n* wurde NICHT gepr\u00FCft. Um die Integrit\u00E4t zu pr\u00FCfen, *\n* m\u00FCssen Sie Ihr Keystore-Kennwort angeben.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* Die Integrit\u00E4t der Informationen, die in Ihrem Srckeystore gespeichert sind, *\n* wurde NICHT gepr\u00FCft. Um die Integrit\u00E4t zu pr\u00FCfen, *\n* m\u00FCssen Sie Ihr Srckeystore-Kennwort angeben.                  *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "Zertifikatantwort enth\u00E4lt keinen Public Key f\u00FCr <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Unvollst\u00E4ndige Zertifikatkette in Antwort"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "Zertifikatkette in Antwort verifiziert nicht: "},
+        {"Top.level.certificate.in.reply.",
+                "Zertifikat der obersten Ebene in Antwort:\n"},
+        {".is.not.trusted.", "... ist nicht vertrauensw\u00FCrdig. "},
+        {"Install.reply.anyway.no.", "Antwort trotzdem installieren? [Nein]:  "},
+        {"NO", "Nein"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "Public Keys in Antwort und Keystore stimmen nicht \u00FCberein"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "Zertifikatantwort und Zertifikat in Keystore sind identisch"},
+        {"Failed.to.establish.chain.from.reply",
+                "Kette konnte der Antwort nicht entnommen werden"},
+        {"n", "N"},
+        {"Wrong.answer.try.again", "Falsche Antwort. Wiederholen Sie den Vorgang"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "Secret Key wurde nicht generiert. Alias <{0}> ist bereits vorhanden"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Geben Sie -keysize zum Erstellen eines Secret Keys an"},
+
+        {"Extensions.", "Erweiterungen: "},
+        {".Empty.value.", "(Leerer Wert)"},
+        {"Extension.Request.", "Erweiterungsanforderung:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10-Zertifikatanforderung (Version 1.0)\nSubjekt: %s\nPublic Key: %s Format %s Schl\u00FCssel\n"},
+        {"Unknown.keyUsage.type.", "Unbekannter keyUsage-Typ: "},
+        {"Unknown.extendedkeyUsage.type.", "Unbekannter extendedkeyUsage-Typ: "},
+        {"Unknown.AccessDescription.type.", "Unbekannter AccessDescription-Typ: "},
+        {"Unrecognized.GeneralName.type.", "Unbekannter GeneralName-Typ: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "Erweiterung kann nicht als \"Kritisch\" markiert werden. "},
+        {"Odd.number.of.hex.digits.found.", "Ungerade Anzahl hexadezimaler Ziffern gefunden: "},
+        {"Unknown.extension.type.", "Unbekannter Erweiterungstyp: "},
+        {"command.{0}.is.ambiguous.", "Befehl {0} ist mehrdeutig:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_es.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_es extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [Opci\u00F3n]..."},
+        {"Options.", "Opciones:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "Utilice\"keytool -help\" para todos los comandos disponibles"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Herramienta de Gesti\u00F3n de Certificados y Claves"},
+        {"Commands.", "Comandos:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "Utilice \"keytool -command_name -help\" para la sintaxis de nombre_comando"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "Genera una solicitud de certificado"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "Cambia un alias de entrada"}, //-changealias
+        {"Deletes.an.entry",
+                "Suprime una entrada"}, //-delete
+        {"Exports.certificate",
+                "Exporta el certificado"}, //-exportcert
+        {"Generates.a.key.pair",
+                "Genera un par de claves"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "Genera un clave secreta"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "Genera un certificado a partir de una solicitud de certificado"}, //-gencert
+        {"Generates.CRL", "Genera CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Importa entradas desde una base de datos de identidades JDK 1.1.x-style"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Importa un certificado o una cadena de certificados"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Importa una o todas las entradas desde otro almac\u00E9n de claves"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Clona una entrada de clave"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "Cambia la contrase\u00F1a de clave de una entrada"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "Enumera las entradas de un almac\u00E9n de claves"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Imprime el contenido de un certificado"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Imprime el contenido de una solicitud de certificado"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Imprime el contenido de un archivo CRL"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "Genera un certificado autofirmado"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "Cambia la contrase\u00F1a de almac\u00E9n de un almac\u00E9n de claves"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "nombre de alias de la entrada que se va a procesar"}, //-alias
+        {"destination.alias",
+                "alias de destino"}, //-destalias
+        {"destination.key.password",
+                "contrase\u00F1a de clave de destino"}, //-destkeypass
+        {"destination.keystore.name",
+                "nombre de almac\u00E9n de claves de destino"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "almac\u00E9n de claves de destino protegido por contrase\u00F1a"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "nombre de proveedor de almac\u00E9n de claves de destino"}, //-destprovidername
+        {"destination.keystore.password",
+                "contrase\u00F1a de almac\u00E9n de claves de destino"}, //-deststorepass
+        {"destination.keystore.type",
+                "tipo de almac\u00E9n de claves de destino"}, //-deststoretype
+        {"distinguished.name",
+                "nombre distintivo"}, //-dname
+        {"X.509.extension",
+                "extensi\u00F3n X.509"}, //-ext
+        {"output.file.name",
+                "nombre de archivo de salida"}, //-file and -outfile
+        {"input.file.name",
+                "nombre de archivo de entrada"}, //-file and -infile
+        {"key.algorithm.name",
+                "nombre de algoritmo de clave"}, //-keyalg
+        {"key.password",
+                "contrase\u00F1a de clave"}, //-keypass
+        {"key.bit.size",
+                "tama\u00F1o de bit de clave"}, //-keysize
+        {"keystore.name",
+                "nombre de almac\u00E9n de claves"}, //-keystore
+        {"new.password",
+                "nueva contrase\u00F1a"}, //-new
+        {"do.not.prompt",
+                "no solicitar"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "contrase\u00F1a a trav\u00E9s de mecanismo protegido"}, //-protected
+        {"provider.argument",
+                "argumento del proveedor"}, //-providerarg
+        {"provider.class.name",
+                "nombre de clase del proveedor"}, //-providerclass
+        {"provider.name",
+                "nombre del proveedor"}, //-providername
+        {"provider.classpath",
+                "classpath de proveedor"}, //-providerpath
+        {"output.in.RFC.style",
+                "salida en estilo RFC"}, //-rfc
+        {"signature.algorithm.name",
+                "nombre de algoritmo de firma"}, //-sigalg
+        {"source.alias",
+                "alias de origen"}, //-srcalias
+        {"source.key.password",
+                "contrase\u00F1a de clave de origen"}, //-srckeypass
+        {"source.keystore.name",
+                "nombre de almac\u00E9n de claves de origen"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "almac\u00E9n de claves de origen protegido por contrase\u00F1a"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "nombre de proveedor de almac\u00E9n de claves de origen"}, //-srcprovidername
+        {"source.keystore.password",
+                "contrase\u00F1a de almac\u00E9n de claves de origen"}, //-srcstorepass
+        {"source.keystore.type",
+                "tipo de almac\u00E9n de claves de origen"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "puerto y host del servidor SSL"}, //-sslserver
+        {"signed.jar.file",
+                "archivo jar firmado"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "fecha/hora de inicio de validez del certificado"}, //-startdate
+        {"keystore.password",
+                "contrase\u00F1a de almac\u00E9n de claves"}, //-storepass
+        {"keystore.type",
+                "tipo de almac\u00E9n de claves"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "certificados de protecci\u00F3n de cacerts"}, //-trustcacerts
+        {"verbose.output",
+                "salida detallada"}, //-v
+        {"validity.number.of.days",
+                "n\u00FAmero de validez de d\u00EDas"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "identificador de serie del certificado que se va a revocar"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "error de herramienta de claves: "},
+        {"Illegal.option.", "Opci\u00F3n no permitida:  "},
+        {"Illegal.value.", "Valor no permitido: "},
+        {"Unknown.password.type.", "Tipo de contrase\u00F1a desconocido: "},
+        {"Cannot.find.environment.variable.",
+                "No se ha encontrado la variable del entorno: "},
+        {"Cannot.find.file.", "No se ha encontrado el archivo: "},
+        {"Command.option.flag.needs.an.argument.", "La opci\u00F3n de comando {0} necesita un argumento."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Advertencia: los almacenes de claves en formato PKCS12 no admiten contrase\u00F1as de clave y almacenamiento distintas. Se ignorar\u00E1 el valor especificado por el usuario, {0}."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore debe ser NONE si -storetype es {0}"},
+        {"Too.many.retries.program.terminated",
+                 "Ha habido demasiados intentos, se ha cerrado el programa"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "Los comandos -storepasswd y -keypasswd no est\u00E1n soportados si -storetype es {0}"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "Los comandos -keypasswd no est\u00E1n soportados si -storetype es PKCS12"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-keypass y -new no se pueden especificar si -storetype es {0}"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "si se especifica -protected, no deben especificarse -storepass, -keypass ni -new"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Si se especifica -srcprotected, no se puede especificar -srcstorepass ni -srckeypass"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "Si keystore no est\u00E1 protegido por contrase\u00F1a, no se deben especificar -storepass, -keypass ni -new"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Si el almac\u00E9n de claves de origen no est\u00E1 protegido por contrase\u00F1a, no se deben especificar -srcstorepass ni -srckeypass"},
+        {"Illegal.startdate.value", "Valor de fecha de inicio no permitido"},
+        {"Validity.must.be.greater.than.zero",
+                "La validez debe ser mayor que cero"},
+        {"provName.not.a.provider", "{0} no es un proveedor"},
+        {"Usage.error.no.command.provided", "Error de sintaxis: no se ha proporcionado ning\u00FAn comando"},
+        {"Source.keystore.file.exists.but.is.empty.", "El archivo de almac\u00E9n de claves de origen existe, pero est\u00E1 vac\u00EDo: "},
+        {"Please.specify.srckeystore", "Especifique -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "No se deben especificar -v y -rfc simult\u00E1neamente con el comando 'list'"},
+        {"Key.password.must.be.at.least.6.characters",
+                "La contrase\u00F1a de clave debe tener al menos 6 caracteres"},
+        {"New.password.must.be.at.least.6.characters",
+                "La nueva contrase\u00F1a debe tener al menos 6 caracteres"},
+        {"Keystore.file.exists.but.is.empty.",
+                "El archivo de almac\u00E9n de claves existe, pero est\u00E1 vac\u00EDo: "},
+        {"Keystore.file.does.not.exist.",
+                "El archivo de almac\u00E9n de claves no existe: "},
+        {"Must.specify.destination.alias", "Se debe especificar un alias de destino"},
+        {"Must.specify.alias", "Se debe especificar un alias"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "La contrase\u00F1a del almac\u00E9n de claves debe tener al menos 6 caracteres"},
+        {"Enter.keystore.password.", "Introduzca la contrase\u00F1a del almac\u00E9n de claves:  "},
+        {"Enter.source.keystore.password.", "Introduzca la contrase\u00F1a de almac\u00E9n de claves de origen:  "},
+        {"Enter.destination.keystore.password.", "Introduzca la contrase\u00F1a de almac\u00E9n de claves de destino:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "La contrase\u00F1a del almac\u00E9n de claves es demasiado corta, debe tener al menos 6 caracteres"},
+        {"Unknown.Entry.Type", "Tipo de Entrada Desconocido"},
+        {"Too.many.failures.Alias.not.changed", "Demasiados fallos. No se ha cambiado el alias"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "La entrada del alias {0} se ha importado correctamente."},
+        {"Entry.for.alias.alias.not.imported.", "La entrada del alias {0} no se ha importado."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Problema al importar la entrada del alias {0}: {1}.\nNo se ha importado la entrada del alias {0}."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Comando de importaci\u00F3n completado: {0} entradas importadas correctamente, {1} entradas incorrectas o canceladas"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Advertencia: se sobrescribir\u00E1 el alias {0} en el almac\u00E9n de claves de destino"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "El alias de entrada existente {0} ya existe, \u00BFdesea sobrescribirlo? [no]:  "},
+        {"Too.many.failures.try.later", "Demasiados fallos; int\u00E9ntelo m\u00E1s adelante"},
+        {"Certification.request.stored.in.file.filename.",
+                "Solicitud de certificaci\u00F3n almacenada en el archivo <{0}>"},
+        {"Submit.this.to.your.CA", "Enviar a la CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "si no se especifica el alias, no se puede especificar destalias, srckeypass ni destkeypass"},
+        {"Certificate.stored.in.file.filename.",
+                "Certificado almacenado en el archivo <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "Se ha instalado la respuesta del certificado en el almac\u00E9n de claves"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "No se ha instalado la respuesta del certificado en el almac\u00E9n de claves"},
+        {"Certificate.was.added.to.keystore",
+                "Se ha agregado el certificado al almac\u00E9n de claves"},
+        {"Certificate.was.not.added.to.keystore",
+                "No se ha agregado el certificado al almac\u00E9n de claves"},
+        {".Storing.ksfname.", "[Almacenando {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} no tiene clave p\u00FAblica (certificado)"},
+        {"Cannot.derive.signature.algorithm",
+                "No se puede derivar el algoritmo de firma"},
+        {"Alias.alias.does.not.exist",
+                "El alias <{0}> no existe"},
+        {"Alias.alias.has.no.certificate",
+                "El alias <{0}> no tiene certificado"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "No se ha generado el par de claves, el alias <{0}> ya existe"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "Generando par de claves {1} de {0} bits para certificado autofirmado ({2}) con una validez de {3} d\u00EDas\n\tpara: {4}"},
+        {"Enter.key.password.for.alias.", "Introduzca la contrase\u00F1a de clave para <{0}>"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(INTRO si es la misma contrase\u00F1a que la del almac\u00E9n de claves):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "La contrase\u00F1a de clave es demasiado corta; debe tener al menos 6 caracteres"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "Demasiados fallos; no se ha agregado la clave al almac\u00E9n de claves"},
+        {"Destination.alias.dest.already.exists",
+                "El alias de destino <{0}> ya existe"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "La contrase\u00F1a es demasiado corta; debe tener al menos 6 caracteres"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "Demasiados fallos. No se ha clonado la entrada de clave"},
+        {"key.password.for.alias.", "contrase\u00F1a de clave para <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "La entrada de almac\u00E9n de claves para <{0}> ya existe"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Creando entrada de almac\u00E9n de claves para <{0}> ..."},
+        {"No.entries.from.identity.database.added",
+                "No se han agregado entradas de la base de datos de identidades"},
+        {"Alias.name.alias", "Nombre de Alias: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Fecha de Creaci\u00F3n: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Tipo de Entrada: {0}"},
+        {"Certificate.chain.length.", "Longitud de la Cadena de Certificado: "},
+        {"Certificate.i.1.", "Certificado[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Huella Digital de Certificado (SHA1): "},
+        {"Keystore.type.", "Tipo de Almac\u00E9n de Claves: "},
+        {"Keystore.provider.", "Proveedor de Almac\u00E9n de Claves: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Su almac\u00E9n de claves contiene {0,number,integer} entrada"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Su almac\u00E9n de claves contiene {0,number,integer} entradas"},
+        {"Failed.to.parse.input", "Fallo al analizar la entrada"},
+        {"Empty.input", "Entrada vac\u00EDa"},
+        {"Not.X.509.certificate", "No es un certificado X.509"},
+        {"alias.has.no.public.key", "{0} no tiene clave p\u00FAblica"},
+        {"alias.has.no.X.509.certificate", "{0} no tiene certificado X.509"},
+        {"New.certificate.self.signed.", "Nuevo Certificado (Autofirmado):"},
+        {"Reply.has.no.certificates", "La respuesta no tiene certificados"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Certificado no importado, el alias <{0}> ya existe"},
+        {"Input.not.an.X.509.certificate", "La entrada no es un certificado X.509"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "El certificado ya existe en el almac\u00E9n de claves con el alias <{0}>"},
+        {"Do.you.still.want.to.add.it.no.",
+                "\u00BFA\u00FAn desea agregarlo? [no]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "El certificado ya existe en el almac\u00E9n de claves de la CA del sistema, con el alias <{0}>"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "\u00BFA\u00FAn desea agregarlo a su propio almac\u00E9n de claves? [no]:  "},
+        {"Trust.this.certificate.no.", "\u00BFConfiar en este certificado? [no]:  "},
+        {"YES", "S\u00ED"},
+        {"New.prompt.", "Nuevo {0}: "},
+        {"Passwords.must.differ", "Las contrase\u00F1as deben ser distintas"},
+        {"Re.enter.new.prompt.", "Vuelva a escribir el nuevo {0}: "},
+        {"Re.enter.new.password.", "Volver a escribir la contrase\u00F1a nueva: "},
+        {"They.don.t.match.Try.again", "No coinciden. Int\u00E9ntelo de nuevo"},
+        {"Enter.prompt.alias.name.", "Escriba el nombre de alias de {0}:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Indique el nuevo nombre de alias\t(INTRO para cancelar la importaci\u00F3n de esta entrada):  "},
+        {"Enter.alias.name.", "Introduzca el nombre de alias:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(INTRO si es el mismo que para <{0}>)"},
+        {".PATTERN.printX509Cert",
+                "Propietario: {0}\nEmisor: {1}\nN\u00FAmero de serie: {2}\nV\u00E1lido desde: {3} hasta: {4}\nHuellas digitales del Certificado:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Nombre del Algoritmo de Firma: {8}\n\t Versi\u00F3n: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "\u00BFCu\u00E1les son su nombre y su apellido?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "\u00BFCu\u00E1l es el nombre de su unidad de organizaci\u00F3n?"},
+        {"What.is.the.name.of.your.organization.",
+                "\u00BFCu\u00E1l es el nombre de su organizaci\u00F3n?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "\u00BFCu\u00E1l es el nombre de su ciudad o localidad?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "\u00BFCu\u00E1l es el nombre de su estado o provincia?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "\u00BFCu\u00E1l es el c\u00F3digo de pa\u00EDs de dos letras de la unidad?"},
+        {"Is.name.correct.", "\u00BFEs correcto {0}?"},
+        {"no", "no"},
+        {"yes", "s\u00ED"},
+        {"y", "s"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "El alias <{0}> no tiene clave"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "El alias <{0}> hace referencia a un tipo de entrada que no es una clave privada. El comando -keyclone s\u00F3lo permite la clonaci\u00F3n de entradas de claves privadas"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  Advertencia Advertencia Advertencia  *****************"},
+        {"Signer.d.", "#%d de Firmante:"},
+        {"Timestamp.", "Registro de Hora:"},
+        {"Signature.", "Firma:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "Propietario del Certificado: "},
+        {"Not.a.signed.jar.file", "No es un archivo jar firmado"},
+        {"No.certificate.from.the.SSL.server",
+                "Ning\u00FAn certificado del servidor SSL"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* La integridad de la informaci\u00F3n almacenada en el almac\u00E9n de claves  *\n* NO se ha comprobado.  Para comprobar dicha integridad, *\n* debe proporcionar la contrase\u00F1a del almac\u00E9n de claves.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* La integridad de la informaci\u00F3n almacenada en srckeystore*\n* NO se ha comprobado.  Para comprobar dicha integridad, *\n* debe proporcionar la contrase\u00F1a de srckeystore.                *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "La respuesta de certificado no contiene una clave p\u00FAblica para <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Cadena de certificado incompleta en la respuesta"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "La cadena de certificado de la respuesta no verifica: "},
+        {"Top.level.certificate.in.reply.",
+                "Certificado de nivel superior en la respuesta:\n"},
+        {".is.not.trusted.", "... no es de confianza. "},
+        {"Install.reply.anyway.no.", "\u00BFInstalar respuesta de todos modos? [no]:  "},
+        {"NO", "No"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "Las claves p\u00FAblicas en la respuesta y en el almac\u00E9n de claves no coinciden"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "La respuesta del certificado y el certificado en el almac\u00E9n de claves son id\u00E9nticos"},
+        {"Failed.to.establish.chain.from.reply",
+                "No se ha podido definir una cadena a partir de la respuesta"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "Respuesta incorrecta, vuelva a intentarlo"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "No se ha generado la clave secreta, el alias <{0}> ya existe"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Proporcione el valor de -keysize para la generaci\u00F3n de claves secretas"},
+
+        {"Extensions.", "Extensiones: "},
+        {".Empty.value.", "(Valor vac\u00EDo)"},
+        {"Extension.Request.", "Solicitud de Extensi\u00F3n:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "Solicitud de Certificado PKCS #10 (Versi\u00F3n 1.0)\nAsunto: %s\nClave P\u00FAblica: %s formato %s clave\n"},
+        {"Unknown.keyUsage.type.", "Tipo de uso de clave desconocido: "},
+        {"Unknown.extendedkeyUsage.type.", "Tipo de uso de clave extendida desconocido: "},
+        {"Unknown.AccessDescription.type.", "Tipo de descripci\u00F3n de acceso desconocido: "},
+        {"Unrecognized.GeneralName.type.", "Tipo de nombre general no reconocido: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "Esta extensi\u00F3n no se puede marcar como cr\u00EDtica. "},
+        {"Odd.number.of.hex.digits.found.", "Se ha encontrado un n\u00FAmero impar de d\u00EDgitos hexadecimales: "},
+        {"Unknown.extension.type.", "Tipo de extensi\u00F3n desconocida: "},
+        {"command.{0}.is.ambiguous.", "El comando {0} es ambiguo:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_fr.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_fr extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [Option]..."},
+        {"Options.", "Options :"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "Utiliser \"keytool -help\" pour toutes les commandes disponibles"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Outil de gestion de certificats et de cl\u00E9s"},
+        {"Commands.", "Commandes :"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "Utiliser \"keytool -command_name -help\" pour la syntaxe de command_name"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "G\u00E9n\u00E8re une demande de certificat"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "Modifie l'alias d'une entr\u00E9e"}, //-changealias
+        {"Deletes.an.entry",
+                "Supprime une entr\u00E9e"}, //-delete
+        {"Exports.certificate",
+                "Exporte le certificat"}, //-exportcert
+        {"Generates.a.key.pair",
+                "G\u00E9n\u00E8re une paire de cl\u00E9s"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "G\u00E9n\u00E8re une cl\u00E9 secr\u00E8te"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "G\u00E9n\u00E8re le certificat \u00E0 partir d'une demande de certificat"}, //-gencert
+        {"Generates.CRL", "G\u00E9n\u00E8re la liste des certificats r\u00E9voqu\u00E9s (CRL)"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Importe les entr\u00E9es \u00E0 partir d'une base de donn\u00E9es d'identit\u00E9s de type JDK 1.1.x"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Importe un certificat ou une cha\u00EEne de certificat"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Importe une entr\u00E9e ou la totalit\u00E9 des entr\u00E9es depuis un autre fichier de cl\u00E9s"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Clone une entr\u00E9e de cl\u00E9"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "Modifie le mot de passe de cl\u00E9 d'une entr\u00E9e"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "R\u00E9pertorie les entr\u00E9es d'un fichier de cl\u00E9s"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Imprime le contenu d'un certificat"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Imprime le contenu d'une demande de certificat"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Imprime le contenu d'un fichier de liste des certificats r\u00E9voqu\u00E9s (CRL)"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "G\u00E9n\u00E8re un certificat auto-sign\u00E9"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "Modifie le mot de passe de banque d'un fichier de cl\u00E9s"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "nom d'alias de l'entr\u00E9e \u00E0 traiter"}, //-alias
+        {"destination.alias",
+                "alias de destination"}, //-destalias
+        {"destination.key.password",
+                "mot de passe de la cl\u00E9 de destination"}, //-destkeypass
+        {"destination.keystore.name",
+                "nom du fichier de cl\u00E9s de destination"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "mot de passe du fichier de cl\u00E9s de destination prot\u00E9g\u00E9"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "nom du fournisseur du fichier de cl\u00E9s de destination"}, //-destprovidername
+        {"destination.keystore.password",
+                "mot de passe du fichier de cl\u00E9s de destination"}, //-deststorepass
+        {"destination.keystore.type",
+                "type du fichier de cl\u00E9s de destination"}, //-deststoretype
+        {"distinguished.name",
+                "nom distinctif"}, //-dname
+        {"X.509.extension",
+                "extension X.509"}, //-ext
+        {"output.file.name",
+                "nom du fichier de sortie"}, //-file and -outfile
+        {"input.file.name",
+                "nom du fichier d'entr\u00E9e"}, //-file and -infile
+        {"key.algorithm.name",
+                "nom de l'algorithme de cl\u00E9"}, //-keyalg
+        {"key.password",
+                "mot de passe de la cl\u00E9"}, //-keypass
+        {"key.bit.size",
+                "taille en bits de la cl\u00E9"}, //-keysize
+        {"keystore.name",
+                "nom du fichier de cl\u00E9s"}, //-keystore
+        {"new.password",
+                "nouveau mot de passe"}, //-new
+        {"do.not.prompt",
+                "ne pas inviter"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "mot de passe via m\u00E9canisme prot\u00E9g\u00E9"}, //-protected
+        {"provider.argument",
+                "argument du fournisseur"}, //-providerarg
+        {"provider.class.name",
+                "nom de la classe de fournisseur"}, //-providerclass
+        {"provider.name",
+                "nom du fournisseur"}, //-providername
+        {"provider.classpath",
+                "variable d'environnement CLASSPATH du fournisseur"}, //-providerpath
+        {"output.in.RFC.style",
+                "sortie au style RFC"}, //-rfc
+        {"signature.algorithm.name",
+                "nom de l'algorithme de signature"}, //-sigalg
+        {"source.alias",
+                "alias source"}, //-srcalias
+        {"source.key.password",
+                "mot de passe de la cl\u00E9 source"}, //-srckeypass
+        {"source.keystore.name",
+                "nom du fichier de cl\u00E9s source"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "mot de passe du fichier de cl\u00E9s source prot\u00E9g\u00E9"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "nom du fournisseur du fichier de cl\u00E9s source"}, //-srcprovidername
+        {"source.keystore.password",
+                "mot de passe du fichier de cl\u00E9s source"}, //-srcstorepass
+        {"source.keystore.type",
+                "type du fichier de cl\u00E9s source"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "Port et h\u00F4te du serveur SSL"}, //-sslserver
+        {"signed.jar.file",
+                "fichier JAR sign\u00E9"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "date/heure de d\u00E9but de validit\u00E9 du certificat"}, //-startdate
+        {"keystore.password",
+                "mot de passe du fichier de cl\u00E9s"}, //-storepass
+        {"keystore.type",
+                "type du fichier de cl\u00E9s"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "certificats s\u00E9curis\u00E9s issus de certificats CA"}, //-trustcacerts
+        {"verbose.output",
+                "sortie en mode verbose"}, //-v
+        {"validity.number.of.days",
+                "nombre de jours de validit\u00E9"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "ID de s\u00E9rie du certificat \u00E0 r\u00E9voquer"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "erreur keytool : "},
+        {"Illegal.option.", "Option non admise :  "},
+        {"Illegal.value.", "Valeur non admise : "},
+        {"Unknown.password.type.", "Type de mot de passe inconnu : "},
+        {"Cannot.find.environment.variable.",
+                "Variable d'environnement introuvable : "},
+        {"Cannot.find.file.", "Fichier introuvable : "},
+        {"Command.option.flag.needs.an.argument.", "L''option de commande {0} requiert un argument."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Avertissement\u00A0: les mots de passe de cl\u00E9 et de banque distincts ne sont pas pris en charge pour les fichiers de cl\u00E9s d''acc\u00E8s PKCS12. La valeur {0} sp\u00E9cifi\u00E9e par l''utilisateur est ignor\u00E9e."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore doit \u00EAtre d\u00E9fini sur NONE si -storetype est {0}"},
+        {"Too.many.retries.program.terminated",
+                 "Trop de tentatives, fin du programme"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "Les commandes -storepasswd et -keypasswd ne sont pas prises en charge si -storetype est d\u00E9fini sur {0}"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "Les commandes -keypasswd ne sont pas prises en charge si -storetype est d\u00E9fini sur PKCS12"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "Les commandes -keypass et -new ne peuvent pas \u00EAtre sp\u00E9cifi\u00E9es si -storetype est d\u00E9fini sur {0}"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "si -protected est sp\u00E9cifi\u00E9, -storepass, -keypass et -new ne doivent pas \u00EAtre indiqu\u00E9s"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Si -srcprotected est indiqu\u00E9, les commandes -srcstorepass et -srckeypass ne doivent pas \u00EAtre sp\u00E9cifi\u00E9es"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "Si le fichier de cl\u00E9s n'est pas prot\u00E9g\u00E9 par un mot de passe, les commandes -storepass, -keypass et -new ne doivent pas \u00EAtre sp\u00E9cifi\u00E9es"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Si le fichier de cl\u00E9s source n'est pas prot\u00E9g\u00E9 par un mot de passe, les commandes -srcstorepass et -srckeypass ne doivent pas \u00EAtre sp\u00E9cifi\u00E9es"},
+        {"Illegal.startdate.value", "Valeur de date de d\u00E9but non admise"},
+        {"Validity.must.be.greater.than.zero",
+                "La validit\u00E9 doit \u00EAtre sup\u00E9rieure \u00E0 z\u00E9ro"},
+        {"provName.not.a.provider", "{0} n''est pas un fournisseur"},
+        {"Usage.error.no.command.provided", "Erreur de syntaxe\u00A0: aucune commande fournie"},
+        {"Source.keystore.file.exists.but.is.empty.", "Le fichier de cl\u00E9s source existe mais il est vide : "},
+        {"Please.specify.srckeystore", "Indiquez -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "-v et -rfc ne doivent pas \u00EAtre sp\u00E9cifi\u00E9s avec la commande 'list'"},
+        {"Key.password.must.be.at.least.6.characters",
+                "Un mot de passe de cl\u00E9 doit comporter au moins 6 caract\u00E8res"},
+        {"New.password.must.be.at.least.6.characters",
+                "Le nouveau mot de passe doit comporter au moins 6 caract\u00E8res"},
+        {"Keystore.file.exists.but.is.empty.",
+                "Fichier de cl\u00E9s existant mais vide : "},
+        {"Keystore.file.does.not.exist.",
+                "Le fichier de cl\u00E9s n'existe pas : "},
+        {"Must.specify.destination.alias", "L'alias de destination doit \u00EAtre sp\u00E9cifi\u00E9"},
+        {"Must.specify.alias", "L'alias doit \u00EAtre sp\u00E9cifi\u00E9"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "Un mot de passe de fichier de cl\u00E9s doit comporter au moins 6 caract\u00E8res"},
+        {"Enter.keystore.password.", "Entrez le mot de passe du fichier de cl\u00E9s :  "},
+        {"Enter.source.keystore.password.", "Entrez le mot de passe du fichier de cl\u00E9s source\u00A0:  "},
+        {"Enter.destination.keystore.password.", "Entrez le mot de passe du fichier de cl\u00E9s de destination\u00A0:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "Le mot de passe du fichier de cl\u00E9s est trop court : il doit comporter au moins 6 caract\u00E8res"},
+        {"Unknown.Entry.Type", "Type d'entr\u00E9e inconnu"},
+        {"Too.many.failures.Alias.not.changed", "Trop d'erreurs. Alias non modifi\u00E9"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "L''entr\u00E9e de l''alias {0} a \u00E9t\u00E9 import\u00E9e."},
+        {"Entry.for.alias.alias.not.imported.", "L''entr\u00E9e de l''alias {0} n''a pas \u00E9t\u00E9 import\u00E9e."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Probl\u00E8me lors de l''import de l''entr\u00E9e de l''alias {0}\u00A0: {1}.\nL''entr\u00E9e de l''alias {0} n''a pas \u00E9t\u00E9 import\u00E9e."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Commande d''import ex\u00E9cut\u00E9e\u00A0: {0} entr\u00E9es import\u00E9es, \u00E9chec ou annulation de {1} entr\u00E9es"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Avertissement\u00A0: l''alias {0} existant sera remplac\u00E9 dans le fichier de cl\u00E9s d''acc\u00E8s de destination"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "L''alias d''entr\u00E9e {0} existe d\u00E9j\u00E0. Voulez-vous le remplacer ? [non]\u00A0:  "},
+        {"Too.many.failures.try.later", "Trop d'erreurs. R\u00E9essayez plus tard"},
+        {"Certification.request.stored.in.file.filename.",
+                "Demande de certification stock\u00E9e dans le fichier <{0}>"},
+        {"Submit.this.to.your.CA", "Soumettre \u00E0 votre CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "si l'alias n'est pas sp\u00E9cifi\u00E9, destalias, srckeypass et destkeypass ne doivent pas \u00EAtre sp\u00E9cifi\u00E9s"},
+        {"Certificate.stored.in.file.filename.",
+                "Certificat stock\u00E9 dans le fichier <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "R\u00E9ponse de certificat install\u00E9e dans le fichier de cl\u00E9s"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "R\u00E9ponse de certificat non install\u00E9e dans le fichier de cl\u00E9s"},
+        {"Certificate.was.added.to.keystore",
+                "Certificat ajout\u00E9 au fichier de cl\u00E9s"},
+        {"Certificate.was.not.added.to.keystore",
+                "Certificat non ajout\u00E9 au fichier de cl\u00E9s"},
+        {".Storing.ksfname.", "[Stockage de {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} ne poss\u00E8de pas de cl\u00E9 publique (certificat)"},
+        {"Cannot.derive.signature.algorithm",
+                "Impossible de d\u00E9duire l'algorithme de signature"},
+        {"Alias.alias.does.not.exist",
+                "L''alias <{0}> n''existe pas"},
+        {"Alias.alias.has.no.certificate",
+                "L''alias <{0}> ne poss\u00E8de pas de certificat"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "Paire de cl\u00E9s non g\u00E9n\u00E9r\u00E9e, l''alias <{0}> existe d\u00E9j\u00E0"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "G\u00E9n\u00E9ration d''une paire de cl\u00E9s {1} de {0} bits et d''un certificat auto-sign\u00E9 ({2}) d''une validit\u00E9 de {3} jours\n\tpour : {4}"},
+        {"Enter.key.password.for.alias.", "Entrez le mot de passe de la cl\u00E9 pour <{0}>"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(appuyez sur Entr\u00E9e s'il s'agit du mot de passe du fichier de cl\u00E9s) :  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "Le mot de passe de la cl\u00E9 est trop court : il doit comporter au moins 6 caract\u00E8res"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "Trop d'erreurs. Cl\u00E9 non ajout\u00E9e au fichier de cl\u00E9s"},
+        {"Destination.alias.dest.already.exists",
+                "L''alias de la destination <{0}> existe d\u00E9j\u00E0"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "Le mot de passe est trop court : il doit comporter au moins 6 caract\u00E8res"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "Trop d'erreurs. Entr\u00E9e de cl\u00E9 non clon\u00E9e"},
+        {"key.password.for.alias.", "mot de passe de cl\u00E9 pour <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "L''entr\u00E9e de fichier de cl\u00E9s d''acc\u00E8s pour <{0}> existe d\u00E9j\u00E0"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Cr\u00E9ation d''une entr\u00E9e de fichier de cl\u00E9s d''acc\u00E8s pour <{0}>..."},
+        {"No.entries.from.identity.database.added",
+                "Aucune entr\u00E9e ajout\u00E9e \u00E0 partir de la base de donn\u00E9es d'identit\u00E9s"},
+        {"Alias.name.alias", "Nom d''alias : {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Date de cr\u00E9ation : {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Type d''entr\u00E9e\u00A0: {0}"},
+        {"Certificate.chain.length.", "Longueur de cha\u00EEne du certificat : "},
+        {"Certificate.i.1.", "Certificat[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Empreinte du certificat (SHA1) : "},
+        {"Keystore.type.", "Type de fichier de cl\u00E9s : "},
+        {"Keystore.provider.", "Fournisseur de fichier de cl\u00E9s : "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Votre fichier de cl\u00E9s d''acc\u00E8s contient {0,number,integer} entr\u00E9e"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Votre fichier de cl\u00E9s d''acc\u00E8s contient {0,number,integer} entr\u00E9es"},
+        {"Failed.to.parse.input", "L'analyse de l'entr\u00E9e a \u00E9chou\u00E9"},
+        {"Empty.input", "Entr\u00E9e vide"},
+        {"Not.X.509.certificate", "Pas un certificat X.509"},
+        {"alias.has.no.public.key", "{0} ne poss\u00E8de pas de cl\u00E9 publique"},
+        {"alias.has.no.X.509.certificate", "{0} ne poss\u00E8de pas de certificat X.509"},
+        {"New.certificate.self.signed.", "Nouveau certificat (auto-sign\u00E9) :"},
+        {"Reply.has.no.certificates", "La r\u00E9ponse n'a pas de certificat"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Certificat non import\u00E9, l''alias <{0}> existe d\u00E9j\u00E0"},
+        {"Input.not.an.X.509.certificate", "L'entr\u00E9e n'est pas un certificat X.509"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "Le certificat existe d\u00E9j\u00E0 dans le fichier de cl\u00E9s d''acc\u00E8s sous l''alias <{0}>"},
+        {"Do.you.still.want.to.add.it.no.",
+                "Voulez-vous toujours l'ajouter ? [non] :  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "Le certificat existe d\u00E9j\u00E0 dans le fichier de cl\u00E9s d''acc\u00E8s CA syst\u00E8me sous l''alias <{0}>"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "Voulez-vous toujours l'ajouter \u00E0 votre fichier de cl\u00E9s ? [non] :  "},
+        {"Trust.this.certificate.no.", "Faire confiance \u00E0 ce certificat ? [non] :  "},
+        {"YES", "Oui"},
+        {"New.prompt.", "Nouveau {0} : "},
+        {"Passwords.must.differ", "Les mots de passe doivent diff\u00E9rer"},
+        {"Re.enter.new.prompt.", "Indiquez encore le nouveau {0} : "},
+        {"Re.enter.new.password.", "Ressaisissez le nouveau mot de passe : "},
+        {"They.don.t.match.Try.again", "Ils sont diff\u00E9rents. R\u00E9essayez."},
+        {"Enter.prompt.alias.name.", "Indiquez le nom d''alias {0} :  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Saisissez le nom du nouvel alias\t(ou appuyez sur Entr\u00E9e pour annuler l'import de cette entr\u00E9e)\u00A0:  "},
+        {"Enter.alias.name.", "Indiquez le nom d'alias :  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(appuyez sur Entr\u00E9e si le r\u00E9sultat est identique \u00E0 <{0}>)"},
+        {".PATTERN.printX509Cert",
+                "Propri\u00E9taire : {0}\nEmetteur : {1}\nNum\u00E9ro de s\u00E9rie : {2}\nValide du : {3} au : {4}\nEmpreintes du certificat :\n\t MD5:  {5}\n\t SHA1 : {6}\n\t SHA256 : {7}\n\t Nom de l''algorithme de signature : {8}\n\t Version : {9}"},
+        {"What.is.your.first.and.last.name.",
+                "Quels sont vos nom et pr\u00E9nom ?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "Quel est le nom de votre unit\u00E9 organisationnelle ?"},
+        {"What.is.the.name.of.your.organization.",
+                "Quel est le nom de votre entreprise ?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "Quel est le nom de votre ville de r\u00E9sidence ?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "Quel est le nom de votre \u00E9tat ou province ?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "Quel est le code pays \u00E0 deux lettres pour cette unit\u00E9 ?"},
+        {"Is.name.correct.", "Est-ce {0} ?"},
+        {"no", "non"},
+        {"yes", "oui"},
+        {"y", "o"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "L''alias <{0}> n''est associ\u00E9 \u00E0 aucune cl\u00E9"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "L''entr\u00E9e \u00E0 laquelle l''alias <{0}> fait r\u00E9f\u00E9rence n''est pas une entr\u00E9e de type cl\u00E9 priv\u00E9e. La commande -keyclone prend uniquement en charge le clonage des cl\u00E9s priv\u00E9es"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  Avertissement Avertissement Avertissement  *****************"},
+        {"Signer.d.", "Signataire n\u00B0%d :"},
+        {"Timestamp.", "Horodatage :"},
+        {"Signature.", "Signature :"},
+        {"CRLs.", "Listes des certificats r\u00E9voqu\u00E9s (CRL) :"},
+        {"Certificate.owner.", "Propri\u00E9taire du certificat : "},
+        {"Not.a.signed.jar.file", "Fichier JAR non sign\u00E9"},
+        {"No.certificate.from.the.SSL.server",
+                "Aucun certificat du serveur SSL"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* L'int\u00E9grit\u00E9 des informations stock\u00E9es dans votre fichier de cl\u00E9s  *\n* n'a PAS \u00E9t\u00E9 v\u00E9rifi\u00E9e. Pour cela, *\n* vous devez fournir le mot de passe de votre fichier de cl\u00E9s.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* L'int\u00E9grit\u00E9 des informations stock\u00E9es dans le fichier de cl\u00E9s source  *\n* n'a PAS \u00E9t\u00E9 v\u00E9rifi\u00E9e. Pour cela, *\n* vous devez fournir le mot de passe de votre fichier de cl\u00E9s source.                  *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "La r\u00E9ponse au certificat ne contient pas de cl\u00E9 publique pour <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Cha\u00EEne de certificat incompl\u00E8te dans la r\u00E9ponse"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "La cha\u00EEne de certificat de la r\u00E9ponse ne concorde pas : "},
+        {"Top.level.certificate.in.reply.",
+                "Certificat de niveau sup\u00E9rieur dans la r\u00E9ponse :\n"},
+        {".is.not.trusted.", "... non s\u00E9curis\u00E9. "},
+        {"Install.reply.anyway.no.", "Installer la r\u00E9ponse quand m\u00EAme ? [non] :  "},
+        {"NO", "Non"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "Les cl\u00E9s publiques de la r\u00E9ponse et du fichier de cl\u00E9s ne concordent pas"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "La r\u00E9ponse au certificat et le certificat du fichier de cl\u00E9s sont identiques"},
+        {"Failed.to.establish.chain.from.reply",
+                "Impossible de cr\u00E9er une cha\u00EEne \u00E0 partir de la r\u00E9ponse"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "R\u00E9ponse incorrecte, recommencez"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "Cl\u00E9 secr\u00E8te non g\u00E9n\u00E9r\u00E9e, l''alias <{0}> existe d\u00E9j\u00E0"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Indiquez -keysize pour la g\u00E9n\u00E9ration de la cl\u00E9 secr\u00E8te"},
+
+        {"Extensions.", "Extensions\u00A0: "},
+        {".Empty.value.", "(Valeur vide)"},
+        {"Extension.Request.", "Demande d'extension :"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "Demande de certificat PKCS #10 (version 1.0)\nSujet : %s\nCl\u00E9 publique : format %s pour la cl\u00E9 %s\n"},
+        {"Unknown.keyUsage.type.", "Type keyUsage inconnu : "},
+        {"Unknown.extendedkeyUsage.type.", "Type extendedkeyUsage inconnu : "},
+        {"Unknown.AccessDescription.type.", "Type AccessDescription inconnu : "},
+        {"Unrecognized.GeneralName.type.", "Type GeneralName non reconnu : "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "Cette extension ne peut pas \u00EAtre marqu\u00E9e comme critique. "},
+        {"Odd.number.of.hex.digits.found.", "Nombre impair de chiffres hexad\u00E9cimaux trouv\u00E9 : "},
+        {"Unknown.extension.type.", "Type d'extension inconnu : "},
+        {"command.{0}.is.ambiguous.", "commande {0} ambigu\u00EB :"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_it.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_it extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [Opzione]..."},
+        {"Options.", "Opzioni:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "Utilizzare \"keytool -help\" per visualizzare tutti i comandi disponibili"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Strumento di gestione di chiavi e certificati"},
+        {"Commands.", "Comandi:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "Utilizzare \"keytool -command_name -help\" per informazioni sull'uso di command_name"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "Genera una richiesta di certificato"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "Modifica l'alias di una voce"}, //-changealias
+        {"Deletes.an.entry",
+                "Elimina una voce"}, //-delete
+        {"Exports.certificate",
+                "Esporta il certificato"}, //-exportcert
+        {"Generates.a.key.pair",
+                "Genera una coppia di chiavi"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "Genera una chiave segreta"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "Genera un certificato da una richiesta di certificato"}, //-gencert
+        {"Generates.CRL", "Genera CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Importa le voci da un database delle identit\u00E0 di tipo JDK 1.1.x"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Importa un certificato o una catena di certificati"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Importa una o tutte le voci da un altro keystore"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Duplica una voce di chiave"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "Modifica la password della chiave per una voce"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "Elenca le voci in un keystore"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Visualizza i contenuti di un certificato"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Visualizza i contenuti di una richiesta di certificato"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Visualizza i contenuti di un file CRL"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "Genera certificato con firma automatica"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "Modifica la password di area di memorizzazione di un keystore"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "nome alias della voce da elaborare"}, //-alias
+        {"destination.alias",
+                "alias di destinazione"}, //-destalias
+        {"destination.key.password",
+                "password chiave di destinazione"}, //-destkeypass
+        {"destination.keystore.name",
+                "nome keystore di destinazione"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "password keystore di destinazione protetta"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "nome provider keystore di destinazione"}, //-destprovidername
+        {"destination.keystore.password",
+                "password keystore di destinazione"}, //-deststorepass
+        {"destination.keystore.type",
+                "tipo keystore di destinazione"}, //-deststoretype
+        {"distinguished.name",
+                "nome distinto"}, //-dname
+        {"X.509.extension",
+                "estensione X.509"}, //-ext
+        {"output.file.name",
+                "nome file di output"}, //-file and -outfile
+        {"input.file.name",
+                "nome file di input"}, //-file and -infile
+        {"key.algorithm.name",
+                "nome algoritmo chiave"}, //-keyalg
+        {"key.password",
+                "password chiave"}, //-keypass
+        {"key.bit.size",
+                "dimensione bit chiave"}, //-keysize
+        {"keystore.name",
+                "nome keystore"}, //-keystore
+        {"new.password",
+                "nuova password"}, //-new
+        {"do.not.prompt",
+                "non richiedere"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "password mediante meccanismo protetto"}, //-protected
+        {"provider.argument",
+                "argomento provider"}, //-providerarg
+        {"provider.class.name",
+                "nome classe provider"}, //-providerclass
+        {"provider.name",
+                "nome provider"}, //-providername
+        {"provider.classpath",
+                "classpath provider"}, //-providerpath
+        {"output.in.RFC.style",
+                "output in stile RFC"}, //-rfc
+        {"signature.algorithm.name",
+                "nome algoritmo firma"}, //-sigalg
+        {"source.alias",
+                "alias origine"}, //-srcalias
+        {"source.key.password",
+                "password chiave di origine"}, //-srckeypass
+        {"source.keystore.name",
+                "nome keystore di origine"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "password keystore di origine protetta"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "nome provider keystore di origine"}, //-srcprovidername
+        {"source.keystore.password",
+                "password keystore di origine"}, //-srcstorepass
+        {"source.keystore.type",
+                "tipo keystore di origine"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "host e porta server SSL"}, //-sslserver
+        {"signed.jar.file",
+                "file jar firmato"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "data/ora di inizio validit\u00E0 certificato"}, //-startdate
+        {"keystore.password",
+                "password keystore"}, //-storepass
+        {"keystore.type",
+                "tipo keystore"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "considera sicuri i certificati da cacerts"}, //-trustcacerts
+        {"verbose.output",
+                "output descrittivo"}, //-v
+        {"validity.number.of.days",
+                "numero di giorni di validit\u00E0"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "ID seriale del certificato da revocare"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "Errore keytool: "},
+        {"Illegal.option.", "Opzione non valida:  "},
+        {"Illegal.value.", "Valore non valido: "},
+        {"Unknown.password.type.", "Tipo di password sconosciuto: "},
+        {"Cannot.find.environment.variable.",
+                "Impossibile trovare la variabile di ambiente: "},
+        {"Cannot.find.file.", "Impossibile trovare il file: "},
+        {"Command.option.flag.needs.an.argument.", "\u00C8 necessario specificare un argomento per l''opzione di comando {0}."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Avvertenza: non sono supportate password diverse di chiave e di archivio per i keystore PKCS12. Il valore {0} specificato dall''utente verr\u00E0 ignorato."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "Se -storetype \u00E8 impostato su {0}, -keystore deve essere impostato su NONE"},
+        {"Too.many.retries.program.terminated",
+                 "Il numero dei tentativi consentiti \u00E8 stato superato. Il programma verr\u00E0 terminato."},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "Se -storetype \u00E8 impostato su {0}, i comandi -storepasswd e -keypasswd non sono supportati"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "Se -storetype \u00E8 impostato su PKCS12 i comandi -keypasswd non vengono supportati"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "Se -storetype \u00E8 impostato su {0}, non \u00E8 possibile specificare un valore per -keypass e -new"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "Se \u00E8 specificata l'opzione -protected, le opzioni -storepass, -keypass e -new non possono essere specificate"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Se viene specificato -srcprotected, -srcstorepass e -srckeypass non dovranno essere specificati"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "Se il file keystore non \u00E8 protetto da password, non deve essere specificato alcun valore per -storepass, -keypass e -new"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "Se il file keystore non \u00E8 protetto da password, non deve essere specificato alcun valore per -srcstorepass e -srckeypass"},
+        {"Illegal.startdate.value", "Valore di data di inizio non valido"},
+        {"Validity.must.be.greater.than.zero",
+                "La validit\u00E0 deve essere maggiore di zero"},
+        {"provName.not.a.provider", "{0} non \u00E8 un provider"},
+        {"Usage.error.no.command.provided", "Errore di utilizzo: nessun comando specificato"},
+        {"Source.keystore.file.exists.but.is.empty.", "Il file keystore di origine esiste, ma \u00E8 vuoto: "},
+        {"Please.specify.srckeystore", "Specificare -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "Impossibile specificare sia -v sia -rfc con il comando 'list'"},
+        {"Key.password.must.be.at.least.6.characters",
+                "La password della chiave deve contenere almeno 6 caratteri"},
+        {"New.password.must.be.at.least.6.characters",
+                "La nuova password deve contenere almeno 6 caratteri"},
+        {"Keystore.file.exists.but.is.empty.",
+                "Il file keystore esiste ma \u00E8 vuoto: "},
+        {"Keystore.file.does.not.exist.",
+                "Il file keystore non esiste: "},
+        {"Must.specify.destination.alias", "\u00C8 necessario specificare l'alias di destinazione"},
+        {"Must.specify.alias", "\u00C8 necessario specificare l'alias"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "La password del keystore deve contenere almeno 6 caratteri"},
+        {"Enter.keystore.password.", "Immettere la password del keystore:  "},
+        {"Enter.source.keystore.password.", "Immettere la password del keystore di origine:  "},
+        {"Enter.destination.keystore.password.", "Immettere la password del keystore di destinazione:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "La password del keystore \u00E8 troppo corta - deve contenere almeno 6 caratteri"},
+        {"Unknown.Entry.Type", "Tipo di voce sconosciuto"},
+        {"Too.many.failures.Alias.not.changed", "Numero eccessivo di errori. L'alias non \u00E8 stato modificato."},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "La voce dell''alias {0} \u00E8 stata importata."},
+        {"Entry.for.alias.alias.not.imported.", "La voce dell''alias {0} non \u00E8 stata importata."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Si \u00E8 verificato un problema durante l''importazione della voce dell''alias {0}: {1}.\nLa voce dell''alias {0} non \u00E8 stata importata."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Comando di importazione completato: {0} voce/i importata/e, {1} voce/i non importata/e o annullata/e"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Avvertenza: sovrascrittura in corso dell''alias {0} nel file keystore di destinazione"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "La voce dell''alias {0} esiste gi\u00E0. Sovrascrivere? [no]:  "},
+        {"Too.many.failures.try.later", "Troppi errori - riprovare"},
+        {"Certification.request.stored.in.file.filename.",
+                "La richiesta di certificazione \u00E8 memorizzata nel file <{0}>"},
+        {"Submit.this.to.your.CA", "Sottomettere alla propria CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "Se l'alias non \u00E8 specificato, destalias, srckeypass e destkeypass non dovranno essere specificati"},
+        {"Certificate.stored.in.file.filename.",
+                "Il certificato \u00E8 memorizzato nel file <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "La risposta del certificato \u00E8 stata installata nel keystore"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "La risposta del certificato non \u00E8 stata installata nel keystore"},
+        {"Certificate.was.added.to.keystore",
+                "Il certificato \u00E8 stato aggiunto al keystore"},
+        {"Certificate.was.not.added.to.keystore",
+                "Il certificato non \u00E8 stato aggiunto al keystore"},
+        {".Storing.ksfname.", "[Memorizzazione di {0}] in corso"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} non dispone di chiave pubblica (certificato)"},
+        {"Cannot.derive.signature.algorithm",
+                "Impossibile derivare l'algoritmo di firma"},
+        {"Alias.alias.does.not.exist",
+                "L''alias <{0}> non esiste"},
+        {"Alias.alias.has.no.certificate",
+                "L''alias <{0}> non dispone di certificato"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "Non \u00E8 stata generata la coppia di chiavi, l''alias <{0}> \u00E8 gi\u00E0 esistente"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "Generazione in corso di una coppia di chiavi {1} da {0} bit e di un certificato autofirmato ({2}) con una validit\u00E0 di {3} giorni\n\tper: {4}"},
+        {"Enter.key.password.for.alias.", "Immettere la password della chiave per <{0}>"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(INVIO se corrisponde alla password del keystore):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "La password della chiave \u00E8 troppo corta - deve contenere almeno 6 caratteri"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "Troppi errori - la chiave non \u00E8 stata aggiunta al keystore"},
+        {"Destination.alias.dest.already.exists",
+                "L''alias di destinazione <{0}> \u00E8 gi\u00E0 esistente"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "La password \u00E8 troppo corta - deve contenere almeno 6 caratteri"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "Numero eccessivo di errori. Il valore della chiave non \u00E8 stato copiato."},
+        {"key.password.for.alias.", "password della chiave per <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "La voce del keystore per <{0}> esiste gi\u00E0"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Creazione della voce del keystore per <{0}> in corso..."},
+        {"No.entries.from.identity.database.added",
+                "Nessuna voce aggiunta dal database delle identit\u00E0"},
+        {"Alias.name.alias", "Nome alias: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Data di creazione: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Tipo di voce: {0}"},
+        {"Certificate.chain.length.", "Lunghezza catena certificati: "},
+        {"Certificate.i.1.", "Certificato[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Impronta digitale certificato (SHA1): "},
+        {"Keystore.type.", "Tipo keystore: "},
+        {"Keystore.provider.", "Provider keystore: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Il keystore contiene {0,number,integer} voce"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Il keystore contiene {0,number,integer} voci"},
+        {"Failed.to.parse.input", "Impossibile analizzare l'input"},
+        {"Empty.input", "Input vuoto"},
+        {"Not.X.509.certificate", "Il certificato non \u00E8 X.509"},
+        {"alias.has.no.public.key", "{0} non dispone di chiave pubblica"},
+        {"alias.has.no.X.509.certificate", "{0} non dispone di certificato X.509"},
+        {"New.certificate.self.signed.", "Nuovo certificato (autofirmato):"},
+        {"Reply.has.no.certificates", "La risposta non dispone di certificati"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Impossibile importare il certificato, l''alias <{0}> \u00E8 gi\u00E0 esistente"},
+        {"Input.not.an.X.509.certificate", "L'input non \u00E8 un certificato X.509"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "Il certificato esiste gi\u00E0 nel keystore con alias <{0}>"},
+        {"Do.you.still.want.to.add.it.no.",
+                "Aggiungerlo ugualmente? [no]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "Il certificato esiste gi\u00E0 nel keystore CA con alias <{0}>"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "Aggiungerlo al proprio keystore? [no]:  "},
+        {"Trust.this.certificate.no.", "Considerare sicuro questo certificato? [no]:  "},
+        {"YES", "S\u00EC"},
+        {"New.prompt.", "Nuova {0}: "},
+        {"Passwords.must.differ", "Le password non devono coincidere"},
+        {"Re.enter.new.prompt.", "Reimmettere un nuovo valore per {0}: "},
+        {"Re.enter.new.password.", "Immettere nuovamente la nuova password: "},
+        {"They.don.t.match.Try.again", "Non corrispondono. Riprovare."},
+        {"Enter.prompt.alias.name.", "Immettere nome alias {0}:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Immettere un nuovo nome alias\t(premere INVIO per annullare l'importazione della voce):  "},
+        {"Enter.alias.name.", "Immettere nome alias:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(INVIO se corrisponde al nome di <{0}>"},
+        {".PATTERN.printX509Cert",
+                "Proprietario: {0}\nAutorit\u00E0 emittente: {1}\nNumero di serie: {2}\nValido da: {3} a: {4}\nImpronte digitali certificato:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Nome algoritmo firma: {8}\n\t Versione: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "Specificare nome e cognome"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "Specificare il nome dell'unit\u00E0 organizzativa"},
+        {"What.is.the.name.of.your.organization.",
+                "Specificare il nome dell'organizzazione"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "Specificare la localit\u00E0"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "Specificare la provincia"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "Specificare il codice a due lettere del paese in cui si trova l'unit\u00E0"},
+        {"Is.name.correct.", "Il dato {0} \u00E8 corretto?"},
+        {"no", "no"},
+        {"yes", "s\u00EC"},
+        {"y", "s"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "All''alias <{0}> non \u00E8 associata alcuna chiave"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "L''alias <{0}> fa riferimento a un tipo di voce che non \u00E8 una voce di chiave privata. Il comando -keyclone supporta solo la copia delle voci di chiave private."},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  Avvertenza Avvertenza Avvertenza  *****************"},
+        {"Signer.d.", "Firmatario #%d:"},
+        {"Timestamp.", "Indicatore orario:"},
+        {"Signature.", "Firma:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "Proprietario certificato: "},
+        {"Not.a.signed.jar.file", "Non \u00E8 un file jar firmato"},
+        {"No.certificate.from.the.SSL.server",
+                "Nessun certificato dal server SSL"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* L'integrit\u00E0 delle informazioni memorizzate nel keystore *\n* NON \u00E8 stata verificata. Per verificarne l'integrit\u00E0 *\n* \u00E8 necessario fornire la password del keystore.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* L'integrit\u00E0 delle informazioni memorizzate nel srckeystore *\n* NON \u00E8 stata verificata. Per verificarne l'integrit\u00E0 *\n* \u00E8 necessario fornire la password del srckeystore.                  *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "La risposta del certificato non contiene la chiave pubblica per <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Catena dei certificati incompleta nella risposta"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "La catena dei certificati nella risposta non verifica: "},
+        {"Top.level.certificate.in.reply.",
+                "Certificato di primo livello nella risposta:\n"},
+        {".is.not.trusted.", "...non \u00E8 considerato sicuro. "},
+        {"Install.reply.anyway.no.", "Installare la risposta? [no]:  "},
+        {"NO", "No"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "Le chiavi pubbliche nella risposta e nel keystore non corrispondono"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "La risposta del certificato e il certificato nel keystore sono identici"},
+        {"Failed.to.establish.chain.from.reply",
+                "Impossibile stabilire la catena dalla risposta"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "Risposta errata, riprovare"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "La chiave segreta non \u00E8 stata generata; l''alias <{0}> esiste gi\u00E0"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Specificare il valore -keysize per la generazione della chiave segreta"},
+
+        {"Extensions.", "Estensioni: "},
+        {".Empty.value.", "(valore vuoto)"},
+        {"Extension.Request.", "Richiesta di estensione:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "Richiesta di certificato PKCS #10 (versione 1.0)\nOggetto: %s\nChiave pubblica: %s formato %s chiave\n"},
+        {"Unknown.keyUsage.type.", "Tipo keyUsage sconosciuto: "},
+        {"Unknown.extendedkeyUsage.type.", "Tipo extendedkeyUsage sconosciuto: "},
+        {"Unknown.AccessDescription.type.", "Tipo AccessDescription sconosciuto: "},
+        {"Unrecognized.GeneralName.type.", "Tipo GeneralName non riconosciuto: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "Impossibile contrassegnare questa estensione come critica. "},
+        {"Odd.number.of.hex.digits.found.", "\u00C8 stato trovato un numero dispari di cifre esadecimali: "},
+        {"Unknown.extension.type.", "Tipo di estensione sconosciuto: "},
+        {"command.{0}.is.ambiguous.", "il comando {0} \u00E8 ambiguo:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_ja.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_ja extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [\u30AA\u30D7\u30B7\u30E7\u30F3]..."},
+        {"Options.", "\u30AA\u30D7\u30B7\u30E7\u30F3:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "\u4F7F\u7528\u53EF\u80FD\u306A\u3059\u3079\u3066\u306E\u30B3\u30DE\u30F3\u30C9\u306B\u3064\u3044\u3066\u306F\"keytool -help\"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Key.and.Certificate.Management.Tool",
+                 "\u30AD\u30FC\u304A\u3088\u3073\u8A3C\u660E\u66F8\u7BA1\u7406\u30C4\u30FC\u30EB"},
+        {"Commands.", "\u30B3\u30DE\u30F3\u30C9:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "command_name\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306F\"keytool -command_name -help\"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-changealias
+        {"Deletes.an.entry",
+                "\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664\u3057\u307E\u3059"}, //-delete
+        {"Exports.certificate",
+                "\u8A3C\u660E\u66F8\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-exportcert
+        {"Generates.a.key.pair",
+                "\u9375\u30DA\u30A2\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "\u79D8\u5BC6\u9375\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u304B\u3089\u8A3C\u660E\u66F8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-gencert
+        {"Generates.CRL", "CRL\u3092\u751F\u6210\u3057\u307E\u3059"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "JDK 1.1.x-style\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304B\u3089\u30A8\u30F3\u30C8\u30EA\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "\u8A3C\u660E\u66F8\u307E\u305F\u306F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "\u5225\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u30891\u3064\u307E\u305F\u306F\u3059\u3079\u3066\u306E\u30A8\u30F3\u30C8\u30EA\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u3092\u4F5C\u6210\u3057\u307E\u3059"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\u30A8\u30F3\u30C8\u30EA\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u30A8\u30F3\u30C8\u30EA\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "\u8A3C\u660E\u66F8\u306E\u5185\u5BB9\u3092\u51FA\u529B\u3057\u307E\u3059"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u5185\u5BB9\u3092\u51FA\u529B\u3057\u307E\u3059"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "CRL\u30D5\u30A1\u30A4\u30EB\u306E\u5185\u5BB9\u3092\u51FA\u529B\u3057\u307E\u3059"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "\u81EA\u5DF1\u7F72\u540D\u578B\u8A3C\u660E\u66F8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "\u51E6\u7406\u3059\u308B\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D"}, //-alias
+        {"destination.alias",
+                "\u51FA\u529B\u5148\u306E\u5225\u540D"}, //-destalias
+        {"destination.key.password",
+                "\u51FA\u529B\u5148\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-destkeypass
+        {"destination.keystore.name",
+                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u4FDD\u8B77\u5BFE\u8C61\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-destprovidername
+        {"destination.keystore.password",
+                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-deststorepass
+        {"destination.keystore.type",
+                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7"}, //-deststoretype
+        {"distinguished.name",
+                "\u8B58\u5225\u540D"}, //-dname
+        {"X.509.extension",
+                "X.509\u62E1\u5F35"}, //-ext
+        {"output.file.name",
+                "\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u540D"}, //-file and -outfile
+        {"input.file.name",
+                "\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u540D"}, //-file and -infile
+        {"key.algorithm.name",
+                "\u9375\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D"}, //-keyalg
+        {"key.password",
+                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-keypass
+        {"key.bit.size",
+                "\u9375\u306E\u30D3\u30C3\u30C8\u30FB\u30B5\u30A4\u30BA"}, //-keysize
+        {"keystore.name",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-keystore
+        {"new.password",
+                "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-new
+        {"do.not.prompt",
+                "\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u306A\u3044"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "\u4FDD\u8B77\u30E1\u30AB\u30CB\u30BA\u30E0\u306B\u3088\u308B\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-protected
+        {"provider.argument",
+                "\u30D7\u30ED\u30D0\u30A4\u30C0\u5F15\u6570"}, //-providerarg
+        {"provider.class.name",
+                "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FB\u30AF\u30E9\u30B9\u540D"}, //-providerclass
+        {"provider.name",
+                "\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-providername
+        {"provider.classpath",
+                "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9"}, //-providerpath
+        {"output.in.RFC.style",
+                "RFC\u30B9\u30BF\u30A4\u30EB\u306E\u51FA\u529B"}, //-rfc
+        {"signature.algorithm.name",
+                "\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D"}, //-sigalg
+        {"source.alias",
+                "\u30BD\u30FC\u30B9\u5225\u540D"}, //-srcalias
+        {"source.key.password",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-srckeypass
+        {"source.keystore.name",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u4FDD\u8B77\u5BFE\u8C61\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-srcprovidername
+        {"source.keystore.password",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-srcstorepass
+        {"source.keystore.type",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL\u30B5\u30FC\u30D0\u30FC\u306E\u30DB\u30B9\u30C8\u3068\u30DD\u30FC\u30C8"}, //-sslserver
+        {"signed.jar.file",
+                "\u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "\u8A3C\u660E\u66F8\u306E\u6709\u52B9\u958B\u59CB\u65E5\u6642"}, //-startdate
+        {"keystore.password",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-storepass
+        {"keystore.type",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "cacerts\u304B\u3089\u306E\u8A3C\u660E\u66F8\u3092\u4FE1\u983C\u3059\u308B"}, //-trustcacerts
+        {"verbose.output",
+                "\u8A73\u7D30\u51FA\u529B"}, //-v
+        {"validity.number.of.days",
+                "\u59A5\u5F53\u6027\u65E5\u6570"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "\u5931\u52B9\u3059\u308B\u8A3C\u660E\u66F8\u306E\u30B7\u30EA\u30A2\u30EBID"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "keytool\u30A8\u30E9\u30FC: "},
+        {"Illegal.option.", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3:  "},
+        {"Illegal.value.", "\u4E0D\u6B63\u306A\u5024: "},
+        {"Unknown.password.type.", "\u4E0D\u660E\u306A\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30BF\u30A4\u30D7: "},
+        {"Cannot.find.environment.variable.",
+                "\u74B0\u5883\u5909\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
+        {"Cannot.find.file.", "\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
+        {"Command.option.flag.needs.an.argument.", "\u30B3\u30DE\u30F3\u30C9\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002"},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "\u8B66\u544A: PKCS12\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u306F\u3001\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7570\u306A\u308B\u72B6\u6CC1\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F{0}\u306E\u5024\u306F\u7121\u8996\u3057\u307E\u3059\u3002"},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keystore\u306FNONE\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Too.many.retries.program.terminated",
+                 "\u518D\u8A66\u884C\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u30D7\u30ED\u30B0\u30E9\u30E0\u304C\u7D42\u4E86\u3057\u307E\u3057\u305F"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-storepasswd\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073-keypasswd\u30B3\u30DE\u30F3\u30C9\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "-storetype\u304CPKCS12\u306E\u5834\u5408\u3001-keypasswd\u30B3\u30DE\u30F3\u30C9\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keypass\u3068-new\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "-protected\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001-storepass\u3001-keypass\u304A\u3088\u3073-new\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "-srcprotected\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001-srcstorepass\u304A\u3088\u3073-srckeypass\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u4FDD\u8B77\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001-storepass\u3001-keypass\u304A\u3088\u3073-new\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u4FDD\u8B77\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001-srcstorepass\u304A\u3088\u3073-srckeypass\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"Illegal.startdate.value", "startdate\u5024\u304C\u7121\u52B9\u3067\u3059"},
+        {"Validity.must.be.greater.than.zero",
+                "\u59A5\u5F53\u6027\u306F\u30BC\u30ED\u3088\u308A\u5927\u304D\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"provName.not.a.provider", "{0}\u306F\u30D7\u30ED\u30D0\u30A4\u30C0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"Usage.error.no.command.provided", "\u4F7F\u7528\u30A8\u30E9\u30FC: \u30B3\u30DE\u30F3\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"Source.keystore.file.exists.but.is.empty.", "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u5B58\u5728\u3057\u307E\u3059\u304C\u7A7A\u3067\u3059: "},
+        {"Please.specify.srckeystore", "-srckeystore\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "'list'\u30B3\u30DE\u30F3\u30C9\u306B-v\u3068-rfc\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
+        {"Key.password.must.be.at.least.6.characters",
+                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"New.password.must.be.at.least.6.characters",
+                "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Keystore.file.exists.but.is.empty.",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u3059\u304C\u3001\u7A7A\u3067\u3059: "},
+        {"Keystore.file.does.not.exist.",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u305B\u3093: "},
+        {"Must.specify.destination.alias", "\u51FA\u529B\u5148\u306E\u5225\u540D\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Must.specify.alias", "\u5225\u540D\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Enter.keystore.password.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
+        {"Enter.source.keystore.password.", "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
+        {"Enter.destination.keystore.password.", "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u306B\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Unknown.Entry.Type", "\u4E0D\u660E\u306A\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7"},
+        {"Too.many.failures.Alias.not.changed", "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u5225\u540D\u306F\u5909\u66F4\u3055\u308C\u307E\u305B\u3093"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002"},
+        {"Entry.for.alias.alias.not.imported.", "\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u4E2D\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1}\u3002\n\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "\u30A4\u30F3\u30DD\u30FC\u30C8\u30FB\u30B3\u30DE\u30F3\u30C9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F: {0}\u4EF6\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u304C\u6210\u529F\u3057\u307E\u3057\u305F\u3002{1}\u4EF6\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u304C\u5931\u6557\u3057\u305F\u304B\u53D6\u308A\u6D88\u3055\u308C\u307E\u3057\u305F"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "\u8B66\u544A: \u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u65E2\u5B58\u306E\u5225\u540D{0}\u3092\u4E0A\u66F8\u304D\u3057\u3066\u3044\u307E\u3059"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "\u65E2\u5B58\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D{0}\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
+        {"Too.many.failures.try.later", "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059 - \u5F8C\u3067\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Certification.request.stored.in.file.filename.",
+                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u30D5\u30A1\u30A4\u30EB<{0}>\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F"},
+        {"Submit.this.to.your.CA", "\u3053\u308C\u3092CA\u306B\u63D0\u51FA\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "\u5225\u540D\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u3001\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u5225\u540D\u3001\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304A\u3088\u3073\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
+        {"Certificate.stored.in.file.filename.",
+                "\u8A3C\u660E\u66F8\u304C\u30D5\u30A1\u30A4\u30EB<{0}>\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u307E\u3057\u305F"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
+        {"Certificate.was.added.to.keystore",
+                "\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F"},
+        {"Certificate.was.not.added.to.keystore",
+                "\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
+        {".Storing.ksfname.", "[{0}\u3092\u683C\u7D0D\u4E2D]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0}\u306B\u306F\u516C\u958B\u9375(\u8A3C\u660E\u66F8)\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"Cannot.derive.signature.algorithm",
+                "\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093"},
+        {"Alias.alias.does.not.exist",
+                "\u5225\u540D<{0}>\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
+        {"Alias.alias.has.no.certificate",
+                "\u5225\u540D<{0}>\u306B\u306F\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "\u9375\u30DA\u30A2\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "{3}\u65E5\u9593\u6709\u52B9\u306A{0}\u30D3\u30C3\u30C8\u306E{1}\u306E\u9375\u30DA\u30A2\u3068\u81EA\u5DF1\u7F72\u540D\u578B\u8A3C\u660E\u66F8({2})\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059\n\t\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540D: {4}"},
+        {"Enter.key.password.for.alias.", "<{0}>\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u540C\u3058\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059 - \u9375\u306F\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
+        {"Destination.alias.dest.already.exists",
+                "\u51FA\u529B\u5148\u306E\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
+        {"key.password.for.alias.", "<{0}>\u306E\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30A8\u30F3\u30C8\u30EA\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u4F5C\u6210\u4E2D..."},
+        {"No.entries.from.identity.database.added",
+                "\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304B\u3089\u8FFD\u52A0\u3055\u308C\u305F\u30A8\u30F3\u30C8\u30EA\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"Alias.name.alias", "\u5225\u540D: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "\u4F5C\u6210\u65E5: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0},{1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7: {0}"},
+        {"Certificate.chain.length.", "\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306E\u9577\u3055: "},
+        {"Certificate.i.1.", "\u8A3C\u660E\u66F8[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8(SHA1): "},
+        {"Keystore.type.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7: "},
+        {"Keystore.provider.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u306F{0,number,integer}\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u307E\u3059"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u306F{0,number,integer}\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u307E\u3059"},
+        {"Failed.to.parse.input", "\u5165\u529B\u306E\u69CB\u6587\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
+        {"Empty.input", "\u5165\u529B\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"Not.X.509.certificate", "X.509\u8A3C\u660E\u66F8\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"alias.has.no.public.key", "{0}\u306B\u306F\u516C\u958B\u9375\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"alias.has.no.X.509.certificate", "{0}\u306B\u306FX.509\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"New.certificate.self.signed.", "\u65B0\u3057\u3044\u8A3C\u660E\u66F8(\u81EA\u5DF1\u7F72\u540D\u578B):"},
+        {"Reply.has.no.certificates", "\u5FDC\u7B54\u306B\u306F\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "\u8A3C\u660E\u66F8\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Input.not.an.X.509.certificate", "\u5165\u529B\u306FX.509\u8A3C\u660E\u66F8\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "\u8A3C\u660E\u66F8\u306F\u3001\u5225\u540D<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Do.you.still.want.to.add.it.no.",
+                "\u8FFD\u52A0\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "\u8A3C\u660E\u66F8\u306F\u3001\u5225\u540D<{0}>\u306E\u30B7\u30B9\u30C6\u30E0\u898F\u6A21\u306ECA\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306B\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3057\u307E\u3059\u304B\u3002 [\u3044\u3044\u3048]:  "},
+        {"Trust.this.certificate.no.", "\u3053\u306E\u8A3C\u660E\u66F8\u3092\u4FE1\u983C\u3057\u307E\u3059\u304B\u3002 [\u3044\u3044\u3048]:  "},
+        {"YES", "\u306F\u3044"},
+        {"New.prompt.", "\u65B0\u898F{0}: "},
+        {"Passwords.must.differ", "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7570\u306A\u3063\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Re.enter.new.prompt.", "\u65B0\u898F{0}\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+        {"Re.enter.new.password.", "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+        {"They.don.t.match.Try.again", "\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Enter.prompt.alias.name.", "{0}\u306E\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "\u65B0\u3057\u3044\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\t(\u3053\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u3092\u53D6\u308A\u6D88\u3059\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044):  "},
+        {"Enter.alias.name.", "\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(<{0}>\u3068\u540C\u3058\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044)"},
+        {".PATTERN.printX509Cert",
+                "\u6240\u6709\u8005: {0}\n\u767A\u884C\u8005: {1}\n\u30B7\u30EA\u30A2\u30EB\u756A\u53F7: {2}\n\u6709\u52B9\u671F\u9593\u306E\u958B\u59CB\u65E5: {3}\u7D42\u4E86\u65E5: {4}\n\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D: {8}\n\t \u30D0\u30FC\u30B8\u30E7\u30F3: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "\u59D3\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "\u7D44\u7E54\u5358\u4F4D\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"What.is.the.name.of.your.organization.",
+                "\u7D44\u7E54\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "\u90FD\u5E02\u540D\u307E\u305F\u306F\u5730\u57DF\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "\u90FD\u9053\u5E9C\u770C\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "\u3053\u306E\u5358\u4F4D\u306B\u8A72\u5F53\u3059\u308B2\u6587\u5B57\u306E\u56FD\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"Is.name.correct.", "{0}\u3067\u3088\u308D\u3057\u3044\u3067\u3059\u304B\u3002"},
+        {"no", "\u3044\u3044\u3048"},
+        {"yes", "\u306F\u3044"},
+        {"y", "y"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "\u5225\u540D<{0}>\u306B\u306F\u9375\u304C\u3042\u308A\u307E\u305B\u3093"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "\u5225\u540D<{0}>\u304C\u53C2\u7167\u3057\u3066\u3044\u308B\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7\u306F\u79D8\u5BC6\u9375\u30A8\u30F3\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002-keyclone\u30B3\u30DE\u30F3\u30C9\u306F\u79D8\u5BC6\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u4F5C\u6210\u306E\u307F\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************\u8B66\u544A \u8B66\u544A \u8B66\u544A*****************"},
+        {"Signer.d.", "\u7F72\u540D\u8005\u756A\u53F7%d:"},
+        {"Timestamp.", "\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7:"},
+        {"Signature.", "\u7F72\u540D:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "\u8A3C\u660E\u66F8\u306E\u6240\u6709\u8005: "},
+        {"Not.a.signed.jar.file", "\u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
+        {"No.certificate.from.the.SSL.server",
+                "SSL\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u306E\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "*\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u4FDD\u5B58\u3055\u308C\u305F\u60C5\u5831\u306E\u6574\u5408\u6027\u306F*\n*\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u6574\u5408\u6027\u3092\u691C\u8A3C\u3059\u308B\u306B\u306F*\n*\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002*"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "*\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u4FDD\u5B58\u3055\u308C\u305F\u60C5\u5831\u306E\u6574\u5408\u6027\u306F*\n*\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u6574\u5408\u6027\u3092\u691C\u8A3C\u3059\u308B\u306B\u306F*\n*\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002*"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u306B\u306F\u3001<{0}>\u306E\u516C\u958B\u9375\u306F\u542B\u307E\u308C\u307E\u305B\u3093"},
+        {"Incomplete.certificate.chain.in.reply",
+                "\u5FDC\u7B54\u3057\u305F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u4E0D\u5B8C\u5168\u3067\u3059"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "\u5FDC\u7B54\u3057\u305F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093: "},
+        {"Top.level.certificate.in.reply.",
+                "\u5FDC\u7B54\u3057\u305F\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306E\u8A3C\u660E\u66F8:\n"},
+        {".is.not.trusted.", "... \u306F\u4FE1\u983C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 "},
+        {"Install.reply.anyway.no.", "\u5FDC\u7B54\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
+        {"NO", "\u3044\u3044\u3048"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "\u5FDC\u7B54\u3057\u305F\u516C\u958B\u9375\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u8A3C\u660E\u66F8\u304C\u540C\u3058\u3067\u3059"},
+        {"Failed.to.establish.chain.from.reply",
+                "\u5FDC\u7B54\u304B\u3089\u9023\u9396\u3092\u78BA\u7ACB\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "\u5FDC\u7B54\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "\u79D8\u5BC6\u9375\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "\u79D8\u5BC6\u9375\u306E\u751F\u6210\u6642\u306B\u306F -keysize\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
+
+        {"Extensions.", "\u62E1\u5F35: "},
+        {".Empty.value.", "(\u7A7A\u306E\u5024)"},
+        {"Extension.Request.", "\u62E1\u5F35\u30EA\u30AF\u30A8\u30B9\u30C8:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8(\u30D0\u30FC\u30B8\u30E7\u30F31.0)\n\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8: %s\n\u516C\u958B\u9375: %s \u30D5\u30A9\u30FC\u30DE\u30C3\u30C8 %s \u30AD\u30FC\n"},
+        {"Unknown.keyUsage.type.", "\u4E0D\u660E\u306AkeyUsage\u30BF\u30A4\u30D7: "},
+        {"Unknown.extendedkeyUsage.type.", "\u4E0D\u660E\u306AextendedkeyUsage\u30BF\u30A4\u30D7: "},
+        {"Unknown.AccessDescription.type.", "\u4E0D\u660E\u306AAccessDescription\u30BF\u30A4\u30D7: "},
+        {"Unrecognized.GeneralName.type.", "\u8A8D\u8B58\u3055\u308C\u306A\u3044GeneralName\u30BF\u30A4\u30D7: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "\u3053\u306E\u62E1\u5F35\u306F\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u3068\u3057\u3066\u30DE\u30FC\u30AF\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3002 "},
+        {"Odd.number.of.hex.digits.found.", "\u5947\u6570\u306E16\u9032\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: "},
+        {"Unknown.extension.type.", "\u4E0D\u660E\u306A\u62E1\u5F35\u30BF\u30A4\u30D7: "},
+        {"command.{0}.is.ambiguous.", "\u30B3\u30DE\u30F3\u30C9{0}\u306F\u3042\u3044\u307E\u3044\u3067\u3059:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_ko.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_ko extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [\uC635\uC158]..."},
+        {"Options.", "\uC635\uC158:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uBAA8\uB4E0 \uBA85\uB839\uC5D0 \"keytool -help\" \uC0AC\uC6A9"},
+        {"Key.and.Certificate.Management.Tool",
+                 "\uD0A4 \uBC0F \uC778\uC99D\uC11C \uAD00\uB9AC \uD234"},
+        {"Commands.", "\uBA85\uB839:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "command_name \uC0AC\uC6A9\uBC95\uC5D0 \"keytool -command_name -help\" \uC0AC\uC6A9"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "\uC778\uC99D\uC11C \uC694\uCCAD\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\uD56D\uBAA9\uC758 \uBCC4\uCE6D\uC744 \uBCC0\uACBD\uD569\uB2C8\uB2E4."}, //-changealias
+        {"Deletes.an.entry",
+                "\uD56D\uBAA9\uC744 \uC0AD\uC81C\uD569\uB2C8\uB2E4."}, //-delete
+        {"Exports.certificate",
+                "\uC778\uC99D\uC11C\uB97C \uC775\uC2A4\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-exportcert
+        {"Generates.a.key.pair",
+                "\uD0A4 \uC30D\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "\uBCF4\uC548 \uD0A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "\uC778\uC99D\uC11C \uC694\uCCAD\uC5D0\uC11C \uC778\uC99D\uC11C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-gencert
+        {"Generates.CRL", "CRL\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "JDK 1.1.x \uC2A4\uD0C0\uC77C ID \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0\uC11C \uD56D\uBAA9\uC744 \uC784\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "\uC778\uC99D\uC11C \uB610\uB294 \uC778\uC99D\uC11C \uCCB4\uC778\uC744 \uC784\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "\uB2E4\uB978 \uD0A4 \uC800\uC7A5\uC18C\uC5D0\uC11C \uD558\uB098 \uB610\uB294 \uBAA8\uB4E0 \uD56D\uBAA9\uC744 \uC784\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-importkeystore
+        {"Clones.a.key.entry",
+                "\uD0A4 \uD56D\uBAA9\uC744 \uBCF5\uC81C\uD569\uB2C8\uB2E4."}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\uD56D\uBAA9\uC758 \uD0A4 \uBE44\uBC00\uBC88\uD638\uB97C \uBCC0\uACBD\uD569\uB2C8\uB2E4."}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "\uD0A4 \uC800\uC7A5\uC18C\uC758 \uD56D\uBAA9\uC744 \uB098\uC5F4\uD569\uB2C8\uB2E4."}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "\uC778\uC99D\uC11C\uC758 \uCF58\uD150\uCE20\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4."}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "\uC778\uC99D\uC11C \uC694\uCCAD\uC758 \uCF58\uD150\uCE20\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4."}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "CRL \uD30C\uC77C\uC758 \uCF58\uD150\uCE20\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4."}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "\uC790\uCCB4 \uC11C\uBA85\uB41C \uC778\uC99D\uC11C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\uD0A4 \uC800\uC7A5\uC18C\uC758 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB97C \uBCC0\uACBD\uD569\uB2C8\uB2E4."}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "\uCC98\uB9AC\uD560 \uD56D\uBAA9\uC758 \uBCC4\uCE6D \uC774\uB984"}, //-alias
+        {"destination.alias",
+                "\uB300\uC0C1 \uBCC4\uCE6D"}, //-destalias
+        {"destination.key.password",
+                "\uB300\uC0C1 \uD0A4 \uBE44\uBC00\uBC88\uD638"}, //-destkeypass
+        {"destination.keystore.name",
+                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB428"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790 \uC774\uB984"}, //-destprovidername
+        {"destination.keystore.password",
+                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638"}, //-deststorepass
+        {"destination.keystore.type",
+                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uC720\uD615"}, //-deststoretype
+        {"distinguished.name",
+                "\uC2DD\uBCC4 \uC774\uB984"}, //-dname
+        {"X.509.extension",
+                "X.509 \uD655\uC7A5"}, //-ext
+        {"output.file.name",
+                "\uCD9C\uB825 \uD30C\uC77C \uC774\uB984"}, //-file and -outfile
+        {"input.file.name",
+                "\uC785\uB825 \uD30C\uC77C \uC774\uB984"}, //-file and -infile
+        {"key.algorithm.name",
+                "\uD0A4 \uC54C\uACE0\uB9AC\uC998 \uC774\uB984"}, //-keyalg
+        {"key.password",
+                "\uD0A4 \uBE44\uBC00\uBC88\uD638"}, //-keypass
+        {"key.bit.size",
+                "\uD0A4 \uBE44\uD2B8 \uD06C\uAE30"}, //-keysize
+        {"keystore.name",
+                "\uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-keystore
+        {"new.password",
+                "\uC0C8 \uBE44\uBC00\uBC88\uD638"}, //-new
+        {"do.not.prompt",
+                "\uD655\uC778\uD558\uC9C0 \uC54A\uC74C"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "\uBCF4\uD638\uB418\uB294 \uBA54\uCEE4\uB2C8\uC998\uC744 \uD1B5\uD55C \uBE44\uBC00\uBC88\uD638"}, //-protected
+        {"provider.argument",
+                "\uC81C\uACF5\uC790 \uC778\uC218"}, //-providerarg
+        {"provider.class.name",
+                "\uC81C\uACF5\uC790 \uD074\uB798\uC2A4 \uC774\uB984"}, //-providerclass
+        {"provider.name",
+                "\uC81C\uACF5\uC790 \uC774\uB984"}, //-providername
+        {"provider.classpath",
+                "\uC81C\uACF5\uC790 \uD074\uB798\uC2A4 \uACBD\uB85C"}, //-providerpath
+        {"output.in.RFC.style",
+                "RFC \uC2A4\uD0C0\uC77C\uC758 \uCD9C\uB825"}, //-rfc
+        {"signature.algorithm.name",
+                "\uC11C\uBA85 \uC54C\uACE0\uB9AC\uC998 \uC774\uB984"}, //-sigalg
+        {"source.alias",
+                "\uC18C\uC2A4 \uBCC4\uCE6D"}, //-srcalias
+        {"source.key.password",
+                "\uC18C\uC2A4 \uD0A4 \uBE44\uBC00\uBC88\uD638"}, //-srckeypass
+        {"source.keystore.name",
+                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB428"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790 \uC774\uB984"}, //-srcprovidername
+        {"source.keystore.password",
+                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638"}, //-srcstorepass
+        {"source.keystore.type",
+                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uC720\uD615"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL \uC11C\uBC84 \uD638\uC2A4\uD2B8 \uBC0F \uD3EC\uD2B8"}, //-sslserver
+        {"signed.jar.file",
+                "\uC11C\uBA85\uB41C jar \uD30C\uC77C"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "\uC778\uC99D\uC11C \uC720\uD6A8 \uAE30\uAC04 \uC2DC\uC791 \uB0A0\uC9DC/\uC2DC\uAC04"}, //-startdate
+        {"keystore.password",
+                "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638"}, //-storepass
+        {"keystore.type",
+                "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "cacerts\uC758 \uBCF4\uC548 \uC778\uC99D\uC11C"}, //-trustcacerts
+        {"verbose.output",
+                "\uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825"}, //-v
+        {"validity.number.of.days",
+                "\uC720\uD6A8 \uAE30\uAC04 \uC77C \uC218"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "\uCCA0\uD68C\uD560 \uC778\uC99D\uC11C\uC758 \uC77C\uB828 ID"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "keytool \uC624\uB958: "},
+        {"Illegal.option.", "\uC798\uBABB\uB41C \uC635\uC158:   "},
+        {"Illegal.value.", "\uC798\uBABB\uB41C \uAC12: "},
+        {"Unknown.password.type.", "\uC54C \uC218 \uC5C6\uB294 \uBE44\uBC00\uBC88\uD638 \uC720\uD615: "},
+        {"Cannot.find.environment.variable.",
+                "\uD658\uACBD \uBCC0\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: "},
+        {"Cannot.find.file.", "\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: "},
+        {"Command.option.flag.needs.an.argument.", "\uBA85\uB839 \uC635\uC158 {0}\uC5D0 \uC778\uC218\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "\uACBD\uACE0: \uB2E4\uB978 \uC800\uC7A5\uC18C \uBC0F \uD0A4 \uBE44\uBC00\uBC88\uD638\uB294 PKCS12 KeyStores\uC5D0 \uB300\uD574 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C {0} \uAC12\uC744 \uBB34\uC2DC\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -keystore\uB294 NONE\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Too.many.retries.program.terminated",
+                 "\uC7AC\uC2DC\uB3C4 \uD69F\uC218\uAC00 \uB108\uBB34 \uB9CE\uC544 \uD504\uB85C\uADF8\uB7A8\uC774 \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -storepasswd \uBC0F -keypasswd \uBA85\uB839\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "-storetype\uC774 PKCS12\uC778 \uACBD\uC6B0 -keypasswd \uBA85\uB839\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -keypass \uBC0F -new\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "-protected\uB97C \uC9C0\uC815\uD55C \uACBD\uC6B0 -storepass, -keypass \uBC0F -new\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "-srcprotected\uB97C \uC9C0\uC815\uD55C \uACBD\uC6B0 -srcstorepass \uBC0F -srckeypass\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "\uD0A4 \uC800\uC7A5\uC18C\uAC00 \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 -storepass, -keypass \uBC0F -new\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C\uAC00 \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 -srcstorepass \uBC0F -srckeypass\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
+        {"Illegal.startdate.value", "startdate \uAC12\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {"Validity.must.be.greater.than.zero",
+                "\uC720\uD6A8 \uAE30\uAC04\uC740 0\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4."},
+        {"provName.not.a.provider", "{0}\uC740(\uB294) \uC81C\uACF5\uC790\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
+        {"Usage.error.no.command.provided", "\uC0AC\uC6A9\uBC95 \uC624\uB958: \uBA85\uB839\uC744 \uC785\uB825\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"Source.keystore.file.exists.but.is.empty.", "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0\uB9CC \uBE44\uC5B4 \uC788\uC74C: "},
+        {"Please.specify.srckeystore", "-srckeystore\uB97C \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624."},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "'list' \uBA85\uB839\uC5D0 -v\uC640 -rfc\uB97C \uD568\uAED8 \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
+        {"Key.password.must.be.at.least.6.characters",
+                "\uD0A4 \uBE44\uBC00\uBC88\uD638\uB294 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"New.password.must.be.at.least.6.characters",
+                "\uC0C8 \uBE44\uBC00\uBC88\uD638\uB294 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Keystore.file.exists.but.is.empty.",
+                "\uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0\uB9CC \uBE44\uC5B4 \uC788\uC74C: "},
+        {"Keystore.file.does.not.exist.",
+                "\uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC74C: "},
+        {"Must.specify.destination.alias", "\uB300\uC0C1 \uBCC4\uCE6D\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."},
+        {"Must.specify.alias", "\uBCC4\uCE6D\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB294 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Enter.keystore.password.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 \uC785\uB825:  "},
+        {"Enter.source.keystore.password.", "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 \uC785\uB825:  "},
+        {"Enter.destination.keystore.password.", "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 \uC785\uB825:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uAC00 \uB108\uBB34 \uC9E7\uC74C - 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Unknown.Entry.Type", "\uC54C \uC218 \uC5C6\uB294 \uD56D\uBAA9 \uC720\uD615"},
+        {"Too.many.failures.Alias.not.changed", "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4. \uBCC4\uCE6D\uC774 \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC774 \uC131\uACF5\uC801\uC73C\uB85C \uC784\uD3EC\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {"Entry.for.alias.alias.not.imported.", "{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC774 \uC784\uD3EC\uD2B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC744 \uC784\uD3EC\uD2B8\uD558\uB294 \uC911 \uBB38\uC81C \uBC1C\uC0DD: {1}.\n{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC774 \uC784\uD3EC\uD2B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "\uC784\uD3EC\uD2B8 \uBA85\uB839 \uC644\uB8CC: \uC131\uACF5\uC801\uC73C\uB85C \uC784\uD3EC\uD2B8\uB41C \uD56D\uBAA9\uC740 {0}\uAC1C, \uC2E4\uD328\uD558\uAC70\uB098 \uCDE8\uC18C\uB41C \uD56D\uBAA9\uC740 {1}\uAC1C\uC785\uB2C8\uB2E4."},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "\uACBD\uACE0: \uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C\uC5D0\uC11C \uAE30\uC874 \uBCC4\uCE6D {0}\uC744(\uB97C) \uACB9\uCCD0 \uC4F0\uB294 \uC911"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "\uAE30\uC874 \uD56D\uBAA9 \uBCC4\uCE6D {0}\uC774(\uAC00) \uC874\uC7AC\uD569\uB2C8\uB2E4. \uACB9\uCCD0 \uC4F0\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
+        {"Too.many.failures.try.later", "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC74C - \uB098\uC911\uC5D0 \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
+        {"Certification.request.stored.in.file.filename.",
+                "\uC778\uC99D \uC694\uCCAD\uC774 <{0}> \uD30C\uC77C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {"Submit.this.to.your.CA", "CA\uC5D0\uAC8C \uC81C\uCD9C\uD558\uC2ED\uC2DC\uC624."},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "\uBCC4\uCE6D\uC744 \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0 destalias, srckeypass \uBC0F destkeypass\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
+        {"Certificate.stored.in.file.filename.",
+                "\uC778\uC99D\uC11C\uAC00 <{0}> \uD30C\uC77C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.reply.was.installed.in.keystore",
+                "\uC778\uC99D\uC11C \uD68C\uC2E0\uC774 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC124\uCE58\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "\uC778\uC99D\uC11C \uD68C\uC2E0\uC774 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.was.added.to.keystore",
+                "\uC778\uC99D\uC11C\uAC00 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uCD94\uAC00\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.was.not.added.to.keystore",
+                "\uC778\uC99D\uC11C\uAC00 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uCD94\uAC00\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {".Storing.ksfname.", "[{0}\uC744(\uB97C) \uC800\uC7A5\uD558\uB294 \uC911]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0}\uC5D0 \uACF5\uC6A9 \uD0A4(\uC778\uC99D\uC11C)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Cannot.derive.signature.algorithm",
+                "\uC11C\uBA85 \uC54C\uACE0\uB9AC\uC998\uC744 \uD30C\uC0DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Alias.alias.does.not.exist",
+                "<{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
+        {"Alias.alias.has.no.certificate",
+                "<{0}> \uBCC4\uCE6D\uC5D0 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "\uD0A4 \uC30D\uC774 \uC0DD\uC131\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 <{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "\uB2E4\uC74C\uC5D0 \uB300\uD574 \uC720\uD6A8 \uAE30\uAC04\uC774 {3}\uC77C\uC778 {0}\uBE44\uD2B8 {1} \uD0A4 \uC30D \uBC0F \uC790\uCCB4 \uC11C\uBA85\uB41C \uC778\uC99D\uC11C({2})\uB97C \uC0DD\uC131\uD558\uB294 \uC911\n\t: {4}"},
+        {"Enter.key.password.for.alias.", "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uC640 \uB3D9\uC77C\uD55C \uACBD\uC6B0 Enter \uD0A4\uB97C \uB204\uB984):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "\uD0A4 \uBE44\uBC00\uBC88\uD638\uAC00 \uB108\uBB34 \uC9E7\uC74C - 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC74C - \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uD0A4\uAC00 \uCD94\uAC00\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"Destination.alias.dest.already.exists",
+                "\uB300\uC0C1 \uBCC4\uCE6D <{0}>\uC774(\uAC00) \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "\uBE44\uBC00\uBC88\uD638\uAC00 \uB108\uBB34 \uC9E7\uC74C - 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4. \uD0A4 \uD56D\uBAA9\uC774 \uBCF5\uC81C\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
+        {"key.password.for.alias.", "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uBE44\uBC00\uBC88\uD638"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uC800\uC7A5\uC18C \uD56D\uBAA9\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Creating.keystore.entry.for.id.getName.",
+                "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uC800\uC7A5\uC18C \uD56D\uBAA9\uC744 \uC0DD\uC131\uD558\uB294 \uC911..."},
+        {"No.entries.from.identity.database.added",
+                "ID \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0\uC11C \uCD94\uAC00\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Alias.name.alias", "\uBCC4\uCE6D \uC774\uB984: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "\uC0DD\uC131 \uB0A0\uC9DC: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "\uD56D\uBAA9 \uC720\uD615: {0}"},
+        {"Certificate.chain.length.", "\uC778\uC99D\uC11C \uCCB4\uC778 \uAE38\uC774: "},
+        {"Certificate.i.1.", "\uC778\uC99D\uC11C[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "\uC778\uC99D\uC11C \uC9C0\uBB38(SHA1): "},
+        {"Keystore.type.", "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615: "},
+        {"Keystore.provider.", "\uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "\uD0A4 \uC800\uC7A5\uC18C\uC5D0 {0,number,integer}\uAC1C\uC758 \uD56D\uBAA9\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "\uD0A4 \uC800\uC7A5\uC18C\uC5D0 {0,number,integer}\uAC1C\uC758 \uD56D\uBAA9\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
+        {"Failed.to.parse.input", "\uC785\uB825\uAC12\uC758 \uAD6C\uBB38 \uBD84\uC11D\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
+        {"Empty.input", "\uC785\uB825\uAC12\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
+        {"Not.X.509.certificate", "X.509 \uC778\uC99D\uC11C\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
+        {"alias.has.no.public.key", "{0}\uC5D0 \uACF5\uC6A9 \uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"alias.has.no.X.509.certificate", "{0}\uC5D0 X.509 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"New.certificate.self.signed.", "\uC0C8 \uC778\uC99D\uC11C(\uC790\uCCB4 \uC11C\uBA85):"},
+        {"Reply.has.no.certificates", "\uD68C\uC2E0\uC5D0 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "\uC778\uC99D\uC11C\uAC00 \uC784\uD3EC\uD2B8\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 <{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Input.not.an.X.509.certificate", "\uC785\uB825\uC774 X.509 \uC778\uC99D\uC11C\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "\uC778\uC99D\uC11C\uAC00 <{0}> \uBCC4\uCE6D \uC544\uB798\uC758 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Do.you.still.want.to.add.it.no.",
+                "\uCD94\uAC00\uD558\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "\uC778\uC99D\uC11C\uAC00 <{0}> \uBCC4\uCE6D \uC544\uB798\uC5D0 \uC788\uB294 \uC2DC\uC2A4\uD15C \uCC28\uC6D0\uC758 CA \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "\uACE0\uC720\uD55C \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uCD94\uAC00\uD558\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
+        {"Trust.this.certificate.no.", "\uC774 \uC778\uC99D\uC11C\uB97C \uC2E0\uB8B0\uD569\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
+        {"YES", "\uC608"},
+        {"New.prompt.", "\uC0C8 {0}: "},
+        {"Passwords.must.differ", "\uBE44\uBC00\uBC88\uD638\uB294 \uB2EC\uB77C\uC57C \uD569\uB2C8\uB2E4."},
+        {"Re.enter.new.prompt.", "\uC0C8 {0} \uB2E4\uC2DC \uC785\uB825: "},
+        {"Re.enter.new.password.", "\uC0C8 \uBE44\uBC00\uBC88\uD638 \uB2E4\uC2DC \uC785\uB825: "},
+        {"They.don.t.match.Try.again", "\uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
+        {"Enter.prompt.alias.name.", "{0} \uBCC4\uCE6D \uC774\uB984 \uC785\uB825:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "\uC0C8 \uBCC4\uCE6D \uC774\uB984 \uC785\uB825\t(\uC774 \uD56D\uBAA9\uC5D0 \uB300\uD55C \uC784\uD3EC\uD2B8\uB97C \uCDE8\uC18C\uD558\uB824\uBA74 Enter \uD0A4\uB97C \uB204\uB984):  "},
+        {"Enter.alias.name.", "\uBCC4\uCE6D \uC774\uB984 \uC785\uB825:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(<{0}>\uACFC(\uC640) \uB3D9\uC77C\uD55C \uACBD\uC6B0 Enter \uD0A4\uB97C \uB204\uB984)"},
+        {".PATTERN.printX509Cert",
+                "\uC18C\uC720\uC790: {0}\n\uBC1C\uD589\uC790: {1}\n\uC77C\uB828 \uBC88\uD638: {2}\n\uC801\uD569\uD55C \uC2DC\uC791 \uB0A0\uC9DC: {3}, \uC885\uB8CC \uB0A0\uC9DC: {4}\n\uC778\uC99D\uC11C \uC9C0\uBB38:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \uC11C\uBA85 \uC54C\uACE0\uB9AC\uC998 \uC774\uB984: {8}\n\t \uBC84\uC804: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "\uC774\uB984\uACFC \uC131\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "\uC870\uC9C1 \uB2E8\uC704 \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
+        {"What.is.the.name.of.your.organization.",
+                "\uC870\uC9C1 \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "\uAD6C/\uAD70/\uC2DC \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "\uC2DC/\uB3C4 \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "\uC774 \uC870\uC9C1\uC758 \uB450 \uC790\uB9AC \uAD6D\uAC00 \uCF54\uB4DC\uB97C \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
+        {"Is.name.correct.", "{0}\uC774(\uAC00) \uB9DE\uC2B5\uB2C8\uAE4C?"},
+        {"no", "\uC544\uB2C8\uC624"},
+        {"yes", "\uC608"},
+        {"y", "y"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "<{0}> \uBCC4\uCE6D\uC5D0 \uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "<{0}> \uBCC4\uCE6D\uC740 \uC804\uC6A9 \uD0A4 \uD56D\uBAA9\uC774 \uC544\uB2CC \uD56D\uBAA9 \uC720\uD615\uC744 \uCC38\uC870\uD569\uB2C8\uB2E4. -keyclone \uBA85\uB839\uC740 \uC804\uC6A9 \uD0A4 \uD56D\uBAA9\uC758 \uBCF5\uC81C\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  \uACBD\uACE0 \uACBD\uACE0 \uACBD\uACE0  *****************"},
+        {"Signer.d.", "\uC11C\uBA85\uC790 #%d:"},
+        {"Timestamp.", "\uC2DC\uAC04 \uAE30\uB85D:"},
+        {"Signature.", "\uC11C\uBA85:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "\uC778\uC99D\uC11C \uC18C\uC720\uC790: "},
+        {"Not.a.signed.jar.file", "\uC11C\uBA85\uB41C jar \uD30C\uC77C\uC774 \uC544\uB2D9\uB2C8\uB2E4."},
+        {"No.certificate.from.the.SSL.server",
+                "SSL \uC11C\uBC84\uC5D0\uC11C \uAC00\uC838\uC628 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB41C \uC815\uBCF4\uC758 \uBB34\uACB0\uC131\uC774  *\n* \uD655\uC778\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4! \uBB34\uACB0\uC131\uC744 \uD655\uC778\uD558\uB824\uBA74, *\n* \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uACF5\uD574\uC57C \uD569\uB2C8\uB2E4.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* srckeystore\uC5D0 \uC800\uC7A5\uB41C \uC815\uBCF4\uC758 \uBB34\uACB0\uC131\uC774  *\n* \uD655\uC778\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4! \uBB34\uACB0\uC131\uC744 \uD655\uC778\uD558\uB824\uBA74, *\n* srckeystore \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uACF5\uD574\uC57C \uD569\uB2C8\uB2E4.                  *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "\uC778\uC99D\uC11C \uD68C\uC2E0\uC5D0 <{0}>\uC5D0 \uB300\uD55C \uACF5\uC6A9 \uD0A4\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
+        {"Incomplete.certificate.chain.in.reply",
+                "\uD68C\uC2E0\uC5D0 \uBD88\uC644\uC804\uD55C \uC778\uC99D\uC11C \uCCB4\uC778\uC774 \uC788\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "\uD68C\uC2E0\uC758 \uC778\uC99D\uC11C \uCCB4\uC778\uC774 \uD655\uC778\uB418\uC9C0 \uC54A\uC74C: "},
+        {"Top.level.certificate.in.reply.",
+                "\uD68C\uC2E0\uC5D0 \uCD5C\uC0C1\uC704 \uB808\uBCA8 \uC778\uC99D\uC11C\uAC00 \uC788\uC74C:\n"},
+        {".is.not.trusted.", "...\uC744(\uB97C) \uC2E0\uB8B0\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
+        {"Install.reply.anyway.no.", "\uD68C\uC2E0\uC744 \uC124\uCE58\uD558\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
+        {"NO", "\uC544\uB2C8\uC624"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "\uD68C\uC2E0\uACFC \uD0A4 \uC800\uC7A5\uC18C\uC758 \uACF5\uC6A9 \uD0A4\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "\uD68C\uC2E0\uACFC \uD0A4 \uC800\uC7A5\uC18C\uC758 \uC778\uC99D\uC11C\uAC00 \uB3D9\uC77C\uD569\uB2C8\uB2E4."},
+        {"Failed.to.establish.chain.from.reply",
+                "\uD68C\uC2E0\uC758 \uCCB4\uC778 \uC124\uC815\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "\uC798\uBABB\uB41C \uC751\uB2F5\uC785\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "\uBCF4\uC548 \uD0A4\uAC00 \uC0DD\uC131\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 <{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "\uBCF4\uC548 \uD0A4\uB97C \uC0DD\uC131\uD558\uB824\uBA74 -keysize\uB97C \uC81C\uACF5\uD558\uC2ED\uC2DC\uC624."},
+
+        {"Extensions.", "\uD655\uC7A5: "},
+        {".Empty.value.", "(\uBE44\uC5B4 \uC788\uB294 \uAC12)"},
+        {"Extension.Request.", "\uD655\uC7A5 \uC694\uCCAD:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10 \uC778\uC99D\uC11C \uC694\uCCAD(1.0 \uBC84\uC804)\n\uC81C\uBAA9: %s\n\uACF5\uC6A9 \uD0A4: %s \uD615\uC2DD %s \uD0A4\n"},
+        {"Unknown.keyUsage.type.", "\uC54C \uC218 \uC5C6\uB294 keyUsage \uC720\uD615: "},
+        {"Unknown.extendedkeyUsage.type.", "\uC54C \uC218 \uC5C6\uB294 extendedkeyUsage \uC720\uD615: "},
+        {"Unknown.AccessDescription.type.", "\uC54C \uC218 \uC5C6\uB294 AccessDescription \uC720\uD615: "},
+        {"Unrecognized.GeneralName.type.", "\uC54C \uC218 \uC5C6\uB294 GeneralName \uC720\uD615: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "\uC774 \uD655\uC7A5\uC740 \uC911\uC694\uD55C \uAC83\uC73C\uB85C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
+        {"Odd.number.of.hex.digits.found.", "\uD640\uC218 \uAC1C\uC758 16\uC9C4\uC218\uAC00 \uBC1C\uACAC\uB428: "},
+        {"Unknown.extension.type.", "\uC54C \uC218 \uC5C6\uB294 \uD655\uC7A5 \uC720\uD615: "},
+        {"command.{0}.is.ambiguous.", "{0} \uBA85\uB839\uC774 \uBAA8\uD638\uD568:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_pt_BR.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_pt_BR extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [Op\u00E7\u00E3o]..."},
+        {"Options.", "Op\u00E7\u00F5es:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "Use \"keytool -help\" para todos os comandos dispon\u00EDveis"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Ferramenta de Gerenciamento de Chave e Certificado"},
+        {"Commands.", "Comandos:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "Use \"keytool -command_name -help\" para uso de command_name"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "Gera uma solicita\u00E7\u00E3o de certificado"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "Altera um alias de entrada"}, //-changealias
+        {"Deletes.an.entry",
+                "Deleta uma entrada"}, //-delete
+        {"Exports.certificate",
+                "Exporta o certificado"}, //-exportcert
+        {"Generates.a.key.pair",
+                "Gera um par de chaves"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "Gera uma chave Secreta"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "Gera um certificado de uma solicita\u00E7\u00E3o de certificado"}, //-gencert
+        {"Generates.CRL", "Gera CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Importa entradas de um banco de dados de identidade JDK 1.1.x-style"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Importa um certificado ou uma cadeia de certificados"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Importa uma ou todas as entradas de outra \u00E1rea de armazenamento de chaves"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Clona uma entrada de chave"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "Altera a senha da chave de uma entrada"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "Lista entradas em uma \u00E1rea de armazenamento de chaves"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Imprime o conte\u00FAdo de um certificado"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Imprime o conte\u00FAdo de uma solicita\u00E7\u00E3o de certificado"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Imprime o conte\u00FAdo de um arquivo CRL"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "Gera um certificado autoassinado"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "Altera a senha de armazenamento de uma \u00E1rea de armazenamento de chaves"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "nome do alias da entrada a ser processada"}, //-alias
+        {"destination.alias",
+                "alias de destino"}, //-destalias
+        {"destination.key.password",
+                "senha da chave de destino"}, //-destkeypass
+        {"destination.keystore.name",
+                "nome da \u00E1rea de armazenamento de chaves de destino"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "senha protegida da \u00E1rea de armazenamento de chaves de destino"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "nome do fornecedor da \u00E1rea de armazenamento de chaves de destino"}, //-destprovidername
+        {"destination.keystore.password",
+                "senha da \u00E1rea de armazenamento de chaves de destino"}, //-deststorepass
+        {"destination.keystore.type",
+                "tipo de \u00E1rea de armazenamento de chaves de destino"}, //-deststoretype
+        {"distinguished.name",
+                "nome distinto"}, //-dname
+        {"X.509.extension",
+                "extens\u00E3o X.509"}, //-ext
+        {"output.file.name",
+                "nome do arquivo de sa\u00EDda"}, //-file and -outfile
+        {"input.file.name",
+                "nome do arquivo de entrada"}, //-file and -infile
+        {"key.algorithm.name",
+                "nome do algoritmo da chave"}, //-keyalg
+        {"key.password",
+                "senha da chave"}, //-keypass
+        {"key.bit.size",
+                "tamanho do bit da chave"}, //-keysize
+        {"keystore.name",
+                "nome da \u00E1rea de armazenamento de chaves"}, //-keystore
+        {"new.password",
+                "nova senha"}, //-new
+        {"do.not.prompt",
+                "n\u00E3o perguntar"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "senha por meio de mecanismo protegido"}, //-protected
+        {"provider.argument",
+                "argumento do fornecedor"}, //-providerarg
+        {"provider.class.name",
+                "nome da classe do fornecedor"}, //-providerclass
+        {"provider.name",
+                "nome do fornecedor"}, //-providername
+        {"provider.classpath",
+                "classpath do fornecedor"}, //-providerpath
+        {"output.in.RFC.style",
+                "sa\u00EDda no estilo RFC"}, //-rfc
+        {"signature.algorithm.name",
+                "nome do algoritmo de assinatura"}, //-sigalg
+        {"source.alias",
+                "alias de origem"}, //-srcalias
+        {"source.key.password",
+                "senha da chave de origem"}, //-srckeypass
+        {"source.keystore.name",
+                "nome da \u00E1rea de armazenamento de chaves de origem"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "senha protegida da \u00E1rea de armazenamento de chaves de origem"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "nome do fornecedor da \u00E1rea de armazenamento de chaves de origem"}, //-srcprovidername
+        {"source.keystore.password",
+                "senha da \u00E1rea de armazenamento de chaves de origem"}, //-srcstorepass
+        {"source.keystore.type",
+                "tipo de \u00E1rea de armazenamento de chaves de origem"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "porta e host do servidor SSL"}, //-sslserver
+        {"signed.jar.file",
+                "arquivo jar assinado"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "data/hora inicial de validade do certificado"}, //-startdate
+        {"keystore.password",
+                "senha da \u00E1rea de armazenamento de chaves"}, //-storepass
+        {"keystore.type",
+                "tipo de \u00E1rea de armazenamento de chaves"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "certificados confi\u00E1veis do cacerts"}, //-trustcacerts
+        {"verbose.output",
+                "sa\u00EDda detalhada"}, //-v
+        {"validity.number.of.days",
+                "n\u00FAmero de dias da validade"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "ID de s\u00E9rie do certificado a ser revogado"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "erro de keytool: "},
+        {"Illegal.option.", "Op\u00E7\u00E3o inv\u00E1lida:  "},
+        {"Illegal.value.", "Valor inv\u00E1lido: "},
+        {"Unknown.password.type.", "Tipo de senha desconhecido: "},
+        {"Cannot.find.environment.variable.",
+                "N\u00E3o \u00E9 poss\u00EDvel localizar a vari\u00E1vel do ambiente: "},
+        {"Cannot.find.file.", "N\u00E3o \u00E9 poss\u00EDvel localizar o arquivo: "},
+        {"Command.option.flag.needs.an.argument.", "A op\u00E7\u00E3o de comando {0} precisa de um argumento."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Advert\u00EAncia: Senhas de chave e de armazenamento diferentes n\u00E3o suportadas para KeyStores PKCS12. Ignorando valor {0} especificado pelo usu\u00E1rio."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore deve ser NONE se -storetype for {0}"},
+        {"Too.many.retries.program.terminated",
+                 "Excesso de tentativas de repeti\u00E7\u00E3o; programa finalizado"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "comandos -storepasswd e -keypasswd n\u00E3o suportados se -storetype for {0}"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "comandos -keypasswd n\u00E3o suportados se -storetype for PKCS12"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-keypass e -new n\u00E3o podem ser especificados se -storetype for {0}"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "se -protected for especificado, ent\u00E3o -storepass, -keypass e -new n\u00E3o dever\u00E3o ser especificados"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "se -srcprotected for especificado, ent\u00E3o -srcstorepass e -srckeypass n\u00E3o dever\u00E3o ser especificados"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "se a \u00E1rea de armazenamento de chaves n\u00E3o estiver protegida por senha, ent\u00E3o -storepass, -keypass e -new n\u00E3o dever\u00E3o ser especificados"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "se a \u00E1rea de armazenamento de chaves de origem n\u00E3o estiver protegida por senha, ent\u00E3o -srcstorepass e -srckeypass n\u00E3o dever\u00E3o ser especificados"},
+        {"Illegal.startdate.value", "valor da data inicial inv\u00E1lido"},
+        {"Validity.must.be.greater.than.zero",
+                "A validade deve ser maior do que zero"},
+        {"provName.not.a.provider", "{0} n\u00E3o \u00E9 um fornecedor"},
+        {"Usage.error.no.command.provided", "Erro de uso: nenhum comando fornecido"},
+        {"Source.keystore.file.exists.but.is.empty.", "O arquivo da \u00E1rea de armazenamento de chaves de origem existe, mas est\u00E1 vazio: "},
+        {"Please.specify.srckeystore", "Especifique -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "N\u00E3o devem ser especificados -v e -rfc com o comando 'list'"},
+        {"Key.password.must.be.at.least.6.characters",
+                "A senha da chave deve ter, no m\u00EDnimo, 6 caracteres"},
+        {"New.password.must.be.at.least.6.characters",
+                "A nova senha deve ter, no m\u00EDnimo, 6 caracteres"},
+        {"Keystore.file.exists.but.is.empty.",
+                "O arquivo da \u00E1rea de armazenamento de chaves existe, mas est\u00E1 vazio: "},
+        {"Keystore.file.does.not.exist.",
+                "O arquivo da \u00E1rea de armazenamento de chaves n\u00E3o existe. "},
+        {"Must.specify.destination.alias", "Deve ser especificado um alias de destino"},
+        {"Must.specify.alias", "Deve ser especificado um alias"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "A senha da \u00E1rea de armazenamento de chaves deve ter, no m\u00EDnimo, 6 caracteres"},
+        {"Enter.keystore.password.", "Informe a senha da \u00E1rea de armazenamento de chaves:  "},
+        {"Enter.source.keystore.password.", "Informe a senha da \u00E1rea de armazenamento de chaves de origem:  "},
+        {"Enter.destination.keystore.password.", "Informe a senha da \u00E1rea de armazenamento de chaves de destino:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "A senha da \u00E1rea de armazenamento de chaves \u00E9 muito curta - ela deve ter, no m\u00EDnimo, 6 caracteres"},
+        {"Unknown.Entry.Type", "Tipo de Entrada Desconhecido"},
+        {"Too.many.failures.Alias.not.changed", "Excesso de falhas. Alias n\u00E3o alterado"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "Entrada do alias {0} importada com \u00EAxito."},
+        {"Entry.for.alias.alias.not.imported.", "Entrada do alias {0} n\u00E3o importada."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Problema ao importar a entrada do alias {0}: {1}.\nEntrada do alias {0} n\u00E3o importada."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Comando de importa\u00E7\u00E3o conclu\u00EDdo:  {0} entradas importadas com \u00EAxito, {1} entradas falharam ou foram canceladas"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Advert\u00EAncia: Substitui\u00E7\u00E3o do alias {0} existente na \u00E1rea de armazenamento de chaves de destino"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "Entrada j\u00E1 existente no alias {0}, substituir? [n\u00E3o]:  "},
+        {"Too.many.failures.try.later", "Excesso de falhas - tente mais tarde"},
+        {"Certification.request.stored.in.file.filename.",
+                "Solicita\u00E7\u00E3o de certificado armazenada no arquivo <{0}>"},
+        {"Submit.this.to.your.CA", "Submeter \u00E0 CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "se o alias n\u00E3o estiver especificado, destalias, srckeypass e destkeypass n\u00E3o dever\u00E3o ser especificados"},
+        {"Certificate.stored.in.file.filename.",
+                "Certificado armazenado no arquivo <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "A resposta do certificado foi instalada na \u00E1rea de armazenamento de chaves"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "A resposta do certificado n\u00E3o foi instalada na \u00E1rea de armazenamento de chaves"},
+        {"Certificate.was.added.to.keystore",
+                "O certificado foi adicionado \u00E0 \u00E1rea de armazenamento de chaves"},
+        {"Certificate.was.not.added.to.keystore",
+                "O certificado n\u00E3o foi adicionado \u00E0 \u00E1rea de armazenamento de chaves"},
+        {".Storing.ksfname.", "[Armazenando {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} n\u00E3o tem chave p\u00FAblica (certificado)"},
+        {"Cannot.derive.signature.algorithm",
+                "N\u00E3o \u00E9 poss\u00EDvel obter um algoritmo de assinatura"},
+        {"Alias.alias.does.not.exist",
+                "O alias <{0}> n\u00E3o existe"},
+        {"Alias.alias.has.no.certificate",
+                "O alias <{0}> n\u00E3o tem certificado"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "Par de chaves n\u00E3o gerado; o alias <{0}> j\u00E1 existe"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "Gerando o par de chaves {1} de {0} bit e o certificado autoassinado ({2}) com uma validade de {3} dias\n\tpara: {4}"},
+        {"Enter.key.password.for.alias.", "Informar a senha da chave de <{0}>"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(RETURN se for igual \u00E0 senha da \u00E1rea do armazenamento de chaves):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "A senha da chave \u00E9 muito curta - deve ter, no m\u00EDnimo, 6 caracteres"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "Excesso de falhas - chave n\u00E3o adicionada a \u00E1rea de armazenamento de chaves"},
+        {"Destination.alias.dest.already.exists",
+                "O alias de destino <{0}> j\u00E1 existe"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "A senha \u00E9 muito curta - deve ter, no m\u00EDnimo, 6 caracteres"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "Excesso de falhas. Entrada da chave n\u00E3o clonada"},
+        {"key.password.for.alias.", "senha da chave de <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "A entrada da \u00E1rea do armazenamento de chaves de <{0}> j\u00E1 existe"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Criando entrada da \u00E1rea do armazenamento de chaves para <{0}> ..."},
+        {"No.entries.from.identity.database.added",
+                "Nenhuma entrada adicionada do banco de dados de identidades"},
+        {"Alias.name.alias", "Nome do alias: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Data de cria\u00E7\u00E3o: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Tipo de entrada: {0}"},
+        {"Certificate.chain.length.", "Comprimento da cadeia de certificados: "},
+        {"Certificate.i.1.", "Certificado[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Fingerprint (MD5) do certificado: "},
+        {"Keystore.type.", "Tipo de \u00E1rea de armazenamento de chaves: "},
+        {"Keystore.provider.", "Fornecedor da \u00E1rea de armazenamento de chaves: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Sua \u00E1rea de armazenamento de chaves cont\u00E9m {0,number,integer} entrada"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Sua \u00E1rea de armazenamento de chaves cont\u00E9m {0,number,integer} entradas"},
+        {"Failed.to.parse.input", "Falha durante o parse da entrada"},
+        {"Empty.input", "Entrada vazia"},
+        {"Not.X.509.certificate", "N\u00E3o \u00E9 um certificado X.509"},
+        {"alias.has.no.public.key", "{0} n\u00E3o tem chave p\u00FAblica"},
+        {"alias.has.no.X.509.certificate", "{0} n\u00E3o tem certificado X.509"},
+        {"New.certificate.self.signed.", "Novo certificado (autoassinado):"},
+        {"Reply.has.no.certificates", "A resposta n\u00E3o tem certificado"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Certificado n\u00E3o importado, o alias <{0}> j\u00E1 existe"},
+        {"Input.not.an.X.509.certificate", "A entrada n\u00E3o \u00E9 um certificado X.509"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "O certificado j\u00E1 existe no armazenamento de chaves no alias <{0}>"},
+        {"Do.you.still.want.to.add.it.no.",
+                "Ainda deseja adicion\u00E1-lo? [n\u00E3o]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "O certificado j\u00E1 existe na \u00E1rea de armazenamento de chaves da CA em todo o sistema no alias <{0}>"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "Ainda deseja adicion\u00E1-lo \u00E0 sua \u00E1rea de armazenamento de chaves? [n\u00E3o]:  "},
+        {"Trust.this.certificate.no.", "Confiar neste certificado? [n\u00E3o]:  "},
+        {"YES", "Sim"},
+        {"New.prompt.", "Nova {0}: "},
+        {"Passwords.must.differ", "As senhas devem ser diferentes"},
+        {"Re.enter.new.prompt.", "Informe novamente a nova {0}: "},
+        {"Re.enter.new.password.", "Informe novamente a nova senha: "},
+        {"They.don.t.match.Try.again", "Elas n\u00E3o correspondem. Tente novamente"},
+        {"Enter.prompt.alias.name.", "Informe o nome do alias {0}:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Informe o novo nome do alias\t(RETURN para cancelar a importa\u00E7\u00E3o desta entrada):  "},
+        {"Enter.alias.name.", "Informe o nome do alias:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(RETURN se for igual ao de <{0}>)"},
+        {".PATTERN.printX509Cert",
+                "Propriet\u00E1rio: {0}\nEmissor: {1}\nN\u00FAmero de s\u00E9rie: {2}\nV\u00E1lido de: {3} a: {4}\nFingerprints do certificado:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Nome do algoritmo de assinatura: {8}\n\t Vers\u00E3o: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "Qual \u00E9 o seu nome e o seu sobrenome?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "Qual \u00E9 o nome da sua unidade organizacional?"},
+        {"What.is.the.name.of.your.organization.",
+                "Qual \u00E9 o nome da sua empresa?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "Qual \u00E9 o nome da sua Cidade ou Localidade?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "Qual \u00E9 o nome do seu Estado ou Munic\u00EDpio?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "Quais s\u00E3o as duas letras do c\u00F3digo do pa\u00EDs desta unidade?"},
+        {"Is.name.correct.", "{0} Est\u00E1 correto?"},
+        {"no", "n\u00E3o"},
+        {"yes", "sim"},
+        {"y", "s"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "O alias <{0}> n\u00E3o tem chave"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "O alias <{0}> faz refer\u00EAncia a um tipo de entrada que n\u00E3o \u00E9 uma entrada de chave privada. O comando -keyclone oferece suporte somente \u00E0 clonagem de entradas de chave privada"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  Advert\u00EAncia Advert\u00EAncia Advert\u00EAncia  *****************"},
+        {"Signer.d.", "Signat\u00E1rio #%d:"},
+        {"Timestamp.", "Timestamp:"},
+        {"Signature.", "Assinatura:"},
+        {"CRLs.", "CRLs:"},
+        {"Certificate.owner.", "Propriet\u00E1rio do certificado: "},
+        {"Not.a.signed.jar.file", "N\u00E3o \u00E9 um arquivo jar assinado"},
+        {"No.certificate.from.the.SSL.server",
+                "N\u00E3o \u00E9 um certificado do servidor SSL"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* A integridade das informa\u00E7\u00F5es armazenadas na sua \u00E1rea de armazenamento de chaves  *\n* N\u00C3O foi verificada!  Para que seja poss\u00EDvel verificar sua integridade, *\n* voc\u00EA deve fornecer a senha da \u00E1rea de armazenamento de chaves.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* A integridade das informa\u00E7\u00F5es armazenadas no srckeystore  *\n* N\u00C3O foi verificada!  Para que seja poss\u00EDvel verificar sua integridade, *\n* voc\u00EA deve fornecer a senha do srckeystore.                  *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "A resposta do certificado n\u00E3o cont\u00E9m a chave p\u00FAblica de <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Cadeia de certificados incompleta na resposta"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "A cadeia de certificados da resposta n\u00E3o verifica: "},
+        {"Top.level.certificate.in.reply.",
+                "Certificado de n\u00EDvel superior na resposta:\n"},
+        {".is.not.trusted.", "... n\u00E3o \u00E9 confi\u00E1vel. "},
+        {"Install.reply.anyway.no.", "Instalar resposta assim mesmo? [n\u00E3o]:  "},
+        {"NO", "N\u00E3o"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "As chaves p\u00FAblicas da resposta e da \u00E1rea de armazenamento de chaves n\u00E3o correspondem"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "O certificado da resposta e o certificado da \u00E1rea de armazenamento de chaves s\u00E3o id\u00EAnticos"},
+        {"Failed.to.establish.chain.from.reply",
+                "Falha ao estabelecer a cadeia a partir da resposta"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "Resposta errada; tente novamente"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "Chave secreta n\u00E3o gerada; o alias <{0}> j\u00E1 existe"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Forne\u00E7a o -keysize para a gera\u00E7\u00E3o da chave secreta"},
+
+        {"Extensions.", "Extens\u00F5es: "},
+        {".Empty.value.", "(Valor vazio)"},
+        {"Extension.Request.", "Solicita\u00E7\u00E3o de Extens\u00E3o:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "Solicita\u00E7\u00E3o do Certificado PKCS #10 (Vers\u00E3o 1.0)\nAssunto: %s\nChave P\u00FAblica: %s formato %s chave\n"},
+        {"Unknown.keyUsage.type.", "Tipo de keyUsage desconhecido: "},
+        {"Unknown.extendedkeyUsage.type.", "Tipo de extendedkeyUsage desconhecido: "},
+        {"Unknown.AccessDescription.type.", "Tipo de AccessDescription desconhecido: "},
+        {"Unrecognized.GeneralName.type.", "Tipo de GeneralName n\u00E3o reconhecido: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "Esta extens\u00E3o n\u00E3o pode ser marcada como cr\u00EDtica. "},
+        {"Odd.number.of.hex.digits.found.", "Encontrado n\u00FAmero \u00EDmpar de seis d\u00EDgitos: "},
+        {"Unknown.extension.type.", "Tipo de extens\u00E3o desconhecido: "},
+        {"command.{0}.is.ambiguous.", "o comando {0} \u00E9 amb\u00EDguo:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_sv.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_sv extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [Alternativ]..."},
+        {"Options.", "Alternativ:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "L\u00E4s \"Hj\u00E4lp - Nyckelverktyg\" f\u00F6r alla tillg\u00E4ngliga kommandon"},
+        {"Key.and.Certificate.Management.Tool",
+                 "Hanteringsverktyg f\u00F6r nycklar och certifikat"},
+        {"Commands.", "Kommandon:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "L\u00E4s \"Hj\u00E4lp - Nyckelverktyg - command_name\" om anv\u00E4ndning av command_name"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "Genererar certifikatbeg\u00E4ran"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\u00C4ndrar postalias"}, //-changealias
+        {"Deletes.an.entry",
+                "Tar bort post"}, //-delete
+        {"Exports.certificate",
+                "Exporterar certifikat"}, //-exportcert
+        {"Generates.a.key.pair",
+                "Genererar nyckelpar"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "Genererar hemlig nyckel"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "Genererar certifikat fr\u00E5n certifikatbeg\u00E4ran"}, //-gencert
+        {"Generates.CRL", "Genererar CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "Importerar poster fr\u00E5n identitetsdatabas i JDK 1.1.x-format"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "Importerar ett certifikat eller en certifikatkedja"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "Importerar en eller alla poster fr\u00E5n annat nyckellager"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "Klonar en nyckelpost"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\u00C4ndrar nyckell\u00F6senordet f\u00F6r en post"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "Visar lista \u00F6ver poster i nyckellager"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "Skriver ut inneh\u00E5llet i ett certifikat"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "Skriver ut inneh\u00E5llet i en certifikatbeg\u00E4ran"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "Skriver ut inneh\u00E5llet i en CRL-fil"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "Genererar ett sj\u00E4lvsignerat certifikat"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\u00C4ndrar lagerl\u00F6senordet f\u00F6r ett nyckellager"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "aliasnamn f\u00F6r post som ska bearbetas"}, //-alias
+        {"destination.alias",
+                "destinationsalias"}, //-destalias
+        {"destination.key.password",
+                "l\u00F6senord f\u00F6r destinationsnyckel"}, //-destkeypass
+        {"destination.keystore.name",
+                "namn p\u00E5 destinationsnyckellager"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "skyddat l\u00F6senord f\u00F6r destinationsnyckellager"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "leverant\u00F6rsnamn f\u00F6r destinationsnyckellager"}, //-destprovidername
+        {"destination.keystore.password",
+                "l\u00F6senord f\u00F6r destinationsnyckellager"}, //-deststorepass
+        {"destination.keystore.type",
+                "typ av destinationsnyckellager"}, //-deststoretype
+        {"distinguished.name",
+                "unikt namn"}, //-dname
+        {"X.509.extension",
+                "X.509-till\u00E4gg"}, //-ext
+        {"output.file.name",
+                "namn p\u00E5 utdatafil"}, //-file and -outfile
+        {"input.file.name",
+                "namn p\u00E5 indatafil"}, //-file and -infile
+        {"key.algorithm.name",
+                "namn p\u00E5 nyckelalgoritm"}, //-keyalg
+        {"key.password",
+                "nyckell\u00F6senord"}, //-keypass
+        {"key.bit.size",
+                "nyckelbitstorlek"}, //-keysize
+        {"keystore.name",
+                "namn p\u00E5 nyckellager"}, //-keystore
+        {"new.password",
+                "nytt l\u00F6senord"}, //-new
+        {"do.not.prompt",
+                "fr\u00E5ga inte"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "l\u00F6senord med skyddad mekanism"}, //-protected
+        {"provider.argument",
+                "leverant\u00F6rsargument"}, //-providerarg
+        {"provider.class.name",
+                "namn p\u00E5 leverant\u00F6rsklass"}, //-providerclass
+        {"provider.name",
+                "leverant\u00F6rsnamn"}, //-providername
+        {"provider.classpath",
+                "leverant\u00F6rsklass\u00F6kv\u00E4g"}, //-providerpath
+        {"output.in.RFC.style",
+                "utdata i RFC-format"}, //-rfc
+        {"signature.algorithm.name",
+                "namn p\u00E5 signaturalgoritm"}, //-sigalg
+        {"source.alias",
+                "k\u00E4llalias"}, //-srcalias
+        {"source.key.password",
+                "l\u00F6senord f\u00F6r k\u00E4llnyckel"}, //-srckeypass
+        {"source.keystore.name",
+                "namn p\u00E5 k\u00E4llnyckellager"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "skyddat l\u00F6senord f\u00F6r k\u00E4llnyckellager"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "leverant\u00F6rsnamn f\u00F6r k\u00E4llnyckellager"}, //-srcprovidername
+        {"source.keystore.password",
+                "l\u00F6senord f\u00F6r k\u00E4llnyckellager"}, //-srcstorepass
+        {"source.keystore.type",
+                "typ av k\u00E4llnyckellager"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL-serverv\u00E4rd och -port"}, //-sslserver
+        {"signed.jar.file",
+                "signerad jar-fil"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "startdatum/-tid f\u00F6r certifikatets giltighet"}, //-startdate
+        {"keystore.password",
+                "l\u00F6senord f\u00F6r nyckellager"}, //-storepass
+        {"keystore.type",
+                "nyckellagertyp"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "tillf\u00F6rlitliga certifikat fr\u00E5n cacerts"}, //-trustcacerts
+        {"verbose.output",
+                "utf\u00F6rliga utdata"}, //-v
+        {"validity.number.of.days",
+                "antal dagar f\u00F6r giltighet"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "Seriellt ID f\u00F6r certifikat som ska \u00E5terkallas"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "nyckelverktygsfel: "},
+        {"Illegal.option.", "Otill\u00E5tet alternativ:  "},
+        {"Illegal.value.", "Otill\u00E5tet v\u00E4rde: "},
+        {"Unknown.password.type.", "Ok\u00E4nd l\u00F6senordstyp: "},
+        {"Cannot.find.environment.variable.",
+                "Kan inte hitta milj\u00F6variabel: "},
+        {"Cannot.find.file.", "Hittar inte fil: "},
+        {"Command.option.flag.needs.an.argument.", "Kommandoalternativet {0} beh\u00F6ver ett argument."},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "Varning!  PKCS12-nyckellager har inte st\u00F6d f\u00F6r olika l\u00F6senord f\u00F6r lagret och nyckeln. Det anv\u00E4ndarspecificerade {0}-v\u00E4rdet ignoreras."},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "-keystore m\u00E5ste vara NONE om -storetype \u00E4r {0}"},
+        {"Too.many.retries.program.terminated",
+                 "F\u00F6r m\u00E5nga f\u00F6rs\u00F6k. Programmet avslutas"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "-storepasswd- och -keypasswd-kommandon st\u00F6ds inte om -storetype \u00E4r {0}"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "-keypasswd-kommandon st\u00F6ds inte om -storetype \u00E4r PKCS12"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "-keypass och -new kan inte anges om -storetype \u00E4r {0}"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "om -protected har angetts f\u00E5r inte -storepass, -keypass och -new anges"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "om -srcprotected anges f\u00E5r -srcstorepass och -srckeypass inte anges"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "om nyckellagret inte \u00E4r l\u00F6senordsskyddat f\u00E5r -storepass, -keypass och -new inte anges"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "om k\u00E4llnyckellagret inte \u00E4r l\u00F6senordsskyddat f\u00E5r -srcstorepass och -srckeypass inte anges"},
+        {"Illegal.startdate.value", "Otill\u00E5tet v\u00E4rde f\u00F6r startdatum"},
+        {"Validity.must.be.greater.than.zero",
+                "Giltigheten m\u00E5ste vara st\u00F6rre \u00E4n noll"},
+        {"provName.not.a.provider", "{0} \u00E4r inte en leverant\u00F6r"},
+        {"Usage.error.no.command.provided", "Syntaxfel: inget kommando angivet"},
+        {"Source.keystore.file.exists.but.is.empty.", "Nyckellagrets k\u00E4llfil finns, men \u00E4r tom: "},
+        {"Please.specify.srckeystore", "Ange -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "Kan inte specificera b\u00E5de -v och -rfc med 'list'-kommandot"},
+        {"Key.password.must.be.at.least.6.characters",
+                "Nyckell\u00F6senordet m\u00E5ste inneh\u00E5lla minst 6 tecken"},
+        {"New.password.must.be.at.least.6.characters",
+                "Det nya l\u00F6senordet m\u00E5ste inneh\u00E5lla minst 6 tecken"},
+        {"Keystore.file.exists.but.is.empty.",
+                "Nyckellagerfilen finns, men \u00E4r tom: "},
+        {"Keystore.file.does.not.exist.",
+                "Nyckellagerfilen finns inte: "},
+        {"Must.specify.destination.alias", "Du m\u00E5ste ange destinationsalias"},
+        {"Must.specify.alias", "Du m\u00E5ste ange alias"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "Nyckellagerl\u00F6senordet m\u00E5ste inneh\u00E5lla minst 6 tecken"},
+        {"Enter.keystore.password.", "Ange nyckellagerl\u00F6senord:  "},
+        {"Enter.source.keystore.password.", "Ange l\u00F6senord f\u00F6r k\u00E4llnyckellagret:  "},
+        {"Enter.destination.keystore.password.", "Ange nyckellagerl\u00F6senord f\u00F6r destination:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "Nyckellagerl\u00F6senordet \u00E4r f\u00F6r kort - det m\u00E5ste inneh\u00E5lla minst 6 tecken"},
+        {"Unknown.Entry.Type", "Ok\u00E4nd posttyp"},
+        {"Too.many.failures.Alias.not.changed", "F\u00F6r m\u00E5nga fel. Alias har inte \u00E4ndrats"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "Posten f\u00F6r alias {0} har importerats."},
+        {"Entry.for.alias.alias.not.imported.", "Posten f\u00F6r alias {0} har inte importerats."},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "Ett problem uppstod vid importen av posten f\u00F6r alias {0}: {1}.\nPosten {0} har inte importerats."},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "Kommandoimporten slutf\u00F6rd: {0} poster har importerats, {1} poster var felaktiga eller annullerades"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "Varning! Det befintliga aliaset {0} i destinationsnyckellagret skrivs \u00F6ver"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "Aliaset {0} finns redan. Vill du skriva \u00F6ver det? [nej]:  "},
+        {"Too.many.failures.try.later", "F\u00F6r m\u00E5nga fel - f\u00F6rs\u00F6k igen senare"},
+        {"Certification.request.stored.in.file.filename.",
+                "Certifikatbeg\u00E4ran har lagrats i filen <{0}>"},
+        {"Submit.this.to.your.CA", "Skicka detta till certifikatutf\u00E4rdaren"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "om n\u00E5got alias inte anges f\u00E5r destalias, srckeypass och destkeypass inte anges"},
+        {"Certificate.stored.in.file.filename.",
+                "Certifikatet har lagrats i filen <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "Certifikatsvaret har installerats i nyckellagret"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "Certifikatsvaret har inte installerats i nyckellagret"},
+        {"Certificate.was.added.to.keystore",
+                "Certifikatet har lagts till i nyckellagret"},
+        {"Certificate.was.not.added.to.keystore",
+                "Certifikatet har inte lagts till i nyckellagret"},
+        {".Storing.ksfname.", "[Lagrar {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} saknar offentlig nyckel (certifikat)"},
+        {"Cannot.derive.signature.algorithm",
+                "Kan inte h\u00E4rleda signaturalgoritm"},
+        {"Alias.alias.does.not.exist",
+                "Aliaset <{0}> finns inte"},
+        {"Alias.alias.has.no.certificate",
+                "Aliaset <{0}> saknar certifikat"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "Nyckelparet genererades inte. Aliaset <{0}> finns redan"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "Genererar {0} bitars {1}-nyckelpar och sj\u00E4lvsignerat certifikat ({2}) med en giltighet p\u00E5 {3} dagar\n\tf\u00F6r: {4}"},
+        {"Enter.key.password.for.alias.", "Ange nyckell\u00F6senord f\u00F6r <{0}>"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(RETURN om det \u00E4r identiskt med nyckellagerl\u00F6senordet):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "Nyckell\u00F6senordet \u00E4r f\u00F6r kort - det m\u00E5ste inneh\u00E5lla minst 6 tecken"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "F\u00F6r m\u00E5nga fel - nyckeln lades inte till i nyckellagret"},
+        {"Destination.alias.dest.already.exists",
+                "Destinationsaliaset <{0}> finns redan"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "L\u00F6senordet \u00E4r f\u00F6r kort - det m\u00E5ste inneh\u00E5lla minst 6 tecken"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "F\u00F6r m\u00E5nga fel. Nyckelposten har inte klonats"},
+        {"key.password.for.alias.", "nyckell\u00F6senord f\u00F6r <{0}>"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "Nyckellagerpost f\u00F6r <{0}> finns redan"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "Skapar nyckellagerpost f\u00F6r <{0}> ..."},
+        {"No.entries.from.identity.database.added",
+                "Inga poster fr\u00E5n identitetsdatabasen har lagts till"},
+        {"Alias.name.alias", "Aliasnamn: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "Skapat den: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "Posttyp: {0}"},
+        {"Certificate.chain.length.", "L\u00E4ngd p\u00E5 certifikatskedja: "},
+        {"Certificate.i.1.", "Certifikat[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "Certifikatets fingeravtryck (SHA1): "},
+        {"Keystore.type.", "Nyckellagertyp: "},
+        {"Keystore.provider.", "Nyckellagerleverant\u00F6r: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "Nyckellagret inneh\u00E5ller {0,number,integer} post"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "Nyckellagret inneh\u00E5ller {0,number,integer} poster"},
+        {"Failed.to.parse.input", "Kunde inte tolka indata"},
+        {"Empty.input", "Inga indata"},
+        {"Not.X.509.certificate", "Inte ett X.509-certifikat"},
+        {"alias.has.no.public.key", "{0} saknar offentlig nyckel"},
+        {"alias.has.no.X.509.certificate", "{0} saknar X.509-certifikat"},
+        {"New.certificate.self.signed.", "Nytt certifikat (sj\u00E4lvsignerat):"},
+        {"Reply.has.no.certificates", "Svaret saknar certifikat"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "Certifikatet importerades inte. Aliaset <{0}> finns redan"},
+        {"Input.not.an.X.509.certificate", "Indata \u00E4r inte ett X.509-certifikat"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "Certifikatet finns redan i nyckellagerfilen under aliaset <{0}>"},
+        {"Do.you.still.want.to.add.it.no.",
+                "Vill du fortfarande l\u00E4gga till det? [nej]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "Certifikatet finns redan i den systemomsp\u00E4nnande CA-nyckellagerfilen under aliaset <{0}>"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "Vill du fortfarande l\u00E4gga till det i ditt eget nyckellagret? [nej]:  "},
+        {"Trust.this.certificate.no.", "Litar du p\u00E5 det h\u00E4r certifikatet? [nej]:  "},
+        {"YES", "Ja"},
+        {"New.prompt.", "Nytt {0}: "},
+        {"Passwords.must.differ", "L\u00F6senorden m\u00E5ste vara olika"},
+        {"Re.enter.new.prompt.", "Ange nytt {0} igen: "},
+        {"Re.enter.new.password.", "Ange det nya l\u00F6senordet igen: "},
+        {"They.don.t.match.Try.again", "De matchar inte. F\u00F6rs\u00F6k igen"},
+        {"Enter.prompt.alias.name.", "Ange aliasnamn f\u00F6r {0}:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "Ange ett nytt aliasnamn\t(skriv RETURN f\u00F6r att avbryta importen av denna post):  "},
+        {"Enter.alias.name.", "Ange aliasnamn:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(RETURN om det \u00E4r det samma som f\u00F6r <{0}>)"},
+        {".PATTERN.printX509Cert",
+                "\u00C4gare: {0}\nUtf\u00E4rdare: {1}\nSerienummer: {2}\nGiltigt fr\u00E5n den: {3} till: {4}\nCertifikatets fingeravtryck:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Namn p\u00E5 signaturalgoritm: {8}\n\t Version: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "Vad heter du i f\u00F6r- och efternamn?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "Vad heter din avdelning inom organisationen?"},
+        {"What.is.the.name.of.your.organization.",
+                "Vad heter din organisation?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "Vad heter din ort eller plats?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "Vad heter ditt land eller din provins?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "Vilken \u00E4r den tv\u00E5st\u00E4lliga landskoden?"},
+        {"Is.name.correct.", "\u00C4r {0} korrekt?"},
+        {"no", "nej"},
+        {"yes", "ja"},
+        {"y", "j"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "Aliaset <{0}> saknar nyckel"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "Aliaset <{0}> refererar till en posttyp som inte \u00E4r n\u00E5gon privat nyckelpost. Kommandot -keyclone har endast st\u00F6d f\u00F6r kloning av privata nyckelposter"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  Varning Varning Varning  *****************"},
+        {"Signer.d.", "Signerare #%d:"},
+        {"Timestamp.", "Tidsst\u00E4mpel:"},
+        {"Signature.", "Underskrift:"},
+        {"CRLs.", "CRL:er:"},
+        {"Certificate.owner.", "Certifikat\u00E4gare: "},
+        {"Not.a.signed.jar.file", "Ingen signerad jar-fil"},
+        {"No.certificate.from.the.SSL.server",
+                "Inget certifikat fr\u00E5n SSL-servern"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* Integriteten f\u00F6r den information som lagras i nyckellagerfilen  *\n* har INTE verifierats!  Om du vill verifiera dess integritet *\n* m\u00E5ste du ange l\u00F6senordet f\u00F6r nyckellagret.                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* Integriteten f\u00F6r den information som lagras i srckeystore*\n* har INTE verifierats!  Om du vill verifiera dess integritet *\n* m\u00E5ste du ange l\u00F6senordet f\u00F6r srckeystore.                *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "Certifikatsvaret inneh\u00E5ller inte n\u00E5gon offentlig nyckel f\u00F6r <{0}>"},
+        {"Incomplete.certificate.chain.in.reply",
+                "Ofullst\u00E4ndig certifikatskedja i svaret"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "Certifikatskedjan i svaret g\u00E5r inte att verifiera: "},
+        {"Top.level.certificate.in.reply.",
+                "Toppniv\u00E5certifikatet i svaret:\n"},
+        {".is.not.trusted.", "... \u00E4r inte betrott. "},
+        {"Install.reply.anyway.no.", "Vill du installera svaret \u00E4nd\u00E5? [nej]:  "},
+        {"NO", "Nej"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "De offentliga nycklarna i svaret och nyckellagret matchar inte varandra"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "Certifikatsvaret och certifikatet i nyckellagret \u00E4r identiska"},
+        {"Failed.to.establish.chain.from.reply",
+                "Kunde inte uppr\u00E4tta kedja fr\u00E5n svaret"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "Fel svar. F\u00F6rs\u00F6k p\u00E5 nytt."},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "Den hemliga nyckeln har inte genererats eftersom aliaset <{0}> redan finns"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "Ange -keysize f\u00F6r att skapa hemlig nyckel"},
+
+        {"Extensions.", "Till\u00E4gg: "},
+        {".Empty.value.", "(Tomt v\u00E4rde)"},
+        {"Extension.Request.", "Till\u00E4ggsbeg\u00E4ran:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10 certifikatbeg\u00E4ran (version 1.0)\n\u00C4mne: %s\nAllm\u00E4n nyckel: %s-format %s-nyckel\n"},
+        {"Unknown.keyUsage.type.", "Ok\u00E4nd keyUsage-typ: "},
+        {"Unknown.extendedkeyUsage.type.", "Ok\u00E4nd extendedkeyUsage-typ: "},
+        {"Unknown.AccessDescription.type.", "Ok\u00E4nd AccessDescription-typ: "},
+        {"Unrecognized.GeneralName.type.", "Ok\u00E4nd GeneralName-typ: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "Detta till\u00E4gg kan inte markeras som kritiskt. "},
+        {"Odd.number.of.hex.digits.found.", "Udda antal hex-siffror p\u00E5tr\u00E4ffades: "},
+        {"Unknown.extension.type.", "Ok\u00E4nd till\u00E4ggstyp: "},
+        {"command.{0}.is.ambiguous.", "kommandot {0} \u00E4r tvetydigt:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_zh_CN.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_zh_CN extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [\u9009\u9879]..."},
+        {"Options.", "\u9009\u9879:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "\u4F7F\u7528 \"keytool -help\" \u83B7\u53D6\u6240\u6709\u53EF\u7528\u547D\u4EE4"},
+        {"Key.and.Certificate.Management.Tool",
+                 "\u5BC6\u94A5\u548C\u8BC1\u4E66\u7BA1\u7406\u5DE5\u5177"},
+        {"Commands.", "\u547D\u4EE4:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "\u4F7F\u7528 \"keytool -command_name -help\" \u83B7\u53D6 command_name \u7684\u7528\u6CD5"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "\u751F\u6210\u8BC1\u4E66\u8BF7\u6C42"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\u66F4\u6539\u6761\u76EE\u7684\u522B\u540D"}, //-changealias
+        {"Deletes.an.entry",
+                "\u5220\u9664\u6761\u76EE"}, //-delete
+        {"Exports.certificate",
+                "\u5BFC\u51FA\u8BC1\u4E66"}, //-exportcert
+        {"Generates.a.key.pair",
+                "\u751F\u6210\u5BC6\u94A5\u5BF9"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "\u751F\u6210\u5BF9\u79F0\u5BC6\u94A5"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "\u6839\u636E\u8BC1\u4E66\u8BF7\u6C42\u751F\u6210\u8BC1\u4E66"}, //-gencert
+        {"Generates.CRL", "\u751F\u6210 CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "\u4ECE JDK 1.1.x \u6837\u5F0F\u7684\u8EAB\u4EFD\u6570\u636E\u5E93\u5BFC\u5165\u6761\u76EE"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "\u5BFC\u5165\u8BC1\u4E66\u6216\u8BC1\u4E66\u94FE"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "\u4ECE\u5176\u4ED6\u5BC6\u94A5\u5E93\u5BFC\u5165\u4E00\u4E2A\u6216\u6240\u6709\u6761\u76EE"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "\u514B\u9686\u5BC6\u94A5\u6761\u76EE"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\u66F4\u6539\u6761\u76EE\u7684\u5BC6\u94A5\u53E3\u4EE4"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "\u5217\u51FA\u5BC6\u94A5\u5E93\u4E2D\u7684\u6761\u76EE"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "\u6253\u5370\u8BC1\u4E66\u5185\u5BB9"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "\u6253\u5370\u8BC1\u4E66\u8BF7\u6C42\u7684\u5185\u5BB9"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "\u6253\u5370 CRL \u6587\u4EF6\u7684\u5185\u5BB9"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "\u751F\u6210\u81EA\u7B7E\u540D\u8BC1\u4E66"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\u66F4\u6539\u5BC6\u94A5\u5E93\u7684\u5B58\u50A8\u53E3\u4EE4"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "\u8981\u5904\u7406\u7684\u6761\u76EE\u7684\u522B\u540D"}, //-alias
+        {"destination.alias",
+                "\u76EE\u6807\u522B\u540D"}, //-destalias
+        {"destination.key.password",
+                "\u76EE\u6807\u5BC6\u94A5\u53E3\u4EE4"}, //-destkeypass
+        {"destination.keystore.name",
+                "\u76EE\u6807\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "\u53D7\u4FDD\u62A4\u7684\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "\u76EE\u6807\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-destprovidername
+        {"destination.keystore.password",
+                "\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-deststorepass
+        {"destination.keystore.type",
+                "\u76EE\u6807\u5BC6\u94A5\u5E93\u7C7B\u578B"}, //-deststoretype
+        {"distinguished.name",
+                "\u552F\u4E00\u5224\u522B\u540D"}, //-dname
+        {"X.509.extension",
+                "X.509 \u6269\u5C55"}, //-ext
+        {"output.file.name",
+                "\u8F93\u51FA\u6587\u4EF6\u540D"}, //-file and -outfile
+        {"input.file.name",
+                "\u8F93\u5165\u6587\u4EF6\u540D"}, //-file and -infile
+        {"key.algorithm.name",
+                "\u5BC6\u94A5\u7B97\u6CD5\u540D\u79F0"}, //-keyalg
+        {"key.password",
+                "\u5BC6\u94A5\u53E3\u4EE4"}, //-keypass
+        {"key.bit.size",
+                "\u5BC6\u94A5\u4F4D\u5927\u5C0F"}, //-keysize
+        {"keystore.name",
+                "\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-keystore
+        {"new.password",
+                "\u65B0\u53E3\u4EE4"}, //-new
+        {"do.not.prompt",
+                "\u4E0D\u63D0\u793A"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "\u901A\u8FC7\u53D7\u4FDD\u62A4\u7684\u673A\u5236\u7684\u53E3\u4EE4"}, //-protected
+        {"provider.argument",
+                "\u63D0\u4F9B\u65B9\u53C2\u6570"}, //-providerarg
+        {"provider.class.name",
+                "\u63D0\u4F9B\u65B9\u7C7B\u540D"}, //-providerclass
+        {"provider.name",
+                "\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-providername
+        {"provider.classpath",
+                "\u63D0\u4F9B\u65B9\u7C7B\u8DEF\u5F84"}, //-providerpath
+        {"output.in.RFC.style",
+                "\u4EE5 RFC \u6837\u5F0F\u8F93\u51FA"}, //-rfc
+        {"signature.algorithm.name",
+                "\u7B7E\u540D\u7B97\u6CD5\u540D\u79F0"}, //-sigalg
+        {"source.alias",
+                "\u6E90\u522B\u540D"}, //-srcalias
+        {"source.key.password",
+                "\u6E90\u5BC6\u94A5\u53E3\u4EE4"}, //-srckeypass
+        {"source.keystore.name",
+                "\u6E90\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "\u53D7\u4FDD\u62A4\u7684\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "\u6E90\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-srcprovidername
+        {"source.keystore.password",
+                "\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-srcstorepass
+        {"source.keystore.type",
+                "\u6E90\u5BC6\u94A5\u5E93\u7C7B\u578B"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL \u670D\u52A1\u5668\u4E3B\u673A\u548C\u7AEF\u53E3"}, //-sslserver
+        {"signed.jar.file",
+                "\u5DF2\u7B7E\u540D\u7684 jar \u6587\u4EF6"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "\u8BC1\u4E66\u6709\u6548\u671F\u5F00\u59CB\u65E5\u671F/\u65F6\u95F4"}, //-startdate
+        {"keystore.password",
+                "\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-storepass
+        {"keystore.type",
+                "\u5BC6\u94A5\u5E93\u7C7B\u578B"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "\u4FE1\u4EFB\u6765\u81EA cacerts \u7684\u8BC1\u4E66"}, //-trustcacerts
+        {"verbose.output",
+                "\u8BE6\u7EC6\u8F93\u51FA"}, //-v
+        {"validity.number.of.days",
+                "\u6709\u6548\u5929\u6570"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "\u8981\u64A4\u9500\u7684\u8BC1\u4E66\u7684\u5E8F\u5217 ID"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "keytool \u9519\u8BEF: "},
+        {"Illegal.option.", "\u975E\u6CD5\u9009\u9879:  "},
+        {"Illegal.value.", "\u975E\u6CD5\u503C: "},
+        {"Unknown.password.type.", "\u672A\u77E5\u53E3\u4EE4\u7C7B\u578B: "},
+        {"Cannot.find.environment.variable.",
+                "\u627E\u4E0D\u5230\u73AF\u5883\u53D8\u91CF: "},
+        {"Cannot.find.file.", "\u627E\u4E0D\u5230\u6587\u4EF6: "},
+        {"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9009\u9879{0}\u9700\u8981\u4E00\u4E2A\u53C2\u6570\u3002"},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "\u8B66\u544A: PKCS12 KeyStore \u4E0D\u652F\u6301\u5176\u4ED6\u5B58\u50A8\u548C\u5BC6\u94A5\u53E3\u4EE4\u3002\u6B63\u5728\u5FFD\u7565\u7528\u6237\u6307\u5B9A\u7684{0}\u503C\u3002"},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u4E3A {0}, \u5219 -keystore \u5FC5\u987B\u4E3A NONE"},
+        {"Too.many.retries.program.terminated",
+                 "\u91CD\u8BD5\u6B21\u6570\u8FC7\u591A, \u7A0B\u5E8F\u5DF2\u7EC8\u6B62"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u4E3A {0}, \u5219\u4E0D\u652F\u6301 -storepasswd \u548C -keypasswd \u547D\u4EE4"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "\u5982\u679C -storetype \u4E3A PKCS12, \u5219\u4E0D\u652F\u6301 -keypasswd \u547D\u4EE4"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u4E3A {0}, \u5219\u4E0D\u80FD\u6307\u5B9A -keypass \u548C -new"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A\u4E86 -protected, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass, -keypass \u548C -new"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A\u4E86 -srcprotected, \u5219\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u5982\u679C\u5BC6\u94A5\u5E93\u672A\u53D7\u53E3\u4EE4\u4FDD\u62A4, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass, -keypass \u548C -new"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u5982\u679C\u6E90\u5BC6\u94A5\u5E93\u672A\u53D7\u53E3\u4EE4\u4FDD\u62A4, \u5219\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
+        {"Illegal.startdate.value", "\u975E\u6CD5\u5F00\u59CB\u65E5\u671F\u503C"},
+        {"Validity.must.be.greater.than.zero",
+                "\u6709\u6548\u671F\u5FC5\u987B\u5927\u4E8E\u96F6"},
+        {"provName.not.a.provider", "{0}\u4E0D\u662F\u63D0\u4F9B\u65B9"},
+        {"Usage.error.no.command.provided", "\u7528\u6CD5\u9519\u8BEF: \u6CA1\u6709\u63D0\u4F9B\u547D\u4EE4"},
+        {"Source.keystore.file.exists.but.is.empty.", "\u6E90\u5BC6\u94A5\u5E93\u6587\u4EF6\u5B58\u5728, \u4F46\u4E3A\u7A7A: "},
+        {"Please.specify.srckeystore", "\u8BF7\u6307\u5B9A -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                "'list' \u547D\u4EE4\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A -v \u53CA -rfc"},
+        {"Key.password.must.be.at.least.6.characters",
+                "\u5BC6\u94A5\u53E3\u4EE4\u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
+        {"New.password.must.be.at.least.6.characters",
+                "\u65B0\u53E3\u4EE4\u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
+        {"Keystore.file.exists.but.is.empty.",
+                "\u5BC6\u94A5\u5E93\u6587\u4EF6\u5B58\u5728, \u4F46\u4E3A\u7A7A: "},
+        {"Keystore.file.does.not.exist.",
+                "\u5BC6\u94A5\u5E93\u6587\u4EF6\u4E0D\u5B58\u5728: "},
+        {"Must.specify.destination.alias", "\u5FC5\u987B\u6307\u5B9A\u76EE\u6807\u522B\u540D"},
+        {"Must.specify.alias", "\u5FC5\u987B\u6307\u5B9A\u522B\u540D"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "\u5BC6\u94A5\u5E93\u53E3\u4EE4\u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
+        {"Enter.keystore.password.", "\u8F93\u5165\u5BC6\u94A5\u5E93\u53E3\u4EE4:  "},
+        {"Enter.source.keystore.password.", "\u8F93\u5165\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4:  "},
+        {"Enter.destination.keystore.password.", "\u8F93\u5165\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4:  "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "\u5BC6\u94A5\u5E93\u53E3\u4EE4\u592A\u77ED - \u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
+        {"Unknown.Entry.Type", "\u672A\u77E5\u6761\u76EE\u7C7B\u578B"},
+        {"Too.many.failures.Alias.not.changed", "\u6545\u969C\u592A\u591A\u3002\u672A\u66F4\u6539\u522B\u540D"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "\u5DF2\u6210\u529F\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u3002"},
+        {"Entry.for.alias.alias.not.imported.", "\u672A\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u3002"},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u65F6\u51FA\u73B0\u95EE\u9898: {1}\u3002\n\u672A\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u3002"},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "\u5DF2\u5B8C\u6210\u5BFC\u5165\u547D\u4EE4: {0} \u4E2A\u6761\u76EE\u6210\u529F\u5BFC\u5165, {1} \u4E2A\u6761\u76EE\u5931\u8D25\u6216\u53D6\u6D88"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "\u8B66\u544A: \u6B63\u5728\u8986\u76D6\u76EE\u6807\u5BC6\u94A5\u5E93\u4E2D\u7684\u73B0\u6709\u522B\u540D {0}"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "\u5B58\u5728\u73B0\u6709\u6761\u76EE\u522B\u540D {0}, \u662F\u5426\u8986\u76D6? [no]:  "},
+        {"Too.many.failures.try.later", "\u6545\u969C\u592A\u591A - \u8BF7\u7A0D\u540E\u518D\u8BD5"},
+        {"Certification.request.stored.in.file.filename.",
+                "\u5B58\u50A8\u5728\u6587\u4EF6 <{0}> \u4E2D\u7684\u8BA4\u8BC1\u8BF7\u6C42"},
+        {"Submit.this.to.your.CA", "\u5C06\u6B64\u63D0\u4EA4\u7ED9\u60A8\u7684 CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u522B\u540D, \u5219\u4E0D\u80FD\u6307\u5B9A\u76EE\u6807\u522B\u540D, \u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4\u548C\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4"},
+        {"Certificate.stored.in.file.filename.",
+                "\u5B58\u50A8\u5728\u6587\u4EF6 <{0}> \u4E2D\u7684\u8BC1\u4E66"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "\u8BC1\u4E66\u56DE\u590D\u5DF2\u5B89\u88C5\u5728\u5BC6\u94A5\u5E93\u4E2D"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "\u8BC1\u4E66\u56DE\u590D\u672A\u5B89\u88C5\u5728\u5BC6\u94A5\u5E93\u4E2D"},
+        {"Certificate.was.added.to.keystore",
+                "\u8BC1\u4E66\u5DF2\u6DFB\u52A0\u5230\u5BC6\u94A5\u5E93\u4E2D"},
+        {"Certificate.was.not.added.to.keystore",
+                "\u8BC1\u4E66\u672A\u6DFB\u52A0\u5230\u5BC6\u94A5\u5E93\u4E2D"},
+        {".Storing.ksfname.", "[\u6B63\u5728\u5B58\u50A8{0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0}\u6CA1\u6709\u516C\u5171\u5BC6\u94A5 (\u8BC1\u4E66)"},
+        {"Cannot.derive.signature.algorithm",
+                "\u65E0\u6CD5\u6D3E\u751F\u7B7E\u540D\u7B97\u6CD5"},
+        {"Alias.alias.does.not.exist",
+                "\u522B\u540D <{0}> \u4E0D\u5B58\u5728"},
+        {"Alias.alias.has.no.certificate",
+                "\u522B\u540D <{0}> \u6CA1\u6709\u8BC1\u4E66"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "\u672A\u751F\u6210\u5BC6\u94A5\u5BF9, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "\u6B63\u5728\u4E3A\u4EE5\u4E0B\u5BF9\u8C61\u751F\u6210 {0} \u4F4D{1}\u5BC6\u94A5\u5BF9\u548C\u81EA\u7B7E\u540D\u8BC1\u4E66 ({2}) (\u6709\u6548\u671F\u4E3A {3} \u5929):\n\t {4}"},
+        {"Enter.key.password.for.alias.", "\u8F93\u5165 <{0}> \u7684\u5BC6\u94A5\u53E3\u4EE4"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(\u5982\u679C\u548C\u5BC6\u94A5\u5E93\u53E3\u4EE4\u76F8\u540C, \u6309\u56DE\u8F66):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "\u5BC6\u94A5\u53E3\u4EE4\u592A\u77ED - \u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "\u6545\u969C\u592A\u591A - \u5BC6\u94A5\u672A\u6DFB\u52A0\u5230\u5BC6\u94A5\u5E93\u4E2D"},
+        {"Destination.alias.dest.already.exists",
+                "\u76EE\u6807\u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "\u53E3\u4EE4\u592A\u77ED - \u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "\u6545\u969C\u592A\u591A\u3002\u672A\u514B\u9686\u5BC6\u94A5\u6761\u76EE"},
+        {"key.password.for.alias.", "<{0}> \u7684\u5BC6\u94A5\u53E3\u4EE4"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "<{0}> \u7684\u5BC6\u94A5\u5E93\u6761\u76EE\u5DF2\u7ECF\u5B58\u5728"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "\u6B63\u5728\u521B\u5EFA <{0}> \u7684\u5BC6\u94A5\u5E93\u6761\u76EE..."},
+        {"No.entries.from.identity.database.added",
+                "\u672A\u4ECE\u8EAB\u4EFD\u6570\u636E\u5E93\u4E2D\u6DFB\u52A0\u4EFB\u4F55\u6761\u76EE"},
+        {"Alias.name.alias", "\u522B\u540D: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "\u521B\u5EFA\u65E5\u671F: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "\u6761\u76EE\u7C7B\u578B: {0}"},
+        {"Certificate.chain.length.", "\u8BC1\u4E66\u94FE\u957F\u5EA6: "},
+        {"Certificate.i.1.", "\u8BC1\u4E66[{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "\u8BC1\u4E66\u6307\u7EB9 (SHA1): "},
+        {"Keystore.type.", "\u5BC6\u94A5\u5E93\u7C7B\u578B: "},
+        {"Keystore.provider.", "\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "\u60A8\u7684\u5BC6\u94A5\u5E93\u5305\u542B {0,number,integer} \u4E2A\u6761\u76EE"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "\u60A8\u7684\u5BC6\u94A5\u5E93\u5305\u542B {0,number,integer} \u4E2A\u6761\u76EE"},
+        {"Failed.to.parse.input", "\u65E0\u6CD5\u5BF9\u8F93\u5165\u8FDB\u884C\u8BED\u6CD5\u5206\u6790"},
+        {"Empty.input", "\u7A7A\u8F93\u5165"},
+        {"Not.X.509.certificate", "\u975E X.509 \u8BC1\u4E66"},
+        {"alias.has.no.public.key", "{0}\u6CA1\u6709\u516C\u5171\u5BC6\u94A5"},
+        {"alias.has.no.X.509.certificate", "{0}\u6CA1\u6709 X.509 \u8BC1\u4E66"},
+        {"New.certificate.self.signed.", "\u65B0\u8BC1\u4E66 (\u81EA\u7B7E\u540D):"},
+        {"Reply.has.no.certificates", "\u56DE\u590D\u4E2D\u6CA1\u6709\u8BC1\u4E66"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "\u8BC1\u4E66\u672A\u5BFC\u5165, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
+        {"Input.not.an.X.509.certificate", "\u6240\u8F93\u5165\u7684\u4E0D\u662F X.509 \u8BC1\u4E66"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "\u5728\u522B\u540D <{0}> \u4E4B\u4E0B, \u8BC1\u4E66\u5DF2\u7ECF\u5B58\u5728\u4E8E\u5BC6\u94A5\u5E93\u4E2D"},
+        {"Do.you.still.want.to.add.it.no.",
+                "\u662F\u5426\u4ECD\u8981\u6DFB\u52A0? [no]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "\u5728\u522B\u540D <{0}> \u4E4B\u4E0B, \u8BC1\u4E66\u5DF2\u7ECF\u5B58\u5728\u4E8E\u7CFB\u7EDF\u8303\u56F4\u7684 CA \u5BC6\u94A5\u5E93\u4E2D"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "\u662F\u5426\u4ECD\u8981\u5C06\u5B83\u6DFB\u52A0\u5230\u81EA\u5DF1\u7684\u5BC6\u94A5\u5E93? [no]:  "},
+        {"Trust.this.certificate.no.", "\u662F\u5426\u4FE1\u4EFB\u6B64\u8BC1\u4E66? [no]:  "},
+        {"YES", "\u662F"},
+        {"New.prompt.", "\u65B0{0}: "},
+        {"Passwords.must.differ", "\u53E3\u4EE4\u4E0D\u80FD\u76F8\u540C"},
+        {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F93\u5165\u65B0{0}: "},
+        {"Re.enter.new.password.", "\u518D\u6B21\u8F93\u5165\u65B0\u53E3\u4EE4: "},
+        {"They.don.t.match.Try.again", "\u5B83\u4EEC\u4E0D\u5339\u914D\u3002\u8BF7\u91CD\u8BD5"},
+        {"Enter.prompt.alias.name.", "\u8F93\u5165{0}\u522B\u540D:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "\u8F93\u5165\u65B0\u7684\u522B\u540D\t(\u6309\u56DE\u8F66\u4EE5\u53D6\u6D88\u5BF9\u6B64\u6761\u76EE\u7684\u5BFC\u5165):  "},
+        {"Enter.alias.name.", "\u8F93\u5165\u522B\u540D:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(\u5982\u679C\u548C <{0}> \u76F8\u540C, \u5219\u6309\u56DE\u8F66)"},
+        {".PATTERN.printX509Cert",
+                "\u6240\u6709\u8005: {0}\n\u53D1\u5E03\u8005: {1}\n\u5E8F\u5217\u53F7: {2}\n\u6709\u6548\u671F\u5F00\u59CB\u65E5\u671F: {3}, \u622A\u6B62\u65E5\u671F: {4}\n\u8BC1\u4E66\u6307\u7EB9:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7B7E\u540D\u7B97\u6CD5\u540D\u79F0: {8}\n\t \u7248\u672C: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "\u60A8\u7684\u540D\u5B57\u4E0E\u59D3\u6C0F\u662F\u4EC0\u4E48?"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "\u60A8\u7684\u7EC4\u7EC7\u5355\u4F4D\u540D\u79F0\u662F\u4EC0\u4E48?"},
+        {"What.is.the.name.of.your.organization.",
+                "\u60A8\u7684\u7EC4\u7EC7\u540D\u79F0\u662F\u4EC0\u4E48?"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "\u60A8\u6240\u5728\u7684\u57CE\u5E02\u6216\u533A\u57DF\u540D\u79F0\u662F\u4EC0\u4E48?"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "\u60A8\u6240\u5728\u7684\u7701/\u5E02/\u81EA\u6CBB\u533A\u540D\u79F0\u662F\u4EC0\u4E48?"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "\u8BE5\u5355\u4F4D\u7684\u53CC\u5B57\u6BCD\u56FD\u5BB6/\u5730\u533A\u4EE3\u7801\u662F\u4EC0\u4E48?"},
+        {"Is.name.correct.", "{0}\u662F\u5426\u6B63\u786E?"},
+        {"no", "\u5426"},
+        {"yes", "\u662F"},
+        {"y", "y"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "\u522B\u540D <{0}> \u6CA1\u6709\u5BC6\u94A5"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "\u522B\u540D <{0}> \u5F15\u7528\u4E86\u4E0D\u5C5E\u4E8E\u79C1\u6709\u5BC6\u94A5\u6761\u76EE\u7684\u6761\u76EE\u7C7B\u578B\u3002-keyclone \u547D\u4EE4\u4EC5\u652F\u6301\u5BF9\u79C1\u6709\u5BC6\u94A5\u6761\u76EE\u7684\u514B\u9686"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  \u8B66\u544A \u8B66\u544A \u8B66\u544A  *****************"},
+        {"Signer.d.", "\u7B7E\u540D\u8005 #%d:"},
+        {"Timestamp.", "\u65F6\u95F4\u6233:"},
+        {"Signature.", "\u7B7E\u540D:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "\u8BC1\u4E66\u6240\u6709\u8005: "},
+        {"Not.a.signed.jar.file", "\u4E0D\u662F\u5DF2\u7B7E\u540D\u7684 jar \u6587\u4EF6"},
+        {"No.certificate.from.the.SSL.server",
+                "\u6CA1\u6709\u6765\u81EA SSL \u670D\u52A1\u5668\u7684\u8BC1\u4E66"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* \u5B58\u50A8\u5728\u60A8\u7684\u5BC6\u94A5\u5E93\u4E2D\u7684\u4FE1\u606F\u7684\u5B8C\u6574\u6027  *\n* \u5C1A\u672A\u7ECF\u8FC7\u9A8C\u8BC1!  \u4E3A\u4E86\u9A8C\u8BC1\u5176\u5B8C\u6574\u6027, *\n* \u5FC5\u987B\u63D0\u4F9B\u5BC6\u94A5\u5E93\u53E3\u4EE4\u3002                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* \u5B58\u50A8\u5728 srckeystore \u4E2D\u7684\u4FE1\u606F\u7684\u5B8C\u6574\u6027*\n* \u5C1A\u672A\u7ECF\u8FC7\u9A8C\u8BC1!  \u4E3A\u4E86\u9A8C\u8BC1\u5176\u5B8C\u6574\u6027, *\n* \u5FC5\u987B\u63D0\u4F9B\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4\u3002                  *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "\u8BC1\u4E66\u56DE\u590D\u4E2D\u4E0D\u5305\u542B <{0}> \u7684\u516C\u5171\u5BC6\u94A5"},
+        {"Incomplete.certificate.chain.in.reply",
+                "\u56DE\u590D\u4E2D\u7684\u8BC1\u4E66\u94FE\u4E0D\u5B8C\u6574"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "\u56DE\u590D\u4E2D\u7684\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1: "},
+        {"Top.level.certificate.in.reply.",
+                "\u56DE\u590D\u4E2D\u7684\u9876\u7EA7\u8BC1\u4E66:\n"},
+        {".is.not.trusted.", "... \u662F\u4E0D\u53EF\u4FE1\u7684\u3002"},
+        {"Install.reply.anyway.no.", "\u662F\u5426\u4ECD\u8981\u5B89\u88C5\u56DE\u590D? [no]:  "},
+        {"NO", "\u5426"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "\u56DE\u590D\u4E2D\u7684\u516C\u5171\u5BC6\u94A5\u4E0E\u5BC6\u94A5\u5E93\u4E0D\u5339\u914D"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "\u8BC1\u4E66\u56DE\u590D\u4E0E\u5BC6\u94A5\u5E93\u4E2D\u7684\u8BC1\u4E66\u662F\u76F8\u540C\u7684"},
+        {"Failed.to.establish.chain.from.reply",
+                "\u65E0\u6CD5\u4ECE\u56DE\u590D\u4E2D\u5EFA\u7ACB\u94FE"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "\u9519\u8BEF\u7684\u7B54\u6848, \u8BF7\u518D\u8BD5\u4E00\u6B21"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "\u6CA1\u6709\u751F\u6210\u5BC6\u94A5, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "\u8BF7\u63D0\u4F9B -keysize \u4EE5\u751F\u6210\u5BF9\u79F0\u5BC6\u94A5"},
+
+        {"Extensions.", "\u6269\u5C55: "},
+        {".Empty.value.", "(\u7A7A\u503C)"},
+        {"Extension.Request.", "\u6269\u5C55\u8BF7\u6C42:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10 \u8BC1\u4E66\u8BF7\u6C42 (\u7248\u672C 1.0)\n\u4E3B\u9898: %s\n\u516C\u5171\u5BC6\u94A5: %s \u683C\u5F0F %s \u5BC6\u94A5\n"},
+        {"Unknown.keyUsage.type.", "\u672A\u77E5 keyUsage \u7C7B\u578B: "},
+        {"Unknown.extendedkeyUsage.type.", "\u672A\u77E5 extendedkeyUsage \u7C7B\u578B: "},
+        {"Unknown.AccessDescription.type.", "\u672A\u77E5 AccessDescription \u7C7B\u578B: "},
+        {"Unrecognized.GeneralName.type.", "\u65E0\u6CD5\u8BC6\u522B\u7684 GeneralName \u7C7B\u578B: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "\u65E0\u6CD5\u5C06\u6B64\u6269\u5C55\u6807\u8BB0\u4E3A\u201C\u4E25\u91CD\u201D\u3002"},
+        {"Odd.number.of.hex.digits.found.", "\u627E\u5230\u5947\u6570\u4E2A\u5341\u516D\u8FDB\u5236\u6570\u5B57: "},
+        {"Unknown.extension.type.", "\u672A\u77E5\u6269\u5C55\u7C7B\u578B: "},
+        {"command.{0}.is.ambiguous.", "\u547D\u4EE4{0}\u4E0D\u660E\u786E:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_zh_HK.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_zh_HK extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [\u9078\u9805]..."},
+        {"Options.", "\u9078\u9805:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "\u4F7F\u7528 \"keytool -help\" \u53D6\u5F97\u6240\u6709\u53EF\u7528\u7684\u547D\u4EE4"},
+        {"Key.and.Certificate.Management.Tool",
+                 "\u91D1\u9470\u8207\u6191\u8B49\u7BA1\u7406\u5DE5\u5177"},
+        {"Commands.", "\u547D\u4EE4:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "\u4F7F\u7528 \"keytool -command_name -help\" \u53D6\u5F97 command_name \u7684\u7528\u6CD5"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "\u7522\u751F\u6191\u8B49\u8981\u6C42"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\u8B8A\u66F4\u9805\u76EE\u7684\u5225\u540D"}, //-changealias
+        {"Deletes.an.entry",
+                "\u522A\u9664\u9805\u76EE"}, //-delete
+        {"Exports.certificate",
+                "\u532F\u51FA\u6191\u8B49"}, //-exportcert
+        {"Generates.a.key.pair",
+                "\u7522\u751F\u91D1\u9470\u7D44"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "\u7522\u751F\u79D8\u5BC6\u91D1\u9470"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "\u5F9E\u6191\u8B49\u8981\u6C42\u7522\u751F\u6191\u8B49"}, //-gencert
+        {"Generates.CRL", "\u7522\u751F CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "\u5F9E JDK 1.1.x-style \u8B58\u5225\u8CC7\u6599\u5EAB\u532F\u5165\u9805\u76EE"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "\u532F\u5165\u6191\u8B49\u6216\u6191\u8B49\u93C8"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "\u5F9E\u5176\u4ED6\u91D1\u9470\u5132\u5B58\u5EAB\u532F\u5165\u4E00\u500B\u6216\u5168\u90E8\u9805\u76EE"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "\u8907\u88FD\u91D1\u9470\u9805\u76EE"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\u8B8A\u66F4\u9805\u76EE\u7684\u91D1\u9470\u5BC6\u78BC"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "\u5217\u793A\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u9805\u76EE"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "\u5217\u5370\u6191\u8B49\u7684\u5167\u5BB9"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "\u5217\u5370\u6191\u8B49\u8981\u6C42\u7684\u5167\u5BB9"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "\u5217\u5370 CRL \u6A94\u6848\u7684\u5167\u5BB9"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "\u7522\u751F\u81EA\u884C\u7C3D\u7F72\u7684\u6191\u8B49"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\u8B8A\u66F4\u91D1\u9470\u5132\u5B58\u5EAB\u7684\u5132\u5B58\u5BC6\u78BC"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "\u8981\u8655\u7406\u9805\u76EE\u7684\u5225\u540D\u540D\u7A31"}, //-alias
+        {"destination.alias",
+                "\u76EE\u7684\u5730\u5225\u540D"}, //-destalias
+        {"destination.key.password",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5BC6\u78BC"}, //-destkeypass
+        {"destination.keystore.name",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u4FDD\u8B77"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005\u540D\u7A31"}, //-destprovidername
+        {"destination.keystore.password",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-deststorepass
+        {"destination.keystore.type",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-deststoretype
+        {"distinguished.name",
+                "\u8FA8\u5225\u540D\u7A31"}, //-dname
+        {"X.509.extension",
+                "X.509 \u64F4\u5145\u5957\u4EF6"}, //-ext
+        {"output.file.name",
+                "\u8F38\u51FA\u6A94\u6848\u540D\u7A31"}, //-file and -outfile
+        {"input.file.name",
+                "\u8F38\u5165\u6A94\u6848\u540D\u7A31"}, //-file and -infile
+        {"key.algorithm.name",
+                "\u91D1\u9470\u6F14\u7B97\u6CD5\u540D\u7A31"}, //-keyalg
+        {"key.password",
+                "\u91D1\u9470\u5BC6\u78BC"}, //-keypass
+        {"key.bit.size",
+                "\u91D1\u9470\u4F4D\u5143\u5927\u5C0F"}, //-keysize
+        {"keystore.name",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-keystore
+        {"new.password",
+                "\u65B0\u5BC6\u78BC"}, //-new
+        {"do.not.prompt",
+                "\u4E0D\u8981\u63D0\u793A"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "\u7D93\u7531\u4FDD\u8B77\u6A5F\u5236\u7684\u5BC6\u78BC"}, //-protected
+        {"provider.argument",
+                "\u63D0\u4F9B\u8005\u5F15\u6578"}, //-providerarg
+        {"provider.class.name",
+                "\u63D0\u4F9B\u8005\u985E\u5225\u540D\u7A31"}, //-providerclass
+        {"provider.name",
+                "\u63D0\u4F9B\u8005\u540D\u7A31"}, //-providername
+        {"provider.classpath",
+                "\u63D0\u4F9B\u8005\u985E\u5225\u8DEF\u5F91"}, //-providerpath
+        {"output.in.RFC.style",
+                "\u4EE5 RFC \u6A23\u5F0F\u8F38\u51FA"}, //-rfc
+        {"signature.algorithm.name",
+                "\u7C3D\u7AE0\u6F14\u7B97\u6CD5\u540D\u7A31"}, //-sigalg
+        {"source.alias",
+                "\u4F86\u6E90\u5225\u540D"}, //-srcalias
+        {"source.key.password",
+                "\u4F86\u6E90\u91D1\u9470\u5BC6\u78BC"}, //-srckeypass
+        {"source.keystore.name",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u4FDD\u8B77"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005\u540D\u7A31"}, //-srcprovidername
+        {"source.keystore.password",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-srcstorepass
+        {"source.keystore.type",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL \u4F3A\u670D\u5668\u4E3B\u6A5F\u8207\u9023\u63A5\u57E0"}, //-sslserver
+        {"signed.jar.file",
+                "\u7C3D\u7F72\u7684 jar \u6A94\u6848"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "\u6191\u8B49\u6709\u6548\u6027\u958B\u59CB\u65E5\u671F/\u6642\u9593"}, //-startdate
+        {"keystore.password",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-storepass
+        {"keystore.type",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "\u4F86\u81EA cacerts \u7684\u4FE1\u4EFB\u6191\u8B49"}, //-trustcacerts
+        {"verbose.output",
+                "\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA"}, //-v
+        {"validity.number.of.days",
+                "\u6709\u6548\u6027\u65E5\u6578"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "\u8981\u64A4\u92B7\u6191\u8B49\u7684\u5E8F\u5217 ID"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "\u91D1\u9470\u5DE5\u5177\u932F\u8AA4: "},
+        {"Illegal.option.", "\u7121\u6548\u7684\u9078\u9805:"},
+        {"Illegal.value.", "\u7121\u6548\u503C: "},
+        {"Unknown.password.type.", "\u4E0D\u660E\u7684\u5BC6\u78BC\u985E\u578B: "},
+        {"Cannot.find.environment.variable.",
+                "\u627E\u4E0D\u5230\u74B0\u5883\u8B8A\u6578: "},
+        {"Cannot.find.file.", "\u627E\u4E0D\u5230\u6A94\u6848: "},
+        {"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9078\u9805 {0} \u9700\u8981\u5F15\u6578\u3002"},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "\u8B66\u544A: PKCS12 \u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u652F\u63F4\u4E0D\u540C\u7684\u5132\u5B58\u5EAB\u548C\u91D1\u9470\u5BC6\u78BC\u3002\u5FFD\u7565\u4F7F\u7528\u8005\u6307\u5B9A\u7684 {0} \u503C\u3002"},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247 -keystore \u5FC5\u9808\u70BA NONE"},
+        {"Too.many.retries.program.terminated",
+                 "\u91CD\u8A66\u6B21\u6578\u592A\u591A\uFF0C\u7A0B\u5F0F\u5DF2\u7D42\u6B62"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247\u4E0D\u652F\u63F4 -storepasswd \u548C -keypasswd \u547D\u4EE4"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "\u5982\u679C -storetype \u70BA PKCS12\uFF0C\u5247\u4E0D\u652F\u63F4 -keypasswd \u547D\u4EE4"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -keypass \u548C -new"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A -protected\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -storepass\u3001-keypass \u548C -new"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A -srcprotected\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u5982\u679C\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u53D7\u5BC6\u78BC\u4FDD\u8B77\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -storepass\u3001-keypass \u548C -new"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u5982\u679C\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u53D7\u5BC6\u78BC\u4FDD\u8B77\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
+        {"Illegal.startdate.value", "\u7121\u6548\u7684 startdate \u503C"},
+        {"Validity.must.be.greater.than.zero",
+                "\u6709\u6548\u6027\u5FC5\u9808\u5927\u65BC\u96F6"},
+        {"provName.not.a.provider", "{0} \u4E0D\u662F\u4E00\u500B\u63D0\u4F9B\u8005"},
+        {"Usage.error.no.command.provided", "\u7528\u6CD5\u932F\u8AA4: \u672A\u63D0\u4F9B\u547D\u4EE4"},
+        {"Source.keystore.file.exists.but.is.empty.", "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A: "},
+        {"Please.specify.srckeystore", "\u8ACB\u6307\u5B9A -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                " 'list' \u547D\u4EE4\u4E0D\u80FD\u540C\u6642\u6307\u5B9A -v \u53CA -rfc"},
+        {"Key.password.must.be.at.least.6.characters",
+                "\u91D1\u9470\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"New.password.must.be.at.least.6.characters",
+                "\u65B0\u7684\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Keystore.file.exists.but.is.empty.",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A\u767D: "},
+        {"Keystore.file.does.not.exist.",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u4E0D\u5B58\u5728: "},
+        {"Must.specify.destination.alias", "\u5FC5\u9808\u6307\u5B9A\u76EE\u7684\u5730\u5225\u540D"},
+        {"Must.specify.alias", "\u5FC5\u9808\u6307\u5B9A\u5225\u540D"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Enter.keystore.password.", "\u8F38\u5165\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC:  "},
+        {"Enter.source.keystore.password.", "\u8ACB\u8F38\u5165\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC: "},
+        {"Enter.destination.keystore.password.", "\u8ACB\u8F38\u5165\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC: "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Unknown.Entry.Type", "\u4E0D\u660E\u7684\u9805\u76EE\u985E\u578B"},
+        {"Too.many.failures.Alias.not.changed", "\u592A\u591A\u932F\u8AA4\u3002\u672A\u8B8A\u66F4\u5225\u540D"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "\u5DF2\u6210\u529F\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
+        {"Entry.for.alias.alias.not.imported.", "\u672A\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u6642\u51FA\u73FE\u554F\u984C: {1}\u3002\n\u672A\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "\u5DF2\u5B8C\u6210\u532F\u5165\u547D\u4EE4: \u6210\u529F\u532F\u5165 {0} \u500B\u9805\u76EE\uFF0C{1} \u500B\u9805\u76EE\u5931\u6557\u6216\u5DF2\u53D6\u6D88"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "\u8B66\u544A: \u6B63\u5728\u8986\u5BEB\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u73FE\u6709\u5225\u540D {0}"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "\u73FE\u6709\u9805\u76EE\u5225\u540D {0} \u5B58\u5728\uFF0C\u662F\u5426\u8986\u5BEB\uFF1F[\u5426]:  "},
+        {"Too.many.failures.try.later", "\u592A\u591A\u932F\u8AA4 - \u8ACB\u7A0D\u5F8C\u518D\u8A66"},
+        {"Certification.request.stored.in.file.filename.",
+                "\u8A8D\u8B49\u8981\u6C42\u5132\u5B58\u5728\u6A94\u6848 <{0}>"},
+        {"Submit.this.to.your.CA", "\u5C07\u6B64\u9001\u51FA\u81F3\u60A8\u7684 CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "\u5982\u679C\u672A\u6307\u5B9A\u5225\u540D\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A destalias\u3001srckeypass \u53CA destkeypass"},
+        {"Certificate.stored.in.file.filename.",
+                "\u6191\u8B49\u5132\u5B58\u5728\u6A94\u6848 <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "\u6191\u8B49\u56DE\u8986\u5DF2\u5B89\u88DD\u5728\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "\u6191\u8B49\u56DE\u8986\u672A\u5B89\u88DD\u5728\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {"Certificate.was.added.to.keystore",
+                "\u6191\u8B49\u5DF2\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {"Certificate.was.not.added.to.keystore",
+                "\u6191\u8B49\u672A\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {".Storing.ksfname.", "[\u5132\u5B58 {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} \u6C92\u6709\u516C\u958B\u91D1\u9470 (\u6191\u8B49)"},
+        {"Cannot.derive.signature.algorithm",
+                "\u7121\u6CD5\u53D6\u5F97\u7C3D\u7AE0\u6F14\u7B97\u6CD5"},
+        {"Alias.alias.does.not.exist",
+                "\u5225\u540D <{0}> \u4E0D\u5B58\u5728"},
+        {"Alias.alias.has.no.certificate",
+                "\u5225\u540D <{0}> \u6C92\u6709\u6191\u8B49"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "\u6C92\u6709\u5EFA\u7ACB\u91D1\u9470\u7D44\uFF0C\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "\u91DD\u5C0D {4} \u7522\u751F\u6709\u6548\u671F {3} \u5929\u7684 {0} \u4F4D\u5143 {1} \u91D1\u9470\u7D44\u4EE5\u53CA\u81EA\u6211\u7C3D\u7F72\u6191\u8B49 ({2})\n\t"},
+        {"Enter.key.password.for.alias.", "\u8F38\u5165 <{0}> \u7684\u91D1\u9470\u5BC6\u78BC"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(RETURN \u5982\u679C\u548C\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u76F8\u540C):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "\u91D1\u9470\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "\u592A\u591A\u932F\u8AA4 - \u91D1\u9470\u672A\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB"},
+        {"Destination.alias.dest.already.exists",
+                "\u76EE\u7684\u5730\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "\u592A\u591A\u932F\u8AA4\u3002\u672A\u8907\u88FD\u91D1\u9470\u9805\u76EE"},
+        {"key.password.for.alias.", "<{0}> \u7684\u91D1\u9470\u5BC6\u78BC"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "<{0}> \u7684\u91D1\u9470\u5132\u5B58\u5EAB\u9805\u76EE\u5DF2\u7D93\u5B58\u5728"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "\u5EFA\u7ACB <{0}> \u7684\u91D1\u9470\u5132\u5B58\u5EAB\u9805\u76EE..."},
+        {"No.entries.from.identity.database.added",
+                "\u6C92\u6709\u65B0\u589E\u4F86\u81EA\u8B58\u5225\u8CC7\u6599\u5EAB\u7684\u9805\u76EE"},
+        {"Alias.name.alias", "\u5225\u540D\u540D\u7A31: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "\u5EFA\u7ACB\u65E5\u671F: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "\u9805\u76EE\u985E\u578B: {0}"},
+        {"Certificate.chain.length.", "\u6191\u8B49\u93C8\u9577\u5EA6: "},
+        {"Certificate.i.1.", "\u6191\u8B49 [{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "\u6191\u8B49\u6307\u7D0B (SHA1): "},
+        {"Keystore.type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B: "},
+        {"Keystore.provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5305\u542B {0,number,integer} \u9805\u76EE"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5305\u542B {0,number,integer} \u9805\u76EE"},
+        {"Failed.to.parse.input", "\u7121\u6CD5\u5256\u6790\u8F38\u5165"},
+        {"Empty.input", "\u7A7A\u8F38\u5165"},
+        {"Not.X.509.certificate", "\u975E X.509 \u6191\u8B49"},
+        {"alias.has.no.public.key", "{0} \u7121\u516C\u958B\u91D1\u9470"},
+        {"alias.has.no.X.509.certificate", "{0} \u7121 X.509 \u6191\u8B49"},
+        {"New.certificate.self.signed.", "\u65B0\u6191\u8B49 (\u81EA\u6211\u7C3D\u7F72): "},
+        {"Reply.has.no.certificates", "\u56DE\u8986\u4E0D\u542B\u6191\u8B49"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "\u6191\u8B49\u672A\u8F38\u5165\uFF0C\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
+        {"Input.not.an.X.509.certificate", "\u8F38\u5165\u7684\u4E0D\u662F X.509 \u6191\u8B49"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684 <{0}> \u5225\u540D\u4E4B\u4E0B\uFF0C\u6191\u8B49\u5DF2\u7D93\u5B58\u5728"},
+        {"Do.you.still.want.to.add.it.no.",
+                "\u60A8\u4ECD\u7136\u60F3\u8981\u5C07\u4E4B\u65B0\u589E\u55CE\uFF1F [\u5426]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "\u6574\u500B\u7CFB\u7D71 CA \u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684 <{0}> \u5225\u540D\u4E4B\u4E0B\uFF0C\u6191\u8B49\u5DF2\u7D93\u5B58\u5728"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "\u60A8\u4ECD\u7136\u60F3\u8981\u5C07\u4E4B\u65B0\u589E\u81F3\u81EA\u5DF1\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u55CE\uFF1F [\u5426]:  "},
+        {"Trust.this.certificate.no.", "\u4FE1\u4EFB\u9019\u500B\u6191\u8B49\uFF1F [\u5426]:  "},
+        {"YES", "\u662F"},
+        {"New.prompt.", "\u65B0 {0}: "},
+        {"Passwords.must.differ", "\u5FC5\u9808\u662F\u4E0D\u540C\u7684\u5BC6\u78BC"},
+        {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F38\u5165\u65B0 {0}: "},
+        {"Re.enter.new.password.", "\u91CD\u65B0\u8F38\u5165\u65B0\u5BC6\u78BC: "},
+        {"They.don.t.match.Try.again", "\u5B83\u5011\u4E0D\u76F8\u7B26\u3002\u8ACB\u91CD\u8A66"},
+        {"Enter.prompt.alias.name.", "\u8F38\u5165 {0} \u5225\u540D\u540D\u7A31:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "\u8ACB\u8F38\u5165\u65B0\u7684\u5225\u540D\u540D\u7A31\t(RETURN \u4EE5\u53D6\u6D88\u532F\u5165\u6B64\u9805\u76EE):"},
+        {"Enter.alias.name.", "\u8F38\u5165\u5225\u540D\u540D\u7A31:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(RETURN \u5982\u679C\u548C <{0}> \u7684\u76F8\u540C)"},
+        {".PATTERN.printX509Cert",
+                "\u64C1\u6709\u8005: {0}\n\u767C\u51FA\u8005: {1}\n\u5E8F\u865F: {2}\n\u6709\u6548\u671F\u81EA: {3} \u5230: {4}\n\u6191\u8B49\u6307\u7D0B:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7C3D\u7AE0\u6F14\u7B97\u6CD5\u540D\u7A31: {8}\n\t \u7248\u672C: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "\u60A8\u7684\u540D\u5B57\u8207\u59D3\u6C0F\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "\u60A8\u7684\u7D44\u7E54\u55AE\u4F4D\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.organization.",
+                "\u60A8\u7684\u7D44\u7E54\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "\u60A8\u6240\u5728\u7684\u57CE\u5E02\u6216\u5730\u5340\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "\u60A8\u6240\u5728\u7684\u5DDE\u53CA\u7701\u4EFD\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "\u6B64\u55AE\u4F4D\u7684\u5169\u500B\u5B57\u6BCD\u570B\u5225\u4EE3\u78BC\u70BA\u4F55\uFF1F"},
+        {"Is.name.correct.", "{0} \u6B63\u78BA\u55CE\uFF1F"},
+        {"no", "\u5426"},
+        {"yes", "\u662F"},
+        {"y", "y"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "\u5225\u540D <{0}> \u6C92\u6709\u91D1\u9470"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "\u5225\u540D <{0}> \u6240\u53C3\u7167\u7684\u9805\u76EE\u4E0D\u662F\u79C1\u5BC6\u91D1\u9470\u985E\u578B\u3002-keyclone \u547D\u4EE4\u50C5\u652F\u63F4\u79C1\u5BC6\u91D1\u9470\u9805\u76EE\u7684\u8907\u88FD"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  \u8B66\u544A \u8B66\u544A \u8B66\u544A  *****************"},
+        {"Signer.d.", "\u7C3D\u7F72\u8005 #%d:"},
+        {"Timestamp.", "\u6642\u6233:"},
+        {"Signature.", "\u7C3D\u7AE0:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "\u6191\u8B49\u64C1\u6709\u8005: "},
+        {"Not.a.signed.jar.file", "\u4E0D\u662F\u7C3D\u7F72\u7684 jar \u6A94\u6848"},
+        {"No.certificate.from.the.SSL.server",
+                "\u6C92\u6709\u4F86\u81EA SSL \u4F3A\u670D\u5668\u7684\u6191\u8B49"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u8CC7\u8A0A  *\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C*\n* \u60A8\u5FC5\u9808\u63D0\u4F9B\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u3002                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC srckeystore \u4E2D\u8CC7\u8A0A*\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C\u60A8\u5FC5\u9808 *\n* \u63D0\u4F9B srckeystore \u5BC6\u78BC\u3002          *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "\u6191\u8B49\u56DE\u8986\u4E26\u672A\u5305\u542B <{0}> \u7684\u516C\u958B\u91D1\u9470"},
+        {"Incomplete.certificate.chain.in.reply",
+                "\u56DE\u8986\u6642\u7684\u6191\u8B49\u93C8\u4E0D\u5B8C\u6574"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "\u56DE\u8986\u6642\u7684\u6191\u8B49\u93C8\u672A\u9A57\u8B49: "},
+        {"Top.level.certificate.in.reply.",
+                "\u56DE\u8986\u6642\u7684\u6700\u9AD8\u7D1A\u6191\u8B49:\\n"},
+        {".is.not.trusted.", "... \u662F\u4E0D\u88AB\u4FE1\u4EFB\u7684\u3002"},
+        {"Install.reply.anyway.no.", "\u9084\u662F\u8981\u5B89\u88DD\u56DE\u8986\uFF1F [\u5426]:  "},
+        {"NO", "\u5426"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "\u56DE\u8986\u6642\u7684\u516C\u958B\u91D1\u9470\u8207\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u7B26"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "\u6191\u8B49\u56DE\u8986\u8207\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u6191\u8B49\u662F\u76F8\u540C\u7684"},
+        {"Failed.to.establish.chain.from.reply",
+                "\u7121\u6CD5\u5F9E\u56DE\u8986\u4E2D\u5C07\u93C8\u5EFA\u7ACB\u8D77\u4F86"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "\u932F\u8AA4\u7684\u7B54\u6848\uFF0C\u8ACB\u518D\u8A66\u4E00\u6B21"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "\u672A\u7522\u751F\u79D8\u5BC6\u91D1\u9470\uFF0C\u5225\u540D <{0}> \u5DF2\u5B58\u5728"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "\u8ACB\u63D0\u4F9B -keysize \u4EE5\u7522\u751F\u79D8\u5BC6\u91D1\u9470"},
+
+        {"Extensions.", "\u64F4\u5145\u5957\u4EF6: "},
+        {".Empty.value.", "(\u7A7A\u767D\u503C)"},
+        {"Extension.Request.", "\u64F4\u5145\u5957\u4EF6\u8981\u6C42:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10 \u6191\u8B49\u8981\u6C42 (\u7248\u672C 1.0)\n\u4E3B\u9AD4: %s\n\u516C\u7528\u91D1\u9470: %s \u683C\u5F0F %s \u91D1\u9470\n"},
+        {"Unknown.keyUsage.type.", "\u4E0D\u660E\u7684 keyUsage \u985E\u578B: "},
+        {"Unknown.extendedkeyUsage.type.", "\u4E0D\u660E\u7684 extendedkeyUsage \u985E\u578B: "},
+        {"Unknown.AccessDescription.type.", "\u4E0D\u660E\u7684 AccessDescription \u985E\u578B: "},
+        {"Unrecognized.GeneralName.type.", "\u7121\u6CD5\u8FA8\u8B58\u7684 GeneralName \u985E\u578B: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "\u6B64\u64F4\u5145\u5957\u4EF6\u7121\u6CD5\u6A19\u793A\u70BA\u95DC\u9375\u3002"},
+        {"Odd.number.of.hex.digits.found.", "\u627E\u5230\u5341\u516D\u9032\u4F4D\u6578\u5B57\u7684\u5947\u6578: "},
+        {"Unknown.extension.type.", "\u4E0D\u660E\u7684\u64F4\u5145\u5957\u4EF6\u985E\u578B: "},
+        {"command.{0}.is.ambiguous.", "\u547D\u4EE4 {0} \u4E0D\u660E\u78BA:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/keytool/Resources_zh_TW.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.keytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the keytool.
+ *
+ */
+public class Resources_zh_TW extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"STAR",
+                "*******************************************"},
+        {"STARNN",
+                "*******************************************\n\n"},
+
+        // keytool: Help part
+// "Option" should be translated.
+        {".OPTION.", " [\u9078\u9805]..."},
+        {"Options.", "\u9078\u9805:"},
+        {"Use.keytool.help.for.all.available.commands",
+                 "\u4F7F\u7528 \"keytool -help\" \u53D6\u5F97\u6240\u6709\u53EF\u7528\u7684\u547D\u4EE4"},
+        {"Key.and.Certificate.Management.Tool",
+                 "\u91D1\u9470\u8207\u6191\u8B49\u7BA1\u7406\u5DE5\u5177"},
+        {"Commands.", "\u547D\u4EE4:"},
+        {"Use.keytool.command.name.help.for.usage.of.command.name",
+                "\u4F7F\u7528 \"keytool -command_name -help\" \u53D6\u5F97 command_name \u7684\u7528\u6CD5"},
+        // keytool: help: commands
+        {"Generates.a.certificate.request",
+                "\u7522\u751F\u6191\u8B49\u8981\u6C42"}, //-certreq
+        {"Changes.an.entry.s.alias",
+                "\u8B8A\u66F4\u9805\u76EE\u7684\u5225\u540D"}, //-changealias
+        {"Deletes.an.entry",
+                "\u522A\u9664\u9805\u76EE"}, //-delete
+        {"Exports.certificate",
+                "\u532F\u51FA\u6191\u8B49"}, //-exportcert
+        {"Generates.a.key.pair",
+                "\u7522\u751F\u91D1\u9470\u7D44"}, //-genkeypair
+// translation of "secret" key should be different to "private" key.
+        {"Generates.a.secret.key",
+                "\u7522\u751F\u79D8\u5BC6\u91D1\u9470"}, //-genseckey
+        {"Generates.certificate.from.a.certificate.request",
+                "\u5F9E\u6191\u8B49\u8981\u6C42\u7522\u751F\u6191\u8B49"}, //-gencert
+        {"Generates.CRL", "\u7522\u751F CRL"}, //-gencrl
+        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
+                "\u5F9E JDK 1.1.x-style \u8B58\u5225\u8CC7\u6599\u5EAB\u532F\u5165\u9805\u76EE"}, //-identitydb
+        {"Imports.a.certificate.or.a.certificate.chain",
+                "\u532F\u5165\u6191\u8B49\u6216\u6191\u8B49\u93C8"}, //-importcert
+        {"Imports.one.or.all.entries.from.another.keystore",
+                "\u5F9E\u5176\u4ED6\u91D1\u9470\u5132\u5B58\u5EAB\u532F\u5165\u4E00\u500B\u6216\u5168\u90E8\u9805\u76EE"}, //-importkeystore
+        {"Clones.a.key.entry",
+                "\u8907\u88FD\u91D1\u9470\u9805\u76EE"}, //-keyclone
+        {"Changes.the.key.password.of.an.entry",
+                "\u8B8A\u66F4\u9805\u76EE\u7684\u91D1\u9470\u5BC6\u78BC"}, //-keypasswd
+        {"Lists.entries.in.a.keystore",
+                "\u5217\u793A\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u9805\u76EE"}, //-list
+        {"Prints.the.content.of.a.certificate",
+                "\u5217\u5370\u6191\u8B49\u7684\u5167\u5BB9"}, //-printcert
+        {"Prints.the.content.of.a.certificate.request",
+                "\u5217\u5370\u6191\u8B49\u8981\u6C42\u7684\u5167\u5BB9"}, //-printcertreq
+        {"Prints.the.content.of.a.CRL.file",
+                "\u5217\u5370 CRL \u6A94\u6848\u7684\u5167\u5BB9"}, //-printcrl
+        {"Generates.a.self.signed.certificate",
+                "\u7522\u751F\u81EA\u884C\u7C3D\u7F72\u7684\u6191\u8B49"}, //-selfcert
+        {"Changes.the.store.password.of.a.keystore",
+                "\u8B8A\u66F4\u91D1\u9470\u5132\u5B58\u5EAB\u7684\u5132\u5B58\u5BC6\u78BC"}, //-storepasswd
+        // keytool: help: options
+        {"alias.name.of.the.entry.to.process",
+                "\u8981\u8655\u7406\u9805\u76EE\u7684\u5225\u540D\u540D\u7A31"}, //-alias
+        {"destination.alias",
+                "\u76EE\u7684\u5730\u5225\u540D"}, //-destalias
+        {"destination.key.password",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5BC6\u78BC"}, //-destkeypass
+        {"destination.keystore.name",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-destkeystore
+        {"destination.keystore.password.protected",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u4FDD\u8B77"}, //-destprotected
+        {"destination.keystore.provider.name",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005\u540D\u7A31"}, //-destprovidername
+        {"destination.keystore.password",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-deststorepass
+        {"destination.keystore.type",
+                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-deststoretype
+        {"distinguished.name",
+                "\u8FA8\u5225\u540D\u7A31"}, //-dname
+        {"X.509.extension",
+                "X.509 \u64F4\u5145\u5957\u4EF6"}, //-ext
+        {"output.file.name",
+                "\u8F38\u51FA\u6A94\u6848\u540D\u7A31"}, //-file and -outfile
+        {"input.file.name",
+                "\u8F38\u5165\u6A94\u6848\u540D\u7A31"}, //-file and -infile
+        {"key.algorithm.name",
+                "\u91D1\u9470\u6F14\u7B97\u6CD5\u540D\u7A31"}, //-keyalg
+        {"key.password",
+                "\u91D1\u9470\u5BC6\u78BC"}, //-keypass
+        {"key.bit.size",
+                "\u91D1\u9470\u4F4D\u5143\u5927\u5C0F"}, //-keysize
+        {"keystore.name",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-keystore
+        {"new.password",
+                "\u65B0\u5BC6\u78BC"}, //-new
+        {"do.not.prompt",
+                "\u4E0D\u8981\u63D0\u793A"}, //-noprompt
+        {"password.through.protected.mechanism",
+                "\u7D93\u7531\u4FDD\u8B77\u6A5F\u5236\u7684\u5BC6\u78BC"}, //-protected
+        {"provider.argument",
+                "\u63D0\u4F9B\u8005\u5F15\u6578"}, //-providerarg
+        {"provider.class.name",
+                "\u63D0\u4F9B\u8005\u985E\u5225\u540D\u7A31"}, //-providerclass
+        {"provider.name",
+                "\u63D0\u4F9B\u8005\u540D\u7A31"}, //-providername
+        {"provider.classpath",
+                "\u63D0\u4F9B\u8005\u985E\u5225\u8DEF\u5F91"}, //-providerpath
+        {"output.in.RFC.style",
+                "\u4EE5 RFC \u6A23\u5F0F\u8F38\u51FA"}, //-rfc
+        {"signature.algorithm.name",
+                "\u7C3D\u7AE0\u6F14\u7B97\u6CD5\u540D\u7A31"}, //-sigalg
+        {"source.alias",
+                "\u4F86\u6E90\u5225\u540D"}, //-srcalias
+        {"source.key.password",
+                "\u4F86\u6E90\u91D1\u9470\u5BC6\u78BC"}, //-srckeypass
+        {"source.keystore.name",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-srckeystore
+        {"source.keystore.password.protected",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u4FDD\u8B77"}, //-srcprotected
+        {"source.keystore.provider.name",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005\u540D\u7A31"}, //-srcprovidername
+        {"source.keystore.password",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-srcstorepass
+        {"source.keystore.type",
+                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-srcstoretype
+        {"SSL.server.host.and.port",
+                "SSL \u4F3A\u670D\u5668\u4E3B\u6A5F\u8207\u9023\u63A5\u57E0"}, //-sslserver
+        {"signed.jar.file",
+                "\u7C3D\u7F72\u7684 jar \u6A94\u6848"}, //=jarfile
+        {"certificate.validity.start.date.time",
+                "\u6191\u8B49\u6709\u6548\u6027\u958B\u59CB\u65E5\u671F/\u6642\u9593"}, //-startdate
+        {"keystore.password",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-storepass
+        {"keystore.type",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-storetype
+        {"trust.certificates.from.cacerts",
+                "\u4F86\u81EA cacerts \u7684\u4FE1\u4EFB\u6191\u8B49"}, //-trustcacerts
+        {"verbose.output",
+                "\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA"}, //-v
+        {"validity.number.of.days",
+                "\u6709\u6548\u6027\u65E5\u6578"}, //-validity
+        {"Serial.ID.of.cert.to.revoke",
+                 "\u8981\u64A4\u92B7\u6191\u8B49\u7684\u5E8F\u5217 ID"}, //-id
+        // keytool: Running part
+        {"keytool.error.", "\u91D1\u9470\u5DE5\u5177\u932F\u8AA4: "},
+        {"Illegal.option.", "\u7121\u6548\u7684\u9078\u9805:"},
+        {"Illegal.value.", "\u7121\u6548\u503C: "},
+        {"Unknown.password.type.", "\u4E0D\u660E\u7684\u5BC6\u78BC\u985E\u578B: "},
+        {"Cannot.find.environment.variable.",
+                "\u627E\u4E0D\u5230\u74B0\u5883\u8B8A\u6578: "},
+        {"Cannot.find.file.", "\u627E\u4E0D\u5230\u6A94\u6848: "},
+        {"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9078\u9805 {0} \u9700\u8981\u5F15\u6578\u3002"},
+        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
+                "\u8B66\u544A: PKCS12 \u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u652F\u63F4\u4E0D\u540C\u7684\u5132\u5B58\u5EAB\u548C\u91D1\u9470\u5BC6\u78BC\u3002\u5FFD\u7565\u4F7F\u7528\u8005\u6307\u5B9A\u7684 {0} \u503C\u3002"},
+        {".keystore.must.be.NONE.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247 -keystore \u5FC5\u9808\u70BA NONE"},
+        {"Too.many.retries.program.terminated",
+                 "\u91CD\u8A66\u6B21\u6578\u592A\u591A\uFF0C\u7A0B\u5F0F\u5DF2\u7D42\u6B62"},
+        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247\u4E0D\u652F\u63F4 -storepasswd \u548C -keypasswd \u547D\u4EE4"},
+        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
+                "\u5982\u679C -storetype \u70BA PKCS12\uFF0C\u5247\u4E0D\u652F\u63F4 -keypasswd \u547D\u4EE4"},
+        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
+                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -keypass \u548C -new"},
+        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A -protected\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -storepass\u3001-keypass \u548C -new"},
+        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u5982\u679C\u6307\u5B9A -srcprotected\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
+        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
+                "\u5982\u679C\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u53D7\u5BC6\u78BC\u4FDD\u8B77\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -storepass\u3001-keypass \u548C -new"},
+        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
+                "\u5982\u679C\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u53D7\u5BC6\u78BC\u4FDD\u8B77\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
+        {"Illegal.startdate.value", "\u7121\u6548\u7684 startdate \u503C"},
+        {"Validity.must.be.greater.than.zero",
+                "\u6709\u6548\u6027\u5FC5\u9808\u5927\u65BC\u96F6"},
+        {"provName.not.a.provider", "{0} \u4E0D\u662F\u4E00\u500B\u63D0\u4F9B\u8005"},
+        {"Usage.error.no.command.provided", "\u7528\u6CD5\u932F\u8AA4: \u672A\u63D0\u4F9B\u547D\u4EE4"},
+        {"Source.keystore.file.exists.but.is.empty.", "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A: "},
+        {"Please.specify.srckeystore", "\u8ACB\u6307\u5B9A -srckeystore"},
+        {"Must.not.specify.both.v.and.rfc.with.list.command",
+                " 'list' \u547D\u4EE4\u4E0D\u80FD\u540C\u6642\u6307\u5B9A -v \u53CA -rfc"},
+        {"Key.password.must.be.at.least.6.characters",
+                "\u91D1\u9470\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"New.password.must.be.at.least.6.characters",
+                "\u65B0\u7684\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Keystore.file.exists.but.is.empty.",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A\u767D: "},
+        {"Keystore.file.does.not.exist.",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u4E0D\u5B58\u5728: "},
+        {"Must.specify.destination.alias", "\u5FC5\u9808\u6307\u5B9A\u76EE\u7684\u5730\u5225\u540D"},
+        {"Must.specify.alias", "\u5FC5\u9808\u6307\u5B9A\u5225\u540D"},
+        {"Keystore.password.must.be.at.least.6.characters",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Enter.keystore.password.", "\u8F38\u5165\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC:  "},
+        {"Enter.source.keystore.password.", "\u8ACB\u8F38\u5165\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC: "},
+        {"Enter.destination.keystore.password.", "\u8ACB\u8F38\u5165\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC: "},
+        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
+         "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Unknown.Entry.Type", "\u4E0D\u660E\u7684\u9805\u76EE\u985E\u578B"},
+        {"Too.many.failures.Alias.not.changed", "\u592A\u591A\u932F\u8AA4\u3002\u672A\u8B8A\u66F4\u5225\u540D"},
+        {"Entry.for.alias.alias.successfully.imported.",
+                 "\u5DF2\u6210\u529F\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
+        {"Entry.for.alias.alias.not.imported.", "\u672A\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
+        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
+                 "\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u6642\u51FA\u73FE\u554F\u984C: {1}\u3002\n\u672A\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
+        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
+                 "\u5DF2\u5B8C\u6210\u532F\u5165\u547D\u4EE4: \u6210\u529F\u532F\u5165 {0} \u500B\u9805\u76EE\uFF0C{1} \u500B\u9805\u76EE\u5931\u6557\u6216\u5DF2\u53D6\u6D88"},
+        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
+                 "\u8B66\u544A: \u6B63\u5728\u8986\u5BEB\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u73FE\u6709\u5225\u540D {0}"},
+        {"Existing.entry.alias.alias.exists.overwrite.no.",
+                 "\u73FE\u6709\u9805\u76EE\u5225\u540D {0} \u5B58\u5728\uFF0C\u662F\u5426\u8986\u5BEB\uFF1F[\u5426]:  "},
+        {"Too.many.failures.try.later", "\u592A\u591A\u932F\u8AA4 - \u8ACB\u7A0D\u5F8C\u518D\u8A66"},
+        {"Certification.request.stored.in.file.filename.",
+                "\u8A8D\u8B49\u8981\u6C42\u5132\u5B58\u5728\u6A94\u6848 <{0}>"},
+        {"Submit.this.to.your.CA", "\u5C07\u6B64\u9001\u51FA\u81F3\u60A8\u7684 CA"},
+        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
+            "\u5982\u679C\u672A\u6307\u5B9A\u5225\u540D\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A destalias\u3001srckeypass \u53CA destkeypass"},
+        {"Certificate.stored.in.file.filename.",
+                "\u6191\u8B49\u5132\u5B58\u5728\u6A94\u6848 <{0}>"},
+        {"Certificate.reply.was.installed.in.keystore",
+                "\u6191\u8B49\u56DE\u8986\u5DF2\u5B89\u88DD\u5728\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {"Certificate.reply.was.not.installed.in.keystore",
+                "\u6191\u8B49\u56DE\u8986\u672A\u5B89\u88DD\u5728\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {"Certificate.was.added.to.keystore",
+                "\u6191\u8B49\u5DF2\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {"Certificate.was.not.added.to.keystore",
+                "\u6191\u8B49\u672A\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
+        {".Storing.ksfname.", "[\u5132\u5B58 {0}]"},
+        {"alias.has.no.public.key.certificate.",
+                "{0} \u6C92\u6709\u516C\u958B\u91D1\u9470 (\u6191\u8B49)"},
+        {"Cannot.derive.signature.algorithm",
+                "\u7121\u6CD5\u53D6\u5F97\u7C3D\u7AE0\u6F14\u7B97\u6CD5"},
+        {"Alias.alias.does.not.exist",
+                "\u5225\u540D <{0}> \u4E0D\u5B58\u5728"},
+        {"Alias.alias.has.no.certificate",
+                "\u5225\u540D <{0}> \u6C92\u6709\u6191\u8B49"},
+        {"Key.pair.not.generated.alias.alias.already.exists",
+                "\u6C92\u6709\u5EFA\u7ACB\u91D1\u9470\u7D44\uFF0C\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
+        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
+                "\u91DD\u5C0D {4} \u7522\u751F\u6709\u6548\u671F {3} \u5929\u7684 {0} \u4F4D\u5143 {1} \u91D1\u9470\u7D44\u4EE5\u53CA\u81EA\u6211\u7C3D\u7F72\u6191\u8B49 ({2})\n\t"},
+        {"Enter.key.password.for.alias.", "\u8F38\u5165 <{0}> \u7684\u91D1\u9470\u5BC6\u78BC"},
+        {".RETURN.if.same.as.keystore.password.",
+                "\t(RETURN \u5982\u679C\u548C\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u76F8\u540C):  "},
+        {"Key.password.is.too.short.must.be.at.least.6.characters",
+                "\u91D1\u9470\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Too.many.failures.key.not.added.to.keystore",
+                "\u592A\u591A\u932F\u8AA4 - \u91D1\u9470\u672A\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB"},
+        {"Destination.alias.dest.already.exists",
+                "\u76EE\u7684\u5730\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
+        {"Password.is.too.short.must.be.at.least.6.characters",
+                "\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
+        {"Too.many.failures.Key.entry.not.cloned",
+                "\u592A\u591A\u932F\u8AA4\u3002\u672A\u8907\u88FD\u91D1\u9470\u9805\u76EE"},
+        {"key.password.for.alias.", "<{0}> \u7684\u91D1\u9470\u5BC6\u78BC"},
+        {"Keystore.entry.for.id.getName.already.exists",
+                "<{0}> \u7684\u91D1\u9470\u5132\u5B58\u5EAB\u9805\u76EE\u5DF2\u7D93\u5B58\u5728"},
+        {"Creating.keystore.entry.for.id.getName.",
+                "\u5EFA\u7ACB <{0}> \u7684\u91D1\u9470\u5132\u5B58\u5EAB\u9805\u76EE..."},
+        {"No.entries.from.identity.database.added",
+                "\u6C92\u6709\u65B0\u589E\u4F86\u81EA\u8B58\u5225\u8CC7\u6599\u5EAB\u7684\u9805\u76EE"},
+        {"Alias.name.alias", "\u5225\u540D\u540D\u7A31: {0}"},
+        {"Creation.date.keyStore.getCreationDate.alias.",
+                "\u5EFA\u7ACB\u65E5\u671F: {0,date}"},
+        {"alias.keyStore.getCreationDate.alias.",
+                "{0}, {1,date}, "},
+        {"alias.", "{0}, "},
+        {"Entry.type.type.", "\u9805\u76EE\u985E\u578B: {0}"},
+        {"Certificate.chain.length.", "\u6191\u8B49\u93C8\u9577\u5EA6: "},
+        {"Certificate.i.1.", "\u6191\u8B49 [{0,number,integer}]:"},
+        {"Certificate.fingerprint.SHA1.", "\u6191\u8B49\u6307\u7D0B (SHA1): "},
+        {"Keystore.type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B: "},
+        {"Keystore.provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005: "},
+        {"Your.keystore.contains.keyStore.size.entry",
+                "\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5305\u542B {0,number,integer} \u9805\u76EE"},
+        {"Your.keystore.contains.keyStore.size.entries",
+                "\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5305\u542B {0,number,integer} \u9805\u76EE"},
+        {"Failed.to.parse.input", "\u7121\u6CD5\u5256\u6790\u8F38\u5165"},
+        {"Empty.input", "\u7A7A\u8F38\u5165"},
+        {"Not.X.509.certificate", "\u975E X.509 \u6191\u8B49"},
+        {"alias.has.no.public.key", "{0} \u7121\u516C\u958B\u91D1\u9470"},
+        {"alias.has.no.X.509.certificate", "{0} \u7121 X.509 \u6191\u8B49"},
+        {"New.certificate.self.signed.", "\u65B0\u6191\u8B49 (\u81EA\u6211\u7C3D\u7F72): "},
+        {"Reply.has.no.certificates", "\u56DE\u8986\u4E0D\u542B\u6191\u8B49"},
+        {"Certificate.not.imported.alias.alias.already.exists",
+                "\u6191\u8B49\u672A\u8F38\u5165\uFF0C\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
+        {"Input.not.an.X.509.certificate", "\u8F38\u5165\u7684\u4E0D\u662F X.509 \u6191\u8B49"},
+        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
+                "\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684 <{0}> \u5225\u540D\u4E4B\u4E0B\uFF0C\u6191\u8B49\u5DF2\u7D93\u5B58\u5728"},
+        {"Do.you.still.want.to.add.it.no.",
+                "\u60A8\u4ECD\u7136\u60F3\u8981\u5C07\u4E4B\u65B0\u589E\u55CE\uFF1F [\u5426]:  "},
+        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
+                "\u6574\u500B\u7CFB\u7D71 CA \u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684 <{0}> \u5225\u540D\u4E4B\u4E0B\uFF0C\u6191\u8B49\u5DF2\u7D93\u5B58\u5728"},
+        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
+                "\u60A8\u4ECD\u7136\u60F3\u8981\u5C07\u4E4B\u65B0\u589E\u81F3\u81EA\u5DF1\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u55CE\uFF1F [\u5426]:  "},
+        {"Trust.this.certificate.no.", "\u4FE1\u4EFB\u9019\u500B\u6191\u8B49\uFF1F [\u5426]:  "},
+        {"YES", "\u662F"},
+        {"New.prompt.", "\u65B0 {0}: "},
+        {"Passwords.must.differ", "\u5FC5\u9808\u662F\u4E0D\u540C\u7684\u5BC6\u78BC"},
+        {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F38\u5165\u65B0 {0}: "},
+        {"Re.enter.new.password.", "\u91CD\u65B0\u8F38\u5165\u65B0\u5BC6\u78BC: "},
+        {"They.don.t.match.Try.again", "\u5B83\u5011\u4E0D\u76F8\u7B26\u3002\u8ACB\u91CD\u8A66"},
+        {"Enter.prompt.alias.name.", "\u8F38\u5165 {0} \u5225\u540D\u540D\u7A31:  "},
+        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
+                 "\u8ACB\u8F38\u5165\u65B0\u7684\u5225\u540D\u540D\u7A31\t(RETURN \u4EE5\u53D6\u6D88\u532F\u5165\u6B64\u9805\u76EE):"},
+        {"Enter.alias.name.", "\u8F38\u5165\u5225\u540D\u540D\u7A31:  "},
+        {".RETURN.if.same.as.for.otherAlias.",
+                "\t(RETURN \u5982\u679C\u548C <{0}> \u7684\u76F8\u540C)"},
+        {".PATTERN.printX509Cert",
+                "\u64C1\u6709\u8005: {0}\n\u767C\u51FA\u8005: {1}\n\u5E8F\u865F: {2}\n\u6709\u6548\u671F\u81EA: {3} \u5230: {4}\n\u6191\u8B49\u6307\u7D0B:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7C3D\u7AE0\u6F14\u7B97\u6CD5\u540D\u7A31: {8}\n\t \u7248\u672C: {9}"},
+        {"What.is.your.first.and.last.name.",
+                "\u60A8\u7684\u540D\u5B57\u8207\u59D3\u6C0F\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.organizational.unit.",
+                "\u60A8\u7684\u7D44\u7E54\u55AE\u4F4D\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.organization.",
+                "\u60A8\u7684\u7D44\u7E54\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.City.or.Locality.",
+                "\u60A8\u6240\u5728\u7684\u57CE\u5E02\u6216\u5730\u5340\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.name.of.your.State.or.Province.",
+                "\u60A8\u6240\u5728\u7684\u5DDE\u53CA\u7701\u4EFD\u540D\u7A31\u70BA\u4F55\uFF1F"},
+        {"What.is.the.two.letter.country.code.for.this.unit.",
+                "\u6B64\u55AE\u4F4D\u7684\u5169\u500B\u5B57\u6BCD\u570B\u5225\u4EE3\u78BC\u70BA\u4F55\uFF1F"},
+        {"Is.name.correct.", "{0} \u6B63\u78BA\u55CE\uFF1F"},
+        {"no", "\u5426"},
+        {"yes", "\u662F"},
+        {"y", "y"},
+        {".defaultValue.", "  [{0}]:  "},
+        {"Alias.alias.has.no.key",
+                "\u5225\u540D <{0}> \u6C92\u6709\u91D1\u9470"},
+        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
+                 "\u5225\u540D <{0}> \u6240\u53C3\u7167\u7684\u9805\u76EE\u4E0D\u662F\u79C1\u5BC6\u91D1\u9470\u985E\u578B\u3002-keyclone \u547D\u4EE4\u50C5\u652F\u63F4\u79C1\u5BC6\u91D1\u9470\u9805\u76EE\u7684\u8907\u88FD"},
+
+        {".WARNING.WARNING.WARNING.",
+            "*****************  \u8B66\u544A \u8B66\u544A \u8B66\u544A  *****************"},
+        {"Signer.d.", "\u7C3D\u7F72\u8005 #%d:"},
+        {"Timestamp.", "\u6642\u6233:"},
+        {"Signature.", "\u7C3D\u7AE0:"},
+        {"CRLs.", "CRL:"},
+        {"Certificate.owner.", "\u6191\u8B49\u64C1\u6709\u8005: "},
+        {"Not.a.signed.jar.file", "\u4E0D\u662F\u7C3D\u7F72\u7684 jar \u6A94\u6848"},
+        {"No.certificate.from.the.SSL.server",
+                "\u6C92\u6709\u4F86\u81EA SSL \u4F3A\u670D\u5668\u7684\u6191\u8B49"},
+
+        {".The.integrity.of.the.information.stored.in.your.keystore.",
+            "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u8CC7\u8A0A  *\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C*\n* \u60A8\u5FC5\u9808\u63D0\u4F9B\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u3002                  *"},
+        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
+            "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC srckeystore \u4E2D\u8CC7\u8A0A*\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C\u60A8\u5FC5\u9808 *\n* \u63D0\u4F9B srckeystore \u5BC6\u78BC\u3002          *"},
+
+        {"Certificate.reply.does.not.contain.public.key.for.alias.",
+                "\u6191\u8B49\u56DE\u8986\u4E26\u672A\u5305\u542B <{0}> \u7684\u516C\u958B\u91D1\u9470"},
+        {"Incomplete.certificate.chain.in.reply",
+                "\u56DE\u8986\u6642\u7684\u6191\u8B49\u93C8\u4E0D\u5B8C\u6574"},
+        {"Certificate.chain.in.reply.does.not.verify.",
+                "\u56DE\u8986\u6642\u7684\u6191\u8B49\u93C8\u672A\u9A57\u8B49: "},
+        {"Top.level.certificate.in.reply.",
+                "\u56DE\u8986\u6642\u7684\u6700\u9AD8\u7D1A\u6191\u8B49:\\n"},
+        {".is.not.trusted.", "... \u662F\u4E0D\u88AB\u4FE1\u4EFB\u7684\u3002"},
+        {"Install.reply.anyway.no.", "\u9084\u662F\u8981\u5B89\u88DD\u56DE\u8986\uFF1F [\u5426]:  "},
+        {"NO", "\u5426"},
+        {"Public.keys.in.reply.and.keystore.don.t.match",
+                "\u56DE\u8986\u6642\u7684\u516C\u958B\u91D1\u9470\u8207\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u7B26"},
+        {"Certificate.reply.and.certificate.in.keystore.are.identical",
+                "\u6191\u8B49\u56DE\u8986\u8207\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u6191\u8B49\u662F\u76F8\u540C\u7684"},
+        {"Failed.to.establish.chain.from.reply",
+                "\u7121\u6CD5\u5F9E\u56DE\u8986\u4E2D\u5C07\u93C8\u5EFA\u7ACB\u8D77\u4F86"},
+        {"n", "n"},
+        {"Wrong.answer.try.again", "\u932F\u8AA4\u7684\u7B54\u6848\uFF0C\u8ACB\u518D\u8A66\u4E00\u6B21"},
+        {"Secret.key.not.generated.alias.alias.already.exists",
+                "\u672A\u7522\u751F\u79D8\u5BC6\u91D1\u9470\uFF0C\u5225\u540D <{0}> \u5DF2\u5B58\u5728"},
+        {"Please.provide.keysize.for.secret.key.generation",
+                "\u8ACB\u63D0\u4F9B -keysize \u4EE5\u7522\u751F\u79D8\u5BC6\u91D1\u9470"},
+
+        {"Extensions.", "\u64F4\u5145\u5957\u4EF6: "},
+        {".Empty.value.", "(\u7A7A\u767D\u503C)"},
+        {"Extension.Request.", "\u64F4\u5145\u5957\u4EF6\u8981\u6C42:"},
+        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
+                "PKCS #10 \u6191\u8B49\u8981\u6C42 (\u7248\u672C 1.0)\n\u4E3B\u9AD4: %s\n\u516C\u7528\u91D1\u9470: %s \u683C\u5F0F %s \u91D1\u9470\n"},
+        {"Unknown.keyUsage.type.", "\u4E0D\u660E\u7684 keyUsage \u985E\u578B: "},
+        {"Unknown.extendedkeyUsage.type.", "\u4E0D\u660E\u7684 extendedkeyUsage \u985E\u578B: "},
+        {"Unknown.AccessDescription.type.", "\u4E0D\u660E\u7684 AccessDescription \u985E\u578B: "},
+        {"Unrecognized.GeneralName.type.", "\u7121\u6CD5\u8FA8\u8B58\u7684 GeneralName \u985E\u578B: "},
+        {"This.extension.cannot.be.marked.as.critical.",
+                 "\u6B64\u64F4\u5145\u5957\u4EF6\u7121\u6CD5\u6A19\u793A\u70BA\u95DC\u9375\u3002"},
+        {"Odd.number.of.hex.digits.found.", "\u627E\u5230\u5341\u516D\u9032\u4F4D\u6578\u5B57\u7684\u5947\u6578: "},
+        {"Unknown.extension.type.", "\u4E0D\u660E\u7684\u64F4\u5145\u5957\u4EF6\u985E\u578B: "},
+        {"command.{0}.is.ambiguous.", "\u547D\u4EE4 {0} \u4E0D\u660E\u78BA:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,8 @@
 
     // for i18n
     static final java.util.ResourceBundle rb =
-        java.util.ResourceBundle.getBundle("sun.security.util.Resources");
+        java.util.ResourceBundle.getBundle(
+            "sun.security.tools.policytool.Resources");
     static final Collator collator = Collator.getInstance();
     static {
         // this is for case insensitive string comparisons
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Warning: A public key for alias {0} does not exist.  Make sure a KeyStore is properly configured."},
+        {"Warning.Class.not.found.class", "Warning: Class not found: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Warning: Invalid argument(s) for constructor: {0}"},
+        {"Illegal.Principal.Type.type", "Illegal Principal Type: {0}"},
+        {"Illegal.option.option", "Illegal option: {0}"},
+        {"Usage.policytool.options.", "Usage: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    policy file location"},
+        {"New", "New"},
+        {"Open", "Open"},
+        {"Save", "Save"},
+        {"Save.As", "Save As"},
+        {"View.Warning.Log", "View Warning Log"},
+        {"Exit", "Exit"},
+        {"Add.Policy.Entry", "Add Policy Entry"},
+        {"Edit.Policy.Entry", "Edit Policy Entry"},
+        {"Remove.Policy.Entry", "Remove Policy Entry"},
+        {"Edit", "Edit"},
+        {"Retain", "Retain"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Warning: File name may include escaped backslash characters. " +
+                        "It is not necessary to escape backslash characters " +
+                        "(the tool escapes characters as necessary when writing " +
+                        "the policy contents to the persistent store).\n\n" +
+                        "Click on Retain to retain the entered name, or click on " +
+                        "Edit to edit the name."},
+
+        {"Add.Public.Key.Alias", "Add Public Key Alias"},
+        {"Remove.Public.Key.Alias", "Remove Public Key Alias"},
+        {"File", "File"},
+        {"KeyStore", "KeyStore"},
+        {"Policy.File.", "Policy File:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Could not open policy file: {0}: {1}"},
+        {"Policy.Tool", "Policy Tool"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Errors have occurred while opening the policy configuration.  View the Warning Log for more information."},
+        {"Error", "Error"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Warning"},
+        {"Permission.",
+                "Permission:                                                       "},
+        {"Principal.Type.", "Principal Type:"},
+        {"Principal.Name.", "Principal Name:"},
+        {"Target.Name.",
+                "Target Name:                                                    "},
+        {"Actions.",
+                "Actions:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "OK to overwrite existing file {0}?"},
+        {"Cancel", "Cancel"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Add Principal"},
+        {"Edit.Principal", "Edit Principal"},
+        {"Remove.Principal", "Remove Principal"},
+        {"Principals.", "Principals:"},
+        {".Add.Permission", "  Add Permission"},
+        {".Edit.Permission", "  Edit Permission"},
+        {"Remove.Permission", "Remove Permission"},
+        {"Done", "Done"},
+        {"KeyStore.URL.", "KeyStore URL:"},
+        {"KeyStore.Type.", "KeyStore Type:"},
+        {"KeyStore.Provider.", "KeyStore Provider:"},
+        {"KeyStore.Password.URL.", "KeyStore Password URL:"},
+        {"Principals", "Principals"},
+        {".Edit.Principal.", "  Edit Principal:"},
+        {".Add.New.Principal.", "  Add New Principal:"},
+        {"Permissions", "Permissions"},
+        {".Edit.Permission.", "  Edit Permission:"},
+        {".Add.New.Permission.", "  Add New Permission:"},
+        {"Signed.By.", "Signed By:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Cannot Specify Principal with a Wildcard Class without a Wildcard Name"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Cannot Specify Principal without a Name"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Permission and Target Name must have a value"},
+        {"Remove.this.Policy.Entry.", "Remove this Policy Entry?"},
+        {"Overwrite.File", "Overwrite File"},
+        {"Policy.successfully.written.to.filename",
+                "Policy successfully written to {0}"},
+        {"null.filename", "null filename"},
+        {"Save.changes.", "Save changes?"},
+        {"Yes", "Yes"},
+        {"No", "No"},
+        {"Policy.Entry", "Policy Entry"},
+        {"Save.Changes", "Save Changes"},
+        {"No.Policy.Entry.selected", "No Policy Entry selected"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Unable to open KeyStore: {0}"},
+        {"No.principal.selected", "No principal selected"},
+        {"No.permission.selected", "No permission selected"},
+        {"name", "name"},
+        {"configuration.type", "configuration type"},
+        {"environment.variable.name", "environment variable name"},
+        {"library.name", "library name"},
+        {"package.name", "package name"},
+        {"policy.type", "policy type"},
+        {"property.name", "property name"},
+        {"provider.name", "provider name"},
+        {"Principal.List", "Principal List"},
+        {"Permission.List", "Permission List"},
+        {"Code.Base", "Code Base"},
+        {"KeyStore.U.R.L.", "KeyStore U R L:"},
+        {"KeyStore.Password.U.R.L.", "KeyStore Password U R L:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_de.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_de extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Warnung: Kein Public Key f\u00FCr Alias {0} vorhanden. Vergewissern Sie sich, dass der KeyStore ordnungsgem\u00E4\u00DF konfiguriert ist."},
+        {"Warning.Class.not.found.class", "Warnung: Klasse nicht gefunden: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Warnung: Ung\u00FCltige(s) Argument(e) f\u00FCr Constructor: {0}"},
+        {"Illegal.Principal.Type.type", "Ung\u00FCltiger Principal-Typ: {0}"},
+        {"Illegal.option.option", "Ung\u00FCltige Option: {0}"},
+        {"Usage.policytool.options.", "Verwendung: policytool [Optionen]"},
+        {".file.file.policy.file.location",
+                " [-file <Datei>]    Policy-Dateiverzeichnis"},
+        {"New", "Neu"},
+        {"Open", "\u00D6ffnen"},
+        {"Save", "Speichern"},
+        {"Save.As", "Speichern unter"},
+        {"View.Warning.Log", "Warnungslog anzeigen"},
+        {"Exit", "Beenden"},
+        {"Add.Policy.Entry", "Policy-Eintrag hinzuf\u00FCgen"},
+        {"Edit.Policy.Entry", "Policy-Eintrag bearbeiten"},
+        {"Remove.Policy.Entry", "Policy-Eintrag entfernen"},
+        {"Edit", "Bearbeiten"},
+        {"Retain", "Beibehalten"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Warnung: M\u00F6glicherweise enth\u00E4lt der Dateiname Escape-Zeichen mit Backslash. Es ist nicht notwendig, Backslash-Zeichen zu escapen (das Tool f\u00FChrt dies automatisch beim Schreiben des Policy-Contents in den persistenten Speicher aus).\n\nKlicken Sie auf \"Beibehalten\", um den eingegebenen Namen beizubehalten oder auf \"Bearbeiten\", um den Namen zu bearbeiten."},
+
+        {"Add.Public.Key.Alias", "Public Key-Alias hinzuf\u00FCgen"},
+        {"Remove.Public.Key.Alias", "Public Key-Alias entfernen"},
+        {"File", "Datei"},
+        {"KeyStore", "KeyStore"},
+        {"Policy.File.", "Policy-Datei:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Policy-Datei konnte nicht ge\u00F6ffnet werden: {0}: {1}"},
+        {"Policy.Tool", "Policy-Tool"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Beim \u00D6ffnen der Policy-Konfiguration sind Fehler aufgetreten. Weitere Informationen finden Sie im Warnungslog."},
+        {"Error", "Fehler"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Warnung"},
+        {"Permission.",
+                "Berechtigung:                                                       "},
+        {"Principal.Type.", "Principal-Typ:"},
+        {"Principal.Name.", "Principal-Name:"},
+        {"Target.Name.",
+                "Zielname:                                                    "},
+        {"Actions.",
+                "Aktionen:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Vorhandene Datei {0} \u00FCberschreiben?"},
+        {"Cancel", "Abbrechen"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Principal hinzuf\u00FCgen"},
+        {"Edit.Principal", "Principal bearbeiten"},
+        {"Remove.Principal", "Principal entfernen"},
+        {"Principals.", "Principals:"},
+        {".Add.Permission", "  Berechtigung hinzuf\u00FCgen"},
+        {".Edit.Permission", "  Berechtigung bearbeiten"},
+        {"Remove.Permission", "Berechtigung entfernen"},
+        {"Done", "Fertig"},
+        {"KeyStore.URL.", "KeyStore-URL:"},
+        {"KeyStore.Type.", "KeyStore-Typ:"},
+        {"KeyStore.Provider.", "KeyStore-Provider:"},
+        {"KeyStore.Password.URL.", "KeyStore-Kennwort-URL:"},
+        {"Principals", "Principals"},
+        {".Edit.Principal.", "  Principal bearbeiten:"},
+        {".Add.New.Principal.", "  Neuen Principal hinzuf\u00FCgen:"},
+        {"Permissions", "Berechtigungen"},
+        {".Edit.Permission.", "  Berechtigung bearbeiten:"},
+        {".Add.New.Permission.", "  Neue Berechtigung hinzuf\u00FCgen:"},
+        {"Signed.By.", "Signiert von:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Principal kann nicht mit einer Platzhalterklasse ohne Platzhalternamen angegeben werden"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Principal kann nicht ohne einen Namen angegeben werden"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Berechtigung und Zielname m\u00FCssen einen Wert haben"},
+        {"Remove.this.Policy.Entry.", "Diesen Policy-Eintrag entfernen?"},
+        {"Overwrite.File", "Datei \u00FCberschreiben"},
+        {"Policy.successfully.written.to.filename",
+                "Policy erfolgreich in {0} geschrieben"},
+        {"null.filename", "Null-Dateiname"},
+        {"Save.changes.", "\u00C4nderungen speichern?"},
+        {"Yes", "Ja"},
+        {"No", "Nein"},
+        {"Policy.Entry", "Policy-Eintrag"},
+        {"Save.Changes", "\u00C4nderungen speichern"},
+        {"No.Policy.Entry.selected", "Kein Policy-Eintrag ausgew\u00E4hlt"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "KeyStore kann nicht ge\u00F6ffnet werden: {0}"},
+        {"No.principal.selected", "Kein Principal ausgew\u00E4hlt"},
+        {"No.permission.selected", "Keine Berechtigung ausgew\u00E4hlt"},
+        {"name", "Name"},
+        {"configuration.type", "Konfigurationstyp"},
+        {"environment.variable.name", "Umgebungsvariablenname"},
+        {"library.name", "Library-Name"},
+        {"package.name", "Packagename"},
+        {"policy.type", "Policy-Typ"},
+        {"property.name", "Eigenschaftsname"},
+        {"provider.name", "Providername"},
+        {"Principal.List", "Principal-Liste"},
+        {"Permission.List", "Berechtigungsliste"},
+        {"Code.Base", "Codebase"},
+        {"KeyStore.U.R.L.", "KeyStore-URL:"},
+        {"KeyStore.Password.U.R.L.", "KeyStore-Kennwort-URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_es.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_es extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Advertencia: no hay clave p\u00FAblica para el alias {0}. Aseg\u00FArese de que se ha configurado correctamente un almac\u00E9n de claves."},
+        {"Warning.Class.not.found.class", "Advertencia: no se ha encontrado la clase: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Advertencia: argumento(s) no v\u00E1lido(s) para el constructor: {0}"},
+        {"Illegal.Principal.Type.type", "Tipo de principal no permitido: {0}"},
+        {"Illegal.option.option", "Opci\u00F3n no permitida: {0}"},
+        {"Usage.policytool.options.", "Sintaxis: policytool [opciones]"},
+        {".file.file.policy.file.location",
+                "  [-file <archivo>]    ubicaci\u00F3n del archivo de normas"},
+        {"New", "Nuevo"},
+        {"Open", "Abrir"},
+        {"Save", "Guardar"},
+        {"Save.As", "Guardar como"},
+        {"View.Warning.Log", "Ver Log de Advertencias"},
+        {"Exit", "Salir"},
+        {"Add.Policy.Entry", "Agregar Entrada de Pol\u00EDtica"},
+        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
+        {"Remove.Policy.Entry", "Eliminar Entrada de Pol\u00EDtica"},
+        {"Edit", "Editar"},
+        {"Retain", "Mantener"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Advertencia: el nombre del archivo puede contener caracteres de barra invertida de escape. No es necesario utilizar barras invertidas de escape (la herramienta aplica caracteres de escape seg\u00FAn sea necesario al escribir el contenido de las pol\u00EDticas en el almac\u00E9n persistente).\n\nHaga clic en Mantener para conservar el nombre introducido o en Editar para modificarlo."},
+
+        {"Add.Public.Key.Alias", "Agregar Alias de Clave P\u00FAblico"},
+        {"Remove.Public.Key.Alias", "Eliminar Alias de Clave P\u00FAblico"},
+        {"File", "Archivo"},
+        {"KeyStore", "Almac\u00E9n de Claves"},
+        {"Policy.File.", "Archivo de Pol\u00EDtica:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "No se ha podido abrir el archivo de pol\u00EDtica: {0}: {1}"},
+        {"Policy.Tool", "Herramienta de Pol\u00EDticas"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Ha habido errores al abrir la configuraci\u00F3n de pol\u00EDticas. V\u00E9ase el log de advertencias para obtener m\u00E1s informaci\u00F3n."},
+        {"Error", "Error"},
+        {"OK", "Aceptar"},
+        {"Status", "Estado"},
+        {"Warning", "Advertencia"},
+        {"Permission.",
+                "Permiso:                                                       "},
+        {"Principal.Type.", "Tipo de Principal:"},
+        {"Principal.Name.", "Nombre de Principal:"},
+        {"Target.Name.",
+                "Nombre de Destino:                                                    "},
+        {"Actions.",
+                "Acciones:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u00BFSobrescribir el archivo existente {0}?"},
+        {"Cancel", "Cancelar"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Agregar Principal"},
+        {"Edit.Principal", "Editar Principal"},
+        {"Remove.Principal", "Eliminar Principal"},
+        {"Principals.", "Principales:"},
+        {".Add.Permission", "  Agregar Permiso"},
+        {".Edit.Permission", "  Editar Permiso"},
+        {"Remove.Permission", "Eliminar Permiso"},
+        {"Done", "Listo"},
+        {"KeyStore.URL.", "URL de Almac\u00E9n de Claves:"},
+        {"KeyStore.Type.", "Tipo de Almac\u00E9n de Claves:"},
+        {"KeyStore.Provider.", "Proveedor de Almac\u00E9n de Claves:"},
+        {"KeyStore.Password.URL.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"},
+        {"Principals", "Principales"},
+        {".Edit.Principal.", "  Editar Principal:"},
+        {".Add.New.Principal.", "  Agregar Nuevo Principal:"},
+        {"Permissions", "Permisos"},
+        {".Edit.Permission.", "  Editar Permiso:"},
+        {".Add.New.Permission.", "  Agregar Permiso Nuevo:"},
+        {"Signed.By.", "Firmado Por:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "No se puede especificar un principal con una clase de comod\u00EDn sin un nombre de comod\u00EDn"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "No se puede especificar el principal sin un nombre"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Permiso y Nombre de Destino deben tener un valor"},
+        {"Remove.this.Policy.Entry.", "\u00BFEliminar esta entrada de pol\u00EDtica?"},
+        {"Overwrite.File", "Sobrescribir Archivo"},
+        {"Policy.successfully.written.to.filename",
+                "Pol\u00EDtica escrita correctamente en {0}"},
+        {"null.filename", "nombre de archivo nulo"},
+        {"Save.changes.", "\u00BFGuardar los cambios?"},
+        {"Yes", "S\u00ED"},
+        {"No", "No"},
+        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
+        {"Save.Changes", "Guardar Cambios"},
+        {"No.Policy.Entry.selected", "No se ha seleccionado la entrada de pol\u00EDtica"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "No se ha podido abrir el almac\u00E9n de claves: {0}"},
+        {"No.principal.selected", "No se ha seleccionado un principal"},
+        {"No.permission.selected", "No se ha seleccionado un permiso"},
+        {"name", "nombre"},
+        {"configuration.type", "tipo de configuraci\u00F3n"},
+        {"environment.variable.name", "nombre de variable de entorno"},
+        {"library.name", "nombre de la biblioteca"},
+        {"package.name", "nombre del paquete"},
+        {"policy.type", "tipo de pol\u00EDtica"},
+        {"property.name", "nombre de la propiedad"},
+        {"provider.name", "nombre del proveedor"},
+        {"Principal.List", "Lista de Principales"},
+        {"Permission.List", "Lista de Permisos"},
+        {"Code.Base", "Base de C\u00F3digo"},
+        {"KeyStore.U.R.L.", "URL de Almac\u00E9n de Claves:"},
+        {"KeyStore.Password.U.R.L.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_fr.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_fr extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Avertissement\u00A0: il n''existe pas de cl\u00E9 publique pour l''alias {0}. V\u00E9rifiez que le fichier de cl\u00E9s d''acc\u00E8s est correctement configur\u00E9."},
+        {"Warning.Class.not.found.class", "Avertissement : classe introuvable - {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Avertissement\u00A0: arguments non valides pour le constructeur\u00A0- {0}"},
+        {"Illegal.Principal.Type.type", "Type de principal non admis : {0}"},
+        {"Illegal.option.option", "Option non admise : {0}"},
+        {"Usage.policytool.options.", "Syntaxe : policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    emplacement du fichier de r\u00E8gles"},
+        {"New", "Nouveau"},
+        {"Open", "Ouvrir"},
+        {"Save", "Enregistrer"},
+        {"Save.As", "Enregistrer sous"},
+        {"View.Warning.Log", "Afficher le journal des avertissements"},
+        {"Exit", "Quitter"},
+        {"Add.Policy.Entry", "Ajouter une r\u00E8gle"},
+        {"Edit.Policy.Entry", "Modifier une r\u00E8gle"},
+        {"Remove.Policy.Entry", "Enlever une r\u00E8gle"},
+        {"Edit", "Modifier"},
+        {"Retain", "Conserver"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Avertissement : il se peut que le nom de fichier contienne des barres obliques inverses avec caract\u00E8re d'\u00E9chappement. Il n'est pas n\u00E9cessaire d'ajouter un caract\u00E8re d'\u00E9chappement aux barres obliques inverses. L'outil proc\u00E8de \u00E0 l'\u00E9chappement si n\u00E9cessaire lorsqu'il \u00E9crit le contenu des r\u00E8gles dans la zone de stockage persistant).\n\nCliquez sur Conserver pour garder le nom saisi ou sur Modifier pour le remplacer."},
+
+        {"Add.Public.Key.Alias", "Ajouter un alias de cl\u00E9 publique"},
+        {"Remove.Public.Key.Alias", "Enlever un alias de cl\u00E9 publique"},
+        {"File", "Fichier"},
+        {"KeyStore", "Fichier de cl\u00E9s"},
+        {"Policy.File.", "Fichier de r\u00E8gles :"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Impossible d''ouvrir le fichier de r\u00E8gles\u00A0: {0}: {1}"},
+        {"Policy.Tool", "Policy Tool"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Des erreurs se sont produites \u00E0 l'ouverture de la configuration de r\u00E8gles. Pour plus d'informations, consultez le journal des avertissements."},
+        {"Error", "Erreur"},
+        {"OK", "OK"},
+        {"Status", "Statut"},
+        {"Warning", "Avertissement"},
+        {"Permission.",
+                "Droit :                                                       "},
+        {"Principal.Type.", "Type de principal :"},
+        {"Principal.Name.", "Nom de principal :"},
+        {"Target.Name.",
+                "Nom de cible :                                                    "},
+        {"Actions.",
+                "Actions :                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Remplacer le fichier existant {0} ?"},
+        {"Cancel", "Annuler"},
+        {"CodeBase.", "Base de code :"},
+        {"SignedBy.", "Sign\u00E9 par :"},
+        {"Add.Principal", "Ajouter un principal"},
+        {"Edit.Principal", "Modifier un principal"},
+        {"Remove.Principal", "Enlever un principal"},
+        {"Principals.", "Principaux :"},
+        {".Add.Permission", "  Ajouter un droit"},
+        {".Edit.Permission", "  Modifier un droit"},
+        {"Remove.Permission", "Enlever un droit"},
+        {"Done", "Termin\u00E9"},
+        {"KeyStore.URL.", "URL du fichier de cl\u00E9s :"},
+        {"KeyStore.Type.", "Type du fichier de cl\u00E9s :"},
+        {"KeyStore.Provider.", "Fournisseur du fichier de cl\u00E9s :"},
+        {"KeyStore.Password.URL.", "URL du mot de passe du fichier de cl\u00E9s :"},
+        {"Principals", "Principaux"},
+        {".Edit.Principal.", "  Modifier un principal :"},
+        {".Add.New.Principal.", "  Ajouter un principal :"},
+        {"Permissions", "Droits"},
+        {".Edit.Permission.", "  Modifier un droit :"},
+        {".Add.New.Permission.", "  Ajouter un droit :"},
+        {"Signed.By.", "Sign\u00E9 par :"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Impossible de sp\u00E9cifier un principal avec une classe g\u00E9n\u00E9rique sans nom g\u00E9n\u00E9rique"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Impossible de sp\u00E9cifier un principal sans nom"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Le droit et le nom de cible doivent avoir une valeur"},
+        {"Remove.this.Policy.Entry.", "Enlever cette r\u00E8gle ?"},
+        {"Overwrite.File", "Remplacer le fichier"},
+        {"Policy.successfully.written.to.filename",
+                "R\u00E8gle \u00E9crite dans {0}"},
+        {"null.filename", "nom de fichier NULL"},
+        {"Save.changes.", "Enregistrer les modifications ?"},
+        {"Yes", "Oui"},
+        {"No", "Non"},
+        {"Policy.Entry", "R\u00E8gle"},
+        {"Save.Changes", "Enregistrer les modifications"},
+        {"No.Policy.Entry.selected", "Aucune r\u00E8gle s\u00E9lectionn\u00E9e"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Impossible d''ouvrir le fichier de cl\u00E9s d''acc\u00E8s : {0}"},
+        {"No.principal.selected", "Aucun principal s\u00E9lectionn\u00E9"},
+        {"No.permission.selected", "Aucun droit s\u00E9lectionn\u00E9"},
+        {"name", "nom"},
+        {"configuration.type", "type de configuration"},
+        {"environment.variable.name", "Nom de variable d'environnement"},
+        {"library.name", "nom de biblioth\u00E8que"},
+        {"package.name", "nom de package"},
+        {"policy.type", "type de r\u00E8gle"},
+        {"property.name", "nom de propri\u00E9t\u00E9"},
+        {"provider.name", "nom du fournisseur"},
+        {"Principal.List", "Liste de principaux"},
+        {"Permission.List", "Liste de droits"},
+        {"Code.Base", "Base de code"},
+        {"KeyStore.U.R.L.", "URL du fichier de cl\u00E9s :"},
+        {"KeyStore.Password.U.R.L.", "URL du mot de passe du fichier de cl\u00E9s :"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_it.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_it extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Avvertenza: non esiste una chiave pubblica per l''alias {0}. Verificare che il keystore sia configurato correttamente."},
+        {"Warning.Class.not.found.class", "Avvertenza: classe non trovata: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Avvertenza: argomento o argomenti non validi per il costruttore {0}"},
+        {"Illegal.Principal.Type.type", "Tipo principal non valido: {0}"},
+        {"Illegal.option.option", "Opzione non valida: {0}"},
+        {"Usage.policytool.options.", "Utilizzo: policytool [opzioni]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    posizione del file dei criteri"},
+        {"New", "Nuovo"},
+        {"Open", "Apri"},
+        {"Save", "Salva"},
+        {"Save.As", "Salva con nome"},
+        {"View.Warning.Log", "Visualizza registro avvertenze"},
+        {"Exit", "Esci"},
+        {"Add.Policy.Entry", "Aggiungi voce dei criteri"},
+        {"Edit.Policy.Entry", "Modifica voce dei criteri"},
+        {"Remove.Policy.Entry", "Rimuovi voce dei criteri"},
+        {"Edit", "Modifica"},
+        {"Retain", "Mantieni"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Avvertenza: il nome file pu\u00F2 includere barre rovesciate con escape. Non \u00E8 necessario eseguire l'escape delle barre rovesciate (se necessario lo strumento esegue l'escape dei caratteri al momento della scrittura del contenuto dei criteri nell'area di memorizzazione persistente).\n\nFare click su Mantieni per conservare il nome immesso, oppure su Modifica per modificare il nome."},
+
+        {"Add.Public.Key.Alias", "Aggiungi alias chiave pubblica"},
+        {"Remove.Public.Key.Alias", "Rimuovi alias chiave pubblica"},
+        {"File", "File"},
+        {"KeyStore", "Keystore"},
+        {"Policy.File.", "File dei criteri:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Impossibile aprire il file di criteri {0}: {1}"},
+        {"Policy.Tool", "Strumento criteri"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Si sono verificati errori durante l'apertura della configurazione dei criteri. Consultare il registro delle avvertenze per ulteriori informazioni."},
+        {"Error", "Errore"},
+        {"OK", "OK"},
+        {"Status", "Stato"},
+        {"Warning", "Avvertenza"},
+        {"Permission.",
+                "Autorizzazione:                                                       "},
+        {"Principal.Type.", "Tipo principal:"},
+        {"Principal.Name.", "Nome principal:"},
+        {"Target.Name.",
+                "Nome destinazione:                                                    "},
+        {"Actions.",
+                "Azioni:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "OK per sovrascrivere il file {0}?"},
+        {"Cancel", "Annulla"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Aggiungi principal"},
+        {"Edit.Principal", "Modifica principal"},
+        {"Remove.Principal", "Rimuovi principal"},
+        {"Principals.", "Principal:"},
+        {".Add.Permission", "  Aggiungi autorizzazione"},
+        {".Edit.Permission", "  Modifica autorizzazione"},
+        {"Remove.Permission", "Rimuovi autorizzazione"},
+        {"Done", "Fine"},
+        {"KeyStore.URL.", "URL keystore:"},
+        {"KeyStore.Type.", "Tipo keystore:"},
+        {"KeyStore.Provider.", "Provider keystore:"},
+        {"KeyStore.Password.URL.", "URL password keystore:"},
+        {"Principals", "Principal:"},
+        {".Edit.Principal.", "  Modifica principal:"},
+        {".Add.New.Principal.", "  Aggiungi nuovo principal:"},
+        {"Permissions", "Autorizzazioni"},
+        {".Edit.Permission.", "  Modifica autorizzazione:"},
+        {".Add.New.Permission.", "  Aggiungi nuova autorizzazione:"},
+        {"Signed.By.", "Firmato da:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Impossibile specificare principal con una classe carattere jolly senza un nome carattere jolly"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Impossibile specificare principal senza un nome"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "L'autorizzazione e il nome destinazione non possono essere nulli"},
+        {"Remove.this.Policy.Entry.", "Rimuovere questa voce dei criteri?"},
+        {"Overwrite.File", "Sovrascrivi file"},
+        {"Policy.successfully.written.to.filename",
+                "I criteri sono stati scritti in {0}"},
+        {"null.filename", "nome file nullo"},
+        {"Save.changes.", "Salvare le modifiche?"},
+        {"Yes", "S\u00EC"},
+        {"No", "No"},
+        {"Policy.Entry", "Voce dei criteri"},
+        {"Save.Changes", "Salva le modifiche"},
+        {"No.Policy.Entry.selected", "Nessuna voce dei criteri selezionata"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Impossibile aprire il keystore: {0}"},
+        {"No.principal.selected", "Nessun principal selezionato"},
+        {"No.permission.selected", "Nessuna autorizzazione selezionata"},
+        {"name", "nome"},
+        {"configuration.type", "tipo di configurazione"},
+        {"environment.variable.name", "nome variabile ambiente"},
+        {"library.name", "nome libreria"},
+        {"package.name", "nome package"},
+        {"policy.type", "tipo di criteri"},
+        {"property.name", "nome propriet\u00E0"},
+        {"provider.name", "nome provider"},
+        {"Principal.List", "Lista principal"},
+        {"Permission.List", "Lista autorizzazioni"},
+        {"Code.Base", "Codebase"},
+        {"KeyStore.U.R.L.", "URL keystore:"},
+        {"KeyStore.Password.U.R.L.", "URL password keystore:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_ja.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_ja extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u5225\u540D{0}\u306E\u516C\u958B\u9375\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u6B63\u3057\u304F\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0}"},
+        {"Illegal.Principal.Type.type", "\u4E0D\u6B63\u306A\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7: {0}"},
+        {"Illegal.option.option", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},
+        {"Usage.policytool.options.", "\u4F7F\u7528\u65B9\u6CD5: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]  \u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240"},
+        {"New", "\u65B0\u898F"},
+        {"Open", "\u958B\u304F"},
+        {"Save", "\u4FDD\u5B58"},
+        {"Save.As", "\u5225\u540D\u4FDD\u5B58"},
+        {"View.Warning.Log", "\u8B66\u544A\u30ED\u30B0\u306E\u8868\u793A"},
+        {"Exit", "\u7D42\u4E86"},
+        {"Add.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u8FFD\u52A0"},
+        {"Edit.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u7DE8\u96C6"},
+        {"Remove.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u524A\u9664"},
+        {"Edit", "\u7DE8\u96C6"},
+        {"Retain", "\u4FDD\u6301"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u30D5\u30A1\u30A4\u30EB\u540D\u306B\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093(\u30C4\u30FC\u30EB\u306F\u30DD\u30EA\u30B7\u30FC\u5185\u5BB9\u3092\u6C38\u7D9A\u30B9\u30C8\u30A2\u306B\u66F8\u304D\u8FBC\u3080\u3068\u304D\u306B\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3057\u307E\u3059)\u3002\n\n\u5165\u529B\u6E08\u306E\u540D\u524D\u3092\u4FDD\u6301\u3059\u308B\u306B\u306F\u300C\u4FDD\u6301\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3001\u540D\u524D\u3092\u7DE8\u96C6\u3059\u308B\u306B\u306F\u300C\u7DE8\u96C6\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+
+        {"Add.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u306E\u8FFD\u52A0"},
+        {"Remove.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u3092\u524A\u9664"},
+        {"File", "\u30D5\u30A1\u30A4\u30EB"},
+        {"KeyStore", "\u30AD\u30FC\u30B9\u30C8\u30A2"},
+        {"Policy.File.", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F: {0}: {1}"},
+        {"Policy.Tool", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30C4\u30FC\u30EB"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u30DD\u30EA\u30B7\u30FC\u69CB\u6210\u3092\u958B\u304F\u3068\u304D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u8A73\u7D30\u306F\u8B66\u544A\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
+        {"Error", "\u30A8\u30E9\u30FC"},
+        {"OK", "OK"},
+        {"Status", "\u72B6\u614B"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u30A2\u30AF\u30BB\u30B9\u6A29:                                                       "},
+        {"Principal.Type.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7:"},
+        {"Principal.Name.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u540D\u524D:"},
+        {"Target.Name.",
+                "\u30BF\u30FC\u30B2\u30C3\u30C8\u540D:                                                    "},
+        {"Actions.",
+                "\u30A2\u30AF\u30B7\u30E7\u30F3:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\u3002"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u8FFD\u52A0"},
+        {"Edit.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6"},
+        {"Remove.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u524A\u9664"},
+        {"Principals.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB:"},
+        {".Add.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0"},
+        {".Edit.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6"},
+        {"Remove.Permission", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u524A\u9664"},
+        {"Done", "\u5B8C\u4E86"},
+        {"KeyStore.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2URL:"},
+        {"KeyStore.Type.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7:"},
+        {"KeyStore.Provider.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0:"},
+        {"KeyStore.Password.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9URL:"},
+        {"Principals", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB"},
+        {".Edit.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6:"},
+        {".Add.New.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u65B0\u898F\u8FFD\u52A0:"},
+        {"Permissions", "\u30A2\u30AF\u30BB\u30B9\u6A29"},
+        {".Edit.Permission.", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6:"},
+        {".Add.New.Permission.", "  \u65B0\u898F\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0:"},
+        {"Signed.By.", "\u7F72\u540D\u8005:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u540D\u306E\u306A\u3044\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u30FB\u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u540D\u524D\u3092\u4F7F\u7528\u305B\u305A\u306B\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u30A2\u30AF\u30BB\u30B9\u6A29\u3068\u30BF\u30FC\u30B2\u30C3\u30C8\u540D\u306F\u3001\u5024\u3092\u4FDD\u6301\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
+        {"Remove.this.Policy.Entry.", "\u3053\u306E\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\u3002"},
+        {"Overwrite.File", "\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059"},
+        {"Policy.successfully.written.to.filename",
+                "\u30DD\u30EA\u30B7\u30FC\u306E{0}\u3078\u306E\u66F8\u8FBC\u307F\u306B\u6210\u529F\u3057\u307E\u3057\u305F"},
+        {"null.filename", "\u30D5\u30A1\u30A4\u30EB\u540D\u304Cnull\u3067\u3059"},
+        {"Save.changes.", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059\u304B\u3002"},
+        {"Yes", "\u306F\u3044"},
+        {"No", "\u3044\u3044\u3048"},
+        {"Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA"},
+        {"Save.Changes", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059"},
+        {"No.Policy.Entry.selected", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u30AD\u30FC\u30B9\u30C8\u30A2{0}\u3092\u958B\u3051\u307E\u305B\u3093"},
+        {"No.principal.selected", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"No.permission.selected", "\u30A2\u30AF\u30BB\u30B9\u6A29\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
+        {"name", "\u540D\u524D"},
+        {"configuration.type", "\u69CB\u6210\u30BF\u30A4\u30D7"},
+        {"environment.variable.name", "\u74B0\u5883\u5909\u6570\u540D"},
+        {"library.name", "\u30E9\u30A4\u30D6\u30E9\u30EA\u540D"},
+        {"package.name", "\u30D1\u30C3\u30B1\u30FC\u30B8\u540D"},
+        {"policy.type", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30BF\u30A4\u30D7"},
+        {"property.name", "\u30D7\u30ED\u30D1\u30C6\u30A3\u540D"},
+        {"provider.name", "\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"},
+        {"Principal.List", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30EA\u30B9\u30C8"},
+        {"Permission.List", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u30EA\u30B9\u30C8"},
+        {"Code.Base", "\u30B3\u30FC\u30C9\u30FB\u30D9\u30FC\u30B9"},
+        {"KeyStore.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2U R L:"},
+        {"KeyStore.Password.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9U R L:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_ko.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_ko extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\uACBD\uACE0: {0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uACF5\uC6A9 \uD0A4\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD0A4 \uC800\uC7A5\uC18C\uAC00 \uC81C\uB300\uB85C \uAD6C\uC131\uB418\uC5B4 \uC788\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
+        {"Warning.Class.not.found.class", "\uACBD\uACE0: \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\uACBD\uACE0: \uC0DD\uC131\uC790\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uC778\uC218: {0}"},
+        {"Illegal.Principal.Type.type", "\uC798\uBABB\uB41C \uC8FC\uCCB4 \uC720\uD615: {0}"},
+        {"Illegal.option.option", "\uC798\uBABB\uB41C \uC635\uC158: {0}"},
+        {"Usage.policytool.options.", "\uC0AC\uC6A9\uBC95: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \uC815\uCC45 \uD30C\uC77C \uC704\uCE58"},
+        {"New", "\uC0C8\uB85C \uB9CC\uB4E4\uAE30"},
+        {"Open", "\uC5F4\uAE30"},
+        {"Save", "\uC800\uC7A5"},
+        {"Save.As", "\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"},
+        {"View.Warning.Log", "\uACBD\uACE0 \uB85C\uADF8 \uBCF4\uAE30"},
+        {"Exit", "\uC885\uB8CC"},
+        {"Add.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uCD94\uAC00"},
+        {"Edit.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uD3B8\uC9D1"},
+        {"Remove.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uC81C\uAC70"},
+        {"Edit", "\uD3B8\uC9D1"},
+        {"Retain", "\uC720\uC9C0"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\uACBD\uACE0: \uD30C\uC77C \uC774\uB984\uC5D0 \uC774\uC2A4\uCF00\uC774\uD504\uB41C \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uB294 \uC774\uC2A4\uCF00\uC774\uD504\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC601\uAD6C \uC800\uC7A5\uC18C\uC5D0 \uC815\uCC45 \uCF58\uD150\uCE20\uB97C \uC4F8 \uB54C \uD544\uC694\uC5D0 \uB530\uB77C \uC790\uB3D9\uC73C\uB85C \uBB38\uC790\uAC00 \uC774\uC2A4\uCF00\uC774\uD504\uB429\uB2C8\uB2E4.\n\n\uC785\uB825\uB41C \uC774\uB984\uC744 \uADF8\uB300\uB85C \uC720\uC9C0\uD558\uB824\uBA74 [\uC720\uC9C0]\uB97C \uB204\uB974\uACE0, \uC774\uB984\uC744 \uD3B8\uC9D1\uD558\uB824\uBA74 [\uD3B8\uC9D1]\uC744 \uB204\uB974\uC2ED\uC2DC\uC624."},
+
+        {"Add.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uCD94\uAC00"},
+        {"Remove.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uC81C\uAC70"},
+        {"File", "\uD30C\uC77C"},
+        {"KeyStore", "\uD0A4 \uC800\uC7A5\uC18C"},
+        {"Policy.File.", "\uC815\uCC45 \uD30C\uC77C:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\uC815\uCC45 \uD30C\uC77C\uC744 \uC5F4 \uC218 \uC5C6\uC74C: {0}: {1}"},
+        {"Policy.Tool", "\uC815\uCC45 \uD234"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\uC815\uCC45 \uAD6C\uC131\uC744 \uC5EC\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 \uACBD\uACE0 \uB85C\uADF8\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
+        {"Error", "\uC624\uB958"},
+        {"OK", "\uD655\uC778"},
+        {"Status", "\uC0C1\uD0DC"},
+        {"Warning", "\uACBD\uACE0"},
+        {"Permission.",
+                "\uAD8C\uD55C:                                                       "},
+        {"Principal.Type.", "\uC8FC\uCCB4 \uC720\uD615:"},
+        {"Principal.Name.", "\uC8FC\uCCB4 \uC774\uB984:"},
+        {"Target.Name.",
+                "\uB300\uC0C1 \uC774\uB984:                                                    "},
+        {"Actions.",
+                "\uC791\uC5C5:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\uAE30\uC874 \uD30C\uC77C {0}\uC744(\uB97C) \uACB9\uCCD0 \uC4F0\uACA0\uC2B5\uB2C8\uAE4C?"},
+        {"Cancel", "\uCDE8\uC18C"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\uC8FC\uCCB4 \uCD94\uAC00"},
+        {"Edit.Principal", "\uC8FC\uCCB4 \uD3B8\uC9D1"},
+        {"Remove.Principal", "\uC8FC\uCCB4 \uC81C\uAC70"},
+        {"Principals.", "\uC8FC\uCCB4:"},
+        {".Add.Permission", "  \uAD8C\uD55C \uCD94\uAC00"},
+        {".Edit.Permission", "  \uAD8C\uD55C \uD3B8\uC9D1"},
+        {"Remove.Permission", "\uAD8C\uD55C \uC81C\uAC70"},
+        {"Done", "\uC644\uB8CC"},
+        {"KeyStore.URL.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
+        {"KeyStore.Type.", "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615:"},
+        {"KeyStore.Provider.", "\uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790:"},
+        {"KeyStore.Password.URL.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"},
+        {"Principals", "\uC8FC\uCCB4"},
+        {".Edit.Principal.", "  \uC8FC\uCCB4 \uD3B8\uC9D1:"},
+        {".Add.New.Principal.", "  \uC0C8 \uC8FC\uCCB4 \uCD94\uAC00:"},
+        {"Permissions", "\uAD8C\uD55C"},
+        {".Edit.Permission.", "  \uAD8C\uD55C \uD3B8\uC9D1:"},
+        {".Add.New.Permission.", "  \uC0C8 \uAD8C\uD55C \uCD94\uAC00:"},
+        {"Signed.By.", "\uC11C\uBA85\uC790:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uC774\uB984 \uC5C6\uC774 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uD074\uB798\uC2A4\uB97C \uC0AC\uC6A9\uD558\uB294 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\uC774\uB984 \uC5C6\uC774 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\uAD8C\uD55C\uACFC \uB300\uC0C1 \uC774\uB984\uC758 \uAC12\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
+        {"Remove.this.Policy.Entry.", "\uC774 \uC815\uCC45 \uD56D\uBAA9\uC744 \uC81C\uAC70\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
+        {"Overwrite.File", "\uD30C\uC77C \uACB9\uCCD0\uC4F0\uAE30"},
+        {"Policy.successfully.written.to.filename",
+                "{0}\uC5D0 \uC131\uACF5\uC801\uC73C\uB85C \uC815\uCC45\uC744 \uC37C\uC2B5\uB2C8\uB2E4."},
+        {"null.filename", "\uB110 \uD30C\uC77C \uC774\uB984"},
+        {"Save.changes.", "\uBCC0\uACBD \uC0AC\uD56D\uC744 \uC800\uC7A5\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
+        {"Yes", "\uC608"},
+        {"No", "\uC544\uB2C8\uC624"},
+        {"Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9"},
+        {"Save.Changes", "\uBCC0\uACBD \uC0AC\uD56D \uC800\uC7A5"},
+        {"No.Policy.Entry.selected", "\uC120\uD0DD\uB41C \uC815\uCC45 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\uD0A4 \uC800\uC7A5\uC18C\uB97C \uC5F4 \uC218 \uC5C6\uC74C: {0}"},
+        {"No.principal.selected", "\uC120\uD0DD\uB41C \uC8FC\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"No.permission.selected", "\uC120\uD0DD\uB41C \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
+        {"name", "\uC774\uB984"},
+        {"configuration.type", "\uAD6C\uC131 \uC720\uD615"},
+        {"environment.variable.name", "\uD658\uACBD \uBCC0\uC218 \uC774\uB984"},
+        {"library.name", "\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984"},
+        {"package.name", "\uD328\uD0A4\uC9C0 \uC774\uB984"},
+        {"policy.type", "\uC815\uCC45 \uC720\uD615"},
+        {"property.name", "\uC18D\uC131 \uC774\uB984"},
+        {"provider.name", "\uC81C\uACF5\uC790 \uC774\uB984"},
+        {"Principal.List", "\uC8FC\uCCB4 \uBAA9\uB85D"},
+        {"Permission.List", "\uAD8C\uD55C \uBAA9\uB85D"},
+        {"Code.Base", "\uCF54\uB4DC \uBCA0\uC774\uC2A4"},
+        {"KeyStore.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
+        {"KeyStore.Password.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_pt_BR.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_pt_BR extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Advert\u00EAncia: N\u00E3o existe uma chave p\u00FAblica para o alias {0}. Certifique-se de que um KeyStore esteja configurado adequadamente."},
+        {"Warning.Class.not.found.class", "Advert\u00EAncia: Classe n\u00E3o encontrada: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Advert\u00EAncia: Argumento(s) inv\u00E1lido(s) para o construtor: {0}"},
+        {"Illegal.Principal.Type.type", "Tipo Principal Inv\u00E1lido: {0}"},
+        {"Illegal.option.option", "Op\u00E7\u00E3o inv\u00E1lida: {0}"},
+        {"Usage.policytool.options.", "Uso: policytool [op\u00E7\u00F5es]"},
+        {".file.file.policy.file.location",
+                "  [-file <arquivo>]    localiza\u00E7\u00E3o do arquivo de pol\u00EDtica"},
+        {"New", "Novo"},
+        {"Open", "Abrir"},
+        {"Save", "Salvar"},
+        {"Save.As", "Salvar Como"},
+        {"View.Warning.Log", "Exibir Log de Advert\u00EAncias"},
+        {"Exit", "Sair"},
+        {"Add.Policy.Entry", "Adicionar Entrada de Pol\u00EDtica"},
+        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
+        {"Remove.Policy.Entry", "Remover Entrada de Pol\u00EDtica"},
+        {"Edit", "Editar"},
+        {"Retain", "Reter"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Advert\u00EAncia: O nome do arquivo pode conter caracteres de escape barra invertida. N\u00E3o \u00E9 necess\u00E1rio fazer o escape dos caracteres de barra invertida (a ferramenta faz o escape dos caracteres conforme necess\u00E1rio ao gravar o conte\u00FAdo da pol\u00EDtica no armazenamento persistente).\n\nClique em Reter para reter o nome da entrada ou clique em Editar para edit\u00E1-lo."},
+
+        {"Add.Public.Key.Alias", "Adicionar Alias de Chave P\u00FAblica"},
+        {"Remove.Public.Key.Alias", "Remover Alias de Chave P\u00FAblica"},
+        {"File", "Arquivo"},
+        {"KeyStore", "KeyStore"},
+        {"Policy.File.", "Arquivo de Pol\u00EDtica:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "N\u00E3o foi poss\u00EDvel abrir o arquivo de pol\u00EDtica: {0}: {1}"},
+        {"Policy.Tool", "Ferramenta de Pol\u00EDtica"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Erros durante a abertura da configura\u00E7\u00E3o da pol\u00EDtica. Consulte o Log de Advert\u00EAncias para obter mais informa\u00E7\u00F5es."},
+        {"Error", "Erro"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Advert\u00EAncia"},
+        {"Permission.",
+                "Permiss\u00E3o:                                                       "},
+        {"Principal.Type.", "Tipo do Principal:"},
+        {"Principal.Name.", "Nome do Principal:"},
+        {"Target.Name.",
+                "Nome do Alvo:                                                    "},
+        {"Actions.",
+                "A\u00E7\u00F5es:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Est\u00E1 correto substituir o arquivo existente {0}?"},
+        {"Cancel", "Cancelar"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "Adicionar Principal"},
+        {"Edit.Principal", "Editar Principal"},
+        {"Remove.Principal", "Remover Principal"},
+        {"Principals.", "Principais:"},
+        {".Add.Permission", "  Adicionar Permiss\u00E3o"},
+        {".Edit.Permission", "  Editar Permiss\u00E3o"},
+        {"Remove.Permission", "Remover Permiss\u00E3o"},
+        {"Done", "Conclu\u00EDdo"},
+        {"KeyStore.URL.", "URL do KeyStore:"},
+        {"KeyStore.Type.", "Tipo de KeyStore:"},
+        {"KeyStore.Provider.", "Fornecedor de KeyStore:"},
+        {"KeyStore.Password.URL.", "URL da Senha do KeyStore:"},
+        {"Principals", "Principais"},
+        {".Edit.Principal.", "  Editar Principal:"},
+        {".Add.New.Principal.", "  Adicionar Novo Principal:"},
+        {"Permissions", "Permiss\u00F5es"},
+        {".Edit.Permission.", "  Editar Permiss\u00E3o:"},
+        {".Add.New.Permission.", "  Adicionar Nova Permiss\u00E3o:"},
+        {"Signed.By.", "Assinado por:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal com uma Classe de Curinga sem um Nome de Curinga"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal sem um Nome"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "O Nome de Destino e a Permiss\u00E3o devem ter um Valor"},
+        {"Remove.this.Policy.Entry.", "Remover esta Entrada de Pol\u00EDtica?"},
+        {"Overwrite.File", "Substituir Arquivo"},
+        {"Policy.successfully.written.to.filename",
+                "Pol\u00EDtica gravada com \u00EAxito em {0}"},
+        {"null.filename", "nome de arquivo nulo"},
+        {"Save.changes.", "Salvar altera\u00E7\u00F5es?"},
+        {"Yes", "Sim"},
+        {"No", "N\u00E3o"},
+        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
+        {"Save.Changes", "Salvar Altera\u00E7\u00F5es"},
+        {"No.Policy.Entry.selected", "Nenhuma Entrada de Pol\u00EDtica Selecionada"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "N\u00E3o \u00E9 poss\u00EDvel abrir a KeyStore: {0}"},
+        {"No.principal.selected", "Nenhum principal selecionado"},
+        {"No.permission.selected", "Nenhuma permiss\u00E3o selecionada"},
+        {"name", "nome"},
+        {"configuration.type", "tipo de configura\u00E7\u00E3o"},
+        {"environment.variable.name", "nome da vari\u00E1vel de ambiente"},
+        {"library.name", "nome da biblioteca"},
+        {"package.name", "nome do pacote"},
+        {"policy.type", "tipo de pol\u00EDtica"},
+        {"property.name", "nome da propriedade"},
+        {"provider.name", "nome do fornecedor"},
+        {"Principal.List", "Lista de Principais"},
+        {"Permission.List", "Lista de Permiss\u00F5es"},
+        {"Code.Base", "Base de C\u00F3digo"},
+        {"KeyStore.U.R.L.", "U R L da KeyStore:"},
+        {"KeyStore.Password.U.R.L.", "U R L da Senha do KeyStore:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_sv.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_sv extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "Varning! Det finns ingen offentlig nyckel f\u00F6r aliaset {0}. Kontrollera att det aktuella nyckellagret \u00E4r korrekt konfigurerat."},
+        {"Warning.Class.not.found.class", "Varning! Klassen hittades inte: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "Varning! Ogiltiga argument f\u00F6r konstruktor: {0}"},
+        {"Illegal.Principal.Type.type", "Otill\u00E5ten identitetshavaretyp: {0}"},
+        {"Illegal.option.option", "Otill\u00E5tet alternativ: {0}"},
+        {"Usage.policytool.options.", "Syntax: policytool [alternativ]"},
+        {".file.file.policy.file.location",
+                "  [-file <fil>]    policyfilens plats"},
+        {"New", "Nytt"},
+        {"Open", "\u00D6ppna"},
+        {"Save", "Spara"},
+        {"Save.As", "Spara som"},
+        {"View.Warning.Log", "Visa varningslogg"},
+        {"Exit", "Avsluta"},
+        {"Add.Policy.Entry", "L\u00E4gg till policypost"},
+        {"Edit.Policy.Entry", "Redigera policypost"},
+        {"Remove.Policy.Entry", "Ta bort policypost"},
+        {"Edit", "Redigera"},
+        {"Retain", "Beh\u00E5ll"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "Varning! Filnamnet kan inneh\u00E5lla omv\u00E4nda snedstreck inom citattecken. Citattecken kr\u00E4vs inte f\u00F6r omv\u00E4nda snedstreck (verktyget hanterar detta n\u00E4r policyinneh\u00E5llet skrivs till det best\u00E4ndiga lagret).\n\nKlicka p\u00E5 Beh\u00E5ll f\u00F6r att beh\u00E5lla det angivna namnet, eller klicka p\u00E5 Redigera f\u00F6r att \u00E4ndra det."},
+
+        {"Add.Public.Key.Alias", "L\u00E4gg till offentligt nyckelalias"},
+        {"Remove.Public.Key.Alias", "Ta bort offentligt nyckelalias"},
+        {"File", "Fil"},
+        {"KeyStore", "Nyckellager"},
+        {"Policy.File.", "Policyfil:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "Kan inte \u00F6ppna policyfilen: {0}: {1}"},
+        {"Policy.Tool", "Policyverktyg"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "Det uppstod ett fel n\u00E4r policykonfigurationen skulle \u00F6ppnas. Se varningsloggen f\u00F6r mer information."},
+        {"Error", "Fel"},
+        {"OK", "OK"},
+        {"Status", "Status"},
+        {"Warning", "Varning"},
+        {"Permission.",
+                "Beh\u00F6righet:                                                       "},
+        {"Principal.Type.", "Identitetshavaretyp:"},
+        {"Principal.Name.", "Identitetshavare:"},
+        {"Target.Name.",
+                "M\u00E5l:                                                    "},
+        {"Actions.",
+                "Funktioner:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "Ska den befintliga filen {0} skrivas \u00F6ver?"},
+        {"Cancel", "Avbryt"},
+        {"CodeBase.", "Kodbas:"},
+        {"SignedBy.", "Signerad av:"},
+        {"Add.Principal", "L\u00E4gg till identitetshavare"},
+        {"Edit.Principal", "Redigera identitetshavare"},
+        {"Remove.Principal", "Ta bort identitetshavare"},
+        {"Principals.", "Identitetshavare:"},
+        {".Add.Permission", "  L\u00E4gg till beh\u00F6righet"},
+        {".Edit.Permission", "  Redigera beh\u00F6righet"},
+        {"Remove.Permission", "Ta bort beh\u00F6righet"},
+        {"Done", "Utf\u00F6rd"},
+        {"KeyStore.URL.", "URL f\u00F6r nyckellager:"},
+        {"KeyStore.Type.", "Nyckellagertyp:"},
+        {"KeyStore.Provider.", "Nyckellagerleverant\u00F6r:"},
+        {"KeyStore.Password.URL.", "URL f\u00F6r l\u00F6senord till nyckellager:"},
+        {"Principals", "Identitetshavare"},
+        {".Edit.Principal.", "  Redigera identitetshavare:"},
+        {".Add.New.Principal.", "  L\u00E4gg till ny identitetshavare:"},
+        {"Permissions", "Beh\u00F6righet"},
+        {".Edit.Permission.", "  Redigera beh\u00F6righet:"},
+        {".Add.New.Permission.", "  L\u00E4gg till ny beh\u00F6righet:"},
+        {"Signed.By.", "Signerad av:"},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "Kan inte specificera identitetshavare med jokerteckenklass utan jokerteckennamn"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "Kan inte specificera identitetshavare utan namn"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "Beh\u00F6righet och m\u00E5lnamn m\u00E5ste ha ett v\u00E4rde"},
+        {"Remove.this.Policy.Entry.", "Vill du ta bort den h\u00E4r policyposten?"},
+        {"Overwrite.File", "Skriv \u00F6ver fil"},
+        {"Policy.successfully.written.to.filename",
+                "Policy har skrivits till {0}"},
+        {"null.filename", "nullfilnamn"},
+        {"Save.changes.", "Vill du spara \u00E4ndringarna?"},
+        {"Yes", "Ja"},
+        {"No", "Nej"},
+        {"Policy.Entry", "Policyfel"},
+        {"Save.Changes", "Spara \u00E4ndringar"},
+        {"No.Policy.Entry.selected", "Ingen policypost har valts"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "Kan inte \u00F6ppna nyckellagret: {0}"},
+        {"No.principal.selected", "Ingen identitetshavare har valts"},
+        {"No.permission.selected", "Ingen beh\u00F6righet har valts"},
+        {"name", "namn"},
+        {"configuration.type", "konfigurationstyp"},
+        {"environment.variable.name", "variabelnamn f\u00F6r milj\u00F6"},
+        {"library.name", "biblioteksnamn"},
+        {"package.name", "paketnamn"},
+        {"policy.type", "policytyp"},
+        {"property.name", "egenskapsnamn"},
+        {"provider.name", "leverant\u00F6rsnamn"},
+        {"Principal.List", "Lista \u00F6ver identitetshavare"},
+        {"Permission.List", "Beh\u00F6righetslista"},
+        {"Code.Base", "Kodbas"},
+        {"KeyStore.U.R.L.", "URL f\u00F6r nyckellager:"},
+        {"KeyStore.Password.U.R.L.", "URL f\u00F6r l\u00F6senord till nyckellager:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_zh_CN.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_zh_CN extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u522B\u540D {0} \u7684\u516C\u5171\u5BC6\u94A5\u4E0D\u5B58\u5728\u3002\u8BF7\u786E\u4FDD\u5DF2\u6B63\u786E\u914D\u7F6E KeyStore\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u7C7B: {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u6784\u9020\u5668\u7684\u53C2\u6570\u65E0\u6548: {0}"},
+        {"Illegal.Principal.Type.type", "\u975E\u6CD5\u7684\u4E3B\u7528\u6237\u7C7B\u578B: {0}"},
+        {"Illegal.option.option", "\u975E\u6CD5\u9009\u9879: {0}"},
+        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [\u9009\u9879]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \u7B56\u7565\u6587\u4EF6\u4F4D\u7F6E"},
+        {"New", "\u65B0\u5EFA"},
+        {"Open", "\u6253\u5F00"},
+        {"Save", "\u4FDD\u5B58"},
+        {"Save.As", "\u53E6\u5B58\u4E3A"},
+        {"View.Warning.Log", "\u67E5\u770B\u8B66\u544A\u65E5\u5FD7"},
+        {"Exit", "\u9000\u51FA"},
+        {"Add.Policy.Entry", "\u6DFB\u52A0\u7B56\u7565\u6761\u76EE"},
+        {"Edit.Policy.Entry", "\u7F16\u8F91\u7B56\u7565\u6761\u76EE"},
+        {"Remove.Policy.Entry", "\u5220\u9664\u7B56\u7565\u6761\u76EE"},
+        {"Edit", "\u7F16\u8F91"},
+        {"Retain", "\u4FDD\u7559"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u6587\u4EF6\u540D\u5305\u542B\u8F6C\u4E49\u7684\u53CD\u659C\u6760\u5B57\u7B26\u3002\u4E0D\u9700\u8981\u5BF9\u53CD\u659C\u6760\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49 (\u8BE5\u5DE5\u5177\u5728\u5C06\u7B56\u7565\u5185\u5BB9\u5199\u5165\u6C38\u4E45\u5B58\u50A8\u65F6\u4F1A\u6839\u636E\u9700\u8981\u5BF9\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49)\u3002\n\n\u5355\u51FB\u201C\u4FDD\u7559\u201D\u53EF\u4FDD\u7559\u8F93\u5165\u7684\u540D\u79F0, \u6216\u8005\u5355\u51FB\u201C\u7F16\u8F91\u201D\u53EF\u7F16\u8F91\u8BE5\u540D\u79F0\u3002"},
+
+        {"Add.Public.Key.Alias", "\u6DFB\u52A0\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
+        {"Remove.Public.Key.Alias", "\u5220\u9664\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
+        {"File", "\u6587\u4EF6"},
+        {"KeyStore", "KeyStore"},
+        {"Policy.File.", "\u7B56\u7565\u6587\u4EF6:"},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u65E0\u6CD5\u6253\u5F00\u7B56\u7565\u6587\u4EF6: {0}: {1}"},
+        {"Policy.Tool", "\u7B56\u7565\u5DE5\u5177"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u6253\u5F00\u7B56\u7565\u914D\u7F6E\u65F6\u51FA\u9519\u3002\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u67E5\u770B\u8B66\u544A\u65E5\u5FD7\u3002"},
+        {"Error", "\u9519\u8BEF"},
+        {"OK", "\u786E\u5B9A"},
+        {"Status", "\u72B6\u6001"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u6743\u9650:                                                       "},
+        {"Principal.Type.", "\u4E3B\u7528\u6237\u7C7B\u578B:"},
+        {"Principal.Name.", "\u4E3B\u7528\u6237\u540D\u79F0:"},
+        {"Target.Name.",
+                "\u76EE\u6807\u540D\u79F0:                                                    "},
+        {"Actions.",
+                "\u64CD\u4F5C:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u786E\u8BA4\u8986\u76D6\u73B0\u6709\u7684\u6587\u4EF6{0}?"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u6DFB\u52A0\u4E3B\u7528\u6237"},
+        {"Edit.Principal", "\u7F16\u8F91\u4E3B\u7528\u6237"},
+        {"Remove.Principal", "\u5220\u9664\u4E3B\u7528\u6237"},
+        {"Principals.", "\u4E3B\u7528\u6237:"},
+        {".Add.Permission", "  \u6DFB\u52A0\u6743\u9650"},
+        {".Edit.Permission", "  \u7F16\u8F91\u6743\u9650"},
+        {"Remove.Permission", "\u5220\u9664\u6743\u9650"},
+        {"Done", "\u5B8C\u6210"},
+        {"KeyStore.URL.", "KeyStore URL:"},
+        {"KeyStore.Type.", "KeyStore \u7C7B\u578B:"},
+        {"KeyStore.Provider.", "KeyStore \u63D0\u4F9B\u65B9:"},
+        {"KeyStore.Password.URL.", "KeyStore \u53E3\u4EE4 URL:"},
+        {"Principals", "\u4E3B\u7528\u6237"},
+        {".Edit.Principal.", "  \u7F16\u8F91\u4E3B\u7528\u6237:"},
+        {".Add.New.Principal.", "  \u6DFB\u52A0\u65B0\u4E3B\u7528\u6237:"},
+        {"Permissions", "\u6743\u9650"},
+        {".Edit.Permission.", "  \u7F16\u8F91\u6743\u9650:"},
+        {".Add.New.Permission.", "  \u52A0\u5165\u65B0\u7684\u6743\u9650:"},
+        {"Signed.By.", "\u7B7E\u7F72\u4EBA: "},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u6CA1\u6709\u901A\u914D\u7B26\u540D\u79F0, \u65E0\u6CD5\u4F7F\u7528\u901A\u914D\u7B26\u7C7B\u6307\u5B9A\u4E3B\u7528\u6237"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u6CA1\u6709\u540D\u79F0, \u65E0\u6CD5\u6307\u5B9A\u4E3B\u7528\u6237"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u6743\u9650\u53CA\u76EE\u6807\u540D\u5FC5\u987B\u6709\u4E00\u4E2A\u503C"},
+        {"Remove.this.Policy.Entry.", "\u662F\u5426\u5220\u9664\u6B64\u7B56\u7565\u6761\u76EE?"},
+        {"Overwrite.File", "\u8986\u76D6\u6587\u4EF6"},
+        {"Policy.successfully.written.to.filename",
+                "\u7B56\u7565\u5DF2\u6210\u529F\u5199\u5165\u5230{0}"},
+        {"null.filename", "\u7A7A\u6587\u4EF6\u540D"},
+        {"Save.changes.", "\u662F\u5426\u4FDD\u5B58\u6240\u505A\u7684\u66F4\u6539?"},
+        {"Yes", "\u662F"},
+        {"No", "\u5426"},
+        {"Policy.Entry", "\u7B56\u7565\u6761\u76EE"},
+        {"Save.Changes", "\u4FDD\u5B58\u66F4\u6539"},
+        {"No.Policy.Entry.selected", "\u6CA1\u6709\u9009\u62E9\u7B56\u7565\u6761\u76EE"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u65E0\u6CD5\u6253\u5F00 KeyStore: {0}"},
+        {"No.principal.selected", "\u672A\u9009\u62E9\u4E3B\u7528\u6237"},
+        {"No.permission.selected", "\u6CA1\u6709\u9009\u62E9\u6743\u9650"},
+        {"name", "\u540D\u79F0"},
+        {"configuration.type", "\u914D\u7F6E\u7C7B\u578B"},
+        {"environment.variable.name", "\u73AF\u5883\u53D8\u91CF\u540D"},
+        {"library.name", "\u5E93\u540D\u79F0"},
+        {"package.name", "\u7A0B\u5E8F\u5305\u540D\u79F0"},
+        {"policy.type", "\u7B56\u7565\u7C7B\u578B"},
+        {"property.name", "\u5C5E\u6027\u540D\u79F0"},
+        {"provider.name", "\u63D0\u4F9B\u65B9\u540D\u79F0"},
+        {"Principal.List", "\u4E3B\u7528\u6237\u5217\u8868"},
+        {"Permission.List", "\u6743\u9650\u5217\u8868"},
+        {"Code.Base", "\u4EE3\u7801\u5E93"},
+        {"KeyStore.U.R.L.", "KeyStore URL:"},
+        {"KeyStore.Password.U.R.L.", "KeyStore \u53E3\u4EE4 URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_zh_HK.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_zh_HK extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
+        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
+        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
+        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
+        {"New", "\u65B0\u589E"},
+        {"Open", "\u958B\u555F"},
+        {"Save", "\u5132\u5B58"},
+        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
+        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
+        {"Exit", "\u7D50\u675F"},
+        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
+        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
+        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
+        {"Edit", "\u7DE8\u8F2F"},
+        {"Retain", "\u4FDD\u7559"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
+
+        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"File", "\u6A94\u6848"},
+        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
+        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
+        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
+        {"Error", "\u932F\u8AA4"},
+        {"OK", "\u78BA\u5B9A"},
+        {"Status", "\u72C0\u614B"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u6B0A\u9650:                                                       "},
+        {"Principal.Type.", "Principal \u985E\u578B: "},
+        {"Principal.Name.", "Principal \u540D\u7A31: "},
+        {"Target.Name.",
+                "\u76EE\u6A19\u540D\u7A31:                                                    "},
+        {"Actions.",
+                "\u52D5\u4F5C:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u65B0\u589E Principal"},
+        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
+        {"Remove.Principal", "\u79FB\u9664 Principal"},
+        {"Principals.", "Principal:"},
+        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
+        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
+        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
+        {"Done", "\u5B8C\u6210"},
+        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
+        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
+        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
+        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
+        {"Principals", "Principal"},
+        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
+        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
+        {"Permissions", "\u6B0A\u9650"},
+        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
+        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
+        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
+        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
+        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
+        {"Policy.successfully.written.to.filename",
+                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
+        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
+        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
+        {"Yes", "\u662F"},
+        {"No", "\u5426"},
+        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
+        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
+        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
+        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
+        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
+        {"name", "\u540D\u7A31"},
+        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
+        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
+        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
+        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
+        {"policy.type", "\u539F\u5247\u985E\u578B"},
+        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
+        {"provider.name", "\u63D0\u4F9B\u8005\u540D\u7A31"},
+        {"Principal.List", "Principal \u6E05\u55AE"},
+        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
+        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
+        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
+        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/security/tools/policytool/Resources_zh_TW.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.tools.policytool;
+
+/**
+ * <p> This class represents the <code>ResourceBundle</code>
+ * for the policytool.
+ *
+ */
+public class Resources_zh_TW extends java.util.ListResourceBundle {
+
+    private static final Object[][] contents = {
+        {"NEWLINE", "\n"},
+        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
+                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
+        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
+        {"Warning.Invalid.argument.s.for.constructor.arg",
+                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
+        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
+        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
+        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
+        {".file.file.policy.file.location",
+                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
+        {"New", "\u65B0\u589E"},
+        {"Open", "\u958B\u555F"},
+        {"Save", "\u5132\u5B58"},
+        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
+        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
+        {"Exit", "\u7D50\u675F"},
+        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
+        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
+        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
+        {"Edit", "\u7DE8\u8F2F"},
+        {"Retain", "\u4FDD\u7559"},
+
+        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
+            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
+
+        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
+        {"File", "\u6A94\u6848"},
+        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
+        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
+        {"Could.not.open.policy.file.policyFile.e.toString.",
+                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
+        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
+        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
+                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
+        {"Error", "\u932F\u8AA4"},
+        {"OK", "\u78BA\u5B9A"},
+        {"Status", "\u72C0\u614B"},
+        {"Warning", "\u8B66\u544A"},
+        {"Permission.",
+                "\u6B0A\u9650:                                                       "},
+        {"Principal.Type.", "Principal \u985E\u578B: "},
+        {"Principal.Name.", "Principal \u540D\u7A31: "},
+        {"Target.Name.",
+                "\u76EE\u6A19\u540D\u7A31:                                                    "},
+        {"Actions.",
+                "\u52D5\u4F5C:                                                             "},
+        {"OK.to.overwrite.existing.file.filename.",
+                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
+        {"Cancel", "\u53D6\u6D88"},
+        {"CodeBase.", "CodeBase:"},
+        {"SignedBy.", "SignedBy:"},
+        {"Add.Principal", "\u65B0\u589E Principal"},
+        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
+        {"Remove.Principal", "\u79FB\u9664 Principal"},
+        {"Principals.", "Principal:"},
+        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
+        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
+        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
+        {"Done", "\u5B8C\u6210"},
+        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
+        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
+        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
+        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
+        {"Principals", "Principal"},
+        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
+        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
+        {"Permissions", "\u6B0A\u9650"},
+        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
+        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
+        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
+        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
+            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
+        {"Cannot.Specify.Principal.without.a.Name",
+            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
+        {"Permission.and.Target.Name.must.have.a.value",
+                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
+        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
+        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
+        {"Policy.successfully.written.to.filename",
+                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
+        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
+        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
+        {"Yes", "\u662F"},
+        {"No", "\u5426"},
+        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
+        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
+        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
+        {"Unable.to.open.KeyStore.ex.toString.",
+                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
+        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
+        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
+        {"name", "\u540D\u7A31"},
+        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
+        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
+        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
+        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
+        {"policy.type", "\u539F\u5247\u985E\u578B"},
+        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
+        {"provider.name", "\u63D0\u4F9B\u8005\u540D\u7A31"},
+        {"Principal.List", "Principal \u6E05\u55AE"},
+        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
+        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
+        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
+        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"}
+    };
+
+
+    /**
+     * Returns the contents of this <code>ResourceBundle</code>.
+     *
+     * <p>
+     *
+     * @return the contents of this <code>ResourceBundle</code>.
+     */
+    @Override
+    public Object[][] getContents() {
+        return contents;
+    }
+}
--- a/src/share/classes/sun/security/util/Resources.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,513 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-        {".OPTION.", " [OPTION]..."},
-        {"Options.", "Options:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "Use \"keytool -help\" for all available commands"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Key and Certificate Management Tool"},
-        {"Commands.", "Commands:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "Use \"keytool -command_name -help\" for usage of command_name"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "Generates a certificate request"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "Changes an entry's alias"}, //-changealias
-        {"Deletes.an.entry",
-                "Deletes an entry"}, //-delete
-        {"Exports.certificate",
-                "Exports certificate"}, //-exportcert
-        {"Generates.a.key.pair",
-                "Generates a key pair"}, //-genkeypair
-        {"Generates.a.secret.key",
-                "Generates a secret key"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "Generates certificate from a certificate request"}, //-gencert
-        {"Generates.CRL", "Generates CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Imports entries from a JDK 1.1.x-style identity database"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Imports a certificate or a certificate chain"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Imports one or all entries from another keystore"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Clones a key entry"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "Changes the key password of an entry"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "Lists entries in a keystore"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Prints the content of a certificate"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Prints the content of a certificate request"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Prints the content of a CRL file"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "Generates a self-signed certificate"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "Changes the store password of a keystore"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "alias name of the entry to process"}, //-alias
-        {"destination.alias",
-                "destination alias"}, //-destalias
-        {"destination.key.password",
-                "destination key password"}, //-destkeypass
-        {"destination.keystore.name",
-                "destination keystore name"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "destination keystore password protected"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "destination keystore provider name"}, //-destprovidername
-        {"destination.keystore.password",
-                "destination keystore password"}, //-deststorepass
-        {"destination.keystore.type",
-                "destination keystore type"}, //-deststoretype
-        {"distinguished.name",
-                "distinguished name"}, //-dname
-        {"X.509.extension",
-                "X.509 extension"}, //-ext
-        {"output.file.name",
-                "output file name"}, //-file and -outfile
-        {"input.file.name",
-                "input file name"}, //-file and -infile
-        {"key.algorithm.name",
-                "key algorithm name"}, //-keyalg
-        {"key.password",
-                "key password"}, //-keypass
-        {"key.bit.size",
-                "key bit size"}, //-keysize
-        {"keystore.name",
-                "keystore name"}, //-keystore
-        {"new.password",
-                "new password"}, //-new
-        {"do.not.prompt",
-                "do not prompt"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "password through protected mechanism"}, //-protected
-        {"provider.argument",
-                "provider argument"}, //-providerarg
-        {"provider.class.name",
-                "provider class name"}, //-providerclass
-        {"provider.name",
-                "provider name"}, //-providername
-        {"provider.classpath",
-                "provider classpath"}, //-providerpath
-        {"output.in.RFC.style",
-                "output in RFC style"}, //-rfc
-        {"signature.algorithm.name",
-                "signature algorithm name"}, //-sigalg
-        {"source.alias",
-                "source alias"}, //-srcalias
-        {"source.key.password",
-                "source key password"}, //-srckeypass
-        {"source.keystore.name",
-                "source keystore name"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "source keystore password protected"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "source keystore provider name"}, //-srcprovidername
-        {"source.keystore.password",
-                "source keystore password"}, //-srcstorepass
-        {"source.keystore.type",
-                "source keystore type"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL server host and port"}, //-sslserver
-        {"signed.jar.file",
-                "signed jar file"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "certificate validity start date/time"}, //-startdate
-        {"keystore.password",
-                "keystore password"}, //-storepass
-        {"keystore.type",
-                "keystore type"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "trust certificates from cacerts"}, //-trustcacerts
-        {"verbose.output",
-                "verbose output"}, //-v
-        {"validity.number.of.days",
-                "validity number of days"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "Serial ID of cert to revoke"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "keytool error: "},
-        {"Illegal.option.", "Illegal option:  "},
-        {"Illegal.value.", "Illegal value: "},
-        {"Unknown.password.type.", "Unknown password type: "},
-        {"Cannot.find.environment.variable.",
-                "Cannot find environment variable: "},
-        {"Cannot.find.file.", "Cannot find file: "},
-        {"Command.option.flag.needs.an.argument.", "Command option {0} needs an argument."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Warning:  Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified {0} value."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore must be NONE if -storetype is {0}"},
-        {"Too.many.retries.program.terminated",
-                 "Too many retries, program terminated"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "-storepasswd and -keypasswd commands not supported if -storetype is {0}"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "-keypasswd commands not supported if -storetype is PKCS12"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-keypass and -new can not be specified if -storetype is {0}"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "if -protected is specified, then -storepass, -keypass, and -new must not be specified"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "if -srcprotected is specified, then -srcstorepass and -srckeypass must not be specified"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "if keystore is not password protected, then -storepass, -keypass, and -new must not be specified"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "if source keystore is not password protected, then -srcstorepass and -srckeypass must not be specified"},
-        {"Illegal.startdate.value", "Illegal startdate value"},
-        {"Validity.must.be.greater.than.zero",
-                "Validity must be greater than zero"},
-        {"provName.not.a.provider", "{0} not a provider"},
-        {"Usage.error.no.command.provided", "Usage error: no command provided"},
-        {"Source.keystore.file.exists.but.is.empty.", "Source keystore file exists, but is empty: "},
-        {"Please.specify.srckeystore", "Please specify -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "Must not specify both -v and -rfc with 'list' command"},
-        {"Key.password.must.be.at.least.6.characters",
-                "Key password must be at least 6 characters"},
-        {"New.password.must.be.at.least.6.characters",
-                "New password must be at least 6 characters"},
-        {"Keystore.file.exists.but.is.empty.",
-                "Keystore file exists, but is empty: "},
-        {"Keystore.file.does.not.exist.",
-                "Keystore file does not exist: "},
-        {"Must.specify.destination.alias", "Must specify destination alias"},
-        {"Must.specify.alias", "Must specify alias"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "Keystore password must be at least 6 characters"},
-        {"Enter.keystore.password.", "Enter keystore password:  "},
-        {"Enter.source.keystore.password.", "Enter source keystore password:  "},
-        {"Enter.destination.keystore.password.", "Enter destination keystore password:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "Keystore password is too short - must be at least 6 characters"},
-        {"Unknown.Entry.Type", "Unknown Entry Type"},
-        {"Too.many.failures.Alias.not.changed", "Too many failures. Alias not changed"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "Entry for alias {0} successfully imported."},
-        {"Entry.for.alias.alias.not.imported.", "Entry for alias {0} not imported."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Problem importing entry for alias {0}: {1}.\nEntry for alias {0} not imported."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Import command completed:  {0} entries successfully imported, {1} entries failed or cancelled"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Warning: Overwriting existing alias {0} in destination keystore"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "Existing entry alias {0} exists, overwrite? [no]:  "},
-        {"Too.many.failures.try.later", "Too many failures - try later"},
-        {"Certification.request.stored.in.file.filename.",
-                "Certification request stored in file <{0}>"},
-        {"Submit.this.to.your.CA", "Submit this to your CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "if alias not specified, destalias, srckeypass, and destkeypass must not be specified"},
-        {"Certificate.stored.in.file.filename.",
-                "Certificate stored in file <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "Certificate reply was installed in keystore"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "Certificate reply was not installed in keystore"},
-        {"Certificate.was.added.to.keystore",
-                "Certificate was added to keystore"},
-        {"Certificate.was.not.added.to.keystore",
-                "Certificate was not added to keystore"},
-        {".Storing.ksfname.", "[Storing {0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} has no public key (certificate)"},
-        {"Cannot.derive.signature.algorithm",
-                "Cannot derive signature algorithm"},
-        {"Alias.alias.does.not.exist",
-                "Alias <{0}> does not exist"},
-        {"Alias.alias.has.no.certificate",
-                "Alias <{0}> has no certificate"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "Key pair not generated, alias <{0}> already exists"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "Generating {0} bit {1} key pair and self-signed certificate ({2}) with a validity of {3} days\n\tfor: {4}"},
-        {"Enter.key.password.for.alias.", "Enter key password for <{0}>"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(RETURN if same as keystore password):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "Key password is too short - must be at least 6 characters"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "Too many failures - key not added to keystore"},
-        {"Destination.alias.dest.already.exists",
-                "Destination alias <{0}> already exists"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "Password is too short - must be at least 6 characters"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "Too many failures. Key entry not cloned"},
-        {"key.password.for.alias.", "key password for <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "Keystore entry for <{0}> already exists"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Creating keystore entry for <{0}> ..."},
-        {"No.entries.from.identity.database.added",
-                "No entries from identity database added"},
-        {"Alias.name.alias", "Alias name: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Creation date: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Entry type: {0}"},
-        {"Certificate.chain.length.", "Certificate chain length: "},
-        {"Certificate.i.1.", "Certificate[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Certificate fingerprint (SHA1): "},
-        {"Keystore.type.", "Keystore type: "},
-        {"Keystore.provider.", "Keystore provider: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Your keystore contains {0,number,integer} entry"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Your keystore contains {0,number,integer} entries"},
-        {"Failed.to.parse.input", "Failed to parse input"},
-        {"Empty.input", "Empty input"},
-        {"Not.X.509.certificate", "Not X.509 certificate"},
-        {"alias.has.no.public.key", "{0} has no public key"},
-        {"alias.has.no.X.509.certificate", "{0} has no X.509 certificate"},
-        {"New.certificate.self.signed.", "New certificate (self-signed):"},
-        {"Reply.has.no.certificates", "Reply has no certificates"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Certificate not imported, alias <{0}> already exists"},
-        {"Input.not.an.X.509.certificate", "Input not an X.509 certificate"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "Certificate already exists in keystore under alias <{0}>"},
-        {"Do.you.still.want.to.add.it.no.",
-                "Do you still want to add it? [no]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "Certificate already exists in system-wide CA keystore under alias <{0}>"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "Do you still want to add it to your own keystore? [no]:  "},
-        {"Trust.this.certificate.no.", "Trust this certificate? [no]:  "},
-        {"YES", "YES"},
-        {"New.prompt.", "New {0}: "},
-        {"Passwords.must.differ", "Passwords must differ"},
-        {"Re.enter.new.prompt.", "Re-enter new {0}: "},
-        {"Re.enter.new.password.", "Re-enter new password: "},
-        {"They.don.t.match.Try.again", "They don't match. Try again"},
-        {"Enter.prompt.alias.name.", "Enter {0} alias name:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Enter new alias name\t(RETURN to cancel import for this entry):  "},
-        {"Enter.alias.name.", "Enter alias name:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(RETURN if same as for <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Signature algorithm name: {8}\n\t Version: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "What is your first and last name?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "What is the name of your organizational unit?"},
-        {"What.is.the.name.of.your.organization.",
-                "What is the name of your organization?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "What is the name of your City or Locality?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "What is the name of your State or Province?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "What is the two-letter country code for this unit?"},
-        {"Is.name.correct.", "Is {0} correct?"},
-        {"no", "no"},
-        {"yes", "yes"},
-        {"y", "y"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "Alias <{0}> has no key"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "Alias <{0}> references an entry type that is not a private key entry.  The -keyclone command only supports cloning of private key entries"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  WARNING WARNING WARNING  *****************"},
-        {"Signer.d.", "Signer #%d:"},
-        {"Timestamp.", "Timestamp:"},
-        {"Signature.", "Signature:"},
-        {"CRLs.", "CRLs:"},
-        {"Certificate.owner.", "Certificate owner: "},
-        {"Not.a.signed.jar.file", "Not a signed jar file"},
-        {"No.certificate.from.the.SSL.server",
-                "No certificate from the SSL server"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* The integrity of the information stored in your keystore  *\n" +
-            "* has NOT been verified!  In order to verify its integrity, *\n" +
-            "* you must provide your keystore password.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* The integrity of the information stored in the srckeystore*\n" +
-            "* has NOT been verified!  In order to verify its integrity, *\n" +
-            "* you must provide the srckeystore password.                *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "Certificate reply does not contain public key for <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Incomplete certificate chain in reply"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "Certificate chain in reply does not verify: "},
-        {"Top.level.certificate.in.reply.",
-                "Top-level certificate in reply:\n"},
-        {".is.not.trusted.", "... is not trusted. "},
-        {"Install.reply.anyway.no.", "Install reply anyway? [no]:  "},
-        {"NO", "NO"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "Public keys in reply and keystore don't match"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "Certificate reply and certificate in keystore are identical"},
-        {"Failed.to.establish.chain.from.reply",
-                "Failed to establish chain from reply"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "Wrong answer, try again"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "Secret Key not generated, alias <{0}> already exists"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Please provide -keysize for secret key generation"},
-
-        {"verified.by.s.in.s", "Verified by %s in %s"},
-        {"warning.not.verified.make.sure.keystore.is.correct",
-            "WARNING: not verified. Make sure -keystore is correct."},
-
-        {"Extensions.", "Extensions: "},
-        {".Empty.value.", "(Empty value)"},
-        {"Extension.Request.", "Extension Request:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10 Certificate Request (Version 1.0)\n" +
-                "Subject: %s\nPublic Key: %s format %s key\n"},
-        {"Unknown.keyUsage.type.", "Unknown keyUsage type: "},
-        {"Unknown.extendedkeyUsage.type.", "Unknown extendedkeyUsage type: "},
-        {"Unknown.AccessDescription.type.", "Unknown AccessDescription type: "},
-        {"Unrecognized.GeneralName.type.", "Unrecognized GeneralName type: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "This extension cannot be marked as critical. "},
-        {"Odd.number.of.hex.digits.found.", "Odd number of hex digits found: "},
-        {"Unknown.extension.type.", "Unknown extension type: "},
-        {"command.{0}.is.ambiguous.", "command {0} is ambiguous:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Warning: A public key for alias {0} does not exist.  Make sure a KeyStore is properly configured."},
-        {"Warning.Class.not.found.class", "Warning: Class not found: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Warning: Invalid argument(s) for constructor: {0}"},
-        {"Illegal.Principal.Type.type", "Illegal Principal Type: {0}"},
-        {"Illegal.option.option", "Illegal option: {0}"},
-        {"Usage.policytool.options.", "Usage: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    policy file location"},
-        {"New", "New"},
-        {"Open", "Open"},
-        {"Save", "Save"},
-        {"Save.As", "Save As"},
-        {"View.Warning.Log", "View Warning Log"},
-        {"Exit", "Exit"},
-        {"Add.Policy.Entry", "Add Policy Entry"},
-        {"Edit.Policy.Entry", "Edit Policy Entry"},
-        {"Remove.Policy.Entry", "Remove Policy Entry"},
-        {"Edit", "Edit"},
-        {"Retain", "Retain"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Warning: File name may include escaped backslash characters. " +
-                        "It is not necessary to escape backslash characters " +
-                        "(the tool escapes characters as necessary when writing " +
-                        "the policy contents to the persistent store).\n\n" +
-                        "Click on Retain to retain the entered name, or click on " +
-                        "Edit to edit the name."},
-
-        {"Add.Public.Key.Alias", "Add Public Key Alias"},
-        {"Remove.Public.Key.Alias", "Remove Public Key Alias"},
-        {"File", "File"},
-        {"KeyStore", "KeyStore"},
-        {"Policy.File.", "Policy File:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Could not open policy file: {0}: {1}"},
-        {"Policy.Tool", "Policy Tool"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Errors have occurred while opening the policy configuration.  View the Warning Log for more information."},
-        {"Error", "Error"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Warning"},
-        {"Permission.",
-                "Permission:                                                       "},
-        {"Principal.Type.", "Principal Type:"},
-        {"Principal.Name.", "Principal Name:"},
-        {"Target.Name.",
-                "Target Name:                                                    "},
-        {"Actions.",
-                "Actions:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "OK to overwrite existing file {0}?"},
-        {"Cancel", "Cancel"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Add Principal"},
-        {"Edit.Principal", "Edit Principal"},
-        {"Remove.Principal", "Remove Principal"},
-        {"Principals.", "Principals:"},
-        {".Add.Permission", "  Add Permission"},
-        {".Edit.Permission", "  Edit Permission"},
-        {"Remove.Permission", "Remove Permission"},
-        {"Done", "Done"},
-        {"KeyStore.URL.", "KeyStore URL:"},
-        {"KeyStore.Type.", "KeyStore Type:"},
-        {"KeyStore.Provider.", "KeyStore Provider:"},
-        {"KeyStore.Password.URL.", "KeyStore Password URL:"},
-        {"Principals", "Principals"},
-        {".Edit.Principal.", "  Edit Principal:"},
-        {".Add.New.Principal.", "  Add New Principal:"},
-        {"Permissions", "Permissions"},
-        {".Edit.Permission.", "  Edit Permission:"},
-        {".Add.New.Permission.", "  Add New Permission:"},
-        {"Signed.By.", "Signed By:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Cannot Specify Principal with a Wildcard Class without a Wildcard Name"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Cannot Specify Principal without a Name"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Permission and Target Name must have a value"},
-        {"Remove.this.Policy.Entry.", "Remove this Policy Entry?"},
-        {"Overwrite.File", "Overwrite File"},
-        {"Policy.successfully.written.to.filename",
-                "Policy successfully written to {0}"},
-        {"null.filename", "null filename"},
-        {"Save.changes.", "Save changes?"},
-        {"Yes", "Yes"},
-        {"No", "No"},
-        {"Policy.Entry", "Policy Entry"},
-        {"Save.Changes", "Save Changes"},
-        {"No.Policy.Entry.selected", "No Policy Entry selected"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Unable to open KeyStore: {0}"},
-        {"No.principal.selected", "No principal selected"},
-        {"No.permission.selected", "No permission selected"},
-        {"name", "name"},
-        {"configuration.type", "configuration type"},
-        {"environment.variable.name", "environment variable name"},
-        {"library.name", "library name"},
-        {"package.name", "package name"},
-        {"policy.type", "policy type"},
-        {"property.name", "property name"},
-        {"Principal.List", "Principal List"},
-        {"Permission.List", "Permission List"},
-        {"Code.Base", "Code Base"},
-        {"KeyStore.U.R.L.", "KeyStore U R L:"},
-        {"KeyStore.Password.U.R.L.", "KeyStore Password U R L:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "invalid null input(s)"},
         {"actions.can.only.be.read.", "actions can only be 'read'"},
@@ -565,6 +58,7 @@
         {"provided.null.OID.map", "provided null OID map"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "invalid null AccessControlContext provided"},
         {"invalid.null.action.provided", "invalid null action provided"},
@@ -668,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_de.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_de.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [Option]..."},
-        {"Options.", "Optionen:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "\"keytool -help\" f\u00FCr alle verf\u00FCgbaren Befehle verwenden"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Schl\u00FCssel- und Zertifikatsverwaltungstool"},
-        {"Commands.", "Befehle:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "\"keytool -command_name -help\" f\u00FCr Verwendung von command_name verwenden"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "Generiert eine Zertifikatanforderung"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "\u00C4ndert den Alias eines Eintrags"}, //-changealias
-        {"Deletes.an.entry",
-                "L\u00F6scht einen Eintrag"}, //-delete
-        {"Exports.certificate",
-                "Exportiert ein Zertifikat"}, //-exportcert
-        {"Generates.a.key.pair",
-                "Generiert ein Schl\u00FCsselpaar"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "Generiert einen Secret Key"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "Generiert ein Zertifikat aus einer Zertifikatanforderung"}, //-gencert
-        {"Generates.CRL", "Generiert eine CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Importiert Eintr\u00E4ge aus einer Identity-Datenbank im JDK 1.1.x-Stil"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Importiert ein Zertifikat oder eine Zertifikatkette"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Importiert einen oder alle Eintr\u00E4ge aus einem anderen Keystore"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Clont einen Schl\u00FCsseleintrag"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "\u00C4ndert das Schl\u00FCsselkennwort eines Eintrags"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "Listet die Eintr\u00E4ge in einem Keystore auf"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Druckt den Content eines Zertifikats"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Druckt den Content einer Zertifikatanforderung"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Druckt den Content einer CRL-Datei"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "Generiert ein selbst signiertes Zertifikat"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "\u00C4ndert das Speicherkennwort eines Keystores"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "Aliasname des zu verarbeitenden Eintrags"}, //-alias
-        {"destination.alias",
-                "Zielalias"}, //-destalias
-        {"destination.key.password",
-                "Zielschl\u00FCssel-Kennwort"}, //-destkeypass
-        {"destination.keystore.name",
-                "Ziel-Keystore-Name"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "Ziel-Keystore kennwortgesch\u00FCtzt"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "Ziel-Keystore-Providername"}, //-destprovidername
-        {"destination.keystore.password",
-                "Ziel-Keystore-Kennwort"}, //-deststorepass
-        {"destination.keystore.type",
-                "Ziel-Keystore-Typ"}, //-deststoretype
-        {"distinguished.name",
-                "Distinguished Name"}, //-dname
-        {"X.509.extension",
-                "X.509-Erweiterung"}, //-ext
-        {"output.file.name",
-                "Ausgabedateiname"}, //-file and -outfile
-        {"input.file.name",
-                "Eingabedateiname"}, //-file and -infile
-        {"key.algorithm.name",
-                "Schl\u00FCsselalgorithmusname"}, //-keyalg
-        {"key.password",
-                "Schl\u00FCsselkennwort"}, //-keypass
-        {"key.bit.size",
-                "Schl\u00FCsselbitgr\u00F6\u00DFe"}, //-keysize
-        {"keystore.name",
-                "Keystore-Name"}, //-keystore
-        {"new.password",
-                "Neues Kennwort"}, //-new
-        {"do.not.prompt",
-                "Kein Prompt"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "Kennwort \u00FCber gesch\u00FCtzten Mechanismus"}, //-protected
-        {"provider.argument",
-                "Providerargument"}, //-providerarg
-        {"provider.class.name",
-                "Providerklassenname"}, //-providerclass
-        {"provider.name",
-                "Providername"}, //-providername
-        {"provider.classpath",
-                "Provider-Classpath"}, //-providerpath
-        {"output.in.RFC.style",
-                "Ausgabe in RFC-Stil"}, //-rfc
-        {"signature.algorithm.name",
-                "Signaturalgorithmusname"}, //-sigalg
-        {"source.alias",
-                "Quellalias"}, //-srcalias
-        {"source.key.password",
-                "Quellschl\u00FCssel-Kennwort"}, //-srckeypass
-        {"source.keystore.name",
-                "Quell-Keystore-Name"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "Quell-Keystore kennwortgesch\u00FCtzt"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "Quell-Keystore-Providername"}, //-srcprovidername
-        {"source.keystore.password",
-                "Quell-Keystore-Kennwort"}, //-srcstorepass
-        {"source.keystore.type",
-                "Quell-Keystore-Typ"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL-Serverhost und -port"}, //-sslserver
-        {"signed.jar.file",
-                "Signierte JAR-Datei"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "Anfangsdatum/-zeit f\u00FCr Zertifikatsg\u00FCltigkeit"}, //-startdate
-        {"keystore.password",
-                "Keystore-Kennwort"}, //-storepass
-        {"keystore.type",
-                "Keystore-Typ"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "Zertifikaten aus cacerts vertrauen"}, //-trustcacerts
-        {"verbose.output",
-                "Verbose-Ausgabe"}, //-v
-        {"validity.number.of.days",
-                "G\u00FCltigkeitsdauer (Tage)"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "Serielle ID des zu entziehenden Certs"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "Keytool-Fehler: "},
-        {"Illegal.option.", "Ung\u00FCltige Option:  "},
-        {"Illegal.value.", "Ung\u00FCltiger Wert: "},
-        {"Unknown.password.type.", "Unbekannter Kennworttyp: "},
-        {"Cannot.find.environment.variable.",
-                "Umgebungsvariable kann nicht gefunden werden: "},
-        {"Cannot.find.file.", "Datei kann nicht gefunden werden: "},
-        {"Command.option.flag.needs.an.argument.", "Befehlsoption {0} ben\u00F6tigt ein Argument."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Warnung: Keine Unterst\u00FCtzung f\u00FCr unterschiedliche Speicher- und Schl\u00FCsselkennw\u00F6rter bei PKCS12 KeyStores. Der benutzerdefinierte Wert {0} wird ignoriert."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore muss NONE sein, wenn -storetype {0} ist"},
-        {"Too.many.retries.program.terminated",
-                 "Zu viele erneute Versuche. Programm wird beendet"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "Befehle -storepasswd und -keypasswd werden nicht unterst\u00FCtzt, wenn -storetype {0} ist"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "Befehle des Typs -keypasswd werden nicht unterst\u00FCtzt, wenn -storetype PKCS12 ist"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-keypass und -new k\u00F6nnen nicht angegeben werden, wenn -storetype {0} ist"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "Wenn -protected angegeben ist, d\u00FCrfen -storepass, -keypass und -new nicht angegeben werden"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Wenn -srcprotected angegeben ist, d\u00FCrfen -srcstorepass und -srckeypass nicht angegeben werden"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "Wenn der Keystore nicht kennwortgesch\u00FCtzt ist, d\u00FCrfen -storepass, -keypass und -new nicht angegeben werden"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Wenn der Quell-Keystore nicht kennwortgesch\u00FCtzt ist, d\u00FCrfen -srcstorepass und -srckeypass nicht angegeben werden"},
-        {"Illegal.startdate.value", "Ung\u00FCltiger Wert f\u00FCr Anfangsdatum"},
-        {"Validity.must.be.greater.than.zero",
-                "G\u00FCltigkeit muss gr\u00F6\u00DFer als null sein"},
-        {"provName.not.a.provider", "{0} kein Provider"},
-        {"Usage.error.no.command.provided", "Verwendungsfehler: Kein Befehl angegeben"},
-        {"Source.keystore.file.exists.but.is.empty.", "Quell-Keystore-Datei ist zwar vorhanden, ist aber leer: "},
-        {"Please.specify.srckeystore", "Geben Sie -srckeystore an"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "-v und -rfc d\u00FCrfen bei Befehl \"list\" nicht beide angegeben werden"},
-        {"Key.password.must.be.at.least.6.characters",
-                "Schl\u00FCsselkennwort muss mindestens sechs Zeichen lang sein"},
-        {"New.password.must.be.at.least.6.characters",
-                "Neues Kennwort muss mindestens sechs Zeichen lang sein"},
-        {"Keystore.file.exists.but.is.empty.",
-                "Keystore-Datei ist vorhanden, ist aber leer: "},
-        {"Keystore.file.does.not.exist.",
-                "Keystore-Datei ist nicht vorhanden: "},
-        {"Must.specify.destination.alias", "Sie m\u00FCssen einen Zielalias angeben"},
-        {"Must.specify.alias", "Sie m\u00FCssen einen Alias angeben"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "Keystore-Kennwort muss mindestens sechs Zeichen lang sein"},
-        {"Enter.keystore.password.", "Keystore-Kennwort eingeben:  "},
-        {"Enter.source.keystore.password.", "Quell-Keystore-Kennwort eingeben:  "},
-        {"Enter.destination.keystore.password.", "Ziel-Keystore-Kennwort eingeben:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "Keystore-Kennwort ist zu kurz. Es muss mindestens sechs Zeichen lang sein"},
-        {"Unknown.Entry.Type", "Unbekannter Eintragstyp"},
-        {"Too.many.failures.Alias.not.changed", "Zu viele Fehler. Alias nicht ge\u00E4ndert"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "Eintrag f\u00FCr Alias {0} erfolgreich importiert."},
-        {"Entry.for.alias.alias.not.imported.", "Eintrag f\u00FCr Alias {0} nicht importiert."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Problem beim Importieren des Eintrags f\u00FCr Alias {0}: {1}.\nEintrag f\u00FCr Alias {0} nicht importiert."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Importbefehl abgeschlossen: {0} Eintr\u00E4ge erfolgreich importiert, {1} Eintr\u00E4ge nicht erfolgreich oder abgebrochen"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Warnung: Vorhandener Alias {0} in Ziel-Keystore wird \u00FCberschrieben"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "Eintragsalias {0} ist bereits vorhanden. \u00DCberschreiben? [Nein]:  "},
-        {"Too.many.failures.try.later", "Zu viele Fehler. Versuchen Sie es sp\u00E4ter erneut"},
-        {"Certification.request.stored.in.file.filename.",
-                "Zertifizierungsanforderung in Datei <{0}> gespeichert"},
-        {"Submit.this.to.your.CA", "Leiten Sie dies an die CA weiter"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "Wenn kein Alias angegeben ist, d\u00FCrfen destalias, srckeypass und destkeypass nicht angegeben werden"},
-        {"Certificate.stored.in.file.filename.",
-                "Zertifikat in Datei <{0}> gespeichert"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "Zertifikatantwort wurde in Keystore installiert"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "Zertifikatantwort wurde nicht in Keystore installiert"},
-        {"Certificate.was.added.to.keystore",
-                "Zertifikat wurde Keystore hinzugef\u00FCgt"},
-        {"Certificate.was.not.added.to.keystore",
-                "Zertifikat wurde nicht zu Keystore hinzugef\u00FCgt"},
-        {".Storing.ksfname.", "[{0} wird gesichert]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} hat keinen Public Key (Zertifikat)"},
-        {"Cannot.derive.signature.algorithm",
-                "Signaturalgorithmus kann nicht abgeleitet werden"},
-        {"Alias.alias.does.not.exist",
-                "Alias <{0}> ist nicht vorhanden"},
-        {"Alias.alias.has.no.certificate",
-                "Alias <{0}> hat kein Zertifikat"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "Schl\u00FCsselpaar wurde nicht generiert. Alias <{0}> ist bereits vorhanden"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "Generieren von Schl\u00FCsselpaar (Typ {1}, {0} Bit) und selbst signiertem Zertifikat ({2}) mit einer G\u00FCltigkeit von {3} Tagen\n\tf\u00FCr: {4}"},
-        {"Enter.key.password.for.alias.", "Schl\u00FCsselkennwort f\u00FCr <{0}> eingeben"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(RETURN, wenn identisch mit Keystore-Kennwort):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "Schl\u00FCsselkennwort ist zu kurz. Es muss mindestens sechs Zeichen lang sein"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "Zu viele Fehler. Schl\u00FCssel wurde nicht zu Keystore hinzugef\u00FCgt"},
-        {"Destination.alias.dest.already.exists",
-                "Zielalias <{0}> bereits vorhanden"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "Kennwort ist zu kurz. Es muss mindestens sechs Zeichen lang sein"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "Zu viele Fehler. Schl\u00FCsseleintrag wurde nicht geclont"},
-        {"key.password.for.alias.", "Schl\u00FCsselkennwort f\u00FCr <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "Keystore-Eintrag f\u00FCr <{0}> bereits vorhanden"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Keystore-Eintrag f\u00FCr <{0}> wird erstellt..."},
-        {"No.entries.from.identity.database.added",
-                "Keine Eintr\u00E4ge aus Identity-Datenbank hinzugef\u00FCgt"},
-        {"Alias.name.alias", "Aliasname: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Erstellungsdatum: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Eintragstyp: {0}"},
-        {"Certificate.chain.length.", "Zertifikatkettenl\u00E4nge: "},
-        {"Certificate.i.1.", "Zertifikat[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Zertifikat-Fingerprint (SHA1): "},
-        {"Keystore.type.", "Keystore-Typ: "},
-        {"Keystore.provider.", "Keystore-Provider: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Keystore enth\u00E4lt {0,number,integer} Eintrag"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Keystore enth\u00E4lt {0,number,integer} Eintr\u00E4ge"},
-        {"Failed.to.parse.input", "Eingabe konnte nicht geparst werden"},
-        {"Empty.input", "Leere Eingabe"},
-        {"Not.X.509.certificate", "Kein X.509-Zertifikat"},
-        {"alias.has.no.public.key", "{0} hat keinen Public Key"},
-        {"alias.has.no.X.509.certificate", "{0} hat kein X.509-Zertifikat"},
-        {"New.certificate.self.signed.", "Neues Zertifikat (selbst signiert):"},
-        {"Reply.has.no.certificates", "Antwort hat keine Zertifikate"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Zertifikat nicht importiert. Alias <{0}> ist bereits vorhanden"},
-        {"Input.not.an.X.509.certificate", "Eingabe kein X.509-Zertifikat"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "Zertifikat ist bereits unter Alias <{0}> im Keystore vorhanden"},
-        {"Do.you.still.want.to.add.it.no.",
-                "M\u00F6chten Sie es trotzdem hinzuf\u00FCgen? [Nein]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "Zertifikat ist bereits unter Alias <{0}> im systemweiten CA-Keystore vorhanden"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "M\u00F6chten Sie es trotzdem zu Ihrem eigenen Keystore hinzuf\u00FCgen? [Nein]:  "},
-        {"Trust.this.certificate.no.", "Diesem Zertifikat vertrauen? [Nein]:  "},
-        {"YES", "Ja"},
-        {"New.prompt.", "Neues {0}: "},
-        {"Passwords.must.differ", "Kennw\u00F6rter m\u00FCssen sich unterscheiden"},
-        {"Re.enter.new.prompt.", "Neues {0} erneut eingeben: "},
-        {"Re.enter.new.password.", "Neues Kennwort erneut eingeben: "},
-        {"They.don.t.match.Try.again", "Keine \u00DCbereinstimmung. Wiederholen Sie den Vorgang"},
-        {"Enter.prompt.alias.name.", "{0}-Aliasnamen eingeben:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Geben Sie einen neuen Aliasnamen ein\t(RETURN, um den Import dieses Eintrags abzubrechen):  "},
-        {"Enter.alias.name.", "Aliasnamen eingeben:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(RETURN, wenn identisch mit <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "Eigent\u00FCmer: {0}\nAussteller: {1}\nSeriennummer: {2}\nG\u00FCltig von: {3} bis: {4}\nZertifikat-Fingerprints:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Signaturalgorithmusname: {8}\n\t Version: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "Wie lautet Ihr Vor- und Nachname?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "Wie lautet der Name Ihrer organisatorischen Einheit?"},
-        {"What.is.the.name.of.your.organization.",
-                "Wie lautet der Name Ihrer Organisation?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "Wie lautet der Name Ihrer Stadt oder Gemeinde?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "Wie lautet der Name Ihres Bundeslands?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "Wie lautet der L\u00E4ndercode (zwei Buchstaben) f\u00FCr diese Einheit?"},
-        {"Is.name.correct.", "Ist {0} richtig?"},
-        {"no", "Nein"},
-        {"yes", "Ja"},
-        {"y", "J"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "Alias <{0}> verf\u00FCgt \u00FCber keinen Schl\u00FCssel"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "Alias <{0}> verweist auf einen Eintragstyp, der kein Private Key-Eintrag ist. Der Befehl -keyclone unterst\u00FCtzt nur das Clonen von Private Key-Eintr\u00E4gen"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  Warnung Warnung Warnung  *****************"},
-        {"Signer.d.", "Signaturgeber #%d:"},
-        {"Timestamp.", "Zeitstempel:"},
-        {"Signature.", "Signatur:"},
-        {"CRLs.", "CRLs:"},
-        {"Certificate.owner.", "Zertifikateigent\u00FCmer: "},
-        {"Not.a.signed.jar.file", "Keine signierte JAR-Datei"},
-        {"No.certificate.from.the.SSL.server",
-                "Kein Zertifikat vom SSL-Server"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* Die Integrit\u00E4t der Informationen, die in Ihrem Keystore gespeichert sind, *\n* wurde NICHT gepr\u00FCft. Um die Integrit\u00E4t zu pr\u00FCfen, *\n* m\u00FCssen Sie Ihr Keystore-Kennwort angeben.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* Die Integrit\u00E4t der Informationen, die in Ihrem Srckeystore gespeichert sind, *\n* wurde NICHT gepr\u00FCft. Um die Integrit\u00E4t zu pr\u00FCfen, *\n* m\u00FCssen Sie Ihr Srckeystore-Kennwort angeben.                  *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "Zertifikatantwort enth\u00E4lt keinen Public Key f\u00FCr <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Unvollst\u00E4ndige Zertifikatkette in Antwort"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "Zertifikatkette in Antwort verifiziert nicht: "},
-        {"Top.level.certificate.in.reply.",
-                "Zertifikat der obersten Ebene in Antwort:\n"},
-        {".is.not.trusted.", "... ist nicht vertrauensw\u00FCrdig. "},
-        {"Install.reply.anyway.no.", "Antwort trotzdem installieren? [Nein]:  "},
-        {"NO", "Nein"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "Public Keys in Antwort und Keystore stimmen nicht \u00FCberein"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "Zertifikatantwort und Zertifikat in Keystore sind identisch"},
-        {"Failed.to.establish.chain.from.reply",
-                "Kette konnte der Antwort nicht entnommen werden"},
-        {"n", "N"},
-        {"Wrong.answer.try.again", "Falsche Antwort. Wiederholen Sie den Vorgang"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "Secret Key wurde nicht generiert. Alias <{0}> ist bereits vorhanden"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Geben Sie -keysize zum Erstellen eines Secret Keys an"},
-
-        {"Extensions.", "Erweiterungen: "},
-        {".Empty.value.", "(Leerer Wert)"},
-        {"Extension.Request.", "Erweiterungsanforderung:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10-Zertifikatanforderung (Version 1.0)\nSubjekt: %s\nPublic Key: %s Format %s Schl\u00FCssel\n"},
-        {"Unknown.keyUsage.type.", "Unbekannter keyUsage-Typ: "},
-        {"Unknown.extendedkeyUsage.type.", "Unbekannter extendedkeyUsage-Typ: "},
-        {"Unknown.AccessDescription.type.", "Unbekannter AccessDescription-Typ: "},
-        {"Unrecognized.GeneralName.type.", "Unbekannter GeneralName-Typ: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "Erweiterung kann nicht als \"Kritisch\" markiert werden. "},
-        {"Odd.number.of.hex.digits.found.", "Ungerade Anzahl hexadezimaler Ziffern gefunden: "},
-        {"Unknown.extension.type.", "Unbekannter Erweiterungstyp: "},
-        {"command.{0}.is.ambiguous.", "Befehl {0} ist mehrdeutig:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Warnung: Kein Public Key f\u00FCr Alias {0} vorhanden. Vergewissern Sie sich, dass der KeyStore ordnungsgem\u00E4\u00DF konfiguriert ist."},
-        {"Warning.Class.not.found.class", "Warnung: Klasse nicht gefunden: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Warnung: Ung\u00FCltige(s) Argument(e) f\u00FCr Constructor: {0}"},
-        {"Illegal.Principal.Type.type", "Ung\u00FCltiger Principal-Typ: {0}"},
-        {"Illegal.option.option", "Ung\u00FCltige Option: {0}"},
-        {"Usage.policytool.options.", "Verwendung: policytool [Optionen]"},
-        {".file.file.policy.file.location",
-                " [-file <Datei>]    Policy-Dateiverzeichnis"},
-        {"New", "Neu"},
-        {"Open", "\u00D6ffnen"},
-        {"Save", "Speichern"},
-        {"Save.As", "Speichern unter"},
-        {"View.Warning.Log", "Warnungslog anzeigen"},
-        {"Exit", "Beenden"},
-        {"Add.Policy.Entry", "Policy-Eintrag hinzuf\u00FCgen"},
-        {"Edit.Policy.Entry", "Policy-Eintrag bearbeiten"},
-        {"Remove.Policy.Entry", "Policy-Eintrag entfernen"},
-        {"Edit", "Bearbeiten"},
-        {"Retain", "Beibehalten"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Warnung: M\u00F6glicherweise enth\u00E4lt der Dateiname Escape-Zeichen mit Backslash. Es ist nicht notwendig, Backslash-Zeichen zu escapen (das Tool f\u00FChrt dies automatisch beim Schreiben des Policy-Contents in den persistenten Speicher aus).\n\nKlicken Sie auf \"Beibehalten\", um den eingegebenen Namen beizubehalten oder auf \"Bearbeiten\", um den Namen zu bearbeiten."},
-
-        {"Add.Public.Key.Alias", "Public Key-Alias hinzuf\u00FCgen"},
-        {"Remove.Public.Key.Alias", "Public Key-Alias entfernen"},
-        {"File", "Datei"},
-        {"KeyStore", "KeyStore"},
-        {"Policy.File.", "Policy-Datei:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Policy-Datei konnte nicht ge\u00F6ffnet werden: {0}: {1}"},
-        {"Policy.Tool", "Policy-Tool"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Beim \u00D6ffnen der Policy-Konfiguration sind Fehler aufgetreten. Weitere Informationen finden Sie im Warnungslog."},
-        {"Error", "Fehler"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Warnung"},
-        {"Permission.",
-                "Berechtigung:                                                       "},
-        {"Principal.Type.", "Principal-Typ:"},
-        {"Principal.Name.", "Principal-Name:"},
-        {"Target.Name.",
-                "Zielname:                                                    "},
-        {"Actions.",
-                "Aktionen:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Vorhandene Datei {0} \u00FCberschreiben?"},
-        {"Cancel", "Abbrechen"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Principal hinzuf\u00FCgen"},
-        {"Edit.Principal", "Principal bearbeiten"},
-        {"Remove.Principal", "Principal entfernen"},
-        {"Principals.", "Principals:"},
-        {".Add.Permission", "  Berechtigung hinzuf\u00FCgen"},
-        {".Edit.Permission", "  Berechtigung bearbeiten"},
-        {"Remove.Permission", "Berechtigung entfernen"},
-        {"Done", "Fertig"},
-        {"KeyStore.URL.", "KeyStore-URL:"},
-        {"KeyStore.Type.", "KeyStore-Typ:"},
-        {"KeyStore.Provider.", "KeyStore-Provider:"},
-        {"KeyStore.Password.URL.", "KeyStore-Kennwort-URL:"},
-        {"Principals", "Principals"},
-        {".Edit.Principal.", "  Principal bearbeiten:"},
-        {".Add.New.Principal.", "  Neuen Principal hinzuf\u00FCgen:"},
-        {"Permissions", "Berechtigungen"},
-        {".Edit.Permission.", "  Berechtigung bearbeiten:"},
-        {".Add.New.Permission.", "  Neue Berechtigung hinzuf\u00FCgen:"},
-        {"Signed.By.", "Signiert von:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Principal kann nicht mit einer Platzhalterklasse ohne Platzhalternamen angegeben werden"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Principal kann nicht ohne einen Namen angegeben werden"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Berechtigung und Zielname m\u00FCssen einen Wert haben"},
-        {"Remove.this.Policy.Entry.", "Diesen Policy-Eintrag entfernen?"},
-        {"Overwrite.File", "Datei \u00FCberschreiben"},
-        {"Policy.successfully.written.to.filename",
-                "Policy erfolgreich in {0} geschrieben"},
-        {"null.filename", "Null-Dateiname"},
-        {"Save.changes.", "\u00C4nderungen speichern?"},
-        {"Yes", "Ja"},
-        {"No", "Nein"},
-        {"Policy.Entry", "Policy-Eintrag"},
-        {"Save.Changes", "\u00C4nderungen speichern"},
-        {"No.Policy.Entry.selected", "Kein Policy-Eintrag ausgew\u00E4hlt"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "KeyStore kann nicht ge\u00F6ffnet werden: {0}"},
-        {"No.principal.selected", "Kein Principal ausgew\u00E4hlt"},
-        {"No.permission.selected", "Keine Berechtigung ausgew\u00E4hlt"},
-        {"name", "Name"},
-        {"configuration.type", "Konfigurationstyp"},
-        {"environment.variable.name", "Umgebungsvariablenname"},
-        {"library.name", "Library-Name"},
-        {"package.name", "Packagename"},
-        {"policy.type", "Policy-Typ"},
-        {"property.name", "Eigenschaftsname"},
-        {"Principal.List", "Principal-Liste"},
-        {"Permission.List", "Berechtigungsliste"},
-        {"Code.Base", "Codebase"},
-        {"KeyStore.U.R.L.", "KeyStore-URL:"},
-        {"KeyStore.Password.U.R.L.", "KeyStore-Kennwort-URL:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "Ung\u00FCltige Nulleingabe(n)"},
         {"actions.can.only.be.read.", "Aktionen k\u00F6nnen nur \"lesen\" sein"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "Null-OID-Zuordnung angegeben"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "Ung\u00FCltiger Nullwert f\u00FCr AccessControlContext angegeben"},
         {"invalid.null.action.provided", "Ung\u00FCltige Nullaktion angegeben"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_es.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_es.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [Opci\u00F3n]..."},
-        {"Options.", "Opciones:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "Utilice\"keytool -help\" para todos los comandos disponibles"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Herramienta de Gesti\u00F3n de Certificados y Claves"},
-        {"Commands.", "Comandos:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "Utilice \"keytool -command_name -help\" para la sintaxis de nombre_comando"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "Genera una solicitud de certificado"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "Cambia un alias de entrada"}, //-changealias
-        {"Deletes.an.entry",
-                "Suprime una entrada"}, //-delete
-        {"Exports.certificate",
-                "Exporta el certificado"}, //-exportcert
-        {"Generates.a.key.pair",
-                "Genera un par de claves"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "Genera un clave secreta"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "Genera un certificado a partir de una solicitud de certificado"}, //-gencert
-        {"Generates.CRL", "Genera CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Importa entradas desde una base de datos de identidades JDK 1.1.x-style"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Importa un certificado o una cadena de certificados"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Importa una o todas las entradas desde otro almac\u00E9n de claves"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Clona una entrada de clave"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "Cambia la contrase\u00F1a de clave de una entrada"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "Enumera las entradas de un almac\u00E9n de claves"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Imprime el contenido de un certificado"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Imprime el contenido de una solicitud de certificado"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Imprime el contenido de un archivo CRL"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "Genera un certificado autofirmado"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "Cambia la contrase\u00F1a de almac\u00E9n de un almac\u00E9n de claves"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "nombre de alias de la entrada que se va a procesar"}, //-alias
-        {"destination.alias",
-                "alias de destino"}, //-destalias
-        {"destination.key.password",
-                "contrase\u00F1a de clave de destino"}, //-destkeypass
-        {"destination.keystore.name",
-                "nombre de almac\u00E9n de claves de destino"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "almac\u00E9n de claves de destino protegido por contrase\u00F1a"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "nombre de proveedor de almac\u00E9n de claves de destino"}, //-destprovidername
-        {"destination.keystore.password",
-                "contrase\u00F1a de almac\u00E9n de claves de destino"}, //-deststorepass
-        {"destination.keystore.type",
-                "tipo de almac\u00E9n de claves de destino"}, //-deststoretype
-        {"distinguished.name",
-                "nombre distintivo"}, //-dname
-        {"X.509.extension",
-                "extensi\u00F3n X.509"}, //-ext
-        {"output.file.name",
-                "nombre de archivo de salida"}, //-file and -outfile
-        {"input.file.name",
-                "nombre de archivo de entrada"}, //-file and -infile
-        {"key.algorithm.name",
-                "nombre de algoritmo de clave"}, //-keyalg
-        {"key.password",
-                "contrase\u00F1a de clave"}, //-keypass
-        {"key.bit.size",
-                "tama\u00F1o de bit de clave"}, //-keysize
-        {"keystore.name",
-                "nombre de almac\u00E9n de claves"}, //-keystore
-        {"new.password",
-                "nueva contrase\u00F1a"}, //-new
-        {"do.not.prompt",
-                "no solicitar"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "contrase\u00F1a a trav\u00E9s de mecanismo protegido"}, //-protected
-        {"provider.argument",
-                "argumento del proveedor"}, //-providerarg
-        {"provider.class.name",
-                "nombre de clase del proveedor"}, //-providerclass
-        {"provider.name",
-                "nombre del proveedor"}, //-providername
-        {"provider.classpath",
-                "classpath de proveedor"}, //-providerpath
-        {"output.in.RFC.style",
-                "salida en estilo RFC"}, //-rfc
-        {"signature.algorithm.name",
-                "nombre de algoritmo de firma"}, //-sigalg
-        {"source.alias",
-                "alias de origen"}, //-srcalias
-        {"source.key.password",
-                "contrase\u00F1a de clave de origen"}, //-srckeypass
-        {"source.keystore.name",
-                "nombre de almac\u00E9n de claves de origen"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "almac\u00E9n de claves de origen protegido por contrase\u00F1a"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "nombre de proveedor de almac\u00E9n de claves de origen"}, //-srcprovidername
-        {"source.keystore.password",
-                "contrase\u00F1a de almac\u00E9n de claves de origen"}, //-srcstorepass
-        {"source.keystore.type",
-                "tipo de almac\u00E9n de claves de origen"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "puerto y host del servidor SSL"}, //-sslserver
-        {"signed.jar.file",
-                "archivo jar firmado"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "fecha/hora de inicio de validez del certificado"}, //-startdate
-        {"keystore.password",
-                "contrase\u00F1a de almac\u00E9n de claves"}, //-storepass
-        {"keystore.type",
-                "tipo de almac\u00E9n de claves"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "certificados de protecci\u00F3n de cacerts"}, //-trustcacerts
-        {"verbose.output",
-                "salida detallada"}, //-v
-        {"validity.number.of.days",
-                "n\u00FAmero de validez de d\u00EDas"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "identificador de serie del certificado que se va a revocar"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "error de herramienta de claves: "},
-        {"Illegal.option.", "Opci\u00F3n no permitida:  "},
-        {"Illegal.value.", "Valor no permitido: "},
-        {"Unknown.password.type.", "Tipo de contrase\u00F1a desconocido: "},
-        {"Cannot.find.environment.variable.",
-                "No se ha encontrado la variable del entorno: "},
-        {"Cannot.find.file.", "No se ha encontrado el archivo: "},
-        {"Command.option.flag.needs.an.argument.", "La opci\u00F3n de comando {0} necesita un argumento."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Advertencia: los almacenes de claves en formato PKCS12 no admiten contrase\u00F1as de clave y almacenamiento distintas. Se ignorar\u00E1 el valor especificado por el usuario, {0}."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore debe ser NONE si -storetype es {0}"},
-        {"Too.many.retries.program.terminated",
-                 "Ha habido demasiados intentos, se ha cerrado el programa"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "Los comandos -storepasswd y -keypasswd no est\u00E1n soportados si -storetype es {0}"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "Los comandos -keypasswd no est\u00E1n soportados si -storetype es PKCS12"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-keypass y -new no se pueden especificar si -storetype es {0}"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "si se especifica -protected, no deben especificarse -storepass, -keypass ni -new"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Si se especifica -srcprotected, no se puede especificar -srcstorepass ni -srckeypass"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "Si keystore no est\u00E1 protegido por contrase\u00F1a, no se deben especificar -storepass, -keypass ni -new"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Si el almac\u00E9n de claves de origen no est\u00E1 protegido por contrase\u00F1a, no se deben especificar -srcstorepass ni -srckeypass"},
-        {"Illegal.startdate.value", "Valor de fecha de inicio no permitido"},
-        {"Validity.must.be.greater.than.zero",
-                "La validez debe ser mayor que cero"},
-        {"provName.not.a.provider", "{0} no es un proveedor"},
-        {"Usage.error.no.command.provided", "Error de sintaxis: no se ha proporcionado ning\u00FAn comando"},
-        {"Source.keystore.file.exists.but.is.empty.", "El archivo de almac\u00E9n de claves de origen existe, pero est\u00E1 vac\u00EDo: "},
-        {"Please.specify.srckeystore", "Especifique -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "No se deben especificar -v y -rfc simult\u00E1neamente con el comando 'list'"},
-        {"Key.password.must.be.at.least.6.characters",
-                "La contrase\u00F1a de clave debe tener al menos 6 caracteres"},
-        {"New.password.must.be.at.least.6.characters",
-                "La nueva contrase\u00F1a debe tener al menos 6 caracteres"},
-        {"Keystore.file.exists.but.is.empty.",
-                "El archivo de almac\u00E9n de claves existe, pero est\u00E1 vac\u00EDo: "},
-        {"Keystore.file.does.not.exist.",
-                "El archivo de almac\u00E9n de claves no existe: "},
-        {"Must.specify.destination.alias", "Se debe especificar un alias de destino"},
-        {"Must.specify.alias", "Se debe especificar un alias"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "La contrase\u00F1a del almac\u00E9n de claves debe tener al menos 6 caracteres"},
-        {"Enter.keystore.password.", "Introduzca la contrase\u00F1a del almac\u00E9n de claves:  "},
-        {"Enter.source.keystore.password.", "Introduzca la contrase\u00F1a de almac\u00E9n de claves de origen:  "},
-        {"Enter.destination.keystore.password.", "Introduzca la contrase\u00F1a de almac\u00E9n de claves de destino:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "La contrase\u00F1a del almac\u00E9n de claves es demasiado corta, debe tener al menos 6 caracteres"},
-        {"Unknown.Entry.Type", "Tipo de Entrada Desconocido"},
-        {"Too.many.failures.Alias.not.changed", "Demasiados fallos. No se ha cambiado el alias"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "La entrada del alias {0} se ha importado correctamente."},
-        {"Entry.for.alias.alias.not.imported.", "La entrada del alias {0} no se ha importado."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Problema al importar la entrada del alias {0}: {1}.\nNo se ha importado la entrada del alias {0}."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Comando de importaci\u00F3n completado: {0} entradas importadas correctamente, {1} entradas incorrectas o canceladas"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Advertencia: se sobrescribir\u00E1 el alias {0} en el almac\u00E9n de claves de destino"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "El alias de entrada existente {0} ya existe, \u00BFdesea sobrescribirlo? [no]:  "},
-        {"Too.many.failures.try.later", "Demasiados fallos; int\u00E9ntelo m\u00E1s adelante"},
-        {"Certification.request.stored.in.file.filename.",
-                "Solicitud de certificaci\u00F3n almacenada en el archivo <{0}>"},
-        {"Submit.this.to.your.CA", "Enviar a la CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "si no se especifica el alias, no se puede especificar destalias, srckeypass ni destkeypass"},
-        {"Certificate.stored.in.file.filename.",
-                "Certificado almacenado en el archivo <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "Se ha instalado la respuesta del certificado en el almac\u00E9n de claves"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "No se ha instalado la respuesta del certificado en el almac\u00E9n de claves"},
-        {"Certificate.was.added.to.keystore",
-                "Se ha agregado el certificado al almac\u00E9n de claves"},
-        {"Certificate.was.not.added.to.keystore",
-                "No se ha agregado el certificado al almac\u00E9n de claves"},
-        {".Storing.ksfname.", "[Almacenando {0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} no tiene clave p\u00FAblica (certificado)"},
-        {"Cannot.derive.signature.algorithm",
-                "No se puede derivar el algoritmo de firma"},
-        {"Alias.alias.does.not.exist",
-                "El alias <{0}> no existe"},
-        {"Alias.alias.has.no.certificate",
-                "El alias <{0}> no tiene certificado"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "No se ha generado el par de claves, el alias <{0}> ya existe"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "Generando par de claves {1} de {0} bits para certificado autofirmado ({2}) con una validez de {3} d\u00EDas\n\tpara: {4}"},
-        {"Enter.key.password.for.alias.", "Introduzca la contrase\u00F1a de clave para <{0}>"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(INTRO si es la misma contrase\u00F1a que la del almac\u00E9n de claves):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "La contrase\u00F1a de clave es demasiado corta; debe tener al menos 6 caracteres"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "Demasiados fallos; no se ha agregado la clave al almac\u00E9n de claves"},
-        {"Destination.alias.dest.already.exists",
-                "El alias de destino <{0}> ya existe"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "La contrase\u00F1a es demasiado corta; debe tener al menos 6 caracteres"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "Demasiados fallos. No se ha clonado la entrada de clave"},
-        {"key.password.for.alias.", "contrase\u00F1a de clave para <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "La entrada de almac\u00E9n de claves para <{0}> ya existe"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Creando entrada de almac\u00E9n de claves para <{0}> ..."},
-        {"No.entries.from.identity.database.added",
-                "No se han agregado entradas de la base de datos de identidades"},
-        {"Alias.name.alias", "Nombre de Alias: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Fecha de Creaci\u00F3n: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Tipo de Entrada: {0}"},
-        {"Certificate.chain.length.", "Longitud de la Cadena de Certificado: "},
-        {"Certificate.i.1.", "Certificado[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Huella Digital de Certificado (SHA1): "},
-        {"Keystore.type.", "Tipo de Almac\u00E9n de Claves: "},
-        {"Keystore.provider.", "Proveedor de Almac\u00E9n de Claves: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Su almac\u00E9n de claves contiene {0,number,integer} entrada"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Su almac\u00E9n de claves contiene {0,number,integer} entradas"},
-        {"Failed.to.parse.input", "Fallo al analizar la entrada"},
-        {"Empty.input", "Entrada vac\u00EDa"},
-        {"Not.X.509.certificate", "No es un certificado X.509"},
-        {"alias.has.no.public.key", "{0} no tiene clave p\u00FAblica"},
-        {"alias.has.no.X.509.certificate", "{0} no tiene certificado X.509"},
-        {"New.certificate.self.signed.", "Nuevo Certificado (Autofirmado):"},
-        {"Reply.has.no.certificates", "La respuesta no tiene certificados"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Certificado no importado, el alias <{0}> ya existe"},
-        {"Input.not.an.X.509.certificate", "La entrada no es un certificado X.509"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "El certificado ya existe en el almac\u00E9n de claves con el alias <{0}>"},
-        {"Do.you.still.want.to.add.it.no.",
-                "\u00BFA\u00FAn desea agregarlo? [no]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "El certificado ya existe en el almac\u00E9n de claves de la CA del sistema, con el alias <{0}>"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "\u00BFA\u00FAn desea agregarlo a su propio almac\u00E9n de claves? [no]:  "},
-        {"Trust.this.certificate.no.", "\u00BFConfiar en este certificado? [no]:  "},
-        {"YES", "S\u00ED"},
-        {"New.prompt.", "Nuevo {0}: "},
-        {"Passwords.must.differ", "Las contrase\u00F1as deben ser distintas"},
-        {"Re.enter.new.prompt.", "Vuelva a escribir el nuevo {0}: "},
-        {"Re.enter.new.password.", "Volver a escribir la contrase\u00F1a nueva: "},
-        {"They.don.t.match.Try.again", "No coinciden. Int\u00E9ntelo de nuevo"},
-        {"Enter.prompt.alias.name.", "Escriba el nombre de alias de {0}:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Indique el nuevo nombre de alias\t(INTRO para cancelar la importaci\u00F3n de esta entrada):  "},
-        {"Enter.alias.name.", "Introduzca el nombre de alias:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(INTRO si es el mismo que para <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "Propietario: {0}\nEmisor: {1}\nN\u00FAmero de serie: {2}\nV\u00E1lido desde: {3} hasta: {4}\nHuellas digitales del Certificado:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Nombre del Algoritmo de Firma: {8}\n\t Versi\u00F3n: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "\u00BFCu\u00E1les son su nombre y su apellido?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "\u00BFCu\u00E1l es el nombre de su unidad de organizaci\u00F3n?"},
-        {"What.is.the.name.of.your.organization.",
-                "\u00BFCu\u00E1l es el nombre de su organizaci\u00F3n?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "\u00BFCu\u00E1l es el nombre de su ciudad o localidad?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "\u00BFCu\u00E1l es el nombre de su estado o provincia?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "\u00BFCu\u00E1l es el c\u00F3digo de pa\u00EDs de dos letras de la unidad?"},
-        {"Is.name.correct.", "\u00BFEs correcto {0}?"},
-        {"no", "no"},
-        {"yes", "s\u00ED"},
-        {"y", "s"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "El alias <{0}> no tiene clave"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "El alias <{0}> hace referencia a un tipo de entrada que no es una clave privada. El comando -keyclone s\u00F3lo permite la clonaci\u00F3n de entradas de claves privadas"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  Advertencia Advertencia Advertencia  *****************"},
-        {"Signer.d.", "#%d de Firmante:"},
-        {"Timestamp.", "Registro de Hora:"},
-        {"Signature.", "Firma:"},
-        {"CRLs.", "CRL:"},
-        {"Certificate.owner.", "Propietario del Certificado: "},
-        {"Not.a.signed.jar.file", "No es un archivo jar firmado"},
-        {"No.certificate.from.the.SSL.server",
-                "Ning\u00FAn certificado del servidor SSL"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* La integridad de la informaci\u00F3n almacenada en el almac\u00E9n de claves  *\n* NO se ha comprobado.  Para comprobar dicha integridad, *\n* debe proporcionar la contrase\u00F1a del almac\u00E9n de claves.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* La integridad de la informaci\u00F3n almacenada en srckeystore*\n* NO se ha comprobado.  Para comprobar dicha integridad, *\n* debe proporcionar la contrase\u00F1a de srckeystore.                *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "La respuesta de certificado no contiene una clave p\u00FAblica para <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Cadena de certificado incompleta en la respuesta"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "La cadena de certificado de la respuesta no verifica: "},
-        {"Top.level.certificate.in.reply.",
-                "Certificado de nivel superior en la respuesta:\n"},
-        {".is.not.trusted.", "... no es de confianza. "},
-        {"Install.reply.anyway.no.", "\u00BFInstalar respuesta de todos modos? [no]:  "},
-        {"NO", "No"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "Las claves p\u00FAblicas en la respuesta y en el almac\u00E9n de claves no coinciden"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "La respuesta del certificado y el certificado en el almac\u00E9n de claves son id\u00E9nticos"},
-        {"Failed.to.establish.chain.from.reply",
-                "No se ha podido definir una cadena a partir de la respuesta"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "Respuesta incorrecta, vuelva a intentarlo"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "No se ha generado la clave secreta, el alias <{0}> ya existe"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Proporcione el valor de -keysize para la generaci\u00F3n de claves secretas"},
-
-        {"Extensions.", "Extensiones: "},
-        {".Empty.value.", "(Valor vac\u00EDo)"},
-        {"Extension.Request.", "Solicitud de Extensi\u00F3n:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "Solicitud de Certificado PKCS #10 (Versi\u00F3n 1.0)\nAsunto: %s\nClave P\u00FAblica: %s formato %s clave\n"},
-        {"Unknown.keyUsage.type.", "Tipo de uso de clave desconocido: "},
-        {"Unknown.extendedkeyUsage.type.", "Tipo de uso de clave extendida desconocido: "},
-        {"Unknown.AccessDescription.type.", "Tipo de descripci\u00F3n de acceso desconocido: "},
-        {"Unrecognized.GeneralName.type.", "Tipo de nombre general no reconocido: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "Esta extensi\u00F3n no se puede marcar como cr\u00EDtica. "},
-        {"Odd.number.of.hex.digits.found.", "Se ha encontrado un n\u00FAmero impar de d\u00EDgitos hexadecimales: "},
-        {"Unknown.extension.type.", "Tipo de extensi\u00F3n desconocida: "},
-        {"command.{0}.is.ambiguous.", "El comando {0} es ambiguo:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Advertencia: no hay clave p\u00FAblica para el alias {0}. Aseg\u00FArese de que se ha configurado correctamente un almac\u00E9n de claves."},
-        {"Warning.Class.not.found.class", "Advertencia: no se ha encontrado la clase: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Advertencia: argumento(s) no v\u00E1lido(s) para el constructor: {0}"},
-        {"Illegal.Principal.Type.type", "Tipo de principal no permitido: {0}"},
-        {"Illegal.option.option", "Opci\u00F3n no permitida: {0}"},
-        {"Usage.policytool.options.", "Sintaxis: policytool [opciones]"},
-        {".file.file.policy.file.location",
-                "  [-file <archivo>]    ubicaci\u00F3n del archivo de normas"},
-        {"New", "Nuevo"},
-        {"Open", "Abrir"},
-        {"Save", "Guardar"},
-        {"Save.As", "Guardar como"},
-        {"View.Warning.Log", "Ver Log de Advertencias"},
-        {"Exit", "Salir"},
-        {"Add.Policy.Entry", "Agregar Entrada de Pol\u00EDtica"},
-        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
-        {"Remove.Policy.Entry", "Eliminar Entrada de Pol\u00EDtica"},
-        {"Edit", "Editar"},
-        {"Retain", "Mantener"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Advertencia: el nombre del archivo puede contener caracteres de barra invertida de escape. No es necesario utilizar barras invertidas de escape (la herramienta aplica caracteres de escape seg\u00FAn sea necesario al escribir el contenido de las pol\u00EDticas en el almac\u00E9n persistente).\n\nHaga clic en Mantener para conservar el nombre introducido o en Editar para modificarlo."},
-
-        {"Add.Public.Key.Alias", "Agregar Alias de Clave P\u00FAblico"},
-        {"Remove.Public.Key.Alias", "Eliminar Alias de Clave P\u00FAblico"},
-        {"File", "Archivo"},
-        {"KeyStore", "Almac\u00E9n de Claves"},
-        {"Policy.File.", "Archivo de Pol\u00EDtica:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "No se ha podido abrir el archivo de pol\u00EDtica: {0}: {1}"},
-        {"Policy.Tool", "Herramienta de Pol\u00EDticas"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Ha habido errores al abrir la configuraci\u00F3n de pol\u00EDticas. V\u00E9ase el log de advertencias para obtener m\u00E1s informaci\u00F3n."},
-        {"Error", "Error"},
-        {"OK", "Aceptar"},
-        {"Status", "Estado"},
-        {"Warning", "Advertencia"},
-        {"Permission.",
-                "Permiso:                                                       "},
-        {"Principal.Type.", "Tipo de Principal:"},
-        {"Principal.Name.", "Nombre de Principal:"},
-        {"Target.Name.",
-                "Nombre de Destino:                                                    "},
-        {"Actions.",
-                "Acciones:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u00BFSobrescribir el archivo existente {0}?"},
-        {"Cancel", "Cancelar"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Agregar Principal"},
-        {"Edit.Principal", "Editar Principal"},
-        {"Remove.Principal", "Eliminar Principal"},
-        {"Principals.", "Principales:"},
-        {".Add.Permission", "  Agregar Permiso"},
-        {".Edit.Permission", "  Editar Permiso"},
-        {"Remove.Permission", "Eliminar Permiso"},
-        {"Done", "Listo"},
-        {"KeyStore.URL.", "URL de Almac\u00E9n de Claves:"},
-        {"KeyStore.Type.", "Tipo de Almac\u00E9n de Claves:"},
-        {"KeyStore.Provider.", "Proveedor de Almac\u00E9n de Claves:"},
-        {"KeyStore.Password.URL.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"},
-        {"Principals", "Principales"},
-        {".Edit.Principal.", "  Editar Principal:"},
-        {".Add.New.Principal.", "  Agregar Nuevo Principal:"},
-        {"Permissions", "Permisos"},
-        {".Edit.Permission.", "  Editar Permiso:"},
-        {".Add.New.Permission.", "  Agregar Permiso Nuevo:"},
-        {"Signed.By.", "Firmado Por:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "No se puede especificar un principal con una clase de comod\u00EDn sin un nombre de comod\u00EDn"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "No se puede especificar el principal sin un nombre"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Permiso y Nombre de Destino deben tener un valor"},
-        {"Remove.this.Policy.Entry.", "\u00BFEliminar esta entrada de pol\u00EDtica?"},
-        {"Overwrite.File", "Sobrescribir Archivo"},
-        {"Policy.successfully.written.to.filename",
-                "Pol\u00EDtica escrita correctamente en {0}"},
-        {"null.filename", "nombre de archivo nulo"},
-        {"Save.changes.", "\u00BFGuardar los cambios?"},
-        {"Yes", "S\u00ED"},
-        {"No", "No"},
-        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
-        {"Save.Changes", "Guardar Cambios"},
-        {"No.Policy.Entry.selected", "No se ha seleccionado la entrada de pol\u00EDtica"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "No se ha podido abrir el almac\u00E9n de claves: {0}"},
-        {"No.principal.selected", "No se ha seleccionado un principal"},
-        {"No.permission.selected", "No se ha seleccionado un permiso"},
-        {"name", "nombre"},
-        {"configuration.type", "tipo de configuraci\u00F3n"},
-        {"environment.variable.name", "nombre de variable de entorno"},
-        {"library.name", "nombre de la biblioteca"},
-        {"package.name", "nombre del paquete"},
-        {"policy.type", "tipo de pol\u00EDtica"},
-        {"property.name", "nombre de la propiedad"},
-        {"Principal.List", "Lista de Principales"},
-        {"Permission.List", "Lista de Permisos"},
-        {"Code.Base", "Base de C\u00F3digo"},
-        {"KeyStore.U.R.L.", "URL de Almac\u00E9n de Claves:"},
-        {"KeyStore.Password.U.R.L.", "URL de Contrase\u00F1a de Almac\u00E9n de Claves:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "entradas nulas no v\u00E1lidas"},
         {"actions.can.only.be.read.", "las acciones s\u00F3lo pueden 'leerse'"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "mapa de OID proporcionado nulo"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "se ha proporcionado un AccessControlContext nulo no v\u00E1lido"},
         {"invalid.null.action.provided", "se ha proporcionado una acci\u00F3n nula no v\u00E1lida"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_fr.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_fr.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [Option]..."},
-        {"Options.", "Options :"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "Utiliser \"keytool -help\" pour toutes les commandes disponibles"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Outil de gestion de certificats et de cl\u00E9s"},
-        {"Commands.", "Commandes :"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "Utiliser \"keytool -command_name -help\" pour la syntaxe de command_name"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "G\u00E9n\u00E8re une demande de certificat"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "Modifie l'alias d'une entr\u00E9e"}, //-changealias
-        {"Deletes.an.entry",
-                "Supprime une entr\u00E9e"}, //-delete
-        {"Exports.certificate",
-                "Exporte le certificat"}, //-exportcert
-        {"Generates.a.key.pair",
-                "G\u00E9n\u00E8re une paire de cl\u00E9s"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "G\u00E9n\u00E8re une cl\u00E9 secr\u00E8te"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "G\u00E9n\u00E8re le certificat \u00E0 partir d'une demande de certificat"}, //-gencert
-        {"Generates.CRL", "G\u00E9n\u00E8re la liste des certificats r\u00E9voqu\u00E9s (CRL)"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Importe les entr\u00E9es \u00E0 partir d'une base de donn\u00E9es d'identit\u00E9s de type JDK 1.1.x"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Importe un certificat ou une cha\u00EEne de certificat"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Importe une entr\u00E9e ou la totalit\u00E9 des entr\u00E9es depuis un autre fichier de cl\u00E9s"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Clone une entr\u00E9e de cl\u00E9"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "Modifie le mot de passe de cl\u00E9 d'une entr\u00E9e"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "R\u00E9pertorie les entr\u00E9es d'un fichier de cl\u00E9s"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Imprime le contenu d'un certificat"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Imprime le contenu d'une demande de certificat"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Imprime le contenu d'un fichier de liste des certificats r\u00E9voqu\u00E9s (CRL)"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "G\u00E9n\u00E8re un certificat auto-sign\u00E9"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "Modifie le mot de passe de banque d'un fichier de cl\u00E9s"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "nom d'alias de l'entr\u00E9e \u00E0 traiter"}, //-alias
-        {"destination.alias",
-                "alias de destination"}, //-destalias
-        {"destination.key.password",
-                "mot de passe de la cl\u00E9 de destination"}, //-destkeypass
-        {"destination.keystore.name",
-                "nom du fichier de cl\u00E9s de destination"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "mot de passe du fichier de cl\u00E9s de destination prot\u00E9g\u00E9"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "nom du fournisseur du fichier de cl\u00E9s de destination"}, //-destprovidername
-        {"destination.keystore.password",
-                "mot de passe du fichier de cl\u00E9s de destination"}, //-deststorepass
-        {"destination.keystore.type",
-                "type du fichier de cl\u00E9s de destination"}, //-deststoretype
-        {"distinguished.name",
-                "nom distinctif"}, //-dname
-        {"X.509.extension",
-                "extension X.509"}, //-ext
-        {"output.file.name",
-                "nom du fichier de sortie"}, //-file and -outfile
-        {"input.file.name",
-                "nom du fichier d'entr\u00E9e"}, //-file and -infile
-        {"key.algorithm.name",
-                "nom de l'algorithme de cl\u00E9"}, //-keyalg
-        {"key.password",
-                "mot de passe de la cl\u00E9"}, //-keypass
-        {"key.bit.size",
-                "taille en bits de la cl\u00E9"}, //-keysize
-        {"keystore.name",
-                "nom du fichier de cl\u00E9s"}, //-keystore
-        {"new.password",
-                "nouveau mot de passe"}, //-new
-        {"do.not.prompt",
-                "ne pas inviter"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "mot de passe via m\u00E9canisme prot\u00E9g\u00E9"}, //-protected
-        {"provider.argument",
-                "argument du fournisseur"}, //-providerarg
-        {"provider.class.name",
-                "nom de la classe de fournisseur"}, //-providerclass
-        {"provider.name",
-                "nom du fournisseur"}, //-providername
-        {"provider.classpath",
-                "variable d'environnement CLASSPATH du fournisseur"}, //-providerpath
-        {"output.in.RFC.style",
-                "sortie au style RFC"}, //-rfc
-        {"signature.algorithm.name",
-                "nom de l'algorithme de signature"}, //-sigalg
-        {"source.alias",
-                "alias source"}, //-srcalias
-        {"source.key.password",
-                "mot de passe de la cl\u00E9 source"}, //-srckeypass
-        {"source.keystore.name",
-                "nom du fichier de cl\u00E9s source"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "mot de passe du fichier de cl\u00E9s source prot\u00E9g\u00E9"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "nom du fournisseur du fichier de cl\u00E9s source"}, //-srcprovidername
-        {"source.keystore.password",
-                "mot de passe du fichier de cl\u00E9s source"}, //-srcstorepass
-        {"source.keystore.type",
-                "type du fichier de cl\u00E9s source"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "Port et h\u00F4te du serveur SSL"}, //-sslserver
-        {"signed.jar.file",
-                "fichier JAR sign\u00E9"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "date/heure de d\u00E9but de validit\u00E9 du certificat"}, //-startdate
-        {"keystore.password",
-                "mot de passe du fichier de cl\u00E9s"}, //-storepass
-        {"keystore.type",
-                "type du fichier de cl\u00E9s"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "certificats s\u00E9curis\u00E9s issus de certificats CA"}, //-trustcacerts
-        {"verbose.output",
-                "sortie en mode verbose"}, //-v
-        {"validity.number.of.days",
-                "nombre de jours de validit\u00E9"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "ID de s\u00E9rie du certificat \u00E0 r\u00E9voquer"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "erreur keytool : "},
-        {"Illegal.option.", "Option non admise :  "},
-        {"Illegal.value.", "Valeur non admise : "},
-        {"Unknown.password.type.", "Type de mot de passe inconnu : "},
-        {"Cannot.find.environment.variable.",
-                "Variable d'environnement introuvable : "},
-        {"Cannot.find.file.", "Fichier introuvable : "},
-        {"Command.option.flag.needs.an.argument.", "L''option de commande {0} requiert un argument."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Avertissement\u00A0: les mots de passe de cl\u00E9 et de banque distincts ne sont pas pris en charge pour les fichiers de cl\u00E9s d''acc\u00E8s PKCS12. La valeur {0} sp\u00E9cifi\u00E9e par l''utilisateur est ignor\u00E9e."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore doit \u00EAtre d\u00E9fini sur NONE si -storetype est {0}"},
-        {"Too.many.retries.program.terminated",
-                 "Trop de tentatives, fin du programme"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "Les commandes -storepasswd et -keypasswd ne sont pas prises en charge si -storetype est d\u00E9fini sur {0}"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "Les commandes -keypasswd ne sont pas prises en charge si -storetype est d\u00E9fini sur PKCS12"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "Les commandes -keypass et -new ne peuvent pas \u00EAtre sp\u00E9cifi\u00E9es si -storetype est d\u00E9fini sur {0}"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "si -protected est sp\u00E9cifi\u00E9, -storepass, -keypass et -new ne doivent pas \u00EAtre indiqu\u00E9s"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Si -srcprotected est indiqu\u00E9, les commandes -srcstorepass et -srckeypass ne doivent pas \u00EAtre sp\u00E9cifi\u00E9es"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "Si le fichier de cl\u00E9s n'est pas prot\u00E9g\u00E9 par un mot de passe, les commandes -storepass, -keypass et -new ne doivent pas \u00EAtre sp\u00E9cifi\u00E9es"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Si le fichier de cl\u00E9s source n'est pas prot\u00E9g\u00E9 par un mot de passe, les commandes -srcstorepass et -srckeypass ne doivent pas \u00EAtre sp\u00E9cifi\u00E9es"},
-        {"Illegal.startdate.value", "Valeur de date de d\u00E9but non admise"},
-        {"Validity.must.be.greater.than.zero",
-                "La validit\u00E9 doit \u00EAtre sup\u00E9rieure \u00E0 z\u00E9ro"},
-        {"provName.not.a.provider", "{0} n''est pas un fournisseur"},
-        {"Usage.error.no.command.provided", "Erreur de syntaxe\u00A0: aucune commande fournie"},
-        {"Source.keystore.file.exists.but.is.empty.", "Le fichier de cl\u00E9s source existe mais il est vide : "},
-        {"Please.specify.srckeystore", "Indiquez -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "-v et -rfc ne doivent pas \u00EAtre sp\u00E9cifi\u00E9s avec la commande 'list'"},
-        {"Key.password.must.be.at.least.6.characters",
-                "Un mot de passe de cl\u00E9 doit comporter au moins 6 caract\u00E8res"},
-        {"New.password.must.be.at.least.6.characters",
-                "Le nouveau mot de passe doit comporter au moins 6 caract\u00E8res"},
-        {"Keystore.file.exists.but.is.empty.",
-                "Fichier de cl\u00E9s existant mais vide : "},
-        {"Keystore.file.does.not.exist.",
-                "Le fichier de cl\u00E9s n'existe pas : "},
-        {"Must.specify.destination.alias", "L'alias de destination doit \u00EAtre sp\u00E9cifi\u00E9"},
-        {"Must.specify.alias", "L'alias doit \u00EAtre sp\u00E9cifi\u00E9"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "Un mot de passe de fichier de cl\u00E9s doit comporter au moins 6 caract\u00E8res"},
-        {"Enter.keystore.password.", "Entrez le mot de passe du fichier de cl\u00E9s :  "},
-        {"Enter.source.keystore.password.", "Entrez le mot de passe du fichier de cl\u00E9s source\u00A0:  "},
-        {"Enter.destination.keystore.password.", "Entrez le mot de passe du fichier de cl\u00E9s de destination\u00A0:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "Le mot de passe du fichier de cl\u00E9s est trop court : il doit comporter au moins 6 caract\u00E8res"},
-        {"Unknown.Entry.Type", "Type d'entr\u00E9e inconnu"},
-        {"Too.many.failures.Alias.not.changed", "Trop d'erreurs. Alias non modifi\u00E9"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "L''entr\u00E9e de l''alias {0} a \u00E9t\u00E9 import\u00E9e."},
-        {"Entry.for.alias.alias.not.imported.", "L''entr\u00E9e de l''alias {0} n''a pas \u00E9t\u00E9 import\u00E9e."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Probl\u00E8me lors de l''import de l''entr\u00E9e de l''alias {0}\u00A0: {1}.\nL''entr\u00E9e de l''alias {0} n''a pas \u00E9t\u00E9 import\u00E9e."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Commande d''import ex\u00E9cut\u00E9e\u00A0: {0} entr\u00E9es import\u00E9es, \u00E9chec ou annulation de {1} entr\u00E9es"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Avertissement\u00A0: l''alias {0} existant sera remplac\u00E9 dans le fichier de cl\u00E9s d''acc\u00E8s de destination"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "L''alias d''entr\u00E9e {0} existe d\u00E9j\u00E0. Voulez-vous le remplacer ? [non]\u00A0:  "},
-        {"Too.many.failures.try.later", "Trop d'erreurs. R\u00E9essayez plus tard"},
-        {"Certification.request.stored.in.file.filename.",
-                "Demande de certification stock\u00E9e dans le fichier <{0}>"},
-        {"Submit.this.to.your.CA", "Soumettre \u00E0 votre CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "si l'alias n'est pas sp\u00E9cifi\u00E9, destalias, srckeypass et destkeypass ne doivent pas \u00EAtre sp\u00E9cifi\u00E9s"},
-        {"Certificate.stored.in.file.filename.",
-                "Certificat stock\u00E9 dans le fichier <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "R\u00E9ponse de certificat install\u00E9e dans le fichier de cl\u00E9s"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "R\u00E9ponse de certificat non install\u00E9e dans le fichier de cl\u00E9s"},
-        {"Certificate.was.added.to.keystore",
-                "Certificat ajout\u00E9 au fichier de cl\u00E9s"},
-        {"Certificate.was.not.added.to.keystore",
-                "Certificat non ajout\u00E9 au fichier de cl\u00E9s"},
-        {".Storing.ksfname.", "[Stockage de {0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} ne poss\u00E8de pas de cl\u00E9 publique (certificat)"},
-        {"Cannot.derive.signature.algorithm",
-                "Impossible de d\u00E9duire l'algorithme de signature"},
-        {"Alias.alias.does.not.exist",
-                "L''alias <{0}> n''existe pas"},
-        {"Alias.alias.has.no.certificate",
-                "L''alias <{0}> ne poss\u00E8de pas de certificat"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "Paire de cl\u00E9s non g\u00E9n\u00E9r\u00E9e, l''alias <{0}> existe d\u00E9j\u00E0"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "G\u00E9n\u00E9ration d''une paire de cl\u00E9s {1} de {0} bits et d''un certificat auto-sign\u00E9 ({2}) d''une validit\u00E9 de {3} jours\n\tpour : {4}"},
-        {"Enter.key.password.for.alias.", "Entrez le mot de passe de la cl\u00E9 pour <{0}>"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(appuyez sur Entr\u00E9e s'il s'agit du mot de passe du fichier de cl\u00E9s) :  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "Le mot de passe de la cl\u00E9 est trop court : il doit comporter au moins 6 caract\u00E8res"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "Trop d'erreurs. Cl\u00E9 non ajout\u00E9e au fichier de cl\u00E9s"},
-        {"Destination.alias.dest.already.exists",
-                "L''alias de la destination <{0}> existe d\u00E9j\u00E0"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "Le mot de passe est trop court : il doit comporter au moins 6 caract\u00E8res"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "Trop d'erreurs. Entr\u00E9e de cl\u00E9 non clon\u00E9e"},
-        {"key.password.for.alias.", "mot de passe de cl\u00E9 pour <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "L''entr\u00E9e de fichier de cl\u00E9s d''acc\u00E8s pour <{0}> existe d\u00E9j\u00E0"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Cr\u00E9ation d''une entr\u00E9e de fichier de cl\u00E9s d''acc\u00E8s pour <{0}>..."},
-        {"No.entries.from.identity.database.added",
-                "Aucune entr\u00E9e ajout\u00E9e \u00E0 partir de la base de donn\u00E9es d'identit\u00E9s"},
-        {"Alias.name.alias", "Nom d''alias : {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Date de cr\u00E9ation : {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Type d''entr\u00E9e\u00A0: {0}"},
-        {"Certificate.chain.length.", "Longueur de cha\u00EEne du certificat : "},
-        {"Certificate.i.1.", "Certificat[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Empreinte du certificat (SHA1) : "},
-        {"Keystore.type.", "Type de fichier de cl\u00E9s : "},
-        {"Keystore.provider.", "Fournisseur de fichier de cl\u00E9s : "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Votre fichier de cl\u00E9s d''acc\u00E8s contient {0,number,integer} entr\u00E9e"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Votre fichier de cl\u00E9s d''acc\u00E8s contient {0,number,integer} entr\u00E9es"},
-        {"Failed.to.parse.input", "L'analyse de l'entr\u00E9e a \u00E9chou\u00E9"},
-        {"Empty.input", "Entr\u00E9e vide"},
-        {"Not.X.509.certificate", "Pas un certificat X.509"},
-        {"alias.has.no.public.key", "{0} ne poss\u00E8de pas de cl\u00E9 publique"},
-        {"alias.has.no.X.509.certificate", "{0} ne poss\u00E8de pas de certificat X.509"},
-        {"New.certificate.self.signed.", "Nouveau certificat (auto-sign\u00E9) :"},
-        {"Reply.has.no.certificates", "La r\u00E9ponse n'a pas de certificat"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Certificat non import\u00E9, l''alias <{0}> existe d\u00E9j\u00E0"},
-        {"Input.not.an.X.509.certificate", "L'entr\u00E9e n'est pas un certificat X.509"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "Le certificat existe d\u00E9j\u00E0 dans le fichier de cl\u00E9s d''acc\u00E8s sous l''alias <{0}>"},
-        {"Do.you.still.want.to.add.it.no.",
-                "Voulez-vous toujours l'ajouter ? [non] :  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "Le certificat existe d\u00E9j\u00E0 dans le fichier de cl\u00E9s d''acc\u00E8s CA syst\u00E8me sous l''alias <{0}>"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "Voulez-vous toujours l'ajouter \u00E0 votre fichier de cl\u00E9s ? [non] :  "},
-        {"Trust.this.certificate.no.", "Faire confiance \u00E0 ce certificat ? [non] :  "},
-        {"YES", "Oui"},
-        {"New.prompt.", "Nouveau {0} : "},
-        {"Passwords.must.differ", "Les mots de passe doivent diff\u00E9rer"},
-        {"Re.enter.new.prompt.", "Indiquez encore le nouveau {0} : "},
-        {"Re.enter.new.password.", "Ressaisissez le nouveau mot de passe : "},
-        {"They.don.t.match.Try.again", "Ils sont diff\u00E9rents. R\u00E9essayez."},
-        {"Enter.prompt.alias.name.", "Indiquez le nom d''alias {0} :  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Saisissez le nom du nouvel alias\t(ou appuyez sur Entr\u00E9e pour annuler l'import de cette entr\u00E9e)\u00A0:  "},
-        {"Enter.alias.name.", "Indiquez le nom d'alias :  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(appuyez sur Entr\u00E9e si le r\u00E9sultat est identique \u00E0 <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "Propri\u00E9taire : {0}\nEmetteur : {1}\nNum\u00E9ro de s\u00E9rie : {2}\nValide du : {3} au : {4}\nEmpreintes du certificat :\n\t MD5:  {5}\n\t SHA1 : {6}\n\t SHA256 : {7}\n\t Nom de l''algorithme de signature : {8}\n\t Version : {9}"},
-        {"What.is.your.first.and.last.name.",
-                "Quels sont vos nom et pr\u00E9nom ?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "Quel est le nom de votre unit\u00E9 organisationnelle ?"},
-        {"What.is.the.name.of.your.organization.",
-                "Quel est le nom de votre entreprise ?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "Quel est le nom de votre ville de r\u00E9sidence ?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "Quel est le nom de votre \u00E9tat ou province ?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "Quel est le code pays \u00E0 deux lettres pour cette unit\u00E9 ?"},
-        {"Is.name.correct.", "Est-ce {0} ?"},
-        {"no", "non"},
-        {"yes", "oui"},
-        {"y", "o"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "L''alias <{0}> n''est associ\u00E9 \u00E0 aucune cl\u00E9"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "L''entr\u00E9e \u00E0 laquelle l''alias <{0}> fait r\u00E9f\u00E9rence n''est pas une entr\u00E9e de type cl\u00E9 priv\u00E9e. La commande -keyclone prend uniquement en charge le clonage des cl\u00E9s priv\u00E9es"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  Avertissement Avertissement Avertissement  *****************"},
-        {"Signer.d.", "Signataire n\u00B0%d :"},
-        {"Timestamp.", "Horodatage :"},
-        {"Signature.", "Signature :"},
-        {"CRLs.", "Listes des certificats r\u00E9voqu\u00E9s (CRL) :"},
-        {"Certificate.owner.", "Propri\u00E9taire du certificat : "},
-        {"Not.a.signed.jar.file", "Fichier JAR non sign\u00E9"},
-        {"No.certificate.from.the.SSL.server",
-                "Aucun certificat du serveur SSL"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* L'int\u00E9grit\u00E9 des informations stock\u00E9es dans votre fichier de cl\u00E9s  *\n* n'a PAS \u00E9t\u00E9 v\u00E9rifi\u00E9e. Pour cela, *\n* vous devez fournir le mot de passe de votre fichier de cl\u00E9s.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* L'int\u00E9grit\u00E9 des informations stock\u00E9es dans le fichier de cl\u00E9s source  *\n* n'a PAS \u00E9t\u00E9 v\u00E9rifi\u00E9e. Pour cela, *\n* vous devez fournir le mot de passe de votre fichier de cl\u00E9s source.                  *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "La r\u00E9ponse au certificat ne contient pas de cl\u00E9 publique pour <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Cha\u00EEne de certificat incompl\u00E8te dans la r\u00E9ponse"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "La cha\u00EEne de certificat de la r\u00E9ponse ne concorde pas : "},
-        {"Top.level.certificate.in.reply.",
-                "Certificat de niveau sup\u00E9rieur dans la r\u00E9ponse :\n"},
-        {".is.not.trusted.", "... non s\u00E9curis\u00E9. "},
-        {"Install.reply.anyway.no.", "Installer la r\u00E9ponse quand m\u00EAme ? [non] :  "},
-        {"NO", "Non"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "Les cl\u00E9s publiques de la r\u00E9ponse et du fichier de cl\u00E9s ne concordent pas"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "La r\u00E9ponse au certificat et le certificat du fichier de cl\u00E9s sont identiques"},
-        {"Failed.to.establish.chain.from.reply",
-                "Impossible de cr\u00E9er une cha\u00EEne \u00E0 partir de la r\u00E9ponse"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "R\u00E9ponse incorrecte, recommencez"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "Cl\u00E9 secr\u00E8te non g\u00E9n\u00E9r\u00E9e, l''alias <{0}> existe d\u00E9j\u00E0"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Indiquez -keysize pour la g\u00E9n\u00E9ration de la cl\u00E9 secr\u00E8te"},
-
-        {"Extensions.", "Extensions\u00A0: "},
-        {".Empty.value.", "(Valeur vide)"},
-        {"Extension.Request.", "Demande d'extension :"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "Demande de certificat PKCS #10 (version 1.0)\nSujet : %s\nCl\u00E9 publique : format %s pour la cl\u00E9 %s\n"},
-        {"Unknown.keyUsage.type.", "Type keyUsage inconnu : "},
-        {"Unknown.extendedkeyUsage.type.", "Type extendedkeyUsage inconnu : "},
-        {"Unknown.AccessDescription.type.", "Type AccessDescription inconnu : "},
-        {"Unrecognized.GeneralName.type.", "Type GeneralName non reconnu : "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "Cette extension ne peut pas \u00EAtre marqu\u00E9e comme critique. "},
-        {"Odd.number.of.hex.digits.found.", "Nombre impair de chiffres hexad\u00E9cimaux trouv\u00E9 : "},
-        {"Unknown.extension.type.", "Type d'extension inconnu : "},
-        {"command.{0}.is.ambiguous.", "commande {0} ambigu\u00EB :"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Avertissement\u00A0: il n''existe pas de cl\u00E9 publique pour l''alias {0}. V\u00E9rifiez que le fichier de cl\u00E9s d''acc\u00E8s est correctement configur\u00E9."},
-        {"Warning.Class.not.found.class", "Avertissement : classe introuvable - {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Avertissement\u00A0: arguments non valides pour le constructeur\u00A0- {0}"},
-        {"Illegal.Principal.Type.type", "Type de principal non admis : {0}"},
-        {"Illegal.option.option", "Option non admise : {0}"},
-        {"Usage.policytool.options.", "Syntaxe : policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    emplacement du fichier de r\u00E8gles"},
-        {"New", "Nouveau"},
-        {"Open", "Ouvrir"},
-        {"Save", "Enregistrer"},
-        {"Save.As", "Enregistrer sous"},
-        {"View.Warning.Log", "Afficher le journal des avertissements"},
-        {"Exit", "Quitter"},
-        {"Add.Policy.Entry", "Ajouter une r\u00E8gle"},
-        {"Edit.Policy.Entry", "Modifier une r\u00E8gle"},
-        {"Remove.Policy.Entry", "Enlever une r\u00E8gle"},
-        {"Edit", "Modifier"},
-        {"Retain", "Conserver"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Avertissement : il se peut que le nom de fichier contienne des barres obliques inverses avec caract\u00E8re d'\u00E9chappement. Il n'est pas n\u00E9cessaire d'ajouter un caract\u00E8re d'\u00E9chappement aux barres obliques inverses. L'outil proc\u00E8de \u00E0 l'\u00E9chappement si n\u00E9cessaire lorsqu'il \u00E9crit le contenu des r\u00E8gles dans la zone de stockage persistant).\n\nCliquez sur Conserver pour garder le nom saisi ou sur Modifier pour le remplacer."},
-
-        {"Add.Public.Key.Alias", "Ajouter un alias de cl\u00E9 publique"},
-        {"Remove.Public.Key.Alias", "Enlever un alias de cl\u00E9 publique"},
-        {"File", "Fichier"},
-        {"KeyStore", "Fichier de cl\u00E9s"},
-        {"Policy.File.", "Fichier de r\u00E8gles :"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Impossible d''ouvrir le fichier de r\u00E8gles\u00A0: {0}: {1}"},
-        {"Policy.Tool", "Policy Tool"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Des erreurs se sont produites \u00E0 l'ouverture de la configuration de r\u00E8gles. Pour plus d'informations, consultez le journal des avertissements."},
-        {"Error", "Erreur"},
-        {"OK", "OK"},
-        {"Status", "Statut"},
-        {"Warning", "Avertissement"},
-        {"Permission.",
-                "Droit :                                                       "},
-        {"Principal.Type.", "Type de principal :"},
-        {"Principal.Name.", "Nom de principal :"},
-        {"Target.Name.",
-                "Nom de cible :                                                    "},
-        {"Actions.",
-                "Actions :                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Remplacer le fichier existant {0} ?"},
-        {"Cancel", "Annuler"},
-        {"CodeBase.", "Base de code :"},
-        {"SignedBy.", "Sign\u00E9 par :"},
-        {"Add.Principal", "Ajouter un principal"},
-        {"Edit.Principal", "Modifier un principal"},
-        {"Remove.Principal", "Enlever un principal"},
-        {"Principals.", "Principaux :"},
-        {".Add.Permission", "  Ajouter un droit"},
-        {".Edit.Permission", "  Modifier un droit"},
-        {"Remove.Permission", "Enlever un droit"},
-        {"Done", "Termin\u00E9"},
-        {"KeyStore.URL.", "URL du fichier de cl\u00E9s :"},
-        {"KeyStore.Type.", "Type du fichier de cl\u00E9s :"},
-        {"KeyStore.Provider.", "Fournisseur du fichier de cl\u00E9s :"},
-        {"KeyStore.Password.URL.", "URL du mot de passe du fichier de cl\u00E9s :"},
-        {"Principals", "Principaux"},
-        {".Edit.Principal.", "  Modifier un principal :"},
-        {".Add.New.Principal.", "  Ajouter un principal :"},
-        {"Permissions", "Droits"},
-        {".Edit.Permission.", "  Modifier un droit :"},
-        {".Add.New.Permission.", "  Ajouter un droit :"},
-        {"Signed.By.", "Sign\u00E9 par :"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Impossible de sp\u00E9cifier un principal avec une classe g\u00E9n\u00E9rique sans nom g\u00E9n\u00E9rique"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Impossible de sp\u00E9cifier un principal sans nom"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Le droit et le nom de cible doivent avoir une valeur"},
-        {"Remove.this.Policy.Entry.", "Enlever cette r\u00E8gle ?"},
-        {"Overwrite.File", "Remplacer le fichier"},
-        {"Policy.successfully.written.to.filename",
-                "R\u00E8gle \u00E9crite dans {0}"},
-        {"null.filename", "nom de fichier NULL"},
-        {"Save.changes.", "Enregistrer les modifications ?"},
-        {"Yes", "Oui"},
-        {"No", "Non"},
-        {"Policy.Entry", "R\u00E8gle"},
-        {"Save.Changes", "Enregistrer les modifications"},
-        {"No.Policy.Entry.selected", "Aucune r\u00E8gle s\u00E9lectionn\u00E9e"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Impossible d''ouvrir le fichier de cl\u00E9s d''acc\u00E8s : {0}"},
-        {"No.principal.selected", "Aucun principal s\u00E9lectionn\u00E9"},
-        {"No.permission.selected", "Aucun droit s\u00E9lectionn\u00E9"},
-        {"name", "nom"},
-        {"configuration.type", "type de configuration"},
-        {"environment.variable.name", "Nom de variable d'environnement"},
-        {"library.name", "nom de biblioth\u00E8que"},
-        {"package.name", "nom de package"},
-        {"policy.type", "type de r\u00E8gle"},
-        {"property.name", "nom de propri\u00E9t\u00E9"},
-        {"Principal.List", "Liste de principaux"},
-        {"Permission.List", "Liste de droits"},
-        {"Code.Base", "Base de code"},
-        {"KeyStore.U.R.L.", "URL du fichier de cl\u00E9s :"},
-        {"KeyStore.Password.U.R.L.", "URL du mot de passe du fichier de cl\u00E9s :"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "entr\u00E9es NULL non valides"},
         {"actions.can.only.be.read.", "les actions sont accessibles en lecture uniquement"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "mappage OID NULL fourni"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "AccessControlContext NULL fourni non valide"},
         {"invalid.null.action.provided", "action NULL fournie non valide"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_it.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_it.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [Opzione]..."},
-        {"Options.", "Opzioni:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "Utilizzare \"keytool -help\" per visualizzare tutti i comandi disponibili"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Strumento di gestione di chiavi e certificati"},
-        {"Commands.", "Comandi:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "Utilizzare \"keytool -command_name -help\" per informazioni sull'uso di command_name"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "Genera una richiesta di certificato"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "Modifica l'alias di una voce"}, //-changealias
-        {"Deletes.an.entry",
-                "Elimina una voce"}, //-delete
-        {"Exports.certificate",
-                "Esporta il certificato"}, //-exportcert
-        {"Generates.a.key.pair",
-                "Genera una coppia di chiavi"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "Genera una chiave segreta"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "Genera un certificato da una richiesta di certificato"}, //-gencert
-        {"Generates.CRL", "Genera CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Importa le voci da un database delle identit\u00E0 di tipo JDK 1.1.x"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Importa un certificato o una catena di certificati"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Importa una o tutte le voci da un altro keystore"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Duplica una voce di chiave"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "Modifica la password della chiave per una voce"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "Elenca le voci in un keystore"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Visualizza i contenuti di un certificato"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Visualizza i contenuti di una richiesta di certificato"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Visualizza i contenuti di un file CRL"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "Genera certificato con firma automatica"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "Modifica la password di area di memorizzazione di un keystore"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "nome alias della voce da elaborare"}, //-alias
-        {"destination.alias",
-                "alias di destinazione"}, //-destalias
-        {"destination.key.password",
-                "password chiave di destinazione"}, //-destkeypass
-        {"destination.keystore.name",
-                "nome keystore di destinazione"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "password keystore di destinazione protetta"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "nome provider keystore di destinazione"}, //-destprovidername
-        {"destination.keystore.password",
-                "password keystore di destinazione"}, //-deststorepass
-        {"destination.keystore.type",
-                "tipo keystore di destinazione"}, //-deststoretype
-        {"distinguished.name",
-                "nome distinto"}, //-dname
-        {"X.509.extension",
-                "estensione X.509"}, //-ext
-        {"output.file.name",
-                "nome file di output"}, //-file and -outfile
-        {"input.file.name",
-                "nome file di input"}, //-file and -infile
-        {"key.algorithm.name",
-                "nome algoritmo chiave"}, //-keyalg
-        {"key.password",
-                "password chiave"}, //-keypass
-        {"key.bit.size",
-                "dimensione bit chiave"}, //-keysize
-        {"keystore.name",
-                "nome keystore"}, //-keystore
-        {"new.password",
-                "nuova password"}, //-new
-        {"do.not.prompt",
-                "non richiedere"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "password mediante meccanismo protetto"}, //-protected
-        {"provider.argument",
-                "argomento provider"}, //-providerarg
-        {"provider.class.name",
-                "nome classe provider"}, //-providerclass
-        {"provider.name",
-                "nome provider"}, //-providername
-        {"provider.classpath",
-                "classpath provider"}, //-providerpath
-        {"output.in.RFC.style",
-                "output in stile RFC"}, //-rfc
-        {"signature.algorithm.name",
-                "nome algoritmo firma"}, //-sigalg
-        {"source.alias",
-                "alias origine"}, //-srcalias
-        {"source.key.password",
-                "password chiave di origine"}, //-srckeypass
-        {"source.keystore.name",
-                "nome keystore di origine"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "password keystore di origine protetta"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "nome provider keystore di origine"}, //-srcprovidername
-        {"source.keystore.password",
-                "password keystore di origine"}, //-srcstorepass
-        {"source.keystore.type",
-                "tipo keystore di origine"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "host e porta server SSL"}, //-sslserver
-        {"signed.jar.file",
-                "file jar firmato"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "data/ora di inizio validit\u00E0 certificato"}, //-startdate
-        {"keystore.password",
-                "password keystore"}, //-storepass
-        {"keystore.type",
-                "tipo keystore"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "considera sicuri i certificati da cacerts"}, //-trustcacerts
-        {"verbose.output",
-                "output descrittivo"}, //-v
-        {"validity.number.of.days",
-                "numero di giorni di validit\u00E0"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "ID seriale del certificato da revocare"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "Errore keytool: "},
-        {"Illegal.option.", "Opzione non valida:  "},
-        {"Illegal.value.", "Valore non valido: "},
-        {"Unknown.password.type.", "Tipo di password sconosciuto: "},
-        {"Cannot.find.environment.variable.",
-                "Impossibile trovare la variabile di ambiente: "},
-        {"Cannot.find.file.", "Impossibile trovare il file: "},
-        {"Command.option.flag.needs.an.argument.", "\u00C8 necessario specificare un argomento per l''opzione di comando {0}."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Avvertenza: non sono supportate password diverse di chiave e di archivio per i keystore PKCS12. Il valore {0} specificato dall''utente verr\u00E0 ignorato."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "Se -storetype \u00E8 impostato su {0}, -keystore deve essere impostato su NONE"},
-        {"Too.many.retries.program.terminated",
-                 "Il numero dei tentativi consentiti \u00E8 stato superato. Il programma verr\u00E0 terminato."},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "Se -storetype \u00E8 impostato su {0}, i comandi -storepasswd e -keypasswd non sono supportati"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "Se -storetype \u00E8 impostato su PKCS12 i comandi -keypasswd non vengono supportati"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "Se -storetype \u00E8 impostato su {0}, non \u00E8 possibile specificare un valore per -keypass e -new"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "Se \u00E8 specificata l'opzione -protected, le opzioni -storepass, -keypass e -new non possono essere specificate"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Se viene specificato -srcprotected, -srcstorepass e -srckeypass non dovranno essere specificati"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "Se il file keystore non \u00E8 protetto da password, non deve essere specificato alcun valore per -storepass, -keypass e -new"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "Se il file keystore non \u00E8 protetto da password, non deve essere specificato alcun valore per -srcstorepass e -srckeypass"},
-        {"Illegal.startdate.value", "Valore di data di inizio non valido"},
-        {"Validity.must.be.greater.than.zero",
-                "La validit\u00E0 deve essere maggiore di zero"},
-        {"provName.not.a.provider", "{0} non \u00E8 un provider"},
-        {"Usage.error.no.command.provided", "Errore di utilizzo: nessun comando specificato"},
-        {"Source.keystore.file.exists.but.is.empty.", "Il file keystore di origine esiste, ma \u00E8 vuoto: "},
-        {"Please.specify.srckeystore", "Specificare -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "Impossibile specificare sia -v sia -rfc con il comando 'list'"},
-        {"Key.password.must.be.at.least.6.characters",
-                "La password della chiave deve contenere almeno 6 caratteri"},
-        {"New.password.must.be.at.least.6.characters",
-                "La nuova password deve contenere almeno 6 caratteri"},
-        {"Keystore.file.exists.but.is.empty.",
-                "Il file keystore esiste ma \u00E8 vuoto: "},
-        {"Keystore.file.does.not.exist.",
-                "Il file keystore non esiste: "},
-        {"Must.specify.destination.alias", "\u00C8 necessario specificare l'alias di destinazione"},
-        {"Must.specify.alias", "\u00C8 necessario specificare l'alias"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "La password del keystore deve contenere almeno 6 caratteri"},
-        {"Enter.keystore.password.", "Immettere la password del keystore:  "},
-        {"Enter.source.keystore.password.", "Immettere la password del keystore di origine:  "},
-        {"Enter.destination.keystore.password.", "Immettere la password del keystore di destinazione:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "La password del keystore \u00E8 troppo corta - deve contenere almeno 6 caratteri"},
-        {"Unknown.Entry.Type", "Tipo di voce sconosciuto"},
-        {"Too.many.failures.Alias.not.changed", "Numero eccessivo di errori. L'alias non \u00E8 stato modificato."},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "La voce dell''alias {0} \u00E8 stata importata."},
-        {"Entry.for.alias.alias.not.imported.", "La voce dell''alias {0} non \u00E8 stata importata."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Si \u00E8 verificato un problema durante l''importazione della voce dell''alias {0}: {1}.\nLa voce dell''alias {0} non \u00E8 stata importata."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Comando di importazione completato: {0} voce/i importata/e, {1} voce/i non importata/e o annullata/e"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Avvertenza: sovrascrittura in corso dell''alias {0} nel file keystore di destinazione"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "La voce dell''alias {0} esiste gi\u00E0. Sovrascrivere? [no]:  "},
-        {"Too.many.failures.try.later", "Troppi errori - riprovare"},
-        {"Certification.request.stored.in.file.filename.",
-                "La richiesta di certificazione \u00E8 memorizzata nel file <{0}>"},
-        {"Submit.this.to.your.CA", "Sottomettere alla propria CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "Se l'alias non \u00E8 specificato, destalias, srckeypass e destkeypass non dovranno essere specificati"},
-        {"Certificate.stored.in.file.filename.",
-                "Il certificato \u00E8 memorizzato nel file <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "La risposta del certificato \u00E8 stata installata nel keystore"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "La risposta del certificato non \u00E8 stata installata nel keystore"},
-        {"Certificate.was.added.to.keystore",
-                "Il certificato \u00E8 stato aggiunto al keystore"},
-        {"Certificate.was.not.added.to.keystore",
-                "Il certificato non \u00E8 stato aggiunto al keystore"},
-        {".Storing.ksfname.", "[Memorizzazione di {0}] in corso"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} non dispone di chiave pubblica (certificato)"},
-        {"Cannot.derive.signature.algorithm",
-                "Impossibile derivare l'algoritmo di firma"},
-        {"Alias.alias.does.not.exist",
-                "L''alias <{0}> non esiste"},
-        {"Alias.alias.has.no.certificate",
-                "L''alias <{0}> non dispone di certificato"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "Non \u00E8 stata generata la coppia di chiavi, l''alias <{0}> \u00E8 gi\u00E0 esistente"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "Generazione in corso di una coppia di chiavi {1} da {0} bit e di un certificato autofirmato ({2}) con una validit\u00E0 di {3} giorni\n\tper: {4}"},
-        {"Enter.key.password.for.alias.", "Immettere la password della chiave per <{0}>"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(INVIO se corrisponde alla password del keystore):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "La password della chiave \u00E8 troppo corta - deve contenere almeno 6 caratteri"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "Troppi errori - la chiave non \u00E8 stata aggiunta al keystore"},
-        {"Destination.alias.dest.already.exists",
-                "L''alias di destinazione <{0}> \u00E8 gi\u00E0 esistente"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "La password \u00E8 troppo corta - deve contenere almeno 6 caratteri"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "Numero eccessivo di errori. Il valore della chiave non \u00E8 stato copiato."},
-        {"key.password.for.alias.", "password della chiave per <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "La voce del keystore per <{0}> esiste gi\u00E0"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Creazione della voce del keystore per <{0}> in corso..."},
-        {"No.entries.from.identity.database.added",
-                "Nessuna voce aggiunta dal database delle identit\u00E0"},
-        {"Alias.name.alias", "Nome alias: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Data di creazione: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Tipo di voce: {0}"},
-        {"Certificate.chain.length.", "Lunghezza catena certificati: "},
-        {"Certificate.i.1.", "Certificato[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Impronta digitale certificato (SHA1): "},
-        {"Keystore.type.", "Tipo keystore: "},
-        {"Keystore.provider.", "Provider keystore: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Il keystore contiene {0,number,integer} voce"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Il keystore contiene {0,number,integer} voci"},
-        {"Failed.to.parse.input", "Impossibile analizzare l'input"},
-        {"Empty.input", "Input vuoto"},
-        {"Not.X.509.certificate", "Il certificato non \u00E8 X.509"},
-        {"alias.has.no.public.key", "{0} non dispone di chiave pubblica"},
-        {"alias.has.no.X.509.certificate", "{0} non dispone di certificato X.509"},
-        {"New.certificate.self.signed.", "Nuovo certificato (autofirmato):"},
-        {"Reply.has.no.certificates", "La risposta non dispone di certificati"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Impossibile importare il certificato, l''alias <{0}> \u00E8 gi\u00E0 esistente"},
-        {"Input.not.an.X.509.certificate", "L'input non \u00E8 un certificato X.509"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "Il certificato esiste gi\u00E0 nel keystore con alias <{0}>"},
-        {"Do.you.still.want.to.add.it.no.",
-                "Aggiungerlo ugualmente? [no]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "Il certificato esiste gi\u00E0 nel keystore CA con alias <{0}>"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "Aggiungerlo al proprio keystore? [no]:  "},
-        {"Trust.this.certificate.no.", "Considerare sicuro questo certificato? [no]:  "},
-        {"YES", "S\u00EC"},
-        {"New.prompt.", "Nuova {0}: "},
-        {"Passwords.must.differ", "Le password non devono coincidere"},
-        {"Re.enter.new.prompt.", "Reimmettere un nuovo valore per {0}: "},
-        {"Re.enter.new.password.", "Immettere nuovamente la nuova password: "},
-        {"They.don.t.match.Try.again", "Non corrispondono. Riprovare."},
-        {"Enter.prompt.alias.name.", "Immettere nome alias {0}:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Immettere un nuovo nome alias\t(premere INVIO per annullare l'importazione della voce):  "},
-        {"Enter.alias.name.", "Immettere nome alias:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(INVIO se corrisponde al nome di <{0}>"},
-        {".PATTERN.printX509Cert",
-                "Proprietario: {0}\nAutorit\u00E0 emittente: {1}\nNumero di serie: {2}\nValido da: {3} a: {4}\nImpronte digitali certificato:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Nome algoritmo firma: {8}\n\t Versione: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "Specificare nome e cognome"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "Specificare il nome dell'unit\u00E0 organizzativa"},
-        {"What.is.the.name.of.your.organization.",
-                "Specificare il nome dell'organizzazione"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "Specificare la localit\u00E0"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "Specificare la provincia"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "Specificare il codice a due lettere del paese in cui si trova l'unit\u00E0"},
-        {"Is.name.correct.", "Il dato {0} \u00E8 corretto?"},
-        {"no", "no"},
-        {"yes", "s\u00EC"},
-        {"y", "s"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "All''alias <{0}> non \u00E8 associata alcuna chiave"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "L''alias <{0}> fa riferimento a un tipo di voce che non \u00E8 una voce di chiave privata. Il comando -keyclone supporta solo la copia delle voci di chiave private."},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  Avvertenza Avvertenza Avvertenza  *****************"},
-        {"Signer.d.", "Firmatario #%d:"},
-        {"Timestamp.", "Indicatore orario:"},
-        {"Signature.", "Firma:"},
-        {"CRLs.", "CRL:"},
-        {"Certificate.owner.", "Proprietario certificato: "},
-        {"Not.a.signed.jar.file", "Non \u00E8 un file jar firmato"},
-        {"No.certificate.from.the.SSL.server",
-                "Nessun certificato dal server SSL"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* L'integrit\u00E0 delle informazioni memorizzate nel keystore *\n* NON \u00E8 stata verificata. Per verificarne l'integrit\u00E0 *\n* \u00E8 necessario fornire la password del keystore.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* L'integrit\u00E0 delle informazioni memorizzate nel srckeystore *\n* NON \u00E8 stata verificata. Per verificarne l'integrit\u00E0 *\n* \u00E8 necessario fornire la password del srckeystore.                  *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "La risposta del certificato non contiene la chiave pubblica per <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Catena dei certificati incompleta nella risposta"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "La catena dei certificati nella risposta non verifica: "},
-        {"Top.level.certificate.in.reply.",
-                "Certificato di primo livello nella risposta:\n"},
-        {".is.not.trusted.", "...non \u00E8 considerato sicuro. "},
-        {"Install.reply.anyway.no.", "Installare la risposta? [no]:  "},
-        {"NO", "No"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "Le chiavi pubbliche nella risposta e nel keystore non corrispondono"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "La risposta del certificato e il certificato nel keystore sono identici"},
-        {"Failed.to.establish.chain.from.reply",
-                "Impossibile stabilire la catena dalla risposta"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "Risposta errata, riprovare"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "La chiave segreta non \u00E8 stata generata; l''alias <{0}> esiste gi\u00E0"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Specificare il valore -keysize per la generazione della chiave segreta"},
-
-        {"Extensions.", "Estensioni: "},
-        {".Empty.value.", "(valore vuoto)"},
-        {"Extension.Request.", "Richiesta di estensione:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "Richiesta di certificato PKCS #10 (versione 1.0)\nOggetto: %s\nChiave pubblica: %s formato %s chiave\n"},
-        {"Unknown.keyUsage.type.", "Tipo keyUsage sconosciuto: "},
-        {"Unknown.extendedkeyUsage.type.", "Tipo extendedkeyUsage sconosciuto: "},
-        {"Unknown.AccessDescription.type.", "Tipo AccessDescription sconosciuto: "},
-        {"Unrecognized.GeneralName.type.", "Tipo GeneralName non riconosciuto: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "Impossibile contrassegnare questa estensione come critica. "},
-        {"Odd.number.of.hex.digits.found.", "\u00C8 stato trovato un numero dispari di cifre esadecimali: "},
-        {"Unknown.extension.type.", "Tipo di estensione sconosciuto: "},
-        {"command.{0}.is.ambiguous.", "il comando {0} \u00E8 ambiguo:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Avvertenza: non esiste una chiave pubblica per l''alias {0}. Verificare che il keystore sia configurato correttamente."},
-        {"Warning.Class.not.found.class", "Avvertenza: classe non trovata: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Avvertenza: argomento o argomenti non validi per il costruttore {0}"},
-        {"Illegal.Principal.Type.type", "Tipo principal non valido: {0}"},
-        {"Illegal.option.option", "Opzione non valida: {0}"},
-        {"Usage.policytool.options.", "Utilizzo: policytool [opzioni]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    posizione del file dei criteri"},
-        {"New", "Nuovo"},
-        {"Open", "Apri"},
-        {"Save", "Salva"},
-        {"Save.As", "Salva con nome"},
-        {"View.Warning.Log", "Visualizza registro avvertenze"},
-        {"Exit", "Esci"},
-        {"Add.Policy.Entry", "Aggiungi voce dei criteri"},
-        {"Edit.Policy.Entry", "Modifica voce dei criteri"},
-        {"Remove.Policy.Entry", "Rimuovi voce dei criteri"},
-        {"Edit", "Modifica"},
-        {"Retain", "Mantieni"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Avvertenza: il nome file pu\u00F2 includere barre rovesciate con escape. Non \u00E8 necessario eseguire l'escape delle barre rovesciate (se necessario lo strumento esegue l'escape dei caratteri al momento della scrittura del contenuto dei criteri nell'area di memorizzazione persistente).\n\nFare click su Mantieni per conservare il nome immesso, oppure su Modifica per modificare il nome."},
-
-        {"Add.Public.Key.Alias", "Aggiungi alias chiave pubblica"},
-        {"Remove.Public.Key.Alias", "Rimuovi alias chiave pubblica"},
-        {"File", "File"},
-        {"KeyStore", "Keystore"},
-        {"Policy.File.", "File dei criteri:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Impossibile aprire il file di criteri {0}: {1}"},
-        {"Policy.Tool", "Strumento criteri"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Si sono verificati errori durante l'apertura della configurazione dei criteri. Consultare il registro delle avvertenze per ulteriori informazioni."},
-        {"Error", "Errore"},
-        {"OK", "OK"},
-        {"Status", "Stato"},
-        {"Warning", "Avvertenza"},
-        {"Permission.",
-                "Autorizzazione:                                                       "},
-        {"Principal.Type.", "Tipo principal:"},
-        {"Principal.Name.", "Nome principal:"},
-        {"Target.Name.",
-                "Nome destinazione:                                                    "},
-        {"Actions.",
-                "Azioni:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "OK per sovrascrivere il file {0}?"},
-        {"Cancel", "Annulla"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Aggiungi principal"},
-        {"Edit.Principal", "Modifica principal"},
-        {"Remove.Principal", "Rimuovi principal"},
-        {"Principals.", "Principal:"},
-        {".Add.Permission", "  Aggiungi autorizzazione"},
-        {".Edit.Permission", "  Modifica autorizzazione"},
-        {"Remove.Permission", "Rimuovi autorizzazione"},
-        {"Done", "Fine"},
-        {"KeyStore.URL.", "URL keystore:"},
-        {"KeyStore.Type.", "Tipo keystore:"},
-        {"KeyStore.Provider.", "Provider keystore:"},
-        {"KeyStore.Password.URL.", "URL password keystore:"},
-        {"Principals", "Principal:"},
-        {".Edit.Principal.", "  Modifica principal:"},
-        {".Add.New.Principal.", "  Aggiungi nuovo principal:"},
-        {"Permissions", "Autorizzazioni"},
-        {".Edit.Permission.", "  Modifica autorizzazione:"},
-        {".Add.New.Permission.", "  Aggiungi nuova autorizzazione:"},
-        {"Signed.By.", "Firmato da:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Impossibile specificare principal con una classe carattere jolly senza un nome carattere jolly"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Impossibile specificare principal senza un nome"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "L'autorizzazione e il nome destinazione non possono essere nulli"},
-        {"Remove.this.Policy.Entry.", "Rimuovere questa voce dei criteri?"},
-        {"Overwrite.File", "Sovrascrivi file"},
-        {"Policy.successfully.written.to.filename",
-                "I criteri sono stati scritti in {0}"},
-        {"null.filename", "nome file nullo"},
-        {"Save.changes.", "Salvare le modifiche?"},
-        {"Yes", "S\u00EC"},
-        {"No", "No"},
-        {"Policy.Entry", "Voce dei criteri"},
-        {"Save.Changes", "Salva le modifiche"},
-        {"No.Policy.Entry.selected", "Nessuna voce dei criteri selezionata"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Impossibile aprire il keystore: {0}"},
-        {"No.principal.selected", "Nessun principal selezionato"},
-        {"No.permission.selected", "Nessuna autorizzazione selezionata"},
-        {"name", "nome"},
-        {"configuration.type", "tipo di configurazione"},
-        {"environment.variable.name", "nome variabile ambiente"},
-        {"library.name", "nome libreria"},
-        {"package.name", "nome package"},
-        {"policy.type", "tipo di criteri"},
-        {"property.name", "nome propriet\u00E0"},
-        {"Principal.List", "Lista principal"},
-        {"Permission.List", "Lista autorizzazioni"},
-        {"Code.Base", "Codebase"},
-        {"KeyStore.U.R.L.", "URL keystore:"},
-        {"KeyStore.Password.U.R.L.", "URL password keystore:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "input nullo/i non valido/i"},
         {"actions.can.only.be.read.", "le azioni possono essere solamente 'lette'"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "specificata mappa OID null"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "fornito un valore nullo non valido per AccessControlContext"},
         {"invalid.null.action.provided", "fornita un'azione nulla non valida"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_ja.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_ja.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [\u30AA\u30D7\u30B7\u30E7\u30F3]..."},
-        {"Options.", "\u30AA\u30D7\u30B7\u30E7\u30F3:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "\u4F7F\u7528\u53EF\u80FD\u306A\u3059\u3079\u3066\u306E\u30B3\u30DE\u30F3\u30C9\u306B\u3064\u3044\u3066\u306F\"keytool -help\"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Key.and.Certificate.Management.Tool",
-                 "\u30AD\u30FC\u304A\u3088\u3073\u8A3C\u660E\u66F8\u7BA1\u7406\u30C4\u30FC\u30EB"},
-        {"Commands.", "\u30B3\u30DE\u30F3\u30C9:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "command_name\u306E\u4F7F\u7528\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306F\"keytool -command_name -help\"\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-changealias
-        {"Deletes.an.entry",
-                "\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664\u3057\u307E\u3059"}, //-delete
-        {"Exports.certificate",
-                "\u8A3C\u660E\u66F8\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-exportcert
-        {"Generates.a.key.pair",
-                "\u9375\u30DA\u30A2\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "\u79D8\u5BC6\u9375\u3092\u751F\u6210\u3057\u307E\u3059"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u304B\u3089\u8A3C\u660E\u66F8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-gencert
-        {"Generates.CRL", "CRL\u3092\u751F\u6210\u3057\u307E\u3059"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "JDK 1.1.x-style\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304B\u3089\u30A8\u30F3\u30C8\u30EA\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "\u8A3C\u660E\u66F8\u307E\u305F\u306F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "\u5225\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u304B\u30891\u3064\u307E\u305F\u306F\u3059\u3079\u3066\u306E\u30A8\u30F3\u30C8\u30EA\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3059"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u3092\u4F5C\u6210\u3057\u307E\u3059"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "\u30A8\u30F3\u30C8\u30EA\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u30A8\u30F3\u30C8\u30EA\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "\u8A3C\u660E\u66F8\u306E\u5185\u5BB9\u3092\u51FA\u529B\u3057\u307E\u3059"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u5185\u5BB9\u3092\u51FA\u529B\u3057\u307E\u3059"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "CRL\u30D5\u30A1\u30A4\u30EB\u306E\u5185\u5BB9\u3092\u51FA\u529B\u3057\u307E\u3059"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "\u81EA\u5DF1\u7F72\u540D\u578B\u8A3C\u660E\u66F8\u3092\u751F\u6210\u3057\u307E\u3059"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "\u51E6\u7406\u3059\u308B\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D"}, //-alias
-        {"destination.alias",
-                "\u51FA\u529B\u5148\u306E\u5225\u540D"}, //-destalias
-        {"destination.key.password",
-                "\u51FA\u529B\u5148\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-destkeypass
-        {"destination.keystore.name",
-                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u4FDD\u8B77\u5BFE\u8C61\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-destprovidername
-        {"destination.keystore.password",
-                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-deststorepass
-        {"destination.keystore.type",
-                "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7"}, //-deststoretype
-        {"distinguished.name",
-                "\u8B58\u5225\u540D"}, //-dname
-        {"X.509.extension",
-                "X.509\u62E1\u5F35"}, //-ext
-        {"output.file.name",
-                "\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u540D"}, //-file and -outfile
-        {"input.file.name",
-                "\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u540D"}, //-file and -infile
-        {"key.algorithm.name",
-                "\u9375\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D"}, //-keyalg
-        {"key.password",
-                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-keypass
-        {"key.bit.size",
-                "\u9375\u306E\u30D3\u30C3\u30C8\u30FB\u30B5\u30A4\u30BA"}, //-keysize
-        {"keystore.name",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-keystore
-        {"new.password",
-                "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-new
-        {"do.not.prompt",
-                "\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u306A\u3044"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "\u4FDD\u8B77\u30E1\u30AB\u30CB\u30BA\u30E0\u306B\u3088\u308B\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-protected
-        {"provider.argument",
-                "\u30D7\u30ED\u30D0\u30A4\u30C0\u5F15\u6570"}, //-providerarg
-        {"provider.class.name",
-                "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FB\u30AF\u30E9\u30B9\u540D"}, //-providerclass
-        {"provider.name",
-                "\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-providername
-        {"provider.classpath",
-                "\u30D7\u30ED\u30D0\u30A4\u30C0\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9"}, //-providerpath
-        {"output.in.RFC.style",
-                "RFC\u30B9\u30BF\u30A4\u30EB\u306E\u51FA\u529B"}, //-rfc
-        {"signature.algorithm.name",
-                "\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D"}, //-sigalg
-        {"source.alias",
-                "\u30BD\u30FC\u30B9\u5225\u540D"}, //-srcalias
-        {"source.key.password",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-srckeypass
-        {"source.keystore.name",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u4FDD\u8B77\u5BFE\u8C61\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-srcprovidername
-        {"source.keystore.password",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-srcstorepass
-        {"source.keystore.type",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL\u30B5\u30FC\u30D0\u30FC\u306E\u30DB\u30B9\u30C8\u3068\u30DD\u30FC\u30C8"}, //-sslserver
-        {"signed.jar.file",
-                "\u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "\u8A3C\u660E\u66F8\u306E\u6709\u52B9\u958B\u59CB\u65E5\u6642"}, //-startdate
-        {"keystore.password",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-storepass
-        {"keystore.type",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "cacerts\u304B\u3089\u306E\u8A3C\u660E\u66F8\u3092\u4FE1\u983C\u3059\u308B"}, //-trustcacerts
-        {"verbose.output",
-                "\u8A73\u7D30\u51FA\u529B"}, //-v
-        {"validity.number.of.days",
-                "\u59A5\u5F53\u6027\u65E5\u6570"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "\u5931\u52B9\u3059\u308B\u8A3C\u660E\u66F8\u306E\u30B7\u30EA\u30A2\u30EBID"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "keytool\u30A8\u30E9\u30FC: "},
-        {"Illegal.option.", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3:  "},
-        {"Illegal.value.", "\u4E0D\u6B63\u306A\u5024: "},
-        {"Unknown.password.type.", "\u4E0D\u660E\u306A\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30BF\u30A4\u30D7: "},
-        {"Cannot.find.environment.variable.",
-                "\u74B0\u5883\u5909\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
-        {"Cannot.find.file.", "\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: "},
-        {"Command.option.flag.needs.an.argument.", "\u30B3\u30DE\u30F3\u30C9\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "\u8B66\u544A: PKCS12\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u306F\u3001\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7570\u306A\u308B\u72B6\u6CC1\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F{0}\u306E\u5024\u306F\u7121\u8996\u3057\u307E\u3059\u3002"},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keystore\u306FNONE\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Too.many.retries.program.terminated",
-                 "\u518D\u8A66\u884C\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u30D7\u30ED\u30B0\u30E9\u30E0\u304C\u7D42\u4E86\u3057\u307E\u3057\u305F"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-storepasswd\u30B3\u30DE\u30F3\u30C9\u304A\u3088\u3073-keypasswd\u30B3\u30DE\u30F3\u30C9\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "-storetype\u304CPKCS12\u306E\u5834\u5408\u3001-keypasswd\u30B3\u30DE\u30F3\u30C9\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-storetype\u304C{0}\u306E\u5834\u5408\u3001-keypass\u3068-new\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "-protected\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001-storepass\u3001-keypass\u304A\u3088\u3073-new\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "-srcprotected\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001-srcstorepass\u304A\u3088\u3073-srckeypass\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u4FDD\u8B77\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001-storepass\u3001-keypass\u304A\u3088\u3073-new\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u4FDD\u8B77\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001-srcstorepass\u304A\u3088\u3073-srckeypass\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"Illegal.startdate.value", "startdate\u5024\u304C\u7121\u52B9\u3067\u3059"},
-        {"Validity.must.be.greater.than.zero",
-                "\u59A5\u5F53\u6027\u306F\u30BC\u30ED\u3088\u308A\u5927\u304D\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"provName.not.a.provider", "{0}\u306F\u30D7\u30ED\u30D0\u30A4\u30C0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"Usage.error.no.command.provided", "\u4F7F\u7528\u30A8\u30E9\u30FC: \u30B3\u30DE\u30F3\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Source.keystore.file.exists.but.is.empty.", "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u5B58\u5728\u3057\u307E\u3059\u304C\u7A7A\u3067\u3059: "},
-        {"Please.specify.srckeystore", "-srckeystore\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "'list'\u30B3\u30DE\u30F3\u30C9\u306B-v\u3068-rfc\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-        {"Key.password.must.be.at.least.6.characters",
-                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"New.password.must.be.at.least.6.characters",
-                "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Keystore.file.exists.but.is.empty.",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u3059\u304C\u3001\u7A7A\u3067\u3059: "},
-        {"Keystore.file.does.not.exist.",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u5B58\u5728\u3057\u307E\u305B\u3093: "},
-        {"Must.specify.destination.alias", "\u51FA\u529B\u5148\u306E\u5225\u540D\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Must.specify.alias", "\u5225\u540D\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F6\u6587\u5B57\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Enter.keystore.password.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
-        {"Enter.source.keystore.password.", "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
-        {"Enter.destination.keystore.password.", "\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u306B\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Unknown.Entry.Type", "\u4E0D\u660E\u306A\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7"},
-        {"Too.many.failures.Alias.not.changed", "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u5225\u540D\u306F\u5909\u66F4\u3055\u308C\u307E\u305B\u3093"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002"},
-        {"Entry.for.alias.alias.not.imported.", "\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u4E2D\u306B\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1}\u3002\n\u5225\u540D{0}\u306E\u30A8\u30F3\u30C8\u30EA\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "\u30A4\u30F3\u30DD\u30FC\u30C8\u30FB\u30B3\u30DE\u30F3\u30C9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F: {0}\u4EF6\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u304C\u6210\u529F\u3057\u307E\u3057\u305F\u3002{1}\u4EF6\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u304C\u5931\u6557\u3057\u305F\u304B\u53D6\u308A\u6D88\u3055\u308C\u307E\u3057\u305F"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "\u8B66\u544A: \u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u65E2\u5B58\u306E\u5225\u540D{0}\u3092\u4E0A\u66F8\u304D\u3057\u3066\u3044\u307E\u3059"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "\u65E2\u5B58\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u5225\u540D{0}\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
-        {"Too.many.failures.try.later", "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059 - \u5F8C\u3067\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Certification.request.stored.in.file.filename.",
-                "\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u30D5\u30A1\u30A4\u30EB<{0}>\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F"},
-        {"Submit.this.to.your.CA", "\u3053\u308C\u3092CA\u306B\u63D0\u51FA\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "\u5225\u540D\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u3001\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u5225\u540D\u3001\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304A\u3088\u3073\u51FA\u529B\u5148\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-        {"Certificate.stored.in.file.filename.",
-                "\u8A3C\u660E\u66F8\u304C\u30D5\u30A1\u30A4\u30EB<{0}>\u306B\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u307E\u3057\u305F"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"Certificate.was.added.to.keystore",
-                "\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F"},
-        {"Certificate.was.not.added.to.keystore",
-                "\u8A3C\u660E\u66F8\u304C\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {".Storing.ksfname.", "[{0}\u3092\u683C\u7D0D\u4E2D]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0}\u306B\u306F\u516C\u958B\u9375(\u8A3C\u660E\u66F8)\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"Cannot.derive.signature.algorithm",
-                "\u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093"},
-        {"Alias.alias.does.not.exist",
-                "\u5225\u540D<{0}>\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
-        {"Alias.alias.has.no.certificate",
-                "\u5225\u540D<{0}>\u306B\u306F\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "\u9375\u30DA\u30A2\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "{3}\u65E5\u9593\u6709\u52B9\u306A{0}\u30D3\u30C3\u30C8\u306E{1}\u306E\u9375\u30DA\u30A2\u3068\u81EA\u5DF1\u7F72\u540D\u578B\u8A3C\u660E\u66F8({2})\u3092\u751F\u6210\u3057\u3066\u3044\u307E\u3059\n\t\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u540D: {4}"},
-        {"Enter.key.password.for.alias.", "<{0}>\u306E\u9375\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u540C\u3058\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059 - \u9375\u306F\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"Destination.alias.dest.already.exists",
-                "\u51FA\u529B\u5148\u306E\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u77ED\u3059\u304E\u307E\u3059 - 6\u6587\u5B57\u4EE5\u4E0A\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "\u969C\u5BB3\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u306F\u4F5C\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"key.password.for.alias.", "<{0}>\u306E\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30A8\u30F3\u30C8\u30EA\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u4F5C\u6210\u4E2D..."},
-        {"No.entries.from.identity.database.added",
-                "\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304B\u3089\u8FFD\u52A0\u3055\u308C\u305F\u30A8\u30F3\u30C8\u30EA\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"Alias.name.alias", "\u5225\u540D: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "\u4F5C\u6210\u65E5: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0},{1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7: {0}"},
-        {"Certificate.chain.length.", "\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306E\u9577\u3055: "},
-        {"Certificate.i.1.", "\u8A3C\u660E\u66F8[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8(SHA1): "},
-        {"Keystore.type.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7: "},
-        {"Keystore.provider.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u306F{0,number,integer}\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u307E\u3059"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u306F{0,number,integer}\u30A8\u30F3\u30C8\u30EA\u304C\u542B\u307E\u308C\u307E\u3059"},
-        {"Failed.to.parse.input", "\u5165\u529B\u306E\u69CB\u6587\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"Empty.input", "\u5165\u529B\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"Not.X.509.certificate", "X.509\u8A3C\u660E\u66F8\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"alias.has.no.public.key", "{0}\u306B\u306F\u516C\u958B\u9375\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"alias.has.no.X.509.certificate", "{0}\u306B\u306FX.509\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"New.certificate.self.signed.", "\u65B0\u3057\u3044\u8A3C\u660E\u66F8(\u81EA\u5DF1\u7F72\u540D\u578B):"},
-        {"Reply.has.no.certificates", "\u5FDC\u7B54\u306B\u306F\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "\u8A3C\u660E\u66F8\u306F\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Input.not.an.X.509.certificate", "\u5165\u529B\u306FX.509\u8A3C\u660E\u66F8\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "\u8A3C\u660E\u66F8\u306F\u3001\u5225\u540D<{0}>\u306E\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Do.you.still.want.to.add.it.no.",
-                "\u8FFD\u52A0\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "\u8A3C\u660E\u66F8\u306F\u3001\u5225\u540D<{0}>\u306E\u30B7\u30B9\u30C6\u30E0\u898F\u6A21\u306ECA\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306B\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u8FFD\u52A0\u3057\u307E\u3059\u304B\u3002 [\u3044\u3044\u3048]:  "},
-        {"Trust.this.certificate.no.", "\u3053\u306E\u8A3C\u660E\u66F8\u3092\u4FE1\u983C\u3057\u307E\u3059\u304B\u3002 [\u3044\u3044\u3048]:  "},
-        {"YES", "\u306F\u3044"},
-        {"New.prompt.", "\u65B0\u898F{0}: "},
-        {"Passwords.must.differ", "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7570\u306A\u3063\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Re.enter.new.prompt.", "\u65B0\u898F{0}\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
-        {"Re.enter.new.password.", "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
-        {"They.don.t.match.Try.again", "\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Enter.prompt.alias.name.", "{0}\u306E\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "\u65B0\u3057\u3044\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\t(\u3053\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u3092\u53D6\u308A\u6D88\u3059\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044):  "},
-        {"Enter.alias.name.", "\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(<{0}>\u3068\u540C\u3058\u5834\u5408\u306FRETURN\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044)"},
-        {".PATTERN.printX509Cert",
-                "\u6240\u6709\u8005: {0}\n\u767A\u884C\u8005: {1}\n\u30B7\u30EA\u30A2\u30EB\u756A\u53F7: {2}\n\u6709\u52B9\u671F\u9593\u306E\u958B\u59CB\u65E5: {3}\u7D42\u4E86\u65E5: {4}\n\u8A3C\u660E\u66F8\u306E\u30D5\u30A3\u30F3\u30AC\u30D7\u30EA\u30F3\u30C8:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7F72\u540D\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u540D: {8}\n\t \u30D0\u30FC\u30B8\u30E7\u30F3: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "\u59D3\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "\u7D44\u7E54\u5358\u4F4D\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"What.is.the.name.of.your.organization.",
-                "\u7D44\u7E54\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "\u90FD\u5E02\u540D\u307E\u305F\u306F\u5730\u57DF\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "\u90FD\u9053\u5E9C\u770C\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "\u3053\u306E\u5358\u4F4D\u306B\u8A72\u5F53\u3059\u308B2\u6587\u5B57\u306E\u56FD\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"Is.name.correct.", "{0}\u3067\u3088\u308D\u3057\u3044\u3067\u3059\u304B\u3002"},
-        {"no", "\u3044\u3044\u3048"},
-        {"yes", "\u306F\u3044"},
-        {"y", "y"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "\u5225\u540D<{0}>\u306B\u306F\u9375\u304C\u3042\u308A\u307E\u305B\u3093"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "\u5225\u540D<{0}>\u304C\u53C2\u7167\u3057\u3066\u3044\u308B\u30A8\u30F3\u30C8\u30EA\u30FB\u30BF\u30A4\u30D7\u306F\u79D8\u5BC6\u9375\u30A8\u30F3\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002-keyclone\u30B3\u30DE\u30F3\u30C9\u306F\u79D8\u5BC6\u9375\u30A8\u30F3\u30C8\u30EA\u306E\u30AF\u30ED\u30FC\u30F3\u4F5C\u6210\u306E\u307F\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************\u8B66\u544A \u8B66\u544A \u8B66\u544A*****************"},
-        {"Signer.d.", "\u7F72\u540D\u8005\u756A\u53F7%d:"},
-        {"Timestamp.", "\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7:"},
-        {"Signature.", "\u7F72\u540D:"},
-        {"CRLs.", "CRL:"},
-        {"Certificate.owner.", "\u8A3C\u660E\u66F8\u306E\u6240\u6709\u8005: "},
-        {"Not.a.signed.jar.file", "\u7F72\u540D\u4ED8\u304DJAR\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"No.certificate.from.the.SSL.server",
-                "SSL\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u306E\u8A3C\u660E\u66F8\u304C\u3042\u308A\u307E\u305B\u3093"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "*\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u4FDD\u5B58\u3055\u308C\u305F\u60C5\u5831\u306E\u6574\u5408\u6027\u306F*\n*\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u6574\u5408\u6027\u3092\u691C\u8A3C\u3059\u308B\u306B\u306F*\n*\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002*"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "*\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u4FDD\u5B58\u3055\u308C\u305F\u60C5\u5831\u306E\u6574\u5408\u6027\u306F*\n*\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u6574\u5408\u6027\u3092\u691C\u8A3C\u3059\u308B\u306B\u306F*\n*\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002*"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u306B\u306F\u3001<{0}>\u306E\u516C\u958B\u9375\u306F\u542B\u307E\u308C\u307E\u305B\u3093"},
-        {"Incomplete.certificate.chain.in.reply",
-                "\u5FDC\u7B54\u3057\u305F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u4E0D\u5B8C\u5168\u3067\u3059"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "\u5FDC\u7B54\u3057\u305F\u8A3C\u660E\u66F8\u30C1\u30A7\u30FC\u30F3\u306F\u691C\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093: "},
-        {"Top.level.certificate.in.reply.",
-                "\u5FDC\u7B54\u3057\u305F\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306E\u8A3C\u660E\u66F8:\n"},
-        {".is.not.trusted.", "... \u306F\u4FE1\u983C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 "},
-        {"Install.reply.anyway.no.", "\u5FDC\u7B54\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u307E\u3059\u304B\u3002[\u3044\u3044\u3048]:  "},
-        {"NO", "\u3044\u3044\u3048"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "\u5FDC\u7B54\u3057\u305F\u516C\u958B\u9375\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "\u8A3C\u660E\u66F8\u5FDC\u7B54\u3068\u30AD\u30FC\u30B9\u30C8\u30A2\u5185\u306E\u8A3C\u660E\u66F8\u304C\u540C\u3058\u3067\u3059"},
-        {"Failed.to.establish.chain.from.reply",
-                "\u5FDC\u7B54\u304B\u3089\u9023\u9396\u3092\u78BA\u7ACB\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "\u5FDC\u7B54\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "\u79D8\u5BC6\u9375\u306F\u751F\u6210\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5225\u540D<{0}>\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "\u79D8\u5BC6\u9375\u306E\u751F\u6210\u6642\u306B\u306F -keysize\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},
-
-        {"Extensions.", "\u62E1\u5F35: "},
-        {".Empty.value.", "(\u7A7A\u306E\u5024)"},
-        {"Extension.Request.", "\u62E1\u5F35\u30EA\u30AF\u30A8\u30B9\u30C8:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10\u8A3C\u660E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8(\u30D0\u30FC\u30B8\u30E7\u30F31.0)\n\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8: %s\n\u516C\u958B\u9375: %s \u30D5\u30A9\u30FC\u30DE\u30C3\u30C8 %s \u30AD\u30FC\n"},
-        {"Unknown.keyUsage.type.", "\u4E0D\u660E\u306AkeyUsage\u30BF\u30A4\u30D7: "},
-        {"Unknown.extendedkeyUsage.type.", "\u4E0D\u660E\u306AextendedkeyUsage\u30BF\u30A4\u30D7: "},
-        {"Unknown.AccessDescription.type.", "\u4E0D\u660E\u306AAccessDescription\u30BF\u30A4\u30D7: "},
-        {"Unrecognized.GeneralName.type.", "\u8A8D\u8B58\u3055\u308C\u306A\u3044GeneralName\u30BF\u30A4\u30D7: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "\u3053\u306E\u62E1\u5F35\u306F\u30AF\u30EA\u30C6\u30A3\u30AB\u30EB\u3068\u3057\u3066\u30DE\u30FC\u30AF\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3002 "},
-        {"Odd.number.of.hex.digits.found.", "\u5947\u6570\u306E16\u9032\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: "},
-        {"Unknown.extension.type.", "\u4E0D\u660E\u306A\u62E1\u5F35\u30BF\u30A4\u30D7: "},
-        {"command.{0}.is.ambiguous.", "\u30B3\u30DE\u30F3\u30C9{0}\u306F\u3042\u3044\u307E\u3044\u3067\u3059:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u5225\u540D{0}\u306E\u516C\u958B\u9375\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002\u30AD\u30FC\u30B9\u30C8\u30A2\u304C\u6B63\u3057\u304F\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0}"},
-        {"Illegal.Principal.Type.type", "\u4E0D\u6B63\u306A\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7: {0}"},
-        {"Illegal.option.option", "\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},
-        {"Usage.policytool.options.", "\u4F7F\u7528\u65B9\u6CD5: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]  \u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240"},
-        {"New", "\u65B0\u898F"},
-        {"Open", "\u958B\u304F"},
-        {"Save", "\u4FDD\u5B58"},
-        {"Save.As", "\u5225\u540D\u4FDD\u5B58"},
-        {"View.Warning.Log", "\u8B66\u544A\u30ED\u30B0\u306E\u8868\u793A"},
-        {"Exit", "\u7D42\u4E86"},
-        {"Add.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u8FFD\u52A0"},
-        {"Edit.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u7DE8\u96C6"},
-        {"Remove.Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u306E\u524A\u9664"},
-        {"Edit", "\u7DE8\u96C6"},
-        {"Retain", "\u4FDD\u6301"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u30D5\u30A1\u30A4\u30EB\u540D\u306B\u30A8\u30B9\u30B1\u30FC\u30D7\u3055\u308C\u305F\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D0\u30C3\u30AF\u30B9\u30E9\u30C3\u30B7\u30E5\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093(\u30C4\u30FC\u30EB\u306F\u30DD\u30EA\u30B7\u30FC\u5185\u5BB9\u3092\u6C38\u7D9A\u30B9\u30C8\u30A2\u306B\u66F8\u304D\u8FBC\u3080\u3068\u304D\u306B\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u6587\u5B57\u3092\u30A8\u30B9\u30B1\u30FC\u30D7\u3057\u307E\u3059)\u3002\n\n\u5165\u529B\u6E08\u306E\u540D\u524D\u3092\u4FDD\u6301\u3059\u308B\u306B\u306F\u300C\u4FDD\u6301\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3001\u540D\u524D\u3092\u7DE8\u96C6\u3059\u308B\u306B\u306F\u300C\u7DE8\u96C6\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
-        {"Add.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u306E\u8FFD\u52A0"},
-        {"Remove.Public.Key.Alias", "\u516C\u958B\u9375\u306E\u5225\u540D\u3092\u524A\u9664"},
-        {"File", "\u30D5\u30A1\u30A4\u30EB"},
-        {"KeyStore", "\u30AD\u30FC\u30B9\u30C8\u30A2"},
-        {"Policy.File.", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u30DD\u30EA\u30B7\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F: {0}: {1}"},
-        {"Policy.Tool", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30C4\u30FC\u30EB"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u30DD\u30EA\u30B7\u30FC\u69CB\u6210\u3092\u958B\u304F\u3068\u304D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u8A73\u7D30\u306F\u8B66\u544A\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-        {"Error", "\u30A8\u30E9\u30FC"},
-        {"OK", "OK"},
-        {"Status", "\u72B6\u614B"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u30A2\u30AF\u30BB\u30B9\u6A29:                                                       "},
-        {"Principal.Type.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30BF\u30A4\u30D7:"},
-        {"Principal.Name.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u540D\u524D:"},
-        {"Target.Name.",
-                "\u30BF\u30FC\u30B2\u30C3\u30C8\u540D:                                                    "},
-        {"Actions.",
-                "\u30A2\u30AF\u30B7\u30E7\u30F3:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\u3002"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u8FFD\u52A0"},
-        {"Edit.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6"},
-        {"Remove.Principal", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u524A\u9664"},
-        {"Principals.", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB:"},
-        {".Add.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0"},
-        {".Edit.Permission", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6"},
-        {"Remove.Permission", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u524A\u9664"},
-        {"Done", "\u5B8C\u4E86"},
-        {"KeyStore.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2URL:"},
-        {"KeyStore.Type.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u306E\u30BF\u30A4\u30D7:"},
-        {"KeyStore.Provider.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0:"},
-        {"KeyStore.Password.URL.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9URL:"},
-        {"Principals", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB"},
-        {".Edit.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u7DE8\u96C6:"},
-        {".Add.New.Principal.", "  \u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u65B0\u898F\u8FFD\u52A0:"},
-        {"Permissions", "\u30A2\u30AF\u30BB\u30B9\u6A29"},
-        {".Edit.Permission.", "  \u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u7DE8\u96C6:"},
-        {".Add.New.Permission.", "  \u65B0\u898F\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u8FFD\u52A0:"},
-        {"Signed.By.", "\u7F72\u540D\u8005:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u540D\u306E\u306A\u3044\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u30FB\u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u540D\u524D\u3092\u4F7F\u7528\u305B\u305A\u306B\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u30A2\u30AF\u30BB\u30B9\u6A29\u3068\u30BF\u30FC\u30B2\u30C3\u30C8\u540D\u306F\u3001\u5024\u3092\u4FDD\u6301\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-        {"Remove.this.Policy.Entry.", "\u3053\u306E\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\u3002"},
-        {"Overwrite.File", "\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059"},
-        {"Policy.successfully.written.to.filename",
-                "\u30DD\u30EA\u30B7\u30FC\u306E{0}\u3078\u306E\u66F8\u8FBC\u307F\u306B\u6210\u529F\u3057\u307E\u3057\u305F"},
-        {"null.filename", "\u30D5\u30A1\u30A4\u30EB\u540D\u304Cnull\u3067\u3059"},
-        {"Save.changes.", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059\u304B\u3002"},
-        {"Yes", "\u306F\u3044"},
-        {"No", "\u3044\u3044\u3048"},
-        {"Policy.Entry", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA"},
-        {"Save.Changes", "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3059"},
-        {"No.Policy.Entry.selected", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30A8\u30F3\u30C8\u30EA\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u30AD\u30FC\u30B9\u30C8\u30A2{0}\u3092\u958B\u3051\u307E\u305B\u3093"},
-        {"No.principal.selected", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"No.permission.selected", "\u30A2\u30AF\u30BB\u30B9\u6A29\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"name", "\u540D\u524D"},
-        {"configuration.type", "\u69CB\u6210\u30BF\u30A4\u30D7"},
-        {"environment.variable.name", "\u74B0\u5883\u5909\u6570\u540D"},
-        {"library.name", "\u30E9\u30A4\u30D6\u30E9\u30EA\u540D"},
-        {"package.name", "\u30D1\u30C3\u30B1\u30FC\u30B8\u540D"},
-        {"policy.type", "\u30DD\u30EA\u30B7\u30FC\u30FB\u30BF\u30A4\u30D7"},
-        {"property.name", "\u30D7\u30ED\u30D1\u30C6\u30A3\u540D"},
-        {"Principal.List", "\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u306E\u30EA\u30B9\u30C8"},
-        {"Permission.List", "\u30A2\u30AF\u30BB\u30B9\u6A29\u306E\u30EA\u30B9\u30C8"},
-        {"Code.Base", "\u30B3\u30FC\u30C9\u30FB\u30D9\u30FC\u30B9"},
-        {"KeyStore.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2U R L:"},
-        {"KeyStore.Password.U.R.L.", "\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D1\u30B9\u30EF\u30FC\u30C9U R L:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "null\u306E\u5165\u529B\u306F\u7121\u52B9\u3067\u3059"},
         {"actions.can.only.be.read.", "\u30A2\u30AF\u30B7\u30E7\u30F3\u306F'\u8AAD\u8FBC\u307F'\u306E\u307F\u53EF\u80FD\u3067\u3059"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "null\u306EOID\u30DE\u30C3\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "\u7121\u52B9\u306Anull AccessControlContext\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F"},
         {"invalid.null.action.provided", "\u7121\u52B9\u306Anull\u30A2\u30AF\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_ko.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_ko.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [\uC635\uC158]..."},
-        {"Options.", "\uC635\uC158:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uBAA8\uB4E0 \uBA85\uB839\uC5D0 \"keytool -help\" \uC0AC\uC6A9"},
-        {"Key.and.Certificate.Management.Tool",
-                 "\uD0A4 \uBC0F \uC778\uC99D\uC11C \uAD00\uB9AC \uD234"},
-        {"Commands.", "\uBA85\uB839:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "command_name \uC0AC\uC6A9\uBC95\uC5D0 \"keytool -command_name -help\" \uC0AC\uC6A9"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "\uC778\uC99D\uC11C \uC694\uCCAD\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "\uD56D\uBAA9\uC758 \uBCC4\uCE6D\uC744 \uBCC0\uACBD\uD569\uB2C8\uB2E4."}, //-changealias
-        {"Deletes.an.entry",
-                "\uD56D\uBAA9\uC744 \uC0AD\uC81C\uD569\uB2C8\uB2E4."}, //-delete
-        {"Exports.certificate",
-                "\uC778\uC99D\uC11C\uB97C \uC775\uC2A4\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-exportcert
-        {"Generates.a.key.pair",
-                "\uD0A4 \uC30D\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "\uBCF4\uC548 \uD0A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "\uC778\uC99D\uC11C \uC694\uCCAD\uC5D0\uC11C \uC778\uC99D\uC11C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-gencert
-        {"Generates.CRL", "CRL\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "JDK 1.1.x \uC2A4\uD0C0\uC77C ID \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0\uC11C \uD56D\uBAA9\uC744 \uC784\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "\uC778\uC99D\uC11C \uB610\uB294 \uC778\uC99D\uC11C \uCCB4\uC778\uC744 \uC784\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "\uB2E4\uB978 \uD0A4 \uC800\uC7A5\uC18C\uC5D0\uC11C \uD558\uB098 \uB610\uB294 \uBAA8\uB4E0 \uD56D\uBAA9\uC744 \uC784\uD3EC\uD2B8\uD569\uB2C8\uB2E4."}, //-importkeystore
-        {"Clones.a.key.entry",
-                "\uD0A4 \uD56D\uBAA9\uC744 \uBCF5\uC81C\uD569\uB2C8\uB2E4."}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "\uD56D\uBAA9\uC758 \uD0A4 \uBE44\uBC00\uBC88\uD638\uB97C \uBCC0\uACBD\uD569\uB2C8\uB2E4."}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "\uD0A4 \uC800\uC7A5\uC18C\uC758 \uD56D\uBAA9\uC744 \uB098\uC5F4\uD569\uB2C8\uB2E4."}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "\uC778\uC99D\uC11C\uC758 \uCF58\uD150\uCE20\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4."}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "\uC778\uC99D\uC11C \uC694\uCCAD\uC758 \uCF58\uD150\uCE20\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4."}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "CRL \uD30C\uC77C\uC758 \uCF58\uD150\uCE20\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4."}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "\uC790\uCCB4 \uC11C\uBA85\uB41C \uC778\uC99D\uC11C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "\uD0A4 \uC800\uC7A5\uC18C\uC758 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB97C \uBCC0\uACBD\uD569\uB2C8\uB2E4."}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "\uCC98\uB9AC\uD560 \uD56D\uBAA9\uC758 \uBCC4\uCE6D \uC774\uB984"}, //-alias
-        {"destination.alias",
-                "\uB300\uC0C1 \uBCC4\uCE6D"}, //-destalias
-        {"destination.key.password",
-                "\uB300\uC0C1 \uD0A4 \uBE44\uBC00\uBC88\uD638"}, //-destkeypass
-        {"destination.keystore.name",
-                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB428"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790 \uC774\uB984"}, //-destprovidername
-        {"destination.keystore.password",
-                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638"}, //-deststorepass
-        {"destination.keystore.type",
-                "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uC720\uD615"}, //-deststoretype
-        {"distinguished.name",
-                "\uC2DD\uBCC4 \uC774\uB984"}, //-dname
-        {"X.509.extension",
-                "X.509 \uD655\uC7A5"}, //-ext
-        {"output.file.name",
-                "\uCD9C\uB825 \uD30C\uC77C \uC774\uB984"}, //-file and -outfile
-        {"input.file.name",
-                "\uC785\uB825 \uD30C\uC77C \uC774\uB984"}, //-file and -infile
-        {"key.algorithm.name",
-                "\uD0A4 \uC54C\uACE0\uB9AC\uC998 \uC774\uB984"}, //-keyalg
-        {"key.password",
-                "\uD0A4 \uBE44\uBC00\uBC88\uD638"}, //-keypass
-        {"key.bit.size",
-                "\uD0A4 \uBE44\uD2B8 \uD06C\uAE30"}, //-keysize
-        {"keystore.name",
-                "\uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-keystore
-        {"new.password",
-                "\uC0C8 \uBE44\uBC00\uBC88\uD638"}, //-new
-        {"do.not.prompt",
-                "\uD655\uC778\uD558\uC9C0 \uC54A\uC74C"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "\uBCF4\uD638\uB418\uB294 \uBA54\uCEE4\uB2C8\uC998\uC744 \uD1B5\uD55C \uBE44\uBC00\uBC88\uD638"}, //-protected
-        {"provider.argument",
-                "\uC81C\uACF5\uC790 \uC778\uC218"}, //-providerarg
-        {"provider.class.name",
-                "\uC81C\uACF5\uC790 \uD074\uB798\uC2A4 \uC774\uB984"}, //-providerclass
-        {"provider.name",
-                "\uC81C\uACF5\uC790 \uC774\uB984"}, //-providername
-        {"provider.classpath",
-                "\uC81C\uACF5\uC790 \uD074\uB798\uC2A4 \uACBD\uB85C"}, //-providerpath
-        {"output.in.RFC.style",
-                "RFC \uC2A4\uD0C0\uC77C\uC758 \uCD9C\uB825"}, //-rfc
-        {"signature.algorithm.name",
-                "\uC11C\uBA85 \uC54C\uACE0\uB9AC\uC998 \uC774\uB984"}, //-sigalg
-        {"source.alias",
-                "\uC18C\uC2A4 \uBCC4\uCE6D"}, //-srcalias
-        {"source.key.password",
-                "\uC18C\uC2A4 \uD0A4 \uBE44\uBC00\uBC88\uD638"}, //-srckeypass
-        {"source.keystore.name",
-                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB428"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790 \uC774\uB984"}, //-srcprovidername
-        {"source.keystore.password",
-                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638"}, //-srcstorepass
-        {"source.keystore.type",
-                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uC720\uD615"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL \uC11C\uBC84 \uD638\uC2A4\uD2B8 \uBC0F \uD3EC\uD2B8"}, //-sslserver
-        {"signed.jar.file",
-                "\uC11C\uBA85\uB41C jar \uD30C\uC77C"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "\uC778\uC99D\uC11C \uC720\uD6A8 \uAE30\uAC04 \uC2DC\uC791 \uB0A0\uC9DC/\uC2DC\uAC04"}, //-startdate
-        {"keystore.password",
-                "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638"}, //-storepass
-        {"keystore.type",
-                "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "cacerts\uC758 \uBCF4\uC548 \uC778\uC99D\uC11C"}, //-trustcacerts
-        {"verbose.output",
-                "\uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825"}, //-v
-        {"validity.number.of.days",
-                "\uC720\uD6A8 \uAE30\uAC04 \uC77C \uC218"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "\uCCA0\uD68C\uD560 \uC778\uC99D\uC11C\uC758 \uC77C\uB828 ID"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "keytool \uC624\uB958: "},
-        {"Illegal.option.", "\uC798\uBABB\uB41C \uC635\uC158:   "},
-        {"Illegal.value.", "\uC798\uBABB\uB41C \uAC12: "},
-        {"Unknown.password.type.", "\uC54C \uC218 \uC5C6\uB294 \uBE44\uBC00\uBC88\uD638 \uC720\uD615: "},
-        {"Cannot.find.environment.variable.",
-                "\uD658\uACBD \uBCC0\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: "},
-        {"Cannot.find.file.", "\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: "},
-        {"Command.option.flag.needs.an.argument.", "\uBA85\uB839 \uC635\uC158 {0}\uC5D0 \uC778\uC218\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "\uACBD\uACE0: \uB2E4\uB978 \uC800\uC7A5\uC18C \uBC0F \uD0A4 \uBE44\uBC00\uBC88\uD638\uB294 PKCS12 KeyStores\uC5D0 \uB300\uD574 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C {0} \uAC12\uC744 \uBB34\uC2DC\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -keystore\uB294 NONE\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Too.many.retries.program.terminated",
-                 "\uC7AC\uC2DC\uB3C4 \uD69F\uC218\uAC00 \uB108\uBB34 \uB9CE\uC544 \uD504\uB85C\uADF8\uB7A8\uC774 \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -storepasswd \uBC0F -keypasswd \uBA85\uB839\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "-storetype\uC774 PKCS12\uC778 \uACBD\uC6B0 -keypasswd \uBA85\uB839\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -keypass \uBC0F -new\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "-protected\uB97C \uC9C0\uC815\uD55C \uACBD\uC6B0 -storepass, -keypass \uBC0F -new\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "-srcprotected\uB97C \uC9C0\uC815\uD55C \uACBD\uC6B0 -srcstorepass \uBC0F -srckeypass\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "\uD0A4 \uC800\uC7A5\uC18C\uAC00 \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 -storepass, -keypass \uBC0F -new\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C\uAC00 \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 -srcstorepass \uBC0F -srckeypass\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-        {"Illegal.startdate.value", "startdate \uAC12\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {"Validity.must.be.greater.than.zero",
-                "\uC720\uD6A8 \uAE30\uAC04\uC740 0\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4."},
-        {"provName.not.a.provider", "{0}\uC740(\uB294) \uC81C\uACF5\uC790\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
-        {"Usage.error.no.command.provided", "\uC0AC\uC6A9\uBC95 \uC624\uB958: \uBA85\uB839\uC744 \uC785\uB825\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"Source.keystore.file.exists.but.is.empty.", "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0\uB9CC \uBE44\uC5B4 \uC788\uC74C: "},
-        {"Please.specify.srckeystore", "-srckeystore\uB97C \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624."},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "'list' \uBA85\uB839\uC5D0 -v\uC640 -rfc\uB97C \uD568\uAED8 \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-        {"Key.password.must.be.at.least.6.characters",
-                "\uD0A4 \uBE44\uBC00\uBC88\uD638\uB294 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"New.password.must.be.at.least.6.characters",
-                "\uC0C8 \uBE44\uBC00\uBC88\uD638\uB294 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Keystore.file.exists.but.is.empty.",
-                "\uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0\uB9CC \uBE44\uC5B4 \uC788\uC74C: "},
-        {"Keystore.file.does.not.exist.",
-                "\uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC74C: "},
-        {"Must.specify.destination.alias", "\uB300\uC0C1 \uBCC4\uCE6D\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."},
-        {"Must.specify.alias", "\uBCC4\uCE6D\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4."},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB294 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Enter.keystore.password.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 \uC785\uB825:  "},
-        {"Enter.source.keystore.password.", "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 \uC785\uB825:  "},
-        {"Enter.destination.keystore.password.", "\uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 \uC785\uB825:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uAC00 \uB108\uBB34 \uC9E7\uC74C - 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Unknown.Entry.Type", "\uC54C \uC218 \uC5C6\uB294 \uD56D\uBAA9 \uC720\uD615"},
-        {"Too.many.failures.Alias.not.changed", "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4. \uBCC4\uCE6D\uC774 \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC774 \uC131\uACF5\uC801\uC73C\uB85C \uC784\uD3EC\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {"Entry.for.alias.alias.not.imported.", "{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC774 \uC784\uD3EC\uD2B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC744 \uC784\uD3EC\uD2B8\uD558\uB294 \uC911 \uBB38\uC81C \uBC1C\uC0DD: {1}.\n{0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uD56D\uBAA9\uC774 \uC784\uD3EC\uD2B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "\uC784\uD3EC\uD2B8 \uBA85\uB839 \uC644\uB8CC: \uC131\uACF5\uC801\uC73C\uB85C \uC784\uD3EC\uD2B8\uB41C \uD56D\uBAA9\uC740 {0}\uAC1C, \uC2E4\uD328\uD558\uAC70\uB098 \uCDE8\uC18C\uB41C \uD56D\uBAA9\uC740 {1}\uAC1C\uC785\uB2C8\uB2E4."},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "\uACBD\uACE0: \uB300\uC0C1 \uD0A4 \uC800\uC7A5\uC18C\uC5D0\uC11C \uAE30\uC874 \uBCC4\uCE6D {0}\uC744(\uB97C) \uACB9\uCCD0 \uC4F0\uB294 \uC911"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "\uAE30\uC874 \uD56D\uBAA9 \uBCC4\uCE6D {0}\uC774(\uAC00) \uC874\uC7AC\uD569\uB2C8\uB2E4. \uACB9\uCCD0 \uC4F0\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
-        {"Too.many.failures.try.later", "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC74C - \uB098\uC911\uC5D0 \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
-        {"Certification.request.stored.in.file.filename.",
-                "\uC778\uC99D \uC694\uCCAD\uC774 <{0}> \uD30C\uC77C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {"Submit.this.to.your.CA", "CA\uC5D0\uAC8C \uC81C\uCD9C\uD558\uC2ED\uC2DC\uC624."},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "\uBCC4\uCE6D\uC744 \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0 destalias, srckeypass \uBC0F destkeypass\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-        {"Certificate.stored.in.file.filename.",
-                "\uC778\uC99D\uC11C\uAC00 <{0}> \uD30C\uC77C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.reply.was.installed.in.keystore",
-                "\uC778\uC99D\uC11C \uD68C\uC2E0\uC774 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC124\uCE58\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "\uC778\uC99D\uC11C \uD68C\uC2E0\uC774 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.was.added.to.keystore",
-                "\uC778\uC99D\uC11C\uAC00 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uCD94\uAC00\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.was.not.added.to.keystore",
-                "\uC778\uC99D\uC11C\uAC00 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uCD94\uAC00\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {".Storing.ksfname.", "[{0}\uC744(\uB97C) \uC800\uC7A5\uD558\uB294 \uC911]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0}\uC5D0 \uACF5\uC6A9 \uD0A4(\uC778\uC99D\uC11C)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Cannot.derive.signature.algorithm",
-                "\uC11C\uBA85 \uC54C\uACE0\uB9AC\uC998\uC744 \uD30C\uC0DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Alias.alias.does.not.exist",
-                "<{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-        {"Alias.alias.has.no.certificate",
-                "<{0}> \uBCC4\uCE6D\uC5D0 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "\uD0A4 \uC30D\uC774 \uC0DD\uC131\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 <{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "\uB2E4\uC74C\uC5D0 \uB300\uD574 \uC720\uD6A8 \uAE30\uAC04\uC774 {3}\uC77C\uC778 {0}\uBE44\uD2B8 {1} \uD0A4 \uC30D \uBC0F \uC790\uCCB4 \uC11C\uBA85\uB41C \uC778\uC99D\uC11C({2})\uB97C \uC0DD\uC131\uD558\uB294 \uC911\n\t: {4}"},
-        {"Enter.key.password.for.alias.", "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uC640 \uB3D9\uC77C\uD55C \uACBD\uC6B0 Enter \uD0A4\uB97C \uB204\uB984):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "\uD0A4 \uBE44\uBC00\uBC88\uD638\uAC00 \uB108\uBB34 \uC9E7\uC74C - 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC74C - \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uD0A4\uAC00 \uCD94\uAC00\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"Destination.alias.dest.already.exists",
-                "\uB300\uC0C1 \uBCC4\uCE6D <{0}>\uC774(\uAC00) \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "\uBE44\uBC00\uBC88\uD638\uAC00 \uB108\uBB34 \uC9E7\uC74C - 6\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "\uC624\uB958\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4. \uD0A4 \uD56D\uBAA9\uC774 \uBCF5\uC81C\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-        {"key.password.for.alias.", "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uBE44\uBC00\uBC88\uD638"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uC800\uC7A5\uC18C \uD56D\uBAA9\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Creating.keystore.entry.for.id.getName.",
-                "<{0}>\uC5D0 \uB300\uD55C \uD0A4 \uC800\uC7A5\uC18C \uD56D\uBAA9\uC744 \uC0DD\uC131\uD558\uB294 \uC911..."},
-        {"No.entries.from.identity.database.added",
-                "ID \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0\uC11C \uCD94\uAC00\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Alias.name.alias", "\uBCC4\uCE6D \uC774\uB984: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "\uC0DD\uC131 \uB0A0\uC9DC: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "\uD56D\uBAA9 \uC720\uD615: {0}"},
-        {"Certificate.chain.length.", "\uC778\uC99D\uC11C \uCCB4\uC778 \uAE38\uC774: "},
-        {"Certificate.i.1.", "\uC778\uC99D\uC11C[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "\uC778\uC99D\uC11C \uC9C0\uBB38(SHA1): "},
-        {"Keystore.type.", "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615: "},
-        {"Keystore.provider.", "\uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "\uD0A4 \uC800\uC7A5\uC18C\uC5D0 {0,number,integer}\uAC1C\uC758 \uD56D\uBAA9\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "\uD0A4 \uC800\uC7A5\uC18C\uC5D0 {0,number,integer}\uAC1C\uC758 \uD56D\uBAA9\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
-        {"Failed.to.parse.input", "\uC785\uB825\uAC12\uC758 \uAD6C\uBB38 \uBD84\uC11D\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-        {"Empty.input", "\uC785\uB825\uAC12\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
-        {"Not.X.509.certificate", "X.509 \uC778\uC99D\uC11C\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
-        {"alias.has.no.public.key", "{0}\uC5D0 \uACF5\uC6A9 \uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"alias.has.no.X.509.certificate", "{0}\uC5D0 X.509 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"New.certificate.self.signed.", "\uC0C8 \uC778\uC99D\uC11C(\uC790\uCCB4 \uC11C\uBA85):"},
-        {"Reply.has.no.certificates", "\uD68C\uC2E0\uC5D0 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "\uC778\uC99D\uC11C\uAC00 \uC784\uD3EC\uD2B8\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 <{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Input.not.an.X.509.certificate", "\uC785\uB825\uC774 X.509 \uC778\uC99D\uC11C\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "\uC778\uC99D\uC11C\uAC00 <{0}> \uBCC4\uCE6D \uC544\uB798\uC758 \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Do.you.still.want.to.add.it.no.",
-                "\uCD94\uAC00\uD558\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "\uC778\uC99D\uC11C\uAC00 <{0}> \uBCC4\uCE6D \uC544\uB798\uC5D0 \uC788\uB294 \uC2DC\uC2A4\uD15C \uCC28\uC6D0\uC758 CA \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "\uACE0\uC720\uD55C \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uCD94\uAC00\uD558\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
-        {"Trust.this.certificate.no.", "\uC774 \uC778\uC99D\uC11C\uB97C \uC2E0\uB8B0\uD569\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
-        {"YES", "\uC608"},
-        {"New.prompt.", "\uC0C8 {0}: "},
-        {"Passwords.must.differ", "\uBE44\uBC00\uBC88\uD638\uB294 \uB2EC\uB77C\uC57C \uD569\uB2C8\uB2E4."},
-        {"Re.enter.new.prompt.", "\uC0C8 {0} \uB2E4\uC2DC \uC785\uB825: "},
-        {"Re.enter.new.password.", "\uC0C8 \uBE44\uBC00\uBC88\uD638 \uB2E4\uC2DC \uC785\uB825: "},
-        {"They.don.t.match.Try.again", "\uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
-        {"Enter.prompt.alias.name.", "{0} \uBCC4\uCE6D \uC774\uB984 \uC785\uB825:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "\uC0C8 \uBCC4\uCE6D \uC774\uB984 \uC785\uB825\t(\uC774 \uD56D\uBAA9\uC5D0 \uB300\uD55C \uC784\uD3EC\uD2B8\uB97C \uCDE8\uC18C\uD558\uB824\uBA74 Enter \uD0A4\uB97C \uB204\uB984):  "},
-        {"Enter.alias.name.", "\uBCC4\uCE6D \uC774\uB984 \uC785\uB825:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(<{0}>\uACFC(\uC640) \uB3D9\uC77C\uD55C \uACBD\uC6B0 Enter \uD0A4\uB97C \uB204\uB984)"},
-        {".PATTERN.printX509Cert",
-                "\uC18C\uC720\uC790: {0}\n\uBC1C\uD589\uC790: {1}\n\uC77C\uB828 \uBC88\uD638: {2}\n\uC801\uD569\uD55C \uC2DC\uC791 \uB0A0\uC9DC: {3}, \uC885\uB8CC \uB0A0\uC9DC: {4}\n\uC778\uC99D\uC11C \uC9C0\uBB38:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \uC11C\uBA85 \uC54C\uACE0\uB9AC\uC998 \uC774\uB984: {8}\n\t \uBC84\uC804: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "\uC774\uB984\uACFC \uC131\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "\uC870\uC9C1 \uB2E8\uC704 \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
-        {"What.is.the.name.of.your.organization.",
-                "\uC870\uC9C1 \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "\uAD6C/\uAD70/\uC2DC \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "\uC2DC/\uB3C4 \uC774\uB984\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "\uC774 \uC870\uC9C1\uC758 \uB450 \uC790\uB9AC \uAD6D\uAC00 \uCF54\uB4DC\uB97C \uC785\uB825\uD558\uC2ED\uC2DC\uC624."},
-        {"Is.name.correct.", "{0}\uC774(\uAC00) \uB9DE\uC2B5\uB2C8\uAE4C?"},
-        {"no", "\uC544\uB2C8\uC624"},
-        {"yes", "\uC608"},
-        {"y", "y"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "<{0}> \uBCC4\uCE6D\uC5D0 \uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "<{0}> \uBCC4\uCE6D\uC740 \uC804\uC6A9 \uD0A4 \uD56D\uBAA9\uC774 \uC544\uB2CC \uD56D\uBAA9 \uC720\uD615\uC744 \uCC38\uC870\uD569\uB2C8\uB2E4. -keyclone \uBA85\uB839\uC740 \uC804\uC6A9 \uD0A4 \uD56D\uBAA9\uC758 \uBCF5\uC81C\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  \uACBD\uACE0 \uACBD\uACE0 \uACBD\uACE0  *****************"},
-        {"Signer.d.", "\uC11C\uBA85\uC790 #%d:"},
-        {"Timestamp.", "\uC2DC\uAC04 \uAE30\uB85D:"},
-        {"Signature.", "\uC11C\uBA85:"},
-        {"CRLs.", "CRL:"},
-        {"Certificate.owner.", "\uC778\uC99D\uC11C \uC18C\uC720\uC790: "},
-        {"Not.a.signed.jar.file", "\uC11C\uBA85\uB41C jar \uD30C\uC77C\uC774 \uC544\uB2D9\uB2C8\uB2E4."},
-        {"No.certificate.from.the.SSL.server",
-                "SSL \uC11C\uBC84\uC5D0\uC11C \uAC00\uC838\uC628 \uC778\uC99D\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB41C \uC815\uBCF4\uC758 \uBB34\uACB0\uC131\uC774  *\n* \uD655\uC778\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4! \uBB34\uACB0\uC131\uC744 \uD655\uC778\uD558\uB824\uBA74, *\n* \uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uACF5\uD574\uC57C \uD569\uB2C8\uB2E4.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* srckeystore\uC5D0 \uC800\uC7A5\uB41C \uC815\uBCF4\uC758 \uBB34\uACB0\uC131\uC774  *\n* \uD655\uC778\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4! \uBB34\uACB0\uC131\uC744 \uD655\uC778\uD558\uB824\uBA74, *\n* srckeystore \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uACF5\uD574\uC57C \uD569\uB2C8\uB2E4.                  *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "\uC778\uC99D\uC11C \uD68C\uC2E0\uC5D0 <{0}>\uC5D0 \uB300\uD55C \uACF5\uC6A9 \uD0A4\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-        {"Incomplete.certificate.chain.in.reply",
-                "\uD68C\uC2E0\uC5D0 \uBD88\uC644\uC804\uD55C \uC778\uC99D\uC11C \uCCB4\uC778\uC774 \uC788\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "\uD68C\uC2E0\uC758 \uC778\uC99D\uC11C \uCCB4\uC778\uC774 \uD655\uC778\uB418\uC9C0 \uC54A\uC74C: "},
-        {"Top.level.certificate.in.reply.",
-                "\uD68C\uC2E0\uC5D0 \uCD5C\uC0C1\uC704 \uB808\uBCA8 \uC778\uC99D\uC11C\uAC00 \uC788\uC74C:\n"},
-        {".is.not.trusted.", "...\uC744(\uB97C) \uC2E0\uB8B0\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
-        {"Install.reply.anyway.no.", "\uD68C\uC2E0\uC744 \uC124\uCE58\uD558\uACA0\uC2B5\uB2C8\uAE4C? [\uC544\uB2C8\uC624]:  "},
-        {"NO", "\uC544\uB2C8\uC624"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "\uD68C\uC2E0\uACFC \uD0A4 \uC800\uC7A5\uC18C\uC758 \uACF5\uC6A9 \uD0A4\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "\uD68C\uC2E0\uACFC \uD0A4 \uC800\uC7A5\uC18C\uC758 \uC778\uC99D\uC11C\uAC00 \uB3D9\uC77C\uD569\uB2C8\uB2E4."},
-        {"Failed.to.establish.chain.from.reply",
-                "\uD68C\uC2E0\uC758 \uCCB4\uC778 \uC124\uC815\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "\uC798\uBABB\uB41C \uC751\uB2F5\uC785\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "\uBCF4\uC548 \uD0A4\uAC00 \uC0DD\uC131\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 <{0}> \uBCC4\uCE6D\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "\uBCF4\uC548 \uD0A4\uB97C \uC0DD\uC131\uD558\uB824\uBA74 -keysize\uB97C \uC81C\uACF5\uD558\uC2ED\uC2DC\uC624."},
-
-        {"Extensions.", "\uD655\uC7A5: "},
-        {".Empty.value.", "(\uBE44\uC5B4 \uC788\uB294 \uAC12)"},
-        {"Extension.Request.", "\uD655\uC7A5 \uC694\uCCAD:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10 \uC778\uC99D\uC11C \uC694\uCCAD(1.0 \uBC84\uC804)\n\uC81C\uBAA9: %s\n\uACF5\uC6A9 \uD0A4: %s \uD615\uC2DD %s \uD0A4\n"},
-        {"Unknown.keyUsage.type.", "\uC54C \uC218 \uC5C6\uB294 keyUsage \uC720\uD615: "},
-        {"Unknown.extendedkeyUsage.type.", "\uC54C \uC218 \uC5C6\uB294 extendedkeyUsage \uC720\uD615: "},
-        {"Unknown.AccessDescription.type.", "\uC54C \uC218 \uC5C6\uB294 AccessDescription \uC720\uD615: "},
-        {"Unrecognized.GeneralName.type.", "\uC54C \uC218 \uC5C6\uB294 GeneralName \uC720\uD615: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "\uC774 \uD655\uC7A5\uC740 \uC911\uC694\uD55C \uAC83\uC73C\uB85C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
-        {"Odd.number.of.hex.digits.found.", "\uD640\uC218 \uAC1C\uC758 16\uC9C4\uC218\uAC00 \uBC1C\uACAC\uB428: "},
-        {"Unknown.extension.type.", "\uC54C \uC218 \uC5C6\uB294 \uD655\uC7A5 \uC720\uD615: "},
-        {"command.{0}.is.ambiguous.", "{0} \uBA85\uB839\uC774 \uBAA8\uD638\uD568:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\uACBD\uACE0: {0} \uBCC4\uCE6D\uC5D0 \uB300\uD55C \uACF5\uC6A9 \uD0A4\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD0A4 \uC800\uC7A5\uC18C\uAC00 \uC81C\uB300\uB85C \uAD6C\uC131\uB418\uC5B4 \uC788\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-        {"Warning.Class.not.found.class", "\uACBD\uACE0: \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\uACBD\uACE0: \uC0DD\uC131\uC790\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uC778\uC218: {0}"},
-        {"Illegal.Principal.Type.type", "\uC798\uBABB\uB41C \uC8FC\uCCB4 \uC720\uD615: {0}"},
-        {"Illegal.option.option", "\uC798\uBABB\uB41C \uC635\uC158: {0}"},
-        {"Usage.policytool.options.", "\uC0AC\uC6A9\uBC95: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \uC815\uCC45 \uD30C\uC77C \uC704\uCE58"},
-        {"New", "\uC0C8\uB85C \uB9CC\uB4E4\uAE30"},
-        {"Open", "\uC5F4\uAE30"},
-        {"Save", "\uC800\uC7A5"},
-        {"Save.As", "\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"},
-        {"View.Warning.Log", "\uACBD\uACE0 \uB85C\uADF8 \uBCF4\uAE30"},
-        {"Exit", "\uC885\uB8CC"},
-        {"Add.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uCD94\uAC00"},
-        {"Edit.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uD3B8\uC9D1"},
-        {"Remove.Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9 \uC81C\uAC70"},
-        {"Edit", "\uD3B8\uC9D1"},
-        {"Retain", "\uC720\uC9C0"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\uACBD\uACE0: \uD30C\uC77C \uC774\uB984\uC5D0 \uC774\uC2A4\uCF00\uC774\uD504\uB41C \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uBC31\uC2AC\uB798\uC2DC \uBB38\uC790\uB294 \uC774\uC2A4\uCF00\uC774\uD504\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC601\uAD6C \uC800\uC7A5\uC18C\uC5D0 \uC815\uCC45 \uCF58\uD150\uCE20\uB97C \uC4F8 \uB54C \uD544\uC694\uC5D0 \uB530\uB77C \uC790\uB3D9\uC73C\uB85C \uBB38\uC790\uAC00 \uC774\uC2A4\uCF00\uC774\uD504\uB429\uB2C8\uB2E4.\n\n\uC785\uB825\uB41C \uC774\uB984\uC744 \uADF8\uB300\uB85C \uC720\uC9C0\uD558\uB824\uBA74 [\uC720\uC9C0]\uB97C \uB204\uB974\uACE0, \uC774\uB984\uC744 \uD3B8\uC9D1\uD558\uB824\uBA74 [\uD3B8\uC9D1]\uC744 \uB204\uB974\uC2ED\uC2DC\uC624."},
-
-        {"Add.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uCD94\uAC00"},
-        {"Remove.Public.Key.Alias", "\uACF5\uC6A9 \uD0A4 \uBCC4\uCE6D \uC81C\uAC70"},
-        {"File", "\uD30C\uC77C"},
-        {"KeyStore", "\uD0A4 \uC800\uC7A5\uC18C"},
-        {"Policy.File.", "\uC815\uCC45 \uD30C\uC77C:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\uC815\uCC45 \uD30C\uC77C\uC744 \uC5F4 \uC218 \uC5C6\uC74C: {0}: {1}"},
-        {"Policy.Tool", "\uC815\uCC45 \uD234"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\uC815\uCC45 \uAD6C\uC131\uC744 \uC5EC\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 \uACBD\uACE0 \uB85C\uADF8\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
-        {"Error", "\uC624\uB958"},
-        {"OK", "\uD655\uC778"},
-        {"Status", "\uC0C1\uD0DC"},
-        {"Warning", "\uACBD\uACE0"},
-        {"Permission.",
-                "\uAD8C\uD55C:                                                       "},
-        {"Principal.Type.", "\uC8FC\uCCB4 \uC720\uD615:"},
-        {"Principal.Name.", "\uC8FC\uCCB4 \uC774\uB984:"},
-        {"Target.Name.",
-                "\uB300\uC0C1 \uC774\uB984:                                                    "},
-        {"Actions.",
-                "\uC791\uC5C5:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\uAE30\uC874 \uD30C\uC77C {0}\uC744(\uB97C) \uACB9\uCCD0 \uC4F0\uACA0\uC2B5\uB2C8\uAE4C?"},
-        {"Cancel", "\uCDE8\uC18C"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\uC8FC\uCCB4 \uCD94\uAC00"},
-        {"Edit.Principal", "\uC8FC\uCCB4 \uD3B8\uC9D1"},
-        {"Remove.Principal", "\uC8FC\uCCB4 \uC81C\uAC70"},
-        {"Principals.", "\uC8FC\uCCB4:"},
-        {".Add.Permission", "  \uAD8C\uD55C \uCD94\uAC00"},
-        {".Edit.Permission", "  \uAD8C\uD55C \uD3B8\uC9D1"},
-        {"Remove.Permission", "\uAD8C\uD55C \uC81C\uAC70"},
-        {"Done", "\uC644\uB8CC"},
-        {"KeyStore.URL.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
-        {"KeyStore.Type.", "\uD0A4 \uC800\uC7A5\uC18C \uC720\uD615:"},
-        {"KeyStore.Provider.", "\uD0A4 \uC800\uC7A5\uC18C \uC81C\uACF5\uC790:"},
-        {"KeyStore.Password.URL.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"},
-        {"Principals", "\uC8FC\uCCB4"},
-        {".Edit.Principal.", "  \uC8FC\uCCB4 \uD3B8\uC9D1:"},
-        {".Add.New.Principal.", "  \uC0C8 \uC8FC\uCCB4 \uCD94\uAC00:"},
-        {"Permissions", "\uAD8C\uD55C"},
-        {".Edit.Permission.", "  \uAD8C\uD55C \uD3B8\uC9D1:"},
-        {".Add.New.Permission.", "  \uC0C8 \uAD8C\uD55C \uCD94\uAC00:"},
-        {"Signed.By.", "\uC11C\uBA85\uC790:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uC774\uB984 \uC5C6\uC774 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uD074\uB798\uC2A4\uB97C \uC0AC\uC6A9\uD558\uB294 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\uC774\uB984 \uC5C6\uC774 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\uAD8C\uD55C\uACFC \uB300\uC0C1 \uC774\uB984\uC758 \uAC12\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-        {"Remove.this.Policy.Entry.", "\uC774 \uC815\uCC45 \uD56D\uBAA9\uC744 \uC81C\uAC70\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
-        {"Overwrite.File", "\uD30C\uC77C \uACB9\uCCD0\uC4F0\uAE30"},
-        {"Policy.successfully.written.to.filename",
-                "{0}\uC5D0 \uC131\uACF5\uC801\uC73C\uB85C \uC815\uCC45\uC744 \uC37C\uC2B5\uB2C8\uB2E4."},
-        {"null.filename", "\uB110 \uD30C\uC77C \uC774\uB984"},
-        {"Save.changes.", "\uBCC0\uACBD \uC0AC\uD56D\uC744 \uC800\uC7A5\uD558\uACA0\uC2B5\uB2C8\uAE4C?"},
-        {"Yes", "\uC608"},
-        {"No", "\uC544\uB2C8\uC624"},
-        {"Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9"},
-        {"Save.Changes", "\uBCC0\uACBD \uC0AC\uD56D \uC800\uC7A5"},
-        {"No.Policy.Entry.selected", "\uC120\uD0DD\uB41C \uC815\uCC45 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\uD0A4 \uC800\uC7A5\uC18C\uB97C \uC5F4 \uC218 \uC5C6\uC74C: {0}"},
-        {"No.principal.selected", "\uC120\uD0DD\uB41C \uC8FC\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"No.permission.selected", "\uC120\uD0DD\uB41C \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-        {"name", "\uC774\uB984"},
-        {"configuration.type", "\uAD6C\uC131 \uC720\uD615"},
-        {"environment.variable.name", "\uD658\uACBD \uBCC0\uC218 \uC774\uB984"},
-        {"library.name", "\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984"},
-        {"package.name", "\uD328\uD0A4\uC9C0 \uC774\uB984"},
-        {"policy.type", "\uC815\uCC45 \uC720\uD615"},
-        {"property.name", "\uC18D\uC131 \uC774\uB984"},
-        {"Principal.List", "\uC8FC\uCCB4 \uBAA9\uB85D"},
-        {"Permission.List", "\uAD8C\uD55C \uBAA9\uB85D"},
-        {"Code.Base", "\uCF54\uB4DC \uBCA0\uC774\uC2A4"},
-        {"KeyStore.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C URL:"},
-        {"KeyStore.Password.U.R.L.", "\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638 URL:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "\uB110 \uC785\uB825\uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
         {"actions.can.only.be.read.", "\uC791\uC5C5\uC740 '\uC77D\uAE30' \uC804\uC6A9\uC785\uB2C8\uB2E4."},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "\uB110 OID \uB9F5\uC744 \uC81C\uACF5\uD588\uC2B5\uB2C8\uB2E4."},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "\uBD80\uC801\uD569\uD55C \uB110 AccessControlContext\uAC00 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
         {"invalid.null.action.provided", "\uBD80\uC801\uD569\uD55C \uB110 \uC791\uC5C5\uC774 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_pt_BR.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_pt_BR.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [Op\u00E7\u00E3o]..."},
-        {"Options.", "Op\u00E7\u00F5es:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "Use \"keytool -help\" para todos os comandos dispon\u00EDveis"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Ferramenta de Gerenciamento de Chave e Certificado"},
-        {"Commands.", "Comandos:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "Use \"keytool -command_name -help\" para uso de command_name"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "Gera uma solicita\u00E7\u00E3o de certificado"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "Altera um alias de entrada"}, //-changealias
-        {"Deletes.an.entry",
-                "Deleta uma entrada"}, //-delete
-        {"Exports.certificate",
-                "Exporta o certificado"}, //-exportcert
-        {"Generates.a.key.pair",
-                "Gera um par de chaves"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "Gera uma chave Secreta"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "Gera um certificado de uma solicita\u00E7\u00E3o de certificado"}, //-gencert
-        {"Generates.CRL", "Gera CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Importa entradas de um banco de dados de identidade JDK 1.1.x-style"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Importa um certificado ou uma cadeia de certificados"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Importa uma ou todas as entradas de outra \u00E1rea de armazenamento de chaves"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Clona uma entrada de chave"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "Altera a senha da chave de uma entrada"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "Lista entradas em uma \u00E1rea de armazenamento de chaves"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Imprime o conte\u00FAdo de um certificado"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Imprime o conte\u00FAdo de uma solicita\u00E7\u00E3o de certificado"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Imprime o conte\u00FAdo de um arquivo CRL"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "Gera um certificado autoassinado"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "Altera a senha de armazenamento de uma \u00E1rea de armazenamento de chaves"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "nome do alias da entrada a ser processada"}, //-alias
-        {"destination.alias",
-                "alias de destino"}, //-destalias
-        {"destination.key.password",
-                "senha da chave de destino"}, //-destkeypass
-        {"destination.keystore.name",
-                "nome da \u00E1rea de armazenamento de chaves de destino"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "senha protegida da \u00E1rea de armazenamento de chaves de destino"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "nome do fornecedor da \u00E1rea de armazenamento de chaves de destino"}, //-destprovidername
-        {"destination.keystore.password",
-                "senha da \u00E1rea de armazenamento de chaves de destino"}, //-deststorepass
-        {"destination.keystore.type",
-                "tipo de \u00E1rea de armazenamento de chaves de destino"}, //-deststoretype
-        {"distinguished.name",
-                "nome distinto"}, //-dname
-        {"X.509.extension",
-                "extens\u00E3o X.509"}, //-ext
-        {"output.file.name",
-                "nome do arquivo de sa\u00EDda"}, //-file and -outfile
-        {"input.file.name",
-                "nome do arquivo de entrada"}, //-file and -infile
-        {"key.algorithm.name",
-                "nome do algoritmo da chave"}, //-keyalg
-        {"key.password",
-                "senha da chave"}, //-keypass
-        {"key.bit.size",
-                "tamanho do bit da chave"}, //-keysize
-        {"keystore.name",
-                "nome da \u00E1rea de armazenamento de chaves"}, //-keystore
-        {"new.password",
-                "nova senha"}, //-new
-        {"do.not.prompt",
-                "n\u00E3o perguntar"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "senha por meio de mecanismo protegido"}, //-protected
-        {"provider.argument",
-                "argumento do fornecedor"}, //-providerarg
-        {"provider.class.name",
-                "nome da classe do fornecedor"}, //-providerclass
-        {"provider.name",
-                "nome do fornecedor"}, //-providername
-        {"provider.classpath",
-                "classpath do fornecedor"}, //-providerpath
-        {"output.in.RFC.style",
-                "sa\u00EDda no estilo RFC"}, //-rfc
-        {"signature.algorithm.name",
-                "nome do algoritmo de assinatura"}, //-sigalg
-        {"source.alias",
-                "alias de origem"}, //-srcalias
-        {"source.key.password",
-                "senha da chave de origem"}, //-srckeypass
-        {"source.keystore.name",
-                "nome da \u00E1rea de armazenamento de chaves de origem"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "senha protegida da \u00E1rea de armazenamento de chaves de origem"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "nome do fornecedor da \u00E1rea de armazenamento de chaves de origem"}, //-srcprovidername
-        {"source.keystore.password",
-                "senha da \u00E1rea de armazenamento de chaves de origem"}, //-srcstorepass
-        {"source.keystore.type",
-                "tipo de \u00E1rea de armazenamento de chaves de origem"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "porta e host do servidor SSL"}, //-sslserver
-        {"signed.jar.file",
-                "arquivo jar assinado"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "data/hora inicial de validade do certificado"}, //-startdate
-        {"keystore.password",
-                "senha da \u00E1rea de armazenamento de chaves"}, //-storepass
-        {"keystore.type",
-                "tipo de \u00E1rea de armazenamento de chaves"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "certificados confi\u00E1veis do cacerts"}, //-trustcacerts
-        {"verbose.output",
-                "sa\u00EDda detalhada"}, //-v
-        {"validity.number.of.days",
-                "n\u00FAmero de dias da validade"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "ID de s\u00E9rie do certificado a ser revogado"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "erro de keytool: "},
-        {"Illegal.option.", "Op\u00E7\u00E3o inv\u00E1lida:  "},
-        {"Illegal.value.", "Valor inv\u00E1lido: "},
-        {"Unknown.password.type.", "Tipo de senha desconhecido: "},
-        {"Cannot.find.environment.variable.",
-                "N\u00E3o \u00E9 poss\u00EDvel localizar a vari\u00E1vel do ambiente: "},
-        {"Cannot.find.file.", "N\u00E3o \u00E9 poss\u00EDvel localizar o arquivo: "},
-        {"Command.option.flag.needs.an.argument.", "A op\u00E7\u00E3o de comando {0} precisa de um argumento."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Advert\u00EAncia: Senhas de chave e de armazenamento diferentes n\u00E3o suportadas para KeyStores PKCS12. Ignorando valor {0} especificado pelo usu\u00E1rio."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore deve ser NONE se -storetype for {0}"},
-        {"Too.many.retries.program.terminated",
-                 "Excesso de tentativas de repeti\u00E7\u00E3o; programa finalizado"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "comandos -storepasswd e -keypasswd n\u00E3o suportados se -storetype for {0}"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "comandos -keypasswd n\u00E3o suportados se -storetype for PKCS12"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-keypass e -new n\u00E3o podem ser especificados se -storetype for {0}"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "se -protected for especificado, ent\u00E3o -storepass, -keypass e -new n\u00E3o dever\u00E3o ser especificados"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "se -srcprotected for especificado, ent\u00E3o -srcstorepass e -srckeypass n\u00E3o dever\u00E3o ser especificados"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "se a \u00E1rea de armazenamento de chaves n\u00E3o estiver protegida por senha, ent\u00E3o -storepass, -keypass e -new n\u00E3o dever\u00E3o ser especificados"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "se a \u00E1rea de armazenamento de chaves de origem n\u00E3o estiver protegida por senha, ent\u00E3o -srcstorepass e -srckeypass n\u00E3o dever\u00E3o ser especificados"},
-        {"Illegal.startdate.value", "valor da data inicial inv\u00E1lido"},
-        {"Validity.must.be.greater.than.zero",
-                "A validade deve ser maior do que zero"},
-        {"provName.not.a.provider", "{0} n\u00E3o \u00E9 um fornecedor"},
-        {"Usage.error.no.command.provided", "Erro de uso: nenhum comando fornecido"},
-        {"Source.keystore.file.exists.but.is.empty.", "O arquivo da \u00E1rea de armazenamento de chaves de origem existe, mas est\u00E1 vazio: "},
-        {"Please.specify.srckeystore", "Especifique -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "N\u00E3o devem ser especificados -v e -rfc com o comando 'list'"},
-        {"Key.password.must.be.at.least.6.characters",
-                "A senha da chave deve ter, no m\u00EDnimo, 6 caracteres"},
-        {"New.password.must.be.at.least.6.characters",
-                "A nova senha deve ter, no m\u00EDnimo, 6 caracteres"},
-        {"Keystore.file.exists.but.is.empty.",
-                "O arquivo da \u00E1rea de armazenamento de chaves existe, mas est\u00E1 vazio: "},
-        {"Keystore.file.does.not.exist.",
-                "O arquivo da \u00E1rea de armazenamento de chaves n\u00E3o existe. "},
-        {"Must.specify.destination.alias", "Deve ser especificado um alias de destino"},
-        {"Must.specify.alias", "Deve ser especificado um alias"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "A senha da \u00E1rea de armazenamento de chaves deve ter, no m\u00EDnimo, 6 caracteres"},
-        {"Enter.keystore.password.", "Informe a senha da \u00E1rea de armazenamento de chaves:  "},
-        {"Enter.source.keystore.password.", "Informe a senha da \u00E1rea de armazenamento de chaves de origem:  "},
-        {"Enter.destination.keystore.password.", "Informe a senha da \u00E1rea de armazenamento de chaves de destino:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "A senha da \u00E1rea de armazenamento de chaves \u00E9 muito curta - ela deve ter, no m\u00EDnimo, 6 caracteres"},
-        {"Unknown.Entry.Type", "Tipo de Entrada Desconhecido"},
-        {"Too.many.failures.Alias.not.changed", "Excesso de falhas. Alias n\u00E3o alterado"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "Entrada do alias {0} importada com \u00EAxito."},
-        {"Entry.for.alias.alias.not.imported.", "Entrada do alias {0} n\u00E3o importada."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Problema ao importar a entrada do alias {0}: {1}.\nEntrada do alias {0} n\u00E3o importada."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Comando de importa\u00E7\u00E3o conclu\u00EDdo:  {0} entradas importadas com \u00EAxito, {1} entradas falharam ou foram canceladas"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Advert\u00EAncia: Substitui\u00E7\u00E3o do alias {0} existente na \u00E1rea de armazenamento de chaves de destino"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "Entrada j\u00E1 existente no alias {0}, substituir? [n\u00E3o]:  "},
-        {"Too.many.failures.try.later", "Excesso de falhas - tente mais tarde"},
-        {"Certification.request.stored.in.file.filename.",
-                "Solicita\u00E7\u00E3o de certificado armazenada no arquivo <{0}>"},
-        {"Submit.this.to.your.CA", "Submeter \u00E0 CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "se o alias n\u00E3o estiver especificado, destalias, srckeypass e destkeypass n\u00E3o dever\u00E3o ser especificados"},
-        {"Certificate.stored.in.file.filename.",
-                "Certificado armazenado no arquivo <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "A resposta do certificado foi instalada na \u00E1rea de armazenamento de chaves"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "A resposta do certificado n\u00E3o foi instalada na \u00E1rea de armazenamento de chaves"},
-        {"Certificate.was.added.to.keystore",
-                "O certificado foi adicionado \u00E0 \u00E1rea de armazenamento de chaves"},
-        {"Certificate.was.not.added.to.keystore",
-                "O certificado n\u00E3o foi adicionado \u00E0 \u00E1rea de armazenamento de chaves"},
-        {".Storing.ksfname.", "[Armazenando {0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} n\u00E3o tem chave p\u00FAblica (certificado)"},
-        {"Cannot.derive.signature.algorithm",
-                "N\u00E3o \u00E9 poss\u00EDvel obter um algoritmo de assinatura"},
-        {"Alias.alias.does.not.exist",
-                "O alias <{0}> n\u00E3o existe"},
-        {"Alias.alias.has.no.certificate",
-                "O alias <{0}> n\u00E3o tem certificado"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "Par de chaves n\u00E3o gerado; o alias <{0}> j\u00E1 existe"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "Gerando o par de chaves {1} de {0} bit e o certificado autoassinado ({2}) com uma validade de {3} dias\n\tpara: {4}"},
-        {"Enter.key.password.for.alias.", "Informar a senha da chave de <{0}>"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(RETURN se for igual \u00E0 senha da \u00E1rea do armazenamento de chaves):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "A senha da chave \u00E9 muito curta - deve ter, no m\u00EDnimo, 6 caracteres"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "Excesso de falhas - chave n\u00E3o adicionada a \u00E1rea de armazenamento de chaves"},
-        {"Destination.alias.dest.already.exists",
-                "O alias de destino <{0}> j\u00E1 existe"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "A senha \u00E9 muito curta - deve ter, no m\u00EDnimo, 6 caracteres"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "Excesso de falhas. Entrada da chave n\u00E3o clonada"},
-        {"key.password.for.alias.", "senha da chave de <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "A entrada da \u00E1rea do armazenamento de chaves de <{0}> j\u00E1 existe"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Criando entrada da \u00E1rea do armazenamento de chaves para <{0}> ..."},
-        {"No.entries.from.identity.database.added",
-                "Nenhuma entrada adicionada do banco de dados de identidades"},
-        {"Alias.name.alias", "Nome do alias: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Data de cria\u00E7\u00E3o: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Tipo de entrada: {0}"},
-        {"Certificate.chain.length.", "Comprimento da cadeia de certificados: "},
-        {"Certificate.i.1.", "Certificado[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Fingerprint (MD5) do certificado: "},
-        {"Keystore.type.", "Tipo de \u00E1rea de armazenamento de chaves: "},
-        {"Keystore.provider.", "Fornecedor da \u00E1rea de armazenamento de chaves: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Sua \u00E1rea de armazenamento de chaves cont\u00E9m {0,number,integer} entrada"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Sua \u00E1rea de armazenamento de chaves cont\u00E9m {0,number,integer} entradas"},
-        {"Failed.to.parse.input", "Falha durante o parse da entrada"},
-        {"Empty.input", "Entrada vazia"},
-        {"Not.X.509.certificate", "N\u00E3o \u00E9 um certificado X.509"},
-        {"alias.has.no.public.key", "{0} n\u00E3o tem chave p\u00FAblica"},
-        {"alias.has.no.X.509.certificate", "{0} n\u00E3o tem certificado X.509"},
-        {"New.certificate.self.signed.", "Novo certificado (autoassinado):"},
-        {"Reply.has.no.certificates", "A resposta n\u00E3o tem certificado"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Certificado n\u00E3o importado, o alias <{0}> j\u00E1 existe"},
-        {"Input.not.an.X.509.certificate", "A entrada n\u00E3o \u00E9 um certificado X.509"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "O certificado j\u00E1 existe no armazenamento de chaves no alias <{0}>"},
-        {"Do.you.still.want.to.add.it.no.",
-                "Ainda deseja adicion\u00E1-lo? [n\u00E3o]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "O certificado j\u00E1 existe na \u00E1rea de armazenamento de chaves da CA em todo o sistema no alias <{0}>"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "Ainda deseja adicion\u00E1-lo \u00E0 sua \u00E1rea de armazenamento de chaves? [n\u00E3o]:  "},
-        {"Trust.this.certificate.no.", "Confiar neste certificado? [n\u00E3o]:  "},
-        {"YES", "Sim"},
-        {"New.prompt.", "Nova {0}: "},
-        {"Passwords.must.differ", "As senhas devem ser diferentes"},
-        {"Re.enter.new.prompt.", "Informe novamente a nova {0}: "},
-        {"Re.enter.new.password.", "Informe novamente a nova senha: "},
-        {"They.don.t.match.Try.again", "Elas n\u00E3o correspondem. Tente novamente"},
-        {"Enter.prompt.alias.name.", "Informe o nome do alias {0}:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Informe o novo nome do alias\t(RETURN para cancelar a importa\u00E7\u00E3o desta entrada):  "},
-        {"Enter.alias.name.", "Informe o nome do alias:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(RETURN se for igual ao de <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "Propriet\u00E1rio: {0}\nEmissor: {1}\nN\u00FAmero de s\u00E9rie: {2}\nV\u00E1lido de: {3} a: {4}\nFingerprints do certificado:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Nome do algoritmo de assinatura: {8}\n\t Vers\u00E3o: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "Qual \u00E9 o seu nome e o seu sobrenome?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "Qual \u00E9 o nome da sua unidade organizacional?"},
-        {"What.is.the.name.of.your.organization.",
-                "Qual \u00E9 o nome da sua empresa?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "Qual \u00E9 o nome da sua Cidade ou Localidade?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "Qual \u00E9 o nome do seu Estado ou Munic\u00EDpio?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "Quais s\u00E3o as duas letras do c\u00F3digo do pa\u00EDs desta unidade?"},
-        {"Is.name.correct.", "{0} Est\u00E1 correto?"},
-        {"no", "n\u00E3o"},
-        {"yes", "sim"},
-        {"y", "s"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "O alias <{0}> n\u00E3o tem chave"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "O alias <{0}> faz refer\u00EAncia a um tipo de entrada que n\u00E3o \u00E9 uma entrada de chave privada. O comando -keyclone oferece suporte somente \u00E0 clonagem de entradas de chave privada"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  Advert\u00EAncia Advert\u00EAncia Advert\u00EAncia  *****************"},
-        {"Signer.d.", "Signat\u00E1rio #%d:"},
-        {"Timestamp.", "Timestamp:"},
-        {"Signature.", "Assinatura:"},
-        {"CRLs.", "CRLs:"},
-        {"Certificate.owner.", "Propriet\u00E1rio do certificado: "},
-        {"Not.a.signed.jar.file", "N\u00E3o \u00E9 um arquivo jar assinado"},
-        {"No.certificate.from.the.SSL.server",
-                "N\u00E3o \u00E9 um certificado do servidor SSL"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* A integridade das informa\u00E7\u00F5es armazenadas na sua \u00E1rea de armazenamento de chaves  *\n* N\u00C3O foi verificada!  Para que seja poss\u00EDvel verificar sua integridade, *\n* voc\u00EA deve fornecer a senha da \u00E1rea de armazenamento de chaves.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* A integridade das informa\u00E7\u00F5es armazenadas no srckeystore  *\n* N\u00C3O foi verificada!  Para que seja poss\u00EDvel verificar sua integridade, *\n* voc\u00EA deve fornecer a senha do srckeystore.                  *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "A resposta do certificado n\u00E3o cont\u00E9m a chave p\u00FAblica de <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Cadeia de certificados incompleta na resposta"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "A cadeia de certificados da resposta n\u00E3o verifica: "},
-        {"Top.level.certificate.in.reply.",
-                "Certificado de n\u00EDvel superior na resposta:\n"},
-        {".is.not.trusted.", "... n\u00E3o \u00E9 confi\u00E1vel. "},
-        {"Install.reply.anyway.no.", "Instalar resposta assim mesmo? [n\u00E3o]:  "},
-        {"NO", "N\u00E3o"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "As chaves p\u00FAblicas da resposta e da \u00E1rea de armazenamento de chaves n\u00E3o correspondem"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "O certificado da resposta e o certificado da \u00E1rea de armazenamento de chaves s\u00E3o id\u00EAnticos"},
-        {"Failed.to.establish.chain.from.reply",
-                "Falha ao estabelecer a cadeia a partir da resposta"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "Resposta errada; tente novamente"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "Chave secreta n\u00E3o gerada; o alias <{0}> j\u00E1 existe"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Forne\u00E7a o -keysize para a gera\u00E7\u00E3o da chave secreta"},
-
-        {"Extensions.", "Extens\u00F5es: "},
-        {".Empty.value.", "(Valor vazio)"},
-        {"Extension.Request.", "Solicita\u00E7\u00E3o de Extens\u00E3o:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "Solicita\u00E7\u00E3o do Certificado PKCS #10 (Vers\u00E3o 1.0)\nAssunto: %s\nChave P\u00FAblica: %s formato %s chave\n"},
-        {"Unknown.keyUsage.type.", "Tipo de keyUsage desconhecido: "},
-        {"Unknown.extendedkeyUsage.type.", "Tipo de extendedkeyUsage desconhecido: "},
-        {"Unknown.AccessDescription.type.", "Tipo de AccessDescription desconhecido: "},
-        {"Unrecognized.GeneralName.type.", "Tipo de GeneralName n\u00E3o reconhecido: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "Esta extens\u00E3o n\u00E3o pode ser marcada como cr\u00EDtica. "},
-        {"Odd.number.of.hex.digits.found.", "Encontrado n\u00FAmero \u00EDmpar de seis d\u00EDgitos: "},
-        {"Unknown.extension.type.", "Tipo de extens\u00E3o desconhecido: "},
-        {"command.{0}.is.ambiguous.", "o comando {0} \u00E9 amb\u00EDguo:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Advert\u00EAncia: N\u00E3o existe uma chave p\u00FAblica para o alias {0}. Certifique-se de que um KeyStore esteja configurado adequadamente."},
-        {"Warning.Class.not.found.class", "Advert\u00EAncia: Classe n\u00E3o encontrada: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Advert\u00EAncia: Argumento(s) inv\u00E1lido(s) para o construtor: {0}"},
-        {"Illegal.Principal.Type.type", "Tipo Principal Inv\u00E1lido: {0}"},
-        {"Illegal.option.option", "Op\u00E7\u00E3o inv\u00E1lida: {0}"},
-        {"Usage.policytool.options.", "Uso: policytool [op\u00E7\u00F5es]"},
-        {".file.file.policy.file.location",
-                "  [-file <arquivo>]    localiza\u00E7\u00E3o do arquivo de pol\u00EDtica"},
-        {"New", "Novo"},
-        {"Open", "Abrir"},
-        {"Save", "Salvar"},
-        {"Save.As", "Salvar Como"},
-        {"View.Warning.Log", "Exibir Log de Advert\u00EAncias"},
-        {"Exit", "Sair"},
-        {"Add.Policy.Entry", "Adicionar Entrada de Pol\u00EDtica"},
-        {"Edit.Policy.Entry", "Editar Entrada de Pol\u00EDtica"},
-        {"Remove.Policy.Entry", "Remover Entrada de Pol\u00EDtica"},
-        {"Edit", "Editar"},
-        {"Retain", "Reter"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Advert\u00EAncia: O nome do arquivo pode conter caracteres de escape barra invertida. N\u00E3o \u00E9 necess\u00E1rio fazer o escape dos caracteres de barra invertida (a ferramenta faz o escape dos caracteres conforme necess\u00E1rio ao gravar o conte\u00FAdo da pol\u00EDtica no armazenamento persistente).\n\nClique em Reter para reter o nome da entrada ou clique em Editar para edit\u00E1-lo."},
-
-        {"Add.Public.Key.Alias", "Adicionar Alias de Chave P\u00FAblica"},
-        {"Remove.Public.Key.Alias", "Remover Alias de Chave P\u00FAblica"},
-        {"File", "Arquivo"},
-        {"KeyStore", "KeyStore"},
-        {"Policy.File.", "Arquivo de Pol\u00EDtica:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "N\u00E3o foi poss\u00EDvel abrir o arquivo de pol\u00EDtica: {0}: {1}"},
-        {"Policy.Tool", "Ferramenta de Pol\u00EDtica"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Erros durante a abertura da configura\u00E7\u00E3o da pol\u00EDtica. Consulte o Log de Advert\u00EAncias para obter mais informa\u00E7\u00F5es."},
-        {"Error", "Erro"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Advert\u00EAncia"},
-        {"Permission.",
-                "Permiss\u00E3o:                                                       "},
-        {"Principal.Type.", "Tipo do Principal:"},
-        {"Principal.Name.", "Nome do Principal:"},
-        {"Target.Name.",
-                "Nome do Alvo:                                                    "},
-        {"Actions.",
-                "A\u00E7\u00F5es:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Est\u00E1 correto substituir o arquivo existente {0}?"},
-        {"Cancel", "Cancelar"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "Adicionar Principal"},
-        {"Edit.Principal", "Editar Principal"},
-        {"Remove.Principal", "Remover Principal"},
-        {"Principals.", "Principais:"},
-        {".Add.Permission", "  Adicionar Permiss\u00E3o"},
-        {".Edit.Permission", "  Editar Permiss\u00E3o"},
-        {"Remove.Permission", "Remover Permiss\u00E3o"},
-        {"Done", "Conclu\u00EDdo"},
-        {"KeyStore.URL.", "URL do KeyStore:"},
-        {"KeyStore.Type.", "Tipo de KeyStore:"},
-        {"KeyStore.Provider.", "Fornecedor de KeyStore:"},
-        {"KeyStore.Password.URL.", "URL da Senha do KeyStore:"},
-        {"Principals", "Principais"},
-        {".Edit.Principal.", "  Editar Principal:"},
-        {".Add.New.Principal.", "  Adicionar Novo Principal:"},
-        {"Permissions", "Permiss\u00F5es"},
-        {".Edit.Permission.", "  Editar Permiss\u00E3o:"},
-        {".Add.New.Permission.", "  Adicionar Nova Permiss\u00E3o:"},
-        {"Signed.By.", "Assinado por:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal com uma Classe de Curinga sem um Nome de Curinga"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "N\u00E3o \u00E9 Poss\u00EDvel Especificar um Principal sem um Nome"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "O Nome de Destino e a Permiss\u00E3o devem ter um Valor"},
-        {"Remove.this.Policy.Entry.", "Remover esta Entrada de Pol\u00EDtica?"},
-        {"Overwrite.File", "Substituir Arquivo"},
-        {"Policy.successfully.written.to.filename",
-                "Pol\u00EDtica gravada com \u00EAxito em {0}"},
-        {"null.filename", "nome de arquivo nulo"},
-        {"Save.changes.", "Salvar altera\u00E7\u00F5es?"},
-        {"Yes", "Sim"},
-        {"No", "N\u00E3o"},
-        {"Policy.Entry", "Entrada de Pol\u00EDtica"},
-        {"Save.Changes", "Salvar Altera\u00E7\u00F5es"},
-        {"No.Policy.Entry.selected", "Nenhuma Entrada de Pol\u00EDtica Selecionada"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "N\u00E3o \u00E9 poss\u00EDvel abrir a KeyStore: {0}"},
-        {"No.principal.selected", "Nenhum principal selecionado"},
-        {"No.permission.selected", "Nenhuma permiss\u00E3o selecionada"},
-        {"name", "nome"},
-        {"configuration.type", "tipo de configura\u00E7\u00E3o"},
-        {"environment.variable.name", "nome da vari\u00E1vel de ambiente"},
-        {"library.name", "nome da biblioteca"},
-        {"package.name", "nome do pacote"},
-        {"policy.type", "tipo de pol\u00EDtica"},
-        {"property.name", "nome da propriedade"},
-        {"Principal.List", "Lista de Principais"},
-        {"Permission.List", "Lista de Permiss\u00F5es"},
-        {"Code.Base", "Base de C\u00F3digo"},
-        {"KeyStore.U.R.L.", "U R L da KeyStore:"},
-        {"KeyStore.Password.U.R.L.", "U R L da Senha do KeyStore:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "entrada(s) nula(s) inv\u00E1lida(s)"},
         {"actions.can.only.be.read.", "as a\u00E7\u00F5es s\u00F3 podem ser 'lidas'"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "mapa OID nulo fornecido"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "AccessControlContext nulo inv\u00E1lido fornecido"},
         {"invalid.null.action.provided", "a\u00E7\u00E3o nula inv\u00E1lida fornecida"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_sv.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_sv.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [Alternativ]..."},
-        {"Options.", "Alternativ:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "L\u00E4s \"Hj\u00E4lp - Nyckelverktyg\" f\u00F6r alla tillg\u00E4ngliga kommandon"},
-        {"Key.and.Certificate.Management.Tool",
-                 "Hanteringsverktyg f\u00F6r nycklar och certifikat"},
-        {"Commands.", "Kommandon:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "L\u00E4s \"Hj\u00E4lp - Nyckelverktyg - command_name\" om anv\u00E4ndning av command_name"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "Genererar certifikatbeg\u00E4ran"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "\u00C4ndrar postalias"}, //-changealias
-        {"Deletes.an.entry",
-                "Tar bort post"}, //-delete
-        {"Exports.certificate",
-                "Exporterar certifikat"}, //-exportcert
-        {"Generates.a.key.pair",
-                "Genererar nyckelpar"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "Genererar hemlig nyckel"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "Genererar certifikat fr\u00E5n certifikatbeg\u00E4ran"}, //-gencert
-        {"Generates.CRL", "Genererar CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "Importerar poster fr\u00E5n identitetsdatabas i JDK 1.1.x-format"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "Importerar ett certifikat eller en certifikatkedja"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "Importerar en eller alla poster fr\u00E5n annat nyckellager"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "Klonar en nyckelpost"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "\u00C4ndrar nyckell\u00F6senordet f\u00F6r en post"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "Visar lista \u00F6ver poster i nyckellager"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "Skriver ut inneh\u00E5llet i ett certifikat"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "Skriver ut inneh\u00E5llet i en certifikatbeg\u00E4ran"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "Skriver ut inneh\u00E5llet i en CRL-fil"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "Genererar ett sj\u00E4lvsignerat certifikat"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "\u00C4ndrar lagerl\u00F6senordet f\u00F6r ett nyckellager"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "aliasnamn f\u00F6r post som ska bearbetas"}, //-alias
-        {"destination.alias",
-                "destinationsalias"}, //-destalias
-        {"destination.key.password",
-                "l\u00F6senord f\u00F6r destinationsnyckel"}, //-destkeypass
-        {"destination.keystore.name",
-                "namn p\u00E5 destinationsnyckellager"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "skyddat l\u00F6senord f\u00F6r destinationsnyckellager"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "leverant\u00F6rsnamn f\u00F6r destinationsnyckellager"}, //-destprovidername
-        {"destination.keystore.password",
-                "l\u00F6senord f\u00F6r destinationsnyckellager"}, //-deststorepass
-        {"destination.keystore.type",
-                "typ av destinationsnyckellager"}, //-deststoretype
-        {"distinguished.name",
-                "unikt namn"}, //-dname
-        {"X.509.extension",
-                "X.509-till\u00E4gg"}, //-ext
-        {"output.file.name",
-                "namn p\u00E5 utdatafil"}, //-file and -outfile
-        {"input.file.name",
-                "namn p\u00E5 indatafil"}, //-file and -infile
-        {"key.algorithm.name",
-                "namn p\u00E5 nyckelalgoritm"}, //-keyalg
-        {"key.password",
-                "nyckell\u00F6senord"}, //-keypass
-        {"key.bit.size",
-                "nyckelbitstorlek"}, //-keysize
-        {"keystore.name",
-                "namn p\u00E5 nyckellager"}, //-keystore
-        {"new.password",
-                "nytt l\u00F6senord"}, //-new
-        {"do.not.prompt",
-                "fr\u00E5ga inte"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "l\u00F6senord med skyddad mekanism"}, //-protected
-        {"provider.argument",
-                "leverant\u00F6rsargument"}, //-providerarg
-        {"provider.class.name",
-                "namn p\u00E5 leverant\u00F6rsklass"}, //-providerclass
-        {"provider.name",
-                "leverant\u00F6rsnamn"}, //-providername
-        {"provider.classpath",
-                "leverant\u00F6rsklass\u00F6kv\u00E4g"}, //-providerpath
-        {"output.in.RFC.style",
-                "utdata i RFC-format"}, //-rfc
-        {"signature.algorithm.name",
-                "namn p\u00E5 signaturalgoritm"}, //-sigalg
-        {"source.alias",
-                "k\u00E4llalias"}, //-srcalias
-        {"source.key.password",
-                "l\u00F6senord f\u00F6r k\u00E4llnyckel"}, //-srckeypass
-        {"source.keystore.name",
-                "namn p\u00E5 k\u00E4llnyckellager"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "skyddat l\u00F6senord f\u00F6r k\u00E4llnyckellager"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "leverant\u00F6rsnamn f\u00F6r k\u00E4llnyckellager"}, //-srcprovidername
-        {"source.keystore.password",
-                "l\u00F6senord f\u00F6r k\u00E4llnyckellager"}, //-srcstorepass
-        {"source.keystore.type",
-                "typ av k\u00E4llnyckellager"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL-serverv\u00E4rd och -port"}, //-sslserver
-        {"signed.jar.file",
-                "signerad jar-fil"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "startdatum/-tid f\u00F6r certifikatets giltighet"}, //-startdate
-        {"keystore.password",
-                "l\u00F6senord f\u00F6r nyckellager"}, //-storepass
-        {"keystore.type",
-                "nyckellagertyp"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "tillf\u00F6rlitliga certifikat fr\u00E5n cacerts"}, //-trustcacerts
-        {"verbose.output",
-                "utf\u00F6rliga utdata"}, //-v
-        {"validity.number.of.days",
-                "antal dagar f\u00F6r giltighet"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "Seriellt ID f\u00F6r certifikat som ska \u00E5terkallas"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "nyckelverktygsfel: "},
-        {"Illegal.option.", "Otill\u00E5tet alternativ:  "},
-        {"Illegal.value.", "Otill\u00E5tet v\u00E4rde: "},
-        {"Unknown.password.type.", "Ok\u00E4nd l\u00F6senordstyp: "},
-        {"Cannot.find.environment.variable.",
-                "Kan inte hitta milj\u00F6variabel: "},
-        {"Cannot.find.file.", "Hittar inte fil: "},
-        {"Command.option.flag.needs.an.argument.", "Kommandoalternativet {0} beh\u00F6ver ett argument."},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "Varning!  PKCS12-nyckellager har inte st\u00F6d f\u00F6r olika l\u00F6senord f\u00F6r lagret och nyckeln. Det anv\u00E4ndarspecificerade {0}-v\u00E4rdet ignoreras."},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "-keystore m\u00E5ste vara NONE om -storetype \u00E4r {0}"},
-        {"Too.many.retries.program.terminated",
-                 "F\u00F6r m\u00E5nga f\u00F6rs\u00F6k. Programmet avslutas"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "-storepasswd- och -keypasswd-kommandon st\u00F6ds inte om -storetype \u00E4r {0}"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "-keypasswd-kommandon st\u00F6ds inte om -storetype \u00E4r PKCS12"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "-keypass och -new kan inte anges om -storetype \u00E4r {0}"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "om -protected har angetts f\u00E5r inte -storepass, -keypass och -new anges"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "om -srcprotected anges f\u00E5r -srcstorepass och -srckeypass inte anges"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "om nyckellagret inte \u00E4r l\u00F6senordsskyddat f\u00E5r -storepass, -keypass och -new inte anges"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "om k\u00E4llnyckellagret inte \u00E4r l\u00F6senordsskyddat f\u00E5r -srcstorepass och -srckeypass inte anges"},
-        {"Illegal.startdate.value", "Otill\u00E5tet v\u00E4rde f\u00F6r startdatum"},
-        {"Validity.must.be.greater.than.zero",
-                "Giltigheten m\u00E5ste vara st\u00F6rre \u00E4n noll"},
-        {"provName.not.a.provider", "{0} \u00E4r inte en leverant\u00F6r"},
-        {"Usage.error.no.command.provided", "Syntaxfel: inget kommando angivet"},
-        {"Source.keystore.file.exists.but.is.empty.", "Nyckellagrets k\u00E4llfil finns, men \u00E4r tom: "},
-        {"Please.specify.srckeystore", "Ange -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "Kan inte specificera b\u00E5de -v och -rfc med 'list'-kommandot"},
-        {"Key.password.must.be.at.least.6.characters",
-                "Nyckell\u00F6senordet m\u00E5ste inneh\u00E5lla minst 6 tecken"},
-        {"New.password.must.be.at.least.6.characters",
-                "Det nya l\u00F6senordet m\u00E5ste inneh\u00E5lla minst 6 tecken"},
-        {"Keystore.file.exists.but.is.empty.",
-                "Nyckellagerfilen finns, men \u00E4r tom: "},
-        {"Keystore.file.does.not.exist.",
-                "Nyckellagerfilen finns inte: "},
-        {"Must.specify.destination.alias", "Du m\u00E5ste ange destinationsalias"},
-        {"Must.specify.alias", "Du m\u00E5ste ange alias"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "Nyckellagerl\u00F6senordet m\u00E5ste inneh\u00E5lla minst 6 tecken"},
-        {"Enter.keystore.password.", "Ange nyckellagerl\u00F6senord:  "},
-        {"Enter.source.keystore.password.", "Ange l\u00F6senord f\u00F6r k\u00E4llnyckellagret:  "},
-        {"Enter.destination.keystore.password.", "Ange nyckellagerl\u00F6senord f\u00F6r destination:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "Nyckellagerl\u00F6senordet \u00E4r f\u00F6r kort - det m\u00E5ste inneh\u00E5lla minst 6 tecken"},
-        {"Unknown.Entry.Type", "Ok\u00E4nd posttyp"},
-        {"Too.many.failures.Alias.not.changed", "F\u00F6r m\u00E5nga fel. Alias har inte \u00E4ndrats"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "Posten f\u00F6r alias {0} har importerats."},
-        {"Entry.for.alias.alias.not.imported.", "Posten f\u00F6r alias {0} har inte importerats."},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "Ett problem uppstod vid importen av posten f\u00F6r alias {0}: {1}.\nPosten {0} har inte importerats."},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "Kommandoimporten slutf\u00F6rd: {0} poster har importerats, {1} poster var felaktiga eller annullerades"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "Varning! Det befintliga aliaset {0} i destinationsnyckellagret skrivs \u00F6ver"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "Aliaset {0} finns redan. Vill du skriva \u00F6ver det? [nej]:  "},
-        {"Too.many.failures.try.later", "F\u00F6r m\u00E5nga fel - f\u00F6rs\u00F6k igen senare"},
-        {"Certification.request.stored.in.file.filename.",
-                "Certifikatbeg\u00E4ran har lagrats i filen <{0}>"},
-        {"Submit.this.to.your.CA", "Skicka detta till certifikatutf\u00E4rdaren"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "om n\u00E5got alias inte anges f\u00E5r destalias, srckeypass och destkeypass inte anges"},
-        {"Certificate.stored.in.file.filename.",
-                "Certifikatet har lagrats i filen <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "Certifikatsvaret har installerats i nyckellagret"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "Certifikatsvaret har inte installerats i nyckellagret"},
-        {"Certificate.was.added.to.keystore",
-                "Certifikatet har lagts till i nyckellagret"},
-        {"Certificate.was.not.added.to.keystore",
-                "Certifikatet har inte lagts till i nyckellagret"},
-        {".Storing.ksfname.", "[Lagrar {0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} saknar offentlig nyckel (certifikat)"},
-        {"Cannot.derive.signature.algorithm",
-                "Kan inte h\u00E4rleda signaturalgoritm"},
-        {"Alias.alias.does.not.exist",
-                "Aliaset <{0}> finns inte"},
-        {"Alias.alias.has.no.certificate",
-                "Aliaset <{0}> saknar certifikat"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "Nyckelparet genererades inte. Aliaset <{0}> finns redan"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "Genererar {0} bitars {1}-nyckelpar och sj\u00E4lvsignerat certifikat ({2}) med en giltighet p\u00E5 {3} dagar\n\tf\u00F6r: {4}"},
-        {"Enter.key.password.for.alias.", "Ange nyckell\u00F6senord f\u00F6r <{0}>"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(RETURN om det \u00E4r identiskt med nyckellagerl\u00F6senordet):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "Nyckell\u00F6senordet \u00E4r f\u00F6r kort - det m\u00E5ste inneh\u00E5lla minst 6 tecken"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "F\u00F6r m\u00E5nga fel - nyckeln lades inte till i nyckellagret"},
-        {"Destination.alias.dest.already.exists",
-                "Destinationsaliaset <{0}> finns redan"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "L\u00F6senordet \u00E4r f\u00F6r kort - det m\u00E5ste inneh\u00E5lla minst 6 tecken"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "F\u00F6r m\u00E5nga fel. Nyckelposten har inte klonats"},
-        {"key.password.for.alias.", "nyckell\u00F6senord f\u00F6r <{0}>"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "Nyckellagerpost f\u00F6r <{0}> finns redan"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "Skapar nyckellagerpost f\u00F6r <{0}> ..."},
-        {"No.entries.from.identity.database.added",
-                "Inga poster fr\u00E5n identitetsdatabasen har lagts till"},
-        {"Alias.name.alias", "Aliasnamn: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "Skapat den: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "Posttyp: {0}"},
-        {"Certificate.chain.length.", "L\u00E4ngd p\u00E5 certifikatskedja: "},
-        {"Certificate.i.1.", "Certifikat[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "Certifikatets fingeravtryck (SHA1): "},
-        {"Keystore.type.", "Nyckellagertyp: "},
-        {"Keystore.provider.", "Nyckellagerleverant\u00F6r: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "Nyckellagret inneh\u00E5ller {0,number,integer} post"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "Nyckellagret inneh\u00E5ller {0,number,integer} poster"},
-        {"Failed.to.parse.input", "Kunde inte tolka indata"},
-        {"Empty.input", "Inga indata"},
-        {"Not.X.509.certificate", "Inte ett X.509-certifikat"},
-        {"alias.has.no.public.key", "{0} saknar offentlig nyckel"},
-        {"alias.has.no.X.509.certificate", "{0} saknar X.509-certifikat"},
-        {"New.certificate.self.signed.", "Nytt certifikat (sj\u00E4lvsignerat):"},
-        {"Reply.has.no.certificates", "Svaret saknar certifikat"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "Certifikatet importerades inte. Aliaset <{0}> finns redan"},
-        {"Input.not.an.X.509.certificate", "Indata \u00E4r inte ett X.509-certifikat"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "Certifikatet finns redan i nyckellagerfilen under aliaset <{0}>"},
-        {"Do.you.still.want.to.add.it.no.",
-                "Vill du fortfarande l\u00E4gga till det? [nej]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "Certifikatet finns redan i den systemomsp\u00E4nnande CA-nyckellagerfilen under aliaset <{0}>"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "Vill du fortfarande l\u00E4gga till det i ditt eget nyckellagret? [nej]:  "},
-        {"Trust.this.certificate.no.", "Litar du p\u00E5 det h\u00E4r certifikatet? [nej]:  "},
-        {"YES", "Ja"},
-        {"New.prompt.", "Nytt {0}: "},
-        {"Passwords.must.differ", "L\u00F6senorden m\u00E5ste vara olika"},
-        {"Re.enter.new.prompt.", "Ange nytt {0} igen: "},
-        {"Re.enter.new.password.", "Ange det nya l\u00F6senordet igen: "},
-        {"They.don.t.match.Try.again", "De matchar inte. F\u00F6rs\u00F6k igen"},
-        {"Enter.prompt.alias.name.", "Ange aliasnamn f\u00F6r {0}:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "Ange ett nytt aliasnamn\t(skriv RETURN f\u00F6r att avbryta importen av denna post):  "},
-        {"Enter.alias.name.", "Ange aliasnamn:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(RETURN om det \u00E4r det samma som f\u00F6r <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "\u00C4gare: {0}\nUtf\u00E4rdare: {1}\nSerienummer: {2}\nGiltigt fr\u00E5n den: {3} till: {4}\nCertifikatets fingeravtryck:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Namn p\u00E5 signaturalgoritm: {8}\n\t Version: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "Vad heter du i f\u00F6r- och efternamn?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "Vad heter din avdelning inom organisationen?"},
-        {"What.is.the.name.of.your.organization.",
-                "Vad heter din organisation?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "Vad heter din ort eller plats?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "Vad heter ditt land eller din provins?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "Vilken \u00E4r den tv\u00E5st\u00E4lliga landskoden?"},
-        {"Is.name.correct.", "\u00C4r {0} korrekt?"},
-        {"no", "nej"},
-        {"yes", "ja"},
-        {"y", "j"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "Aliaset <{0}> saknar nyckel"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "Aliaset <{0}> refererar till en posttyp som inte \u00E4r n\u00E5gon privat nyckelpost. Kommandot -keyclone har endast st\u00F6d f\u00F6r kloning av privata nyckelposter"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  Varning Varning Varning  *****************"},
-        {"Signer.d.", "Signerare #%d:"},
-        {"Timestamp.", "Tidsst\u00E4mpel:"},
-        {"Signature.", "Underskrift:"},
-        {"CRLs.", "CRL:er:"},
-        {"Certificate.owner.", "Certifikat\u00E4gare: "},
-        {"Not.a.signed.jar.file", "Ingen signerad jar-fil"},
-        {"No.certificate.from.the.SSL.server",
-                "Inget certifikat fr\u00E5n SSL-servern"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* Integriteten f\u00F6r den information som lagras i nyckellagerfilen  *\n* har INTE verifierats!  Om du vill verifiera dess integritet *\n* m\u00E5ste du ange l\u00F6senordet f\u00F6r nyckellagret.                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* Integriteten f\u00F6r den information som lagras i srckeystore*\n* har INTE verifierats!  Om du vill verifiera dess integritet *\n* m\u00E5ste du ange l\u00F6senordet f\u00F6r srckeystore.                *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "Certifikatsvaret inneh\u00E5ller inte n\u00E5gon offentlig nyckel f\u00F6r <{0}>"},
-        {"Incomplete.certificate.chain.in.reply",
-                "Ofullst\u00E4ndig certifikatskedja i svaret"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "Certifikatskedjan i svaret g\u00E5r inte att verifiera: "},
-        {"Top.level.certificate.in.reply.",
-                "Toppniv\u00E5certifikatet i svaret:\n"},
-        {".is.not.trusted.", "... \u00E4r inte betrott. "},
-        {"Install.reply.anyway.no.", "Vill du installera svaret \u00E4nd\u00E5? [nej]:  "},
-        {"NO", "Nej"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "De offentliga nycklarna i svaret och nyckellagret matchar inte varandra"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "Certifikatsvaret och certifikatet i nyckellagret \u00E4r identiska"},
-        {"Failed.to.establish.chain.from.reply",
-                "Kunde inte uppr\u00E4tta kedja fr\u00E5n svaret"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "Fel svar. F\u00F6rs\u00F6k p\u00E5 nytt."},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "Den hemliga nyckeln har inte genererats eftersom aliaset <{0}> redan finns"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "Ange -keysize f\u00F6r att skapa hemlig nyckel"},
-
-        {"Extensions.", "Till\u00E4gg: "},
-        {".Empty.value.", "(Tomt v\u00E4rde)"},
-        {"Extension.Request.", "Till\u00E4ggsbeg\u00E4ran:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10 certifikatbeg\u00E4ran (version 1.0)\n\u00C4mne: %s\nAllm\u00E4n nyckel: %s-format %s-nyckel\n"},
-        {"Unknown.keyUsage.type.", "Ok\u00E4nd keyUsage-typ: "},
-        {"Unknown.extendedkeyUsage.type.", "Ok\u00E4nd extendedkeyUsage-typ: "},
-        {"Unknown.AccessDescription.type.", "Ok\u00E4nd AccessDescription-typ: "},
-        {"Unrecognized.GeneralName.type.", "Ok\u00E4nd GeneralName-typ: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "Detta till\u00E4gg kan inte markeras som kritiskt. "},
-        {"Odd.number.of.hex.digits.found.", "Udda antal hex-siffror p\u00E5tr\u00E4ffades: "},
-        {"Unknown.extension.type.", "Ok\u00E4nd till\u00E4ggstyp: "},
-        {"command.{0}.is.ambiguous.", "kommandot {0} \u00E4r tvetydigt:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "Varning! Det finns ingen offentlig nyckel f\u00F6r aliaset {0}. Kontrollera att det aktuella nyckellagret \u00E4r korrekt konfigurerat."},
-        {"Warning.Class.not.found.class", "Varning! Klassen hittades inte: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "Varning! Ogiltiga argument f\u00F6r konstruktor: {0}"},
-        {"Illegal.Principal.Type.type", "Otill\u00E5ten identitetshavaretyp: {0}"},
-        {"Illegal.option.option", "Otill\u00E5tet alternativ: {0}"},
-        {"Usage.policytool.options.", "Syntax: policytool [alternativ]"},
-        {".file.file.policy.file.location",
-                "  [-file <fil>]    policyfilens plats"},
-        {"New", "Nytt"},
-        {"Open", "\u00D6ppna"},
-        {"Save", "Spara"},
-        {"Save.As", "Spara som"},
-        {"View.Warning.Log", "Visa varningslogg"},
-        {"Exit", "Avsluta"},
-        {"Add.Policy.Entry", "L\u00E4gg till policypost"},
-        {"Edit.Policy.Entry", "Redigera policypost"},
-        {"Remove.Policy.Entry", "Ta bort policypost"},
-        {"Edit", "Redigera"},
-        {"Retain", "Beh\u00E5ll"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "Varning! Filnamnet kan inneh\u00E5lla omv\u00E4nda snedstreck inom citattecken. Citattecken kr\u00E4vs inte f\u00F6r omv\u00E4nda snedstreck (verktyget hanterar detta n\u00E4r policyinneh\u00E5llet skrivs till det best\u00E4ndiga lagret).\n\nKlicka p\u00E5 Beh\u00E5ll f\u00F6r att beh\u00E5lla det angivna namnet, eller klicka p\u00E5 Redigera f\u00F6r att \u00E4ndra det."},
-
-        {"Add.Public.Key.Alias", "L\u00E4gg till offentligt nyckelalias"},
-        {"Remove.Public.Key.Alias", "Ta bort offentligt nyckelalias"},
-        {"File", "Fil"},
-        {"KeyStore", "Nyckellager"},
-        {"Policy.File.", "Policyfil:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "Kan inte \u00F6ppna policyfilen: {0}: {1}"},
-        {"Policy.Tool", "Policyverktyg"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "Det uppstod ett fel n\u00E4r policykonfigurationen skulle \u00F6ppnas. Se varningsloggen f\u00F6r mer information."},
-        {"Error", "Fel"},
-        {"OK", "OK"},
-        {"Status", "Status"},
-        {"Warning", "Varning"},
-        {"Permission.",
-                "Beh\u00F6righet:                                                       "},
-        {"Principal.Type.", "Identitetshavaretyp:"},
-        {"Principal.Name.", "Identitetshavare:"},
-        {"Target.Name.",
-                "M\u00E5l:                                                    "},
-        {"Actions.",
-                "Funktioner:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "Ska den befintliga filen {0} skrivas \u00F6ver?"},
-        {"Cancel", "Avbryt"},
-        {"CodeBase.", "Kodbas:"},
-        {"SignedBy.", "Signerad av:"},
-        {"Add.Principal", "L\u00E4gg till identitetshavare"},
-        {"Edit.Principal", "Redigera identitetshavare"},
-        {"Remove.Principal", "Ta bort identitetshavare"},
-        {"Principals.", "Identitetshavare:"},
-        {".Add.Permission", "  L\u00E4gg till beh\u00F6righet"},
-        {".Edit.Permission", "  Redigera beh\u00F6righet"},
-        {"Remove.Permission", "Ta bort beh\u00F6righet"},
-        {"Done", "Utf\u00F6rd"},
-        {"KeyStore.URL.", "URL f\u00F6r nyckellager:"},
-        {"KeyStore.Type.", "Nyckellagertyp:"},
-        {"KeyStore.Provider.", "Nyckellagerleverant\u00F6r:"},
-        {"KeyStore.Password.URL.", "URL f\u00F6r l\u00F6senord till nyckellager:"},
-        {"Principals", "Identitetshavare"},
-        {".Edit.Principal.", "  Redigera identitetshavare:"},
-        {".Add.New.Principal.", "  L\u00E4gg till ny identitetshavare:"},
-        {"Permissions", "Beh\u00F6righet"},
-        {".Edit.Permission.", "  Redigera beh\u00F6righet:"},
-        {".Add.New.Permission.", "  L\u00E4gg till ny beh\u00F6righet:"},
-        {"Signed.By.", "Signerad av:"},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "Kan inte specificera identitetshavare med jokerteckenklass utan jokerteckennamn"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "Kan inte specificera identitetshavare utan namn"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "Beh\u00F6righet och m\u00E5lnamn m\u00E5ste ha ett v\u00E4rde"},
-        {"Remove.this.Policy.Entry.", "Vill du ta bort den h\u00E4r policyposten?"},
-        {"Overwrite.File", "Skriv \u00F6ver fil"},
-        {"Policy.successfully.written.to.filename",
-                "Policy har skrivits till {0}"},
-        {"null.filename", "nullfilnamn"},
-        {"Save.changes.", "Vill du spara \u00E4ndringarna?"},
-        {"Yes", "Ja"},
-        {"No", "Nej"},
-        {"Policy.Entry", "Policyfel"},
-        {"Save.Changes", "Spara \u00E4ndringar"},
-        {"No.Policy.Entry.selected", "Ingen policypost har valts"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "Kan inte \u00F6ppna nyckellagret: {0}"},
-        {"No.principal.selected", "Ingen identitetshavare har valts"},
-        {"No.permission.selected", "Ingen beh\u00F6righet har valts"},
-        {"name", "namn"},
-        {"configuration.type", "konfigurationstyp"},
-        {"environment.variable.name", "variabelnamn f\u00F6r milj\u00F6"},
-        {"library.name", "biblioteksnamn"},
-        {"package.name", "paketnamn"},
-        {"policy.type", "policytyp"},
-        {"property.name", "egenskapsnamn"},
-        {"Principal.List", "Lista \u00F6ver identitetshavare"},
-        {"Permission.List", "Beh\u00F6righetslista"},
-        {"Code.Base", "Kodbas"},
-        {"KeyStore.U.R.L.", "URL f\u00F6r nyckellager:"},
-        {"KeyStore.Password.U.R.L.", "URL f\u00F6r l\u00F6senord till nyckellager:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "ogiltiga null-indata"},
         {"actions.can.only.be.read.", "funktioner kan endast 'l\u00E4sas'"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "null-OID-mappning tillhandah\u00F6lls"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "ogiltigt null-AccessControlContext"},
         {"invalid.null.action.provided", "ogiltig null-funktion"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_zh_CN.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_zh_CN.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [\u9009\u9879]..."},
-        {"Options.", "\u9009\u9879:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "\u4F7F\u7528 \"keytool -help\" \u83B7\u53D6\u6240\u6709\u53EF\u7528\u547D\u4EE4"},
-        {"Key.and.Certificate.Management.Tool",
-                 "\u5BC6\u94A5\u548C\u8BC1\u4E66\u7BA1\u7406\u5DE5\u5177"},
-        {"Commands.", "\u547D\u4EE4:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "\u4F7F\u7528 \"keytool -command_name -help\" \u83B7\u53D6 command_name \u7684\u7528\u6CD5"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "\u751F\u6210\u8BC1\u4E66\u8BF7\u6C42"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "\u66F4\u6539\u6761\u76EE\u7684\u522B\u540D"}, //-changealias
-        {"Deletes.an.entry",
-                "\u5220\u9664\u6761\u76EE"}, //-delete
-        {"Exports.certificate",
-                "\u5BFC\u51FA\u8BC1\u4E66"}, //-exportcert
-        {"Generates.a.key.pair",
-                "\u751F\u6210\u5BC6\u94A5\u5BF9"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "\u751F\u6210\u5BF9\u79F0\u5BC6\u94A5"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "\u6839\u636E\u8BC1\u4E66\u8BF7\u6C42\u751F\u6210\u8BC1\u4E66"}, //-gencert
-        {"Generates.CRL", "\u751F\u6210 CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "\u4ECE JDK 1.1.x \u6837\u5F0F\u7684\u8EAB\u4EFD\u6570\u636E\u5E93\u5BFC\u5165\u6761\u76EE"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "\u5BFC\u5165\u8BC1\u4E66\u6216\u8BC1\u4E66\u94FE"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "\u4ECE\u5176\u4ED6\u5BC6\u94A5\u5E93\u5BFC\u5165\u4E00\u4E2A\u6216\u6240\u6709\u6761\u76EE"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "\u514B\u9686\u5BC6\u94A5\u6761\u76EE"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "\u66F4\u6539\u6761\u76EE\u7684\u5BC6\u94A5\u53E3\u4EE4"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "\u5217\u51FA\u5BC6\u94A5\u5E93\u4E2D\u7684\u6761\u76EE"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "\u6253\u5370\u8BC1\u4E66\u5185\u5BB9"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "\u6253\u5370\u8BC1\u4E66\u8BF7\u6C42\u7684\u5185\u5BB9"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "\u6253\u5370 CRL \u6587\u4EF6\u7684\u5185\u5BB9"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "\u751F\u6210\u81EA\u7B7E\u540D\u8BC1\u4E66"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "\u66F4\u6539\u5BC6\u94A5\u5E93\u7684\u5B58\u50A8\u53E3\u4EE4"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "\u8981\u5904\u7406\u7684\u6761\u76EE\u7684\u522B\u540D"}, //-alias
-        {"destination.alias",
-                "\u76EE\u6807\u522B\u540D"}, //-destalias
-        {"destination.key.password",
-                "\u76EE\u6807\u5BC6\u94A5\u53E3\u4EE4"}, //-destkeypass
-        {"destination.keystore.name",
-                "\u76EE\u6807\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "\u53D7\u4FDD\u62A4\u7684\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "\u76EE\u6807\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-destprovidername
-        {"destination.keystore.password",
-                "\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-deststorepass
-        {"destination.keystore.type",
-                "\u76EE\u6807\u5BC6\u94A5\u5E93\u7C7B\u578B"}, //-deststoretype
-        {"distinguished.name",
-                "\u552F\u4E00\u5224\u522B\u540D"}, //-dname
-        {"X.509.extension",
-                "X.509 \u6269\u5C55"}, //-ext
-        {"output.file.name",
-                "\u8F93\u51FA\u6587\u4EF6\u540D"}, //-file and -outfile
-        {"input.file.name",
-                "\u8F93\u5165\u6587\u4EF6\u540D"}, //-file and -infile
-        {"key.algorithm.name",
-                "\u5BC6\u94A5\u7B97\u6CD5\u540D\u79F0"}, //-keyalg
-        {"key.password",
-                "\u5BC6\u94A5\u53E3\u4EE4"}, //-keypass
-        {"key.bit.size",
-                "\u5BC6\u94A5\u4F4D\u5927\u5C0F"}, //-keysize
-        {"keystore.name",
-                "\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-keystore
-        {"new.password",
-                "\u65B0\u53E3\u4EE4"}, //-new
-        {"do.not.prompt",
-                "\u4E0D\u63D0\u793A"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "\u901A\u8FC7\u53D7\u4FDD\u62A4\u7684\u673A\u5236\u7684\u53E3\u4EE4"}, //-protected
-        {"provider.argument",
-                "\u63D0\u4F9B\u65B9\u53C2\u6570"}, //-providerarg
-        {"provider.class.name",
-                "\u63D0\u4F9B\u65B9\u7C7B\u540D"}, //-providerclass
-        {"provider.name",
-                "\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-providername
-        {"provider.classpath",
-                "\u63D0\u4F9B\u65B9\u7C7B\u8DEF\u5F84"}, //-providerpath
-        {"output.in.RFC.style",
-                "\u4EE5 RFC \u6837\u5F0F\u8F93\u51FA"}, //-rfc
-        {"signature.algorithm.name",
-                "\u7B7E\u540D\u7B97\u6CD5\u540D\u79F0"}, //-sigalg
-        {"source.alias",
-                "\u6E90\u522B\u540D"}, //-srcalias
-        {"source.key.password",
-                "\u6E90\u5BC6\u94A5\u53E3\u4EE4"}, //-srckeypass
-        {"source.keystore.name",
-                "\u6E90\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "\u53D7\u4FDD\u62A4\u7684\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "\u6E90\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-srcprovidername
-        {"source.keystore.password",
-                "\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-srcstorepass
-        {"source.keystore.type",
-                "\u6E90\u5BC6\u94A5\u5E93\u7C7B\u578B"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL \u670D\u52A1\u5668\u4E3B\u673A\u548C\u7AEF\u53E3"}, //-sslserver
-        {"signed.jar.file",
-                "\u5DF2\u7B7E\u540D\u7684 jar \u6587\u4EF6"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "\u8BC1\u4E66\u6709\u6548\u671F\u5F00\u59CB\u65E5\u671F/\u65F6\u95F4"}, //-startdate
-        {"keystore.password",
-                "\u5BC6\u94A5\u5E93\u53E3\u4EE4"}, //-storepass
-        {"keystore.type",
-                "\u5BC6\u94A5\u5E93\u7C7B\u578B"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "\u4FE1\u4EFB\u6765\u81EA cacerts \u7684\u8BC1\u4E66"}, //-trustcacerts
-        {"verbose.output",
-                "\u8BE6\u7EC6\u8F93\u51FA"}, //-v
-        {"validity.number.of.days",
-                "\u6709\u6548\u5929\u6570"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "\u8981\u64A4\u9500\u7684\u8BC1\u4E66\u7684\u5E8F\u5217 ID"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "keytool \u9519\u8BEF: "},
-        {"Illegal.option.", "\u975E\u6CD5\u9009\u9879:  "},
-        {"Illegal.value.", "\u975E\u6CD5\u503C: "},
-        {"Unknown.password.type.", "\u672A\u77E5\u53E3\u4EE4\u7C7B\u578B: "},
-        {"Cannot.find.environment.variable.",
-                "\u627E\u4E0D\u5230\u73AF\u5883\u53D8\u91CF: "},
-        {"Cannot.find.file.", "\u627E\u4E0D\u5230\u6587\u4EF6: "},
-        {"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9009\u9879{0}\u9700\u8981\u4E00\u4E2A\u53C2\u6570\u3002"},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "\u8B66\u544A: PKCS12 KeyStore \u4E0D\u652F\u6301\u5176\u4ED6\u5B58\u50A8\u548C\u5BC6\u94A5\u53E3\u4EE4\u3002\u6B63\u5728\u5FFD\u7565\u7528\u6237\u6307\u5B9A\u7684{0}\u503C\u3002"},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u4E3A {0}, \u5219 -keystore \u5FC5\u987B\u4E3A NONE"},
-        {"Too.many.retries.program.terminated",
-                 "\u91CD\u8BD5\u6B21\u6570\u8FC7\u591A, \u7A0B\u5E8F\u5DF2\u7EC8\u6B62"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u4E3A {0}, \u5219\u4E0D\u652F\u6301 -storepasswd \u548C -keypasswd \u547D\u4EE4"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "\u5982\u679C -storetype \u4E3A PKCS12, \u5219\u4E0D\u652F\u6301 -keypasswd \u547D\u4EE4"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u4E3A {0}, \u5219\u4E0D\u80FD\u6307\u5B9A -keypass \u548C -new"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "\u5982\u679C\u6307\u5B9A\u4E86 -protected, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass, -keypass \u548C -new"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "\u5982\u679C\u6307\u5B9A\u4E86 -srcprotected, \u5219\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "\u5982\u679C\u5BC6\u94A5\u5E93\u672A\u53D7\u53E3\u4EE4\u4FDD\u62A4, \u5219\u4E0D\u80FD\u6307\u5B9A -storepass, -keypass \u548C -new"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "\u5982\u679C\u6E90\u5BC6\u94A5\u5E93\u672A\u53D7\u53E3\u4EE4\u4FDD\u62A4, \u5219\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
-        {"Illegal.startdate.value", "\u975E\u6CD5\u5F00\u59CB\u65E5\u671F\u503C"},
-        {"Validity.must.be.greater.than.zero",
-                "\u6709\u6548\u671F\u5FC5\u987B\u5927\u4E8E\u96F6"},
-        {"provName.not.a.provider", "{0}\u4E0D\u662F\u63D0\u4F9B\u65B9"},
-        {"Usage.error.no.command.provided", "\u7528\u6CD5\u9519\u8BEF: \u6CA1\u6709\u63D0\u4F9B\u547D\u4EE4"},
-        {"Source.keystore.file.exists.but.is.empty.", "\u6E90\u5BC6\u94A5\u5E93\u6587\u4EF6\u5B58\u5728, \u4F46\u4E3A\u7A7A: "},
-        {"Please.specify.srckeystore", "\u8BF7\u6307\u5B9A -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                "'list' \u547D\u4EE4\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A -v \u53CA -rfc"},
-        {"Key.password.must.be.at.least.6.characters",
-                "\u5BC6\u94A5\u53E3\u4EE4\u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
-        {"New.password.must.be.at.least.6.characters",
-                "\u65B0\u53E3\u4EE4\u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
-        {"Keystore.file.exists.but.is.empty.",
-                "\u5BC6\u94A5\u5E93\u6587\u4EF6\u5B58\u5728, \u4F46\u4E3A\u7A7A: "},
-        {"Keystore.file.does.not.exist.",
-                "\u5BC6\u94A5\u5E93\u6587\u4EF6\u4E0D\u5B58\u5728: "},
-        {"Must.specify.destination.alias", "\u5FC5\u987B\u6307\u5B9A\u76EE\u6807\u522B\u540D"},
-        {"Must.specify.alias", "\u5FC5\u987B\u6307\u5B9A\u522B\u540D"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "\u5BC6\u94A5\u5E93\u53E3\u4EE4\u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
-        {"Enter.keystore.password.", "\u8F93\u5165\u5BC6\u94A5\u5E93\u53E3\u4EE4:  "},
-        {"Enter.source.keystore.password.", "\u8F93\u5165\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4:  "},
-        {"Enter.destination.keystore.password.", "\u8F93\u5165\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4:  "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "\u5BC6\u94A5\u5E93\u53E3\u4EE4\u592A\u77ED - \u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
-        {"Unknown.Entry.Type", "\u672A\u77E5\u6761\u76EE\u7C7B\u578B"},
-        {"Too.many.failures.Alias.not.changed", "\u6545\u969C\u592A\u591A\u3002\u672A\u66F4\u6539\u522B\u540D"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "\u5DF2\u6210\u529F\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u3002"},
-        {"Entry.for.alias.alias.not.imported.", "\u672A\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u3002"},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u65F6\u51FA\u73B0\u95EE\u9898: {1}\u3002\n\u672A\u5BFC\u5165\u522B\u540D {0} \u7684\u6761\u76EE\u3002"},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "\u5DF2\u5B8C\u6210\u5BFC\u5165\u547D\u4EE4: {0} \u4E2A\u6761\u76EE\u6210\u529F\u5BFC\u5165, {1} \u4E2A\u6761\u76EE\u5931\u8D25\u6216\u53D6\u6D88"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "\u8B66\u544A: \u6B63\u5728\u8986\u76D6\u76EE\u6807\u5BC6\u94A5\u5E93\u4E2D\u7684\u73B0\u6709\u522B\u540D {0}"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "\u5B58\u5728\u73B0\u6709\u6761\u76EE\u522B\u540D {0}, \u662F\u5426\u8986\u76D6? [no]:  "},
-        {"Too.many.failures.try.later", "\u6545\u969C\u592A\u591A - \u8BF7\u7A0D\u540E\u518D\u8BD5"},
-        {"Certification.request.stored.in.file.filename.",
-                "\u5B58\u50A8\u5728\u6587\u4EF6 <{0}> \u4E2D\u7684\u8BA4\u8BC1\u8BF7\u6C42"},
-        {"Submit.this.to.your.CA", "\u5C06\u6B64\u63D0\u4EA4\u7ED9\u60A8\u7684 CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u522B\u540D, \u5219\u4E0D\u80FD\u6307\u5B9A\u76EE\u6807\u522B\u540D, \u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4\u548C\u76EE\u6807\u5BC6\u94A5\u5E93\u53E3\u4EE4"},
-        {"Certificate.stored.in.file.filename.",
-                "\u5B58\u50A8\u5728\u6587\u4EF6 <{0}> \u4E2D\u7684\u8BC1\u4E66"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "\u8BC1\u4E66\u56DE\u590D\u5DF2\u5B89\u88C5\u5728\u5BC6\u94A5\u5E93\u4E2D"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "\u8BC1\u4E66\u56DE\u590D\u672A\u5B89\u88C5\u5728\u5BC6\u94A5\u5E93\u4E2D"},
-        {"Certificate.was.added.to.keystore",
-                "\u8BC1\u4E66\u5DF2\u6DFB\u52A0\u5230\u5BC6\u94A5\u5E93\u4E2D"},
-        {"Certificate.was.not.added.to.keystore",
-                "\u8BC1\u4E66\u672A\u6DFB\u52A0\u5230\u5BC6\u94A5\u5E93\u4E2D"},
-        {".Storing.ksfname.", "[\u6B63\u5728\u5B58\u50A8{0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0}\u6CA1\u6709\u516C\u5171\u5BC6\u94A5 (\u8BC1\u4E66)"},
-        {"Cannot.derive.signature.algorithm",
-                "\u65E0\u6CD5\u6D3E\u751F\u7B7E\u540D\u7B97\u6CD5"},
-        {"Alias.alias.does.not.exist",
-                "\u522B\u540D <{0}> \u4E0D\u5B58\u5728"},
-        {"Alias.alias.has.no.certificate",
-                "\u522B\u540D <{0}> \u6CA1\u6709\u8BC1\u4E66"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "\u672A\u751F\u6210\u5BC6\u94A5\u5BF9, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "\u6B63\u5728\u4E3A\u4EE5\u4E0B\u5BF9\u8C61\u751F\u6210 {0} \u4F4D{1}\u5BC6\u94A5\u5BF9\u548C\u81EA\u7B7E\u540D\u8BC1\u4E66 ({2}) (\u6709\u6548\u671F\u4E3A {3} \u5929):\n\t {4}"},
-        {"Enter.key.password.for.alias.", "\u8F93\u5165 <{0}> \u7684\u5BC6\u94A5\u53E3\u4EE4"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(\u5982\u679C\u548C\u5BC6\u94A5\u5E93\u53E3\u4EE4\u76F8\u540C, \u6309\u56DE\u8F66):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "\u5BC6\u94A5\u53E3\u4EE4\u592A\u77ED - \u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "\u6545\u969C\u592A\u591A - \u5BC6\u94A5\u672A\u6DFB\u52A0\u5230\u5BC6\u94A5\u5E93\u4E2D"},
-        {"Destination.alias.dest.already.exists",
-                "\u76EE\u6807\u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "\u53E3\u4EE4\u592A\u77ED - \u81F3\u5C11\u5FC5\u987B\u4E3A 6 \u4E2A\u5B57\u7B26"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "\u6545\u969C\u592A\u591A\u3002\u672A\u514B\u9686\u5BC6\u94A5\u6761\u76EE"},
-        {"key.password.for.alias.", "<{0}> \u7684\u5BC6\u94A5\u53E3\u4EE4"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "<{0}> \u7684\u5BC6\u94A5\u5E93\u6761\u76EE\u5DF2\u7ECF\u5B58\u5728"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "\u6B63\u5728\u521B\u5EFA <{0}> \u7684\u5BC6\u94A5\u5E93\u6761\u76EE..."},
-        {"No.entries.from.identity.database.added",
-                "\u672A\u4ECE\u8EAB\u4EFD\u6570\u636E\u5E93\u4E2D\u6DFB\u52A0\u4EFB\u4F55\u6761\u76EE"},
-        {"Alias.name.alias", "\u522B\u540D: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "\u521B\u5EFA\u65E5\u671F: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "\u6761\u76EE\u7C7B\u578B: {0}"},
-        {"Certificate.chain.length.", "\u8BC1\u4E66\u94FE\u957F\u5EA6: "},
-        {"Certificate.i.1.", "\u8BC1\u4E66[{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "\u8BC1\u4E66\u6307\u7EB9 (SHA1): "},
-        {"Keystore.type.", "\u5BC6\u94A5\u5E93\u7C7B\u578B: "},
-        {"Keystore.provider.", "\u5BC6\u94A5\u5E93\u63D0\u4F9B\u65B9: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "\u60A8\u7684\u5BC6\u94A5\u5E93\u5305\u542B {0,number,integer} \u4E2A\u6761\u76EE"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "\u60A8\u7684\u5BC6\u94A5\u5E93\u5305\u542B {0,number,integer} \u4E2A\u6761\u76EE"},
-        {"Failed.to.parse.input", "\u65E0\u6CD5\u5BF9\u8F93\u5165\u8FDB\u884C\u8BED\u6CD5\u5206\u6790"},
-        {"Empty.input", "\u7A7A\u8F93\u5165"},
-        {"Not.X.509.certificate", "\u975E X.509 \u8BC1\u4E66"},
-        {"alias.has.no.public.key", "{0}\u6CA1\u6709\u516C\u5171\u5BC6\u94A5"},
-        {"alias.has.no.X.509.certificate", "{0}\u6CA1\u6709 X.509 \u8BC1\u4E66"},
-        {"New.certificate.self.signed.", "\u65B0\u8BC1\u4E66 (\u81EA\u7B7E\u540D):"},
-        {"Reply.has.no.certificates", "\u56DE\u590D\u4E2D\u6CA1\u6709\u8BC1\u4E66"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "\u8BC1\u4E66\u672A\u5BFC\u5165, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
-        {"Input.not.an.X.509.certificate", "\u6240\u8F93\u5165\u7684\u4E0D\u662F X.509 \u8BC1\u4E66"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "\u5728\u522B\u540D <{0}> \u4E4B\u4E0B, \u8BC1\u4E66\u5DF2\u7ECF\u5B58\u5728\u4E8E\u5BC6\u94A5\u5E93\u4E2D"},
-        {"Do.you.still.want.to.add.it.no.",
-                "\u662F\u5426\u4ECD\u8981\u6DFB\u52A0? [no]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "\u5728\u522B\u540D <{0}> \u4E4B\u4E0B, \u8BC1\u4E66\u5DF2\u7ECF\u5B58\u5728\u4E8E\u7CFB\u7EDF\u8303\u56F4\u7684 CA \u5BC6\u94A5\u5E93\u4E2D"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "\u662F\u5426\u4ECD\u8981\u5C06\u5B83\u6DFB\u52A0\u5230\u81EA\u5DF1\u7684\u5BC6\u94A5\u5E93? [no]:  "},
-        {"Trust.this.certificate.no.", "\u662F\u5426\u4FE1\u4EFB\u6B64\u8BC1\u4E66? [no]:  "},
-        {"YES", "\u662F"},
-        {"New.prompt.", "\u65B0{0}: "},
-        {"Passwords.must.differ", "\u53E3\u4EE4\u4E0D\u80FD\u76F8\u540C"},
-        {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F93\u5165\u65B0{0}: "},
-        {"Re.enter.new.password.", "\u518D\u6B21\u8F93\u5165\u65B0\u53E3\u4EE4: "},
-        {"They.don.t.match.Try.again", "\u5B83\u4EEC\u4E0D\u5339\u914D\u3002\u8BF7\u91CD\u8BD5"},
-        {"Enter.prompt.alias.name.", "\u8F93\u5165{0}\u522B\u540D:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "\u8F93\u5165\u65B0\u7684\u522B\u540D\t(\u6309\u56DE\u8F66\u4EE5\u53D6\u6D88\u5BF9\u6B64\u6761\u76EE\u7684\u5BFC\u5165):  "},
-        {"Enter.alias.name.", "\u8F93\u5165\u522B\u540D:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(\u5982\u679C\u548C <{0}> \u76F8\u540C, \u5219\u6309\u56DE\u8F66)"},
-        {".PATTERN.printX509Cert",
-                "\u6240\u6709\u8005: {0}\n\u53D1\u5E03\u8005: {1}\n\u5E8F\u5217\u53F7: {2}\n\u6709\u6548\u671F\u5F00\u59CB\u65E5\u671F: {3}, \u622A\u6B62\u65E5\u671F: {4}\n\u8BC1\u4E66\u6307\u7EB9:\n\t MD5: {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7B7E\u540D\u7B97\u6CD5\u540D\u79F0: {8}\n\t \u7248\u672C: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "\u60A8\u7684\u540D\u5B57\u4E0E\u59D3\u6C0F\u662F\u4EC0\u4E48?"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "\u60A8\u7684\u7EC4\u7EC7\u5355\u4F4D\u540D\u79F0\u662F\u4EC0\u4E48?"},
-        {"What.is.the.name.of.your.organization.",
-                "\u60A8\u7684\u7EC4\u7EC7\u540D\u79F0\u662F\u4EC0\u4E48?"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "\u60A8\u6240\u5728\u7684\u57CE\u5E02\u6216\u533A\u57DF\u540D\u79F0\u662F\u4EC0\u4E48?"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "\u60A8\u6240\u5728\u7684\u7701/\u5E02/\u81EA\u6CBB\u533A\u540D\u79F0\u662F\u4EC0\u4E48?"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "\u8BE5\u5355\u4F4D\u7684\u53CC\u5B57\u6BCD\u56FD\u5BB6/\u5730\u533A\u4EE3\u7801\u662F\u4EC0\u4E48?"},
-        {"Is.name.correct.", "{0}\u662F\u5426\u6B63\u786E?"},
-        {"no", "\u5426"},
-        {"yes", "\u662F"},
-        {"y", "y"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "\u522B\u540D <{0}> \u6CA1\u6709\u5BC6\u94A5"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "\u522B\u540D <{0}> \u5F15\u7528\u4E86\u4E0D\u5C5E\u4E8E\u79C1\u6709\u5BC6\u94A5\u6761\u76EE\u7684\u6761\u76EE\u7C7B\u578B\u3002-keyclone \u547D\u4EE4\u4EC5\u652F\u6301\u5BF9\u79C1\u6709\u5BC6\u94A5\u6761\u76EE\u7684\u514B\u9686"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  \u8B66\u544A \u8B66\u544A \u8B66\u544A  *****************"},
-        {"Signer.d.", "\u7B7E\u540D\u8005 #%d:"},
-        {"Timestamp.", "\u65F6\u95F4\u6233:"},
-        {"Signature.", "\u7B7E\u540D:"},
-        {"CRLs.", "CRL:"},
-        {"Certificate.owner.", "\u8BC1\u4E66\u6240\u6709\u8005: "},
-        {"Not.a.signed.jar.file", "\u4E0D\u662F\u5DF2\u7B7E\u540D\u7684 jar \u6587\u4EF6"},
-        {"No.certificate.from.the.SSL.server",
-                "\u6CA1\u6709\u6765\u81EA SSL \u670D\u52A1\u5668\u7684\u8BC1\u4E66"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* \u5B58\u50A8\u5728\u60A8\u7684\u5BC6\u94A5\u5E93\u4E2D\u7684\u4FE1\u606F\u7684\u5B8C\u6574\u6027  *\n* \u5C1A\u672A\u7ECF\u8FC7\u9A8C\u8BC1!  \u4E3A\u4E86\u9A8C\u8BC1\u5176\u5B8C\u6574\u6027, *\n* \u5FC5\u987B\u63D0\u4F9B\u5BC6\u94A5\u5E93\u53E3\u4EE4\u3002                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* \u5B58\u50A8\u5728 srckeystore \u4E2D\u7684\u4FE1\u606F\u7684\u5B8C\u6574\u6027*\n* \u5C1A\u672A\u7ECF\u8FC7\u9A8C\u8BC1!  \u4E3A\u4E86\u9A8C\u8BC1\u5176\u5B8C\u6574\u6027, *\n* \u5FC5\u987B\u63D0\u4F9B\u6E90\u5BC6\u94A5\u5E93\u53E3\u4EE4\u3002                  *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "\u8BC1\u4E66\u56DE\u590D\u4E2D\u4E0D\u5305\u542B <{0}> \u7684\u516C\u5171\u5BC6\u94A5"},
-        {"Incomplete.certificate.chain.in.reply",
-                "\u56DE\u590D\u4E2D\u7684\u8BC1\u4E66\u94FE\u4E0D\u5B8C\u6574"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "\u56DE\u590D\u4E2D\u7684\u8BC1\u4E66\u94FE\u672A\u9A8C\u8BC1: "},
-        {"Top.level.certificate.in.reply.",
-                "\u56DE\u590D\u4E2D\u7684\u9876\u7EA7\u8BC1\u4E66:\n"},
-        {".is.not.trusted.", "... \u662F\u4E0D\u53EF\u4FE1\u7684\u3002"},
-        {"Install.reply.anyway.no.", "\u662F\u5426\u4ECD\u8981\u5B89\u88C5\u56DE\u590D? [no]:  "},
-        {"NO", "\u5426"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "\u56DE\u590D\u4E2D\u7684\u516C\u5171\u5BC6\u94A5\u4E0E\u5BC6\u94A5\u5E93\u4E0D\u5339\u914D"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "\u8BC1\u4E66\u56DE\u590D\u4E0E\u5BC6\u94A5\u5E93\u4E2D\u7684\u8BC1\u4E66\u662F\u76F8\u540C\u7684"},
-        {"Failed.to.establish.chain.from.reply",
-                "\u65E0\u6CD5\u4ECE\u56DE\u590D\u4E2D\u5EFA\u7ACB\u94FE"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "\u9519\u8BEF\u7684\u7B54\u6848, \u8BF7\u518D\u8BD5\u4E00\u6B21"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "\u6CA1\u6709\u751F\u6210\u5BC6\u94A5, \u522B\u540D <{0}> \u5DF2\u7ECF\u5B58\u5728"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "\u8BF7\u63D0\u4F9B -keysize \u4EE5\u751F\u6210\u5BF9\u79F0\u5BC6\u94A5"},
-
-        {"Extensions.", "\u6269\u5C55: "},
-        {".Empty.value.", "(\u7A7A\u503C)"},
-        {"Extension.Request.", "\u6269\u5C55\u8BF7\u6C42:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10 \u8BC1\u4E66\u8BF7\u6C42 (\u7248\u672C 1.0)\n\u4E3B\u9898: %s\n\u516C\u5171\u5BC6\u94A5: %s \u683C\u5F0F %s \u5BC6\u94A5\n"},
-        {"Unknown.keyUsage.type.", "\u672A\u77E5 keyUsage \u7C7B\u578B: "},
-        {"Unknown.extendedkeyUsage.type.", "\u672A\u77E5 extendedkeyUsage \u7C7B\u578B: "},
-        {"Unknown.AccessDescription.type.", "\u672A\u77E5 AccessDescription \u7C7B\u578B: "},
-        {"Unrecognized.GeneralName.type.", "\u65E0\u6CD5\u8BC6\u522B\u7684 GeneralName \u7C7B\u578B: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "\u65E0\u6CD5\u5C06\u6B64\u6269\u5C55\u6807\u8BB0\u4E3A\u201C\u4E25\u91CD\u201D\u3002"},
-        {"Odd.number.of.hex.digits.found.", "\u627E\u5230\u5947\u6570\u4E2A\u5341\u516D\u8FDB\u5236\u6570\u5B57: "},
-        {"Unknown.extension.type.", "\u672A\u77E5\u6269\u5C55\u7C7B\u578B: "},
-        {"command.{0}.is.ambiguous.", "\u547D\u4EE4{0}\u4E0D\u660E\u786E:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u522B\u540D {0} \u7684\u516C\u5171\u5BC6\u94A5\u4E0D\u5B58\u5728\u3002\u8BF7\u786E\u4FDD\u5DF2\u6B63\u786E\u914D\u7F6E KeyStore\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u7C7B: {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u6784\u9020\u5668\u7684\u53C2\u6570\u65E0\u6548: {0}"},
-        {"Illegal.Principal.Type.type", "\u975E\u6CD5\u7684\u4E3B\u7528\u6237\u7C7B\u578B: {0}"},
-        {"Illegal.option.option", "\u975E\u6CD5\u9009\u9879: {0}"},
-        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [\u9009\u9879]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \u7B56\u7565\u6587\u4EF6\u4F4D\u7F6E"},
-        {"New", "\u65B0\u5EFA"},
-        {"Open", "\u6253\u5F00"},
-        {"Save", "\u4FDD\u5B58"},
-        {"Save.As", "\u53E6\u5B58\u4E3A"},
-        {"View.Warning.Log", "\u67E5\u770B\u8B66\u544A\u65E5\u5FD7"},
-        {"Exit", "\u9000\u51FA"},
-        {"Add.Policy.Entry", "\u6DFB\u52A0\u7B56\u7565\u6761\u76EE"},
-        {"Edit.Policy.Entry", "\u7F16\u8F91\u7B56\u7565\u6761\u76EE"},
-        {"Remove.Policy.Entry", "\u5220\u9664\u7B56\u7565\u6761\u76EE"},
-        {"Edit", "\u7F16\u8F91"},
-        {"Retain", "\u4FDD\u7559"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u6587\u4EF6\u540D\u5305\u542B\u8F6C\u4E49\u7684\u53CD\u659C\u6760\u5B57\u7B26\u3002\u4E0D\u9700\u8981\u5BF9\u53CD\u659C\u6760\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49 (\u8BE5\u5DE5\u5177\u5728\u5C06\u7B56\u7565\u5185\u5BB9\u5199\u5165\u6C38\u4E45\u5B58\u50A8\u65F6\u4F1A\u6839\u636E\u9700\u8981\u5BF9\u5B57\u7B26\u8FDB\u884C\u8F6C\u4E49)\u3002\n\n\u5355\u51FB\u201C\u4FDD\u7559\u201D\u53EF\u4FDD\u7559\u8F93\u5165\u7684\u540D\u79F0, \u6216\u8005\u5355\u51FB\u201C\u7F16\u8F91\u201D\u53EF\u7F16\u8F91\u8BE5\u540D\u79F0\u3002"},
-
-        {"Add.Public.Key.Alias", "\u6DFB\u52A0\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
-        {"Remove.Public.Key.Alias", "\u5220\u9664\u516C\u5171\u5BC6\u94A5\u522B\u540D"},
-        {"File", "\u6587\u4EF6"},
-        {"KeyStore", "KeyStore"},
-        {"Policy.File.", "\u7B56\u7565\u6587\u4EF6:"},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u65E0\u6CD5\u6253\u5F00\u7B56\u7565\u6587\u4EF6: {0}: {1}"},
-        {"Policy.Tool", "\u7B56\u7565\u5DE5\u5177"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u6253\u5F00\u7B56\u7565\u914D\u7F6E\u65F6\u51FA\u9519\u3002\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u67E5\u770B\u8B66\u544A\u65E5\u5FD7\u3002"},
-        {"Error", "\u9519\u8BEF"},
-        {"OK", "\u786E\u5B9A"},
-        {"Status", "\u72B6\u6001"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u6743\u9650:                                                       "},
-        {"Principal.Type.", "\u4E3B\u7528\u6237\u7C7B\u578B:"},
-        {"Principal.Name.", "\u4E3B\u7528\u6237\u540D\u79F0:"},
-        {"Target.Name.",
-                "\u76EE\u6807\u540D\u79F0:                                                    "},
-        {"Actions.",
-                "\u64CD\u4F5C:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u786E\u8BA4\u8986\u76D6\u73B0\u6709\u7684\u6587\u4EF6{0}?"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u6DFB\u52A0\u4E3B\u7528\u6237"},
-        {"Edit.Principal", "\u7F16\u8F91\u4E3B\u7528\u6237"},
-        {"Remove.Principal", "\u5220\u9664\u4E3B\u7528\u6237"},
-        {"Principals.", "\u4E3B\u7528\u6237:"},
-        {".Add.Permission", "  \u6DFB\u52A0\u6743\u9650"},
-        {".Edit.Permission", "  \u7F16\u8F91\u6743\u9650"},
-        {"Remove.Permission", "\u5220\u9664\u6743\u9650"},
-        {"Done", "\u5B8C\u6210"},
-        {"KeyStore.URL.", "KeyStore URL:"},
-        {"KeyStore.Type.", "KeyStore \u7C7B\u578B:"},
-        {"KeyStore.Provider.", "KeyStore \u63D0\u4F9B\u65B9:"},
-        {"KeyStore.Password.URL.", "KeyStore \u53E3\u4EE4 URL:"},
-        {"Principals", "\u4E3B\u7528\u6237"},
-        {".Edit.Principal.", "  \u7F16\u8F91\u4E3B\u7528\u6237:"},
-        {".Add.New.Principal.", "  \u6DFB\u52A0\u65B0\u4E3B\u7528\u6237:"},
-        {"Permissions", "\u6743\u9650"},
-        {".Edit.Permission.", "  \u7F16\u8F91\u6743\u9650:"},
-        {".Add.New.Permission.", "  \u52A0\u5165\u65B0\u7684\u6743\u9650:"},
-        {"Signed.By.", "\u7B7E\u7F72\u4EBA: "},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u6CA1\u6709\u901A\u914D\u7B26\u540D\u79F0, \u65E0\u6CD5\u4F7F\u7528\u901A\u914D\u7B26\u7C7B\u6307\u5B9A\u4E3B\u7528\u6237"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u6CA1\u6709\u540D\u79F0, \u65E0\u6CD5\u6307\u5B9A\u4E3B\u7528\u6237"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u6743\u9650\u53CA\u76EE\u6807\u540D\u5FC5\u987B\u6709\u4E00\u4E2A\u503C"},
-        {"Remove.this.Policy.Entry.", "\u662F\u5426\u5220\u9664\u6B64\u7B56\u7565\u6761\u76EE?"},
-        {"Overwrite.File", "\u8986\u76D6\u6587\u4EF6"},
-        {"Policy.successfully.written.to.filename",
-                "\u7B56\u7565\u5DF2\u6210\u529F\u5199\u5165\u5230{0}"},
-        {"null.filename", "\u7A7A\u6587\u4EF6\u540D"},
-        {"Save.changes.", "\u662F\u5426\u4FDD\u5B58\u6240\u505A\u7684\u66F4\u6539?"},
-        {"Yes", "\u662F"},
-        {"No", "\u5426"},
-        {"Policy.Entry", "\u7B56\u7565\u6761\u76EE"},
-        {"Save.Changes", "\u4FDD\u5B58\u66F4\u6539"},
-        {"No.Policy.Entry.selected", "\u6CA1\u6709\u9009\u62E9\u7B56\u7565\u6761\u76EE"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u65E0\u6CD5\u6253\u5F00 KeyStore: {0}"},
-        {"No.principal.selected", "\u672A\u9009\u62E9\u4E3B\u7528\u6237"},
-        {"No.permission.selected", "\u6CA1\u6709\u9009\u62E9\u6743\u9650"},
-        {"name", "\u540D\u79F0"},
-        {"configuration.type", "\u914D\u7F6E\u7C7B\u578B"},
-        {"environment.variable.name", "\u73AF\u5883\u53D8\u91CF\u540D"},
-        {"library.name", "\u5E93\u540D\u79F0"},
-        {"package.name", "\u7A0B\u5E8F\u5305\u540D\u79F0"},
-        {"policy.type", "\u7B56\u7565\u7C7B\u578B"},
-        {"property.name", "\u5C5E\u6027\u540D\u79F0"},
-        {"Principal.List", "\u4E3B\u7528\u6237\u5217\u8868"},
-        {"Permission.List", "\u6743\u9650\u5217\u8868"},
-        {"Code.Base", "\u4EE3\u7801\u5E93"},
-        {"KeyStore.U.R.L.", "KeyStore URL:"},
-        {"KeyStore.Password.U.R.L.", "KeyStore \u53E3\u4EE4 URL:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "\u65E0\u6548\u7684\u7A7A\u8F93\u5165"},
         {"actions.can.only.be.read.", "\u64CD\u4F5C\u53EA\u80FD\u4E3A '\u8BFB\u53D6'"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "\u63D0\u4F9B\u7684 OID \u6620\u5C04\u4E3A\u7A7A\u503C"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "\u63D0\u4F9B\u4E86\u65E0\u6548\u7684\u7A7A AccessControlContext"},
         {"invalid.null.action.provided", "\u63D0\u4F9B\u4E86\u65E0\u6548\u7684\u7A7A\u64CD\u4F5C"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/security/util/Resources_zh_TW.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/security/util/Resources_zh_TW.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,501 +34,6 @@
 
     private static final Object[][] contents = {
 
-        // shared (from jarsigner)
-        {"SPACE", " "},
-        {"2SPACE", "  "},
-        {"6SPACE", "      "},
-        {"COMMA", ", "},
-        // shared (from keytool)
-        {"NEWLINE", "\n"},
-        {"STAR",
-                "*******************************************"},
-        {"STARNN",
-                "*******************************************\n\n"},
-
-        // keytool: Help part
-// "Option" should be translated.
-        {".OPTION.", " [\u9078\u9805]..."},
-        {"Options.", "\u9078\u9805:"},
-        {"Use.keytool.help.for.all.available.commands",
-                 "\u4F7F\u7528 \"keytool -help\" \u53D6\u5F97\u6240\u6709\u53EF\u7528\u7684\u547D\u4EE4"},
-        {"Key.and.Certificate.Management.Tool",
-                 "\u91D1\u9470\u8207\u6191\u8B49\u7BA1\u7406\u5DE5\u5177"},
-        {"Commands.", "\u547D\u4EE4:"},
-        {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "\u4F7F\u7528 \"keytool -command_name -help\" \u53D6\u5F97 command_name \u7684\u7528\u6CD5"},
-        // keytool: help: commands
-        {"Generates.a.certificate.request",
-                "\u7522\u751F\u6191\u8B49\u8981\u6C42"}, //-certreq
-        {"Changes.an.entry.s.alias",
-                "\u8B8A\u66F4\u9805\u76EE\u7684\u5225\u540D"}, //-changealias
-        {"Deletes.an.entry",
-                "\u522A\u9664\u9805\u76EE"}, //-delete
-        {"Exports.certificate",
-                "\u532F\u51FA\u6191\u8B49"}, //-exportcert
-        {"Generates.a.key.pair",
-                "\u7522\u751F\u91D1\u9470\u7D44"}, //-genkeypair
-// translation of "secret" key should be different to "private" key.
-        {"Generates.a.secret.key",
-                "\u7522\u751F\u79D8\u5BC6\u91D1\u9470"}, //-genseckey
-        {"Generates.certificate.from.a.certificate.request",
-                "\u5F9E\u6191\u8B49\u8981\u6C42\u7522\u751F\u6191\u8B49"}, //-gencert
-        {"Generates.CRL", "\u7522\u751F CRL"}, //-gencrl
-        {"Imports.entries.from.a.JDK.1.1.x.style.identity.database",
-                "\u5F9E JDK 1.1.x-style \u8B58\u5225\u8CC7\u6599\u5EAB\u532F\u5165\u9805\u76EE"}, //-identitydb
-        {"Imports.a.certificate.or.a.certificate.chain",
-                "\u532F\u5165\u6191\u8B49\u6216\u6191\u8B49\u93C8"}, //-importcert
-        {"Imports.one.or.all.entries.from.another.keystore",
-                "\u5F9E\u5176\u4ED6\u91D1\u9470\u5132\u5B58\u5EAB\u532F\u5165\u4E00\u500B\u6216\u5168\u90E8\u9805\u76EE"}, //-importkeystore
-        {"Clones.a.key.entry",
-                "\u8907\u88FD\u91D1\u9470\u9805\u76EE"}, //-keyclone
-        {"Changes.the.key.password.of.an.entry",
-                "\u8B8A\u66F4\u9805\u76EE\u7684\u91D1\u9470\u5BC6\u78BC"}, //-keypasswd
-        {"Lists.entries.in.a.keystore",
-                "\u5217\u793A\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u9805\u76EE"}, //-list
-        {"Prints.the.content.of.a.certificate",
-                "\u5217\u5370\u6191\u8B49\u7684\u5167\u5BB9"}, //-printcert
-        {"Prints.the.content.of.a.certificate.request",
-                "\u5217\u5370\u6191\u8B49\u8981\u6C42\u7684\u5167\u5BB9"}, //-printcertreq
-        {"Prints.the.content.of.a.CRL.file",
-                "\u5217\u5370 CRL \u6A94\u6848\u7684\u5167\u5BB9"}, //-printcrl
-        {"Generates.a.self.signed.certificate",
-                "\u7522\u751F\u81EA\u884C\u7C3D\u7F72\u7684\u6191\u8B49"}, //-selfcert
-        {"Changes.the.store.password.of.a.keystore",
-                "\u8B8A\u66F4\u91D1\u9470\u5132\u5B58\u5EAB\u7684\u5132\u5B58\u5BC6\u78BC"}, //-storepasswd
-        // keytool: help: options
-        {"alias.name.of.the.entry.to.process",
-                "\u8981\u8655\u7406\u9805\u76EE\u7684\u5225\u540D\u540D\u7A31"}, //-alias
-        {"destination.alias",
-                "\u76EE\u7684\u5730\u5225\u540D"}, //-destalias
-        {"destination.key.password",
-                "\u76EE\u7684\u5730\u91D1\u9470\u5BC6\u78BC"}, //-destkeypass
-        {"destination.keystore.name",
-                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-destkeystore
-        {"destination.keystore.password.protected",
-                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u4FDD\u8B77"}, //-destprotected
-        {"destination.keystore.provider.name",
-                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005\u540D\u7A31"}, //-destprovidername
-        {"destination.keystore.password",
-                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-deststorepass
-        {"destination.keystore.type",
-                "\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-deststoretype
-        {"distinguished.name",
-                "\u8FA8\u5225\u540D\u7A31"}, //-dname
-        {"X.509.extension",
-                "X.509 \u64F4\u5145\u5957\u4EF6"}, //-ext
-        {"output.file.name",
-                "\u8F38\u51FA\u6A94\u6848\u540D\u7A31"}, //-file and -outfile
-        {"input.file.name",
-                "\u8F38\u5165\u6A94\u6848\u540D\u7A31"}, //-file and -infile
-        {"key.algorithm.name",
-                "\u91D1\u9470\u6F14\u7B97\u6CD5\u540D\u7A31"}, //-keyalg
-        {"key.password",
-                "\u91D1\u9470\u5BC6\u78BC"}, //-keypass
-        {"key.bit.size",
-                "\u91D1\u9470\u4F4D\u5143\u5927\u5C0F"}, //-keysize
-        {"keystore.name",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-keystore
-        {"new.password",
-                "\u65B0\u5BC6\u78BC"}, //-new
-        {"do.not.prompt",
-                "\u4E0D\u8981\u63D0\u793A"}, //-noprompt
-        {"password.through.protected.mechanism",
-                "\u7D93\u7531\u4FDD\u8B77\u6A5F\u5236\u7684\u5BC6\u78BC"}, //-protected
-        {"provider.argument",
-                "\u63D0\u4F9B\u8005\u5F15\u6578"}, //-providerarg
-        {"provider.class.name",
-                "\u63D0\u4F9B\u8005\u985E\u5225\u540D\u7A31"}, //-providerclass
-        {"provider.name",
-                "\u63D0\u4F9B\u8005\u540D\u7A31"}, //-providername
-        {"provider.classpath",
-                "\u63D0\u4F9B\u8005\u985E\u5225\u8DEF\u5F91"}, //-providerpath
-        {"output.in.RFC.style",
-                "\u4EE5 RFC \u6A23\u5F0F\u8F38\u51FA"}, //-rfc
-        {"signature.algorithm.name",
-                "\u7C3D\u7AE0\u6F14\u7B97\u6CD5\u540D\u7A31"}, //-sigalg
-        {"source.alias",
-                "\u4F86\u6E90\u5225\u540D"}, //-srcalias
-        {"source.key.password",
-                "\u4F86\u6E90\u91D1\u9470\u5BC6\u78BC"}, //-srckeypass
-        {"source.keystore.name",
-                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-srckeystore
-        {"source.keystore.password.protected",
-                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u4FDD\u8B77"}, //-srcprotected
-        {"source.keystore.provider.name",
-                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005\u540D\u7A31"}, //-srcprovidername
-        {"source.keystore.password",
-                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-srcstorepass
-        {"source.keystore.type",
-                "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-srcstoretype
-        {"SSL.server.host.and.port",
-                "SSL \u4F3A\u670D\u5668\u4E3B\u6A5F\u8207\u9023\u63A5\u57E0"}, //-sslserver
-        {"signed.jar.file",
-                "\u7C3D\u7F72\u7684 jar \u6A94\u6848"}, //=jarfile
-        {"certificate.validity.start.date.time",
-                "\u6191\u8B49\u6709\u6548\u6027\u958B\u59CB\u65E5\u671F/\u6642\u9593"}, //-startdate
-        {"keystore.password",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC"}, //-storepass
-        {"keystore.type",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B"}, //-storetype
-        {"trust.certificates.from.cacerts",
-                "\u4F86\u81EA cacerts \u7684\u4FE1\u4EFB\u6191\u8B49"}, //-trustcacerts
-        {"verbose.output",
-                "\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA"}, //-v
-        {"validity.number.of.days",
-                "\u6709\u6548\u6027\u65E5\u6578"}, //-validity
-        {"Serial.ID.of.cert.to.revoke",
-                 "\u8981\u64A4\u92B7\u6191\u8B49\u7684\u5E8F\u5217 ID"}, //-id
-        // keytool: Running part
-        {"keytool.error.", "\u91D1\u9470\u5DE5\u5177\u932F\u8AA4: "},
-        {"Illegal.option.", "\u7121\u6548\u7684\u9078\u9805:"},
-        {"Illegal.value.", "\u7121\u6548\u503C: "},
-        {"Unknown.password.type.", "\u4E0D\u660E\u7684\u5BC6\u78BC\u985E\u578B: "},
-        {"Cannot.find.environment.variable.",
-                "\u627E\u4E0D\u5230\u74B0\u5883\u8B8A\u6578: "},
-        {"Cannot.find.file.", "\u627E\u4E0D\u5230\u6A94\u6848: "},
-        {"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9078\u9805 {0} \u9700\u8981\u5F15\u6578\u3002"},
-        {"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
-                "\u8B66\u544A: PKCS12 \u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u652F\u63F4\u4E0D\u540C\u7684\u5132\u5B58\u5EAB\u548C\u91D1\u9470\u5BC6\u78BC\u3002\u5FFD\u7565\u4F7F\u7528\u8005\u6307\u5B9A\u7684 {0} \u503C\u3002"},
-        {".keystore.must.be.NONE.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247 -keystore \u5FC5\u9808\u70BA NONE"},
-        {"Too.many.retries.program.terminated",
-                 "\u91CD\u8A66\u6B21\u6578\u592A\u591A\uFF0C\u7A0B\u5F0F\u5DF2\u7D42\u6B62"},
-        {".storepasswd.and.keypasswd.commands.not.supported.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247\u4E0D\u652F\u63F4 -storepasswd \u548C -keypasswd \u547D\u4EE4"},
-        {".keypasswd.commands.not.supported.if.storetype.is.PKCS12",
-                "\u5982\u679C -storetype \u70BA PKCS12\uFF0C\u5247\u4E0D\u652F\u63F4 -keypasswd \u547D\u4EE4"},
-        {".keypass.and.new.can.not.be.specified.if.storetype.is.{0}",
-                "\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -keypass \u548C -new"},
-        {"if.protected.is.specified.then.storepass.keypass.and.new.must.not.be.specified",
-                "\u5982\u679C\u6307\u5B9A -protected\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -storepass\u3001-keypass \u548C -new"},
-        {"if.srcprotected.is.specified.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "\u5982\u679C\u6307\u5B9A -srcprotected\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
-        {"if.keystore.is.not.password.protected.then.storepass.keypass.and.new.must.not.be.specified",
-                "\u5982\u679C\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u53D7\u5BC6\u78BC\u4FDD\u8B77\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -storepass\u3001-keypass \u548C -new"},
-        {"if.source.keystore.is.not.password.protected.then.srcstorepass.and.srckeypass.must.not.be.specified",
-                "\u5982\u679C\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u53D7\u5BC6\u78BC\u4FDD\u8B77\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A -srcstorepass \u548C -srckeypass"},
-        {"Illegal.startdate.value", "\u7121\u6548\u7684 startdate \u503C"},
-        {"Validity.must.be.greater.than.zero",
-                "\u6709\u6548\u6027\u5FC5\u9808\u5927\u65BC\u96F6"},
-        {"provName.not.a.provider", "{0} \u4E0D\u662F\u4E00\u500B\u63D0\u4F9B\u8005"},
-        {"Usage.error.no.command.provided", "\u7528\u6CD5\u932F\u8AA4: \u672A\u63D0\u4F9B\u547D\u4EE4"},
-        {"Source.keystore.file.exists.but.is.empty.", "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A: "},
-        {"Please.specify.srckeystore", "\u8ACB\u6307\u5B9A -srckeystore"},
-        {"Must.not.specify.both.v.and.rfc.with.list.command",
-                " 'list' \u547D\u4EE4\u4E0D\u80FD\u540C\u6642\u6307\u5B9A -v \u53CA -rfc"},
-        {"Key.password.must.be.at.least.6.characters",
-                "\u91D1\u9470\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
-        {"New.password.must.be.at.least.6.characters",
-                "\u65B0\u7684\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
-        {"Keystore.file.exists.but.is.empty.",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A\u767D: "},
-        {"Keystore.file.does.not.exist.",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u4E0D\u5B58\u5728: "},
-        {"Must.specify.destination.alias", "\u5FC5\u9808\u6307\u5B9A\u76EE\u7684\u5730\u5225\u540D"},
-        {"Must.specify.alias", "\u5FC5\u9808\u6307\u5B9A\u5225\u540D"},
-        {"Keystore.password.must.be.at.least.6.characters",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
-        {"Enter.keystore.password.", "\u8F38\u5165\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC:  "},
-        {"Enter.source.keystore.password.", "\u8ACB\u8F38\u5165\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC: "},
-        {"Enter.destination.keystore.password.", "\u8ACB\u8F38\u5165\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC: "},
-        {"Keystore.password.is.too.short.must.be.at.least.6.characters",
-         "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
-        {"Unknown.Entry.Type", "\u4E0D\u660E\u7684\u9805\u76EE\u985E\u578B"},
-        {"Too.many.failures.Alias.not.changed", "\u592A\u591A\u932F\u8AA4\u3002\u672A\u8B8A\u66F4\u5225\u540D"},
-        {"Entry.for.alias.alias.successfully.imported.",
-                 "\u5DF2\u6210\u529F\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
-        {"Entry.for.alias.alias.not.imported.", "\u672A\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
-        {"Problem.importing.entry.for.alias.alias.exception.Entry.for.alias.alias.not.imported.",
-                 "\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u6642\u51FA\u73FE\u554F\u984C: {1}\u3002\n\u672A\u532F\u5165\u5225\u540D {0} \u7684\u9805\u76EE\u3002"},
-        {"Import.command.completed.ok.entries.successfully.imported.fail.entries.failed.or.cancelled",
-                 "\u5DF2\u5B8C\u6210\u532F\u5165\u547D\u4EE4: \u6210\u529F\u532F\u5165 {0} \u500B\u9805\u76EE\uFF0C{1} \u500B\u9805\u76EE\u5931\u6557\u6216\u5DF2\u53D6\u6D88"},
-        {"Warning.Overwriting.existing.alias.alias.in.destination.keystore",
-                 "\u8B66\u544A: \u6B63\u5728\u8986\u5BEB\u76EE\u7684\u5730\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u73FE\u6709\u5225\u540D {0}"},
-        {"Existing.entry.alias.alias.exists.overwrite.no.",
-                 "\u73FE\u6709\u9805\u76EE\u5225\u540D {0} \u5B58\u5728\uFF0C\u662F\u5426\u8986\u5BEB\uFF1F[\u5426]:  "},
-        {"Too.many.failures.try.later", "\u592A\u591A\u932F\u8AA4 - \u8ACB\u7A0D\u5F8C\u518D\u8A66"},
-        {"Certification.request.stored.in.file.filename.",
-                "\u8A8D\u8B49\u8981\u6C42\u5132\u5B58\u5728\u6A94\u6848 <{0}>"},
-        {"Submit.this.to.your.CA", "\u5C07\u6B64\u9001\u51FA\u81F3\u60A8\u7684 CA"},
-        {"if.alias.not.specified.destalias.srckeypass.and.destkeypass.must.not.be.specified",
-            "\u5982\u679C\u672A\u6307\u5B9A\u5225\u540D\uFF0C\u5247\u4E0D\u80FD\u6307\u5B9A destalias\u3001srckeypass \u53CA destkeypass"},
-        {"Certificate.stored.in.file.filename.",
-                "\u6191\u8B49\u5132\u5B58\u5728\u6A94\u6848 <{0}>"},
-        {"Certificate.reply.was.installed.in.keystore",
-                "\u6191\u8B49\u56DE\u8986\u5DF2\u5B89\u88DD\u5728\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
-        {"Certificate.reply.was.not.installed.in.keystore",
-                "\u6191\u8B49\u56DE\u8986\u672A\u5B89\u88DD\u5728\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
-        {"Certificate.was.added.to.keystore",
-                "\u6191\u8B49\u5DF2\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
-        {"Certificate.was.not.added.to.keystore",
-                "\u6191\u8B49\u672A\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D"},
-        {".Storing.ksfname.", "[\u5132\u5B58 {0}]"},
-        {"alias.has.no.public.key.certificate.",
-                "{0} \u6C92\u6709\u516C\u958B\u91D1\u9470 (\u6191\u8B49)"},
-        {"Cannot.derive.signature.algorithm",
-                "\u7121\u6CD5\u53D6\u5F97\u7C3D\u7AE0\u6F14\u7B97\u6CD5"},
-        {"Alias.alias.does.not.exist",
-                "\u5225\u540D <{0}> \u4E0D\u5B58\u5728"},
-        {"Alias.alias.has.no.certificate",
-                "\u5225\u540D <{0}> \u6C92\u6709\u6191\u8B49"},
-        {"Key.pair.not.generated.alias.alias.already.exists",
-                "\u6C92\u6709\u5EFA\u7ACB\u91D1\u9470\u7D44\uFF0C\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
-        {"Generating.keysize.bit.keyAlgName.key.pair.and.self.signed.certificate.sigAlgName.with.a.validity.of.validality.days.for",
-                "\u91DD\u5C0D {4} \u7522\u751F\u6709\u6548\u671F {3} \u5929\u7684 {0} \u4F4D\u5143 {1} \u91D1\u9470\u7D44\u4EE5\u53CA\u81EA\u6211\u7C3D\u7F72\u6191\u8B49 ({2})\n\t"},
-        {"Enter.key.password.for.alias.", "\u8F38\u5165 <{0}> \u7684\u91D1\u9470\u5BC6\u78BC"},
-        {".RETURN.if.same.as.keystore.password.",
-                "\t(RETURN \u5982\u679C\u548C\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u76F8\u540C):  "},
-        {"Key.password.is.too.short.must.be.at.least.6.characters",
-                "\u91D1\u9470\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
-        {"Too.many.failures.key.not.added.to.keystore",
-                "\u592A\u591A\u932F\u8AA4 - \u91D1\u9470\u672A\u65B0\u589E\u81F3\u91D1\u9470\u5132\u5B58\u5EAB"},
-        {"Destination.alias.dest.already.exists",
-                "\u76EE\u7684\u5730\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
-        {"Password.is.too.short.must.be.at.least.6.characters",
-                "\u5BC6\u78BC\u592A\u77ED - \u5FC5\u9808\u81F3\u5C11\u70BA 6 \u500B\u5B57\u5143"},
-        {"Too.many.failures.Key.entry.not.cloned",
-                "\u592A\u591A\u932F\u8AA4\u3002\u672A\u8907\u88FD\u91D1\u9470\u9805\u76EE"},
-        {"key.password.for.alias.", "<{0}> \u7684\u91D1\u9470\u5BC6\u78BC"},
-        {"Keystore.entry.for.id.getName.already.exists",
-                "<{0}> \u7684\u91D1\u9470\u5132\u5B58\u5EAB\u9805\u76EE\u5DF2\u7D93\u5B58\u5728"},
-        {"Creating.keystore.entry.for.id.getName.",
-                "\u5EFA\u7ACB <{0}> \u7684\u91D1\u9470\u5132\u5B58\u5EAB\u9805\u76EE..."},
-        {"No.entries.from.identity.database.added",
-                "\u6C92\u6709\u65B0\u589E\u4F86\u81EA\u8B58\u5225\u8CC7\u6599\u5EAB\u7684\u9805\u76EE"},
-        {"Alias.name.alias", "\u5225\u540D\u540D\u7A31: {0}"},
-        {"Creation.date.keyStore.getCreationDate.alias.",
-                "\u5EFA\u7ACB\u65E5\u671F: {0,date}"},
-        {"alias.keyStore.getCreationDate.alias.",
-                "{0}, {1,date}, "},
-        {"alias.", "{0}, "},
-        {"Entry.type.type.", "\u9805\u76EE\u985E\u578B: {0}"},
-        {"Certificate.chain.length.", "\u6191\u8B49\u93C8\u9577\u5EA6: "},
-        {"Certificate.i.1.", "\u6191\u8B49 [{0,number,integer}]:"},
-        {"Certificate.fingerprint.SHA1.", "\u6191\u8B49\u6307\u7D0B (SHA1): "},
-        {"Keystore.type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B: "},
-        {"Keystore.provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005: "},
-        {"Your.keystore.contains.keyStore.size.entry",
-                "\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5305\u542B {0,number,integer} \u9805\u76EE"},
-        {"Your.keystore.contains.keyStore.size.entries",
-                "\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5305\u542B {0,number,integer} \u9805\u76EE"},
-        {"Failed.to.parse.input", "\u7121\u6CD5\u5256\u6790\u8F38\u5165"},
-        {"Empty.input", "\u7A7A\u8F38\u5165"},
-        {"Not.X.509.certificate", "\u975E X.509 \u6191\u8B49"},
-        {"alias.has.no.public.key", "{0} \u7121\u516C\u958B\u91D1\u9470"},
-        {"alias.has.no.X.509.certificate", "{0} \u7121 X.509 \u6191\u8B49"},
-        {"New.certificate.self.signed.", "\u65B0\u6191\u8B49 (\u81EA\u6211\u7C3D\u7F72): "},
-        {"Reply.has.no.certificates", "\u56DE\u8986\u4E0D\u542B\u6191\u8B49"},
-        {"Certificate.not.imported.alias.alias.already.exists",
-                "\u6191\u8B49\u672A\u8F38\u5165\uFF0C\u5225\u540D <{0}> \u5DF2\u7D93\u5B58\u5728"},
-        {"Input.not.an.X.509.certificate", "\u8F38\u5165\u7684\u4E0D\u662F X.509 \u6191\u8B49"},
-        {"Certificate.already.exists.in.keystore.under.alias.trustalias.",
-                "\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684 <{0}> \u5225\u540D\u4E4B\u4E0B\uFF0C\u6191\u8B49\u5DF2\u7D93\u5B58\u5728"},
-        {"Do.you.still.want.to.add.it.no.",
-                "\u60A8\u4ECD\u7136\u60F3\u8981\u5C07\u4E4B\u65B0\u589E\u55CE\uFF1F [\u5426]:  "},
-        {"Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias.",
-                "\u6574\u500B\u7CFB\u7D71 CA \u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684 <{0}> \u5225\u540D\u4E4B\u4E0B\uFF0C\u6191\u8B49\u5DF2\u7D93\u5B58\u5728"},
-        {"Do.you.still.want.to.add.it.to.your.own.keystore.no.",
-                "\u60A8\u4ECD\u7136\u60F3\u8981\u5C07\u4E4B\u65B0\u589E\u81F3\u81EA\u5DF1\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u55CE\uFF1F [\u5426]:  "},
-        {"Trust.this.certificate.no.", "\u4FE1\u4EFB\u9019\u500B\u6191\u8B49\uFF1F [\u5426]:  "},
-        {"YES", "\u662F"},
-        {"New.prompt.", "\u65B0 {0}: "},
-        {"Passwords.must.differ", "\u5FC5\u9808\u662F\u4E0D\u540C\u7684\u5BC6\u78BC"},
-        {"Re.enter.new.prompt.", "\u91CD\u65B0\u8F38\u5165\u65B0 {0}: "},
-        {"Re.enter.new.password.", "\u91CD\u65B0\u8F38\u5165\u65B0\u5BC6\u78BC: "},
-        {"They.don.t.match.Try.again", "\u5B83\u5011\u4E0D\u76F8\u7B26\u3002\u8ACB\u91CD\u8A66"},
-        {"Enter.prompt.alias.name.", "\u8F38\u5165 {0} \u5225\u540D\u540D\u7A31:  "},
-        {"Enter.new.alias.name.RETURN.to.cancel.import.for.this.entry.",
-                 "\u8ACB\u8F38\u5165\u65B0\u7684\u5225\u540D\u540D\u7A31\t(RETURN \u4EE5\u53D6\u6D88\u532F\u5165\u6B64\u9805\u76EE):"},
-        {"Enter.alias.name.", "\u8F38\u5165\u5225\u540D\u540D\u7A31:  "},
-        {".RETURN.if.same.as.for.otherAlias.",
-                "\t(RETURN \u5982\u679C\u548C <{0}> \u7684\u76F8\u540C)"},
-        {".PATTERN.printX509Cert",
-                "\u64C1\u6709\u8005: {0}\n\u767C\u51FA\u8005: {1}\n\u5E8F\u865F: {2}\n\u6709\u6548\u671F\u81EA: {3} \u5230: {4}\n\u6191\u8B49\u6307\u7D0B:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t \u7C3D\u7AE0\u6F14\u7B97\u6CD5\u540D\u7A31: {8}\n\t \u7248\u672C: {9}"},
-        {"What.is.your.first.and.last.name.",
-                "\u60A8\u7684\u540D\u5B57\u8207\u59D3\u6C0F\u70BA\u4F55\uFF1F"},
-        {"What.is.the.name.of.your.organizational.unit.",
-                "\u60A8\u7684\u7D44\u7E54\u55AE\u4F4D\u540D\u7A31\u70BA\u4F55\uFF1F"},
-        {"What.is.the.name.of.your.organization.",
-                "\u60A8\u7684\u7D44\u7E54\u540D\u7A31\u70BA\u4F55\uFF1F"},
-        {"What.is.the.name.of.your.City.or.Locality.",
-                "\u60A8\u6240\u5728\u7684\u57CE\u5E02\u6216\u5730\u5340\u540D\u7A31\u70BA\u4F55\uFF1F"},
-        {"What.is.the.name.of.your.State.or.Province.",
-                "\u60A8\u6240\u5728\u7684\u5DDE\u53CA\u7701\u4EFD\u540D\u7A31\u70BA\u4F55\uFF1F"},
-        {"What.is.the.two.letter.country.code.for.this.unit.",
-                "\u6B64\u55AE\u4F4D\u7684\u5169\u500B\u5B57\u6BCD\u570B\u5225\u4EE3\u78BC\u70BA\u4F55\uFF1F"},
-        {"Is.name.correct.", "{0} \u6B63\u78BA\u55CE\uFF1F"},
-        {"no", "\u5426"},
-        {"yes", "\u662F"},
-        {"y", "y"},
-        {".defaultValue.", "  [{0}]:  "},
-        {"Alias.alias.has.no.key",
-                "\u5225\u540D <{0}> \u6C92\u6709\u91D1\u9470"},
-        {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key",
-                 "\u5225\u540D <{0}> \u6240\u53C3\u7167\u7684\u9805\u76EE\u4E0D\u662F\u79C1\u5BC6\u91D1\u9470\u985E\u578B\u3002-keyclone \u547D\u4EE4\u50C5\u652F\u63F4\u79C1\u5BC6\u91D1\u9470\u9805\u76EE\u7684\u8907\u88FD"},
-
-        {".WARNING.WARNING.WARNING.",
-            "*****************  \u8B66\u544A \u8B66\u544A \u8B66\u544A  *****************"},
-        {"Signer.d.", "\u7C3D\u7F72\u8005 #%d:"},
-        {"Timestamp.", "\u6642\u6233:"},
-        {"Signature.", "\u7C3D\u7AE0:"},
-        {"CRLs.", "CRL:"},
-        {"Certificate.owner.", "\u6191\u8B49\u64C1\u6709\u8005: "},
-        {"Not.a.signed.jar.file", "\u4E0D\u662F\u7C3D\u7F72\u7684 jar \u6A94\u6848"},
-        {"No.certificate.from.the.SSL.server",
-                "\u6C92\u6709\u4F86\u81EA SSL \u4F3A\u670D\u5668\u7684\u6191\u8B49"},
-
-        {".The.integrity.of.the.information.stored.in.your.keystore.",
-            "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u8CC7\u8A0A  *\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C*\n* \u60A8\u5FC5\u9808\u63D0\u4F9B\u60A8\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC\u3002                  *"},
-        {".The.integrity.of.the.information.stored.in.the.srckeystore.",
-            "* \u5C1A\u672A\u9A57\u8B49\u5132\u5B58\u65BC srckeystore \u4E2D\u8CC7\u8A0A*\n* \u7684\u5B8C\u6574\u6027\uFF01\u82E5\u8981\u9A57\u8B49\u5176\u5B8C\u6574\u6027\uFF0C\u60A8\u5FC5\u9808 *\n* \u63D0\u4F9B srckeystore \u5BC6\u78BC\u3002          *"},
-
-        {"Certificate.reply.does.not.contain.public.key.for.alias.",
-                "\u6191\u8B49\u56DE\u8986\u4E26\u672A\u5305\u542B <{0}> \u7684\u516C\u958B\u91D1\u9470"},
-        {"Incomplete.certificate.chain.in.reply",
-                "\u56DE\u8986\u6642\u7684\u6191\u8B49\u93C8\u4E0D\u5B8C\u6574"},
-        {"Certificate.chain.in.reply.does.not.verify.",
-                "\u56DE\u8986\u6642\u7684\u6191\u8B49\u93C8\u672A\u9A57\u8B49: "},
-        {"Top.level.certificate.in.reply.",
-                "\u56DE\u8986\u6642\u7684\u6700\u9AD8\u7D1A\u6191\u8B49:\\n"},
-        {".is.not.trusted.", "... \u662F\u4E0D\u88AB\u4FE1\u4EFB\u7684\u3002"},
-        {"Install.reply.anyway.no.", "\u9084\u662F\u8981\u5B89\u88DD\u56DE\u8986\uFF1F [\u5426]:  "},
-        {"NO", "\u5426"},
-        {"Public.keys.in.reply.and.keystore.don.t.match",
-                "\u56DE\u8986\u6642\u7684\u516C\u958B\u91D1\u9470\u8207\u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u7B26"},
-        {"Certificate.reply.and.certificate.in.keystore.are.identical",
-                "\u6191\u8B49\u56DE\u8986\u8207\u91D1\u9470\u5132\u5B58\u5EAB\u4E2D\u7684\u6191\u8B49\u662F\u76F8\u540C\u7684"},
-        {"Failed.to.establish.chain.from.reply",
-                "\u7121\u6CD5\u5F9E\u56DE\u8986\u4E2D\u5C07\u93C8\u5EFA\u7ACB\u8D77\u4F86"},
-        {"n", "n"},
-        {"Wrong.answer.try.again", "\u932F\u8AA4\u7684\u7B54\u6848\uFF0C\u8ACB\u518D\u8A66\u4E00\u6B21"},
-        {"Secret.key.not.generated.alias.alias.already.exists",
-                "\u672A\u7522\u751F\u79D8\u5BC6\u91D1\u9470\uFF0C\u5225\u540D <{0}> \u5DF2\u5B58\u5728"},
-        {"Please.provide.keysize.for.secret.key.generation",
-                "\u8ACB\u63D0\u4F9B -keysize \u4EE5\u7522\u751F\u79D8\u5BC6\u91D1\u9470"},
-
-        {"Extensions.", "\u64F4\u5145\u5957\u4EF6: "},
-        {".Empty.value.", "(\u7A7A\u767D\u503C)"},
-        {"Extension.Request.", "\u64F4\u5145\u5957\u4EF6\u8981\u6C42:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10 \u6191\u8B49\u8981\u6C42 (\u7248\u672C 1.0)\n\u4E3B\u9AD4: %s\n\u516C\u7528\u91D1\u9470: %s \u683C\u5F0F %s \u91D1\u9470\n"},
-        {"Unknown.keyUsage.type.", "\u4E0D\u660E\u7684 keyUsage \u985E\u578B: "},
-        {"Unknown.extendedkeyUsage.type.", "\u4E0D\u660E\u7684 extendedkeyUsage \u985E\u578B: "},
-        {"Unknown.AccessDescription.type.", "\u4E0D\u660E\u7684 AccessDescription \u985E\u578B: "},
-        {"Unrecognized.GeneralName.type.", "\u7121\u6CD5\u8FA8\u8B58\u7684 GeneralName \u985E\u578B: "},
-        {"This.extension.cannot.be.marked.as.critical.",
-                 "\u6B64\u64F4\u5145\u5957\u4EF6\u7121\u6CD5\u6A19\u793A\u70BA\u95DC\u9375\u3002"},
-        {"Odd.number.of.hex.digits.found.", "\u627E\u5230\u5341\u516D\u9032\u4F4D\u6578\u5B57\u7684\u5947\u6578: "},
-        {"Unknown.extension.type.", "\u4E0D\u660E\u7684\u64F4\u5145\u5957\u4EF6\u985E\u578B: "},
-        {"command.{0}.is.ambiguous.", "\u547D\u4EE4 {0} \u4E0D\u660E\u78BA:"},
-
-        // policytool
-        {"Warning.A.public.key.for.alias.signers.i.does.not.exist.Make.sure.a.KeyStore.is.properly.configured.",
-                "\u8B66\u544A: \u5225\u540D {0} \u7684\u516C\u958B\u91D1\u9470\u4E0D\u5B58\u5728\u3002\u8ACB\u78BA\u5B9A\u91D1\u9470\u5132\u5B58\u5EAB\u914D\u7F6E\u6B63\u78BA\u3002"},
-        {"Warning.Class.not.found.class", "\u8B66\u544A: \u627E\u4E0D\u5230\u985E\u5225 {0}"},
-        {"Warning.Invalid.argument.s.for.constructor.arg",
-                "\u8B66\u544A: \u7121\u6548\u7684\u5EFA\u69CB\u5B50\u5F15\u6578: {0}"},
-        {"Illegal.Principal.Type.type", "\u7121\u6548\u7684 Principal \u985E\u578B: {0}"},
-        {"Illegal.option.option", "\u7121\u6548\u7684\u9078\u9805: {0}"},
-        {"Usage.policytool.options.", "\u7528\u6CD5: policytool [options]"},
-        {".file.file.policy.file.location",
-                "  [-file <file>]    \u539F\u5247\u6A94\u6848\u4F4D\u7F6E"},
-        {"New", "\u65B0\u589E"},
-        {"Open", "\u958B\u555F"},
-        {"Save", "\u5132\u5B58"},
-        {"Save.As", "\u53E6\u5B58\u65B0\u6A94"},
-        {"View.Warning.Log", "\u6AA2\u8996\u8B66\u544A\u8A18\u9304"},
-        {"Exit", "\u7D50\u675F"},
-        {"Add.Policy.Entry", "\u65B0\u589E\u539F\u5247\u9805\u76EE"},
-        {"Edit.Policy.Entry", "\u7DE8\u8F2F\u539F\u5247\u9805\u76EE"},
-        {"Remove.Policy.Entry", "\u79FB\u9664\u539F\u5247\u9805\u76EE"},
-        {"Edit", "\u7DE8\u8F2F"},
-        {"Retain", "\u4FDD\u7559"},
-
-        {"Warning.File.name.may.include.escaped.backslash.characters.It.is.not.necessary.to.escape.backslash.characters.the.tool.escapes",
-            "\u8B66\u544A: \u6A94\u6848\u540D\u7A31\u5305\u542B\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143\u3002\u4E0D\u9700\u8981\u9041\u96E2\u53CD\u659C\u7DDA\u5B57\u5143 (\u64B0\u5BEB\u539F\u5247\u5167\u5BB9\u81F3\u6C38\u4E45\u5B58\u653E\u5340\u6642\u9700\u8981\u5DE5\u5177\u9041\u96E2\u5B57\u5143)\u3002\n\n\u6309\u4E00\u4E0B\u300C\u4FDD\u7559\u300D\u4EE5\u4FDD\u7559\u8F38\u5165\u7684\u540D\u7A31\uFF0C\u6216\u6309\u4E00\u4E0B\u300C\u7DE8\u8F2F\u300D\u4EE5\u7DE8\u8F2F\u540D\u7A31\u3002"},
-
-        {"Add.Public.Key.Alias", "\u65B0\u589E\u516C\u958B\u91D1\u9470\u5225\u540D"},
-        {"Remove.Public.Key.Alias", "\u79FB\u9664\u516C\u958B\u91D1\u9470\u5225\u540D"},
-        {"File", "\u6A94\u6848"},
-        {"KeyStore", "\u91D1\u9470\u5132\u5B58\u5EAB"},
-        {"Policy.File.", "\u539F\u5247\u6A94\u6848: "},
-        {"Could.not.open.policy.file.policyFile.e.toString.",
-                "\u7121\u6CD5\u958B\u555F\u539F\u5247\u6A94\u6848: {0}: {1}"},
-        {"Policy.Tool", "\u539F\u5247\u5DE5\u5177"},
-        {"Errors.have.occurred.while.opening.the.policy.configuration.View.the.Warning.Log.for.more.information.",
-                "\u958B\u555F\u539F\u5247\u8A18\u7F6E\u6642\u767C\u751F\u932F\u8AA4\u3002\u8ACB\u6AA2\u8996\u8B66\u544A\u8A18\u9304\u4EE5\u53D6\u5F97\u66F4\u591A\u7684\u8CC7\u8A0A"},
-        {"Error", "\u932F\u8AA4"},
-        {"OK", "\u78BA\u5B9A"},
-        {"Status", "\u72C0\u614B"},
-        {"Warning", "\u8B66\u544A"},
-        {"Permission.",
-                "\u6B0A\u9650:                                                       "},
-        {"Principal.Type.", "Principal \u985E\u578B: "},
-        {"Principal.Name.", "Principal \u540D\u7A31: "},
-        {"Target.Name.",
-                "\u76EE\u6A19\u540D\u7A31:                                                    "},
-        {"Actions.",
-                "\u52D5\u4F5C:                                                             "},
-        {"OK.to.overwrite.existing.file.filename.",
-                "\u78BA\u8A8D\u8986\u5BEB\u73FE\u5B58\u7684\u6A94\u6848 {0}\uFF1F"},
-        {"Cancel", "\u53D6\u6D88"},
-        {"CodeBase.", "CodeBase:"},
-        {"SignedBy.", "SignedBy:"},
-        {"Add.Principal", "\u65B0\u589E Principal"},
-        {"Edit.Principal", "\u7DE8\u8F2F Principal"},
-        {"Remove.Principal", "\u79FB\u9664 Principal"},
-        {"Principals.", "Principal:"},
-        {".Add.Permission", "  \u65B0\u589E\u6B0A\u9650"},
-        {".Edit.Permission", "  \u7DE8\u8F2F\u6B0A\u9650"},
-        {"Remove.Permission", "\u79FB\u9664\u6B0A\u9650"},
-        {"Done", "\u5B8C\u6210"},
-        {"KeyStore.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB URL: "},
-        {"KeyStore.Type.", "\u91D1\u9470\u5132\u5B58\u5EAB\u985E\u578B:"},
-        {"KeyStore.Provider.", "\u91D1\u9470\u5132\u5B58\u5EAB\u63D0\u4F9B\u8005:"},
-        {"KeyStore.Password.URL.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL: "},
-        {"Principals", "Principal"},
-        {".Edit.Principal.", "  \u7DE8\u8F2F Principal: "},
-        {".Add.New.Principal.", "  \u65B0\u589E Principal: "},
-        {"Permissions", "\u6B0A\u9650"},
-        {".Edit.Permission.", "  \u7DE8\u8F2F\u6B0A\u9650:"},
-        {".Add.New.Permission.", "  \u65B0\u589E\u6B0A\u9650:"},
-        {"Signed.By.", "\u7C3D\u7F72\u4EBA: "},
-        {"Cannot.Specify.Principal.with.a.Wildcard.Class.without.a.Wildcard.Name",
-            "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
-        {"Cannot.Specify.Principal.without.a.Name",
-            "\u6C92\u6709\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A Principal"},
-        {"Permission.and.Target.Name.must.have.a.value",
-                "\u6B0A\u9650\u53CA\u76EE\u6A19\u540D\u7A31\u5FC5\u9808\u6709\u4E00\u500B\u503C\u3002"},
-        {"Remove.this.Policy.Entry.", "\u79FB\u9664\u9019\u500B\u539F\u5247\u9805\u76EE\uFF1F"},
-        {"Overwrite.File", "\u8986\u5BEB\u6A94\u6848"},
-        {"Policy.successfully.written.to.filename",
-                "\u539F\u5247\u6210\u529F\u5BEB\u5165\u81F3 {0}"},
-        {"null.filename", "\u7A7A\u503C\u6A94\u540D"},
-        {"Save.changes.", "\u5132\u5B58\u8B8A\u66F4\uFF1F"},
-        {"Yes", "\u662F"},
-        {"No", "\u5426"},
-        {"Policy.Entry", "\u539F\u5247\u9805\u76EE"},
-        {"Save.Changes", "\u5132\u5B58\u8B8A\u66F4"},
-        {"No.Policy.Entry.selected", "\u6C92\u6709\u9078\u53D6\u539F\u5247\u9805\u76EE"},
-        {"Unable.to.open.KeyStore.ex.toString.",
-                "\u7121\u6CD5\u958B\u555F\u91D1\u9470\u5132\u5B58\u5EAB: {0}"},
-        {"No.principal.selected", "\u672A\u9078\u53D6 Principal"},
-        {"No.permission.selected", "\u6C92\u6709\u9078\u53D6\u6B0A\u9650"},
-        {"name", "\u540D\u7A31"},
-        {"configuration.type", "\u7D44\u614B\u985E\u578B"},
-        {"environment.variable.name", "\u74B0\u5883\u8B8A\u6578\u540D\u7A31"},
-        {"library.name", "\u7A0B\u5F0F\u5EAB\u540D\u7A31"},
-        {"package.name", "\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31"},
-        {"policy.type", "\u539F\u5247\u985E\u578B"},
-        {"property.name", "\u5C6C\u6027\u540D\u7A31"},
-        {"Principal.List", "Principal \u6E05\u55AE"},
-        {"Permission.List", "\u6B0A\u9650\u6E05\u55AE"},
-        {"Code.Base", "\u4EE3\u78BC\u57FA\u6E96"},
-        {"KeyStore.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB URL:"},
-        {"KeyStore.Password.U.R.L.", "\u91D1\u9470\u5132\u5B58\u5EAB\u5BC6\u78BC URL:"},
-
-
         // javax.security.auth.PrivateCredentialPermission
         {"invalid.null.input.s.", "\u7121\u6548\u7A7A\u503C\u8F38\u5165"},
         {"actions.can.only.be.read.", "\u52D5\u4F5C\u53EA\u80FD\u88AB\u300C\u8B80\u53D6\u300D"},
@@ -553,6 +58,7 @@
         {"provided.null.OID.map", "\u63D0\u4F9B\u7A7A\u503C OID \u5C0D\u6620"},
 
         // javax.security.auth.Subject
+        {"NEWLINE", "\n"},
         {"invalid.null.AccessControlContext.provided",
                 "\u63D0\u4F9B\u7121\u6548\u7684\u7A7A\u503C AccessControlContext"},
         {"invalid.null.action.provided", "\u63D0\u4F9B\u7121\u6548\u7684\u7A7A\u503C\u52D5\u4F5C"},
@@ -656,6 +162,7 @@
      *
      * @return the contents of this <code>ResourceBundle</code>.
      */
+    @Override
     public Object[][] getContents() {
         return contents;
     }
--- a/src/share/classes/sun/util/locale/provider/CurrencyNameProviderImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/util/locale/provider/CurrencyNameProviderImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -26,10 +26,9 @@
 package sun.util.locale.provider;
 
 import java.util.Locale;
-import java.util.MissingResourceException;
+import java.util.ResourceBundle;
 import java.util.Set;
 import java.util.spi.CurrencyNameProvider;
-import sun.util.resources.OpenListResourceBundle;
 
 /**
  * Concrete implementation of the
@@ -121,16 +120,10 @@
             throw new NullPointerException();
         }
 
-        OpenListResourceBundle bundle = LocaleProviderAdapter.forType(type).getLocaleData().getCurrencyNames(locale);
-        LocaleServiceProviderPool pool =
-                LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
-        try {
-            if (!pool.hasProviders() ||
-                (bundle.getLocale().equals(locale) &&
-                 bundle.handleGetKeys().contains(key))) {
+        ResourceBundle bundle = LocaleProviderAdapter.forType(type).getLocaleData().getCurrencyNames(locale);
+        if (bundle.containsKey(key)) {
                 return bundle.getString(key);
             }
-        } catch (MissingResourceException mre) {}
 
         return null;
     }
--- a/src/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -26,10 +26,9 @@
 package sun.util.locale.provider;
 
 import java.util.Locale;
-import java.util.MissingResourceException;
+import java.util.ResourceBundle;
 import java.util.Set;
 import java.util.spi.LocaleNameProvider;
-import sun.util.resources.OpenListResourceBundle;
 
 /**
  * Concrete implementation of the
@@ -175,15 +174,10 @@
             throw new NullPointerException();
         }
 
-        OpenListResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getLocaleNames(locale);
-        LocaleServiceProviderPool pool =
-                LocaleServiceProviderPool.getPool(LocaleNameProvider.class);
-        try {
-            if (!pool.hasProviders() ||
-                (rb.getLocale().equals(locale) && rb.handleGetKeys().contains(key))) {
+        ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getLocaleNames(locale);
+        if (rb.containsKey(key)) {
                 return rb.getString(key);
             }
-        } catch (MissingResourceException mre) {}
 
         return null;
     }
--- a/src/share/classes/sun/util/locale/provider/LocaleServiceProviderPool.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/util/locale/provider/LocaleServiceProviderPool.java	Tue Oct 23 09:41:52 2012 -0700
@@ -302,7 +302,7 @@
 
                 for (LocaleProviderAdapter.Type type: findProviders(current)) {
                     LocaleServiceProvider lsp = providers.get(type);
-                    providersObj = getter.getObject((P)lsp, current, key, params);
+                    providersObj = getter.getObject((P)lsp, locale, key, params);
                     if (providersObj != null) {
                         return providersObj;
                     } else if (isObjectProvider) {
--- a/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -26,11 +26,10 @@
 package sun.util.locale.provider;
 
 import java.util.Locale;
-import java.util.MissingResourceException;
+import java.util.ResourceBundle;
 import java.util.Set;
 import java.util.TimeZone;
 import java.util.spi.TimeZoneNameProvider;
-import sun.util.resources.OpenListResourceBundle;
 
 /**
  * Concrete implementation of the
@@ -102,12 +101,8 @@
         }
 
         LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
-        OpenListResourceBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
-        LocaleServiceProviderPool pool =
-                LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
-        try {
-            if (!pool.hasProviders() ||
-                (rb.getLocale().equals(locale) && rb.handleGetKeys().contains(id))) {
+        ResourceBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
+        if (rb.containsKey(id)) {
                 String[] names = rb.getStringArray(id);
                 int index = daylight ? 3 : 1;
                 if (style == TimeZone.SHORT) {
@@ -115,8 +110,6 @@
                 }
                 return names[index];
             }
-        } catch (MissingResourceException mre) {
-        }
 
         return null;
     }
--- a/src/share/classes/sun/util/spi/XmlPropertiesProvider.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/util/spi/XmlPropertiesProvider.java	Tue Oct 23 09:41:52 2012 -0700
@@ -55,6 +55,9 @@
      * @param props the properties table to populate
      * @param in the input stream from which to read the XML document
      * @throws IOException if reading from the specified input stream fails
+     * @throws java.io.UnsupportedEncodingException if the document's encoding
+     *         declaration can be read and it specifies an encoding that is not
+     *         supported
      * @throws InvalidPropertiesFormatException Data on input stream does not
      *         constitute a valid XML document with the mandated document type.
      *
@@ -73,6 +76,8 @@
      * @param encoding the name of a supported character encoding
      *
      * @throws IOException if writing to the specified output stream fails
+     * @throws java.io.UnsupportedEncodingException if the encoding is not
+     *         supported by the implementation
      * @throws NullPointerException if {@code out} is null.
      * @throws ClassCastException  if this {@code Properties} object
      *         contains any keys or values that are not
--- a/src/share/classes/sun/util/xml/PlatformXmlPropertiesProvider.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/classes/sun/util/xml/PlatformXmlPropertiesProvider.java	Tue Oct 23 09:41:52 2012 -0700
@@ -27,6 +27,7 @@
 
 import java.io.*;
 import java.util.*;
+import java.nio.charset.*;
 import org.xml.sax.*;
 import org.w3c.dom.*;
 import javax.xml.parsers.*;
@@ -127,6 +128,13 @@
                       String encoding)
         throws IOException
     {
+        // fast-fail for unsupported charsets as UnsupportedEncodingException may
+        // not be thrown later (see JDK-8000621)
+        try {
+            Charset.forName(encoding);
+        } catch (IllegalCharsetNameException | UnsupportedCharsetException x) {
+            throw new UnsupportedEncodingException(encoding);
+        }
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         DocumentBuilder db = null;
         try {
--- a/src/share/lib/security/java.security	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/lib/security/java.security	Tue Oct 23 09:41:52 2012 -0700
@@ -145,7 +145,7 @@
 # passed to checkPackageAccess unless the
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -157,7 +157,7 @@
 # by default, none of the class loaders supplied with the JDK call
 # checkPackageDefinition.
 #
-package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/share/lib/security/java.security-macosx	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/lib/security/java.security-macosx	Tue Oct 23 09:41:52 2012 -0700
@@ -146,7 +146,7 @@
 # passed to checkPackageAccess unless the
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -158,7 +158,7 @@
 # by default, none of the class loaders supplied with the JDK call
 # checkPackageDefinition.
 #
-package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,apple.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/share/lib/security/java.security-solaris	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/lib/security/java.security-solaris	Tue Oct 23 09:41:52 2012 -0700
@@ -147,7 +147,7 @@
 # passed to checkPackageAccess unless the
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -159,7 +159,7 @@
 # by default, none of the class loaders supplied with the JDK call
 # checkPackageDefinition.
 #
-package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/share/lib/security/java.security-windows	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/share/lib/security/java.security-windows	Tue Oct 23 09:41:52 2012 -0700
@@ -146,7 +146,7 @@
 # passed to checkPackageAccess unless the
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -158,7 +158,7 @@
 # by default, none of the class loaders supplied with the JDK call
 # checkPackageDefinition.
 #
-package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
+package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,jdk.internal.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/solaris/native/com/sun/security/auth/module/Unix.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/solaris/native/com/sun/security/auth/module/Unix.c	Tue Oct 23 09:41:52 2012 -0700
@@ -47,83 +47,53 @@
     jsize numSuppGroups = getgroups(0, NULL);
     gid_t *groups = (gid_t *)calloc(numSuppGroups, sizeof(gid_t));
 
-    jfieldID fid;
+    jfieldID userNameID;
+    jfieldID userID;
+    jfieldID groupID;
+    jfieldID supplementaryGroupID;
+
     jstring jstr;
     jlongArray jgroups;
     jlong *jgroupsAsArray;
     jclass cls = (*env)->GetObjectClass(env, obj);
 
     memset(pwd_buf, 0, sizeof(pwd_buf));
+
     if (getpwuid_r(getuid(), &resbuf, pwd_buf, sizeof(pwd_buf), &pwd) == 0 &&
         pwd != NULL &&
         getgroups(numSuppGroups, groups) != -1) {
 
-        /*
-         * set username
-         */
-        fid = (*env)->GetFieldID(env, cls, "username", "Ljava/lang/String;");
-        if (fid == 0) {
-            jclass newExcCls =
-                (*env)->FindClass(env, "java/lang/IllegalArgumentException");
-            if (newExcCls == 0) {
-                /* Unable to find the new exception class, give up. */
-                return;
-            }
-            (*env)->ThrowNew(env, newExcCls, "invalid field: username");
-        }
-        jstr = (*env)->NewStringUTF(env, pwd->pw_name);
-        (*env)->SetObjectField(env, obj, fid, jstr);
+        userNameID = (*env)->GetFieldID(env, cls, "username", "Ljava/lang/String;");
+        if (userNameID == 0)
+            goto cleanUpAndReturn;
+
+        userID = (*env)->GetFieldID(env, cls, "uid", "J");
+        if (userID == 0)
+            goto cleanUpAndReturn;
 
-        /*
-         * set uid
-         */
-        fid = (*env)->GetFieldID(env, cls, "uid", "J");
-        if (fid == 0) {
-            jclass newExcCls =
-                (*env)->FindClass(env, "java/lang/IllegalArgumentException");
-            if (newExcCls == 0) {
-                /* Unable to find the new exception class, give up. */
-                return;
-            }
-            (*env)->ThrowNew(env, newExcCls, "invalid field: username");
-        }
-        (*env)->SetLongField(env, obj, fid, pwd->pw_uid);
+        groupID = (*env)->GetFieldID(env, cls, "gid", "J");
+        if (groupID == 0)
+            goto cleanUpAndReturn;
 
-        /*
-         * set gid
-         */
-        fid = (*env)->GetFieldID(env, cls, "gid", "J");
-        if (fid == 0) {
-            jclass newExcCls =
-                (*env)->FindClass(env, "java/lang/IllegalArgumentException");
-            if (newExcCls == 0) {
-                /* Unable to find the new exception class, give up. */
-                return;
-            }
-            (*env)->ThrowNew(env, newExcCls, "invalid field: username");
-        }
-        (*env)->SetLongField(env, obj, fid, pwd->pw_gid);
+        supplementaryGroupID = (*env)->GetFieldID(env, cls, "groups", "[J");
+        if (supplementaryGroupID == 0)
+            goto cleanUpAndReturn;
 
-        /*
-         * set supplementary groups
-         */
-        fid = (*env)->GetFieldID(env, cls, "groups", "[J");
-        if (fid == 0) {
-            jclass newExcCls =
-                (*env)->FindClass(env, "java/lang/IllegalArgumentException");
-            if (newExcCls == 0) {
-                /* Unable to find the new exception class, give up. */
-                return;
-            }
-            (*env)->ThrowNew(env, newExcCls, "invalid field: username");
-        }
+        jstr = (*env)->NewStringUTF(env, pwd->pw_name);
+        (*env)->SetObjectField(env, obj, userNameID, jstr);
+
+        (*env)->SetLongField(env, obj, userID, pwd->pw_uid);
+
+        (*env)->SetLongField(env, obj, groupID, pwd->pw_gid);
 
         jgroups = (*env)->NewLongArray(env, numSuppGroups);
         jgroupsAsArray = (*env)->GetLongArrayElements(env, jgroups, 0);
         for (i = 0; i < numSuppGroups; i++)
             jgroupsAsArray[i] = groups[i];
         (*env)->ReleaseLongArrayElements(env, jgroups, jgroupsAsArray, 0);
-        (*env)->SetObjectField(env, obj, fid, jgroups);
+        (*env)->SetObjectField(env, obj, supplementaryGroupID, jgroups);
     }
+cleanUpAndReturn:
+    free(groups);
     return;
 }
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Tue Oct 23 09:41:52 2012 -0700
@@ -1318,10 +1318,8 @@
                                                       jobject value) {
     int fd;
     int level, optname, optlen;
-    union {
-        int i;
-        char c;
-    } optval;
+    int optval;
+    optlen = sizeof(int);
 
     /*
      * Check that socket hasn't been closed
@@ -1381,8 +1379,7 @@
                 fid =  (*env)->GetFieldID(env, cls, "value", "I");
                 CHECK_NULL(fid);
 
-                optval.i = (*env)->GetIntField(env, value, fid);
-                optlen = sizeof(optval.i);
+                optval = (*env)->GetIntField(env, value, fid);
                 break;
             }
 
@@ -1401,8 +1398,7 @@
                 on = (*env)->GetBooleanField(env, value, fid);
 
                 /* SO_REUSEADDR or SO_BROADCAST */
-                optval.i = (on ? 1 : 0);
-                optlen = sizeof(optval.i);
+                optval = (on ? 1 : 0);
 
                 break;
             }
--- a/src/windows/classes/java/io/Win32FileSystem.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,608 +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 java.io;
-
-import java.security.AccessController;
-import java.util.Locale;
-import sun.security.action.GetPropertyAction;
-
-
-class Win32FileSystem extends FileSystem {
-
-    private final char slash;
-    private final char altSlash;
-    private final char semicolon;
-
-    public Win32FileSystem() {
-        slash = AccessController.doPrivileged(
-            new GetPropertyAction("file.separator")).charAt(0);
-        semicolon = AccessController.doPrivileged(
-            new GetPropertyAction("path.separator")).charAt(0);
-        altSlash = (this.slash == '\\') ? '/' : '\\';
-    }
-
-    private boolean isSlash(char c) {
-        return (c == '\\') || (c == '/');
-    }
-
-    private boolean isLetter(char c) {
-        return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
-    }
-
-    private String slashify(String p) {
-        if ((p.length() > 0) && (p.charAt(0) != slash)) return slash + p;
-        else return p;
-    }
-
-
-    /* -- Normalization and construction -- */
-
-    public char getSeparator() {
-        return slash;
-    }
-
-    public char getPathSeparator() {
-        return semicolon;
-    }
-
-    /* A normal Win32 pathname contains no duplicate slashes, except possibly
-       for a UNC prefix, and does not end with a slash.  It may be the empty
-       string.  Normalized Win32 pathnames have the convenient property that
-       the length of the prefix almost uniquely identifies the type of the path
-       and whether it is absolute or relative:
-
-           0  relative to both drive and directory
-           1  drive-relative (begins with '\\')
-           2  absolute UNC (if first char is '\\'),
-                else directory-relative (has form "z:foo")
-           3  absolute local pathname (begins with "z:\\")
-     */
-
-    private int normalizePrefix(String path, int len, StringBuffer sb) {
-        int src = 0;
-        while ((src < len) && isSlash(path.charAt(src))) src++;
-        char c;
-        if ((len - src >= 2)
-            && isLetter(c = path.charAt(src))
-            && path.charAt(src + 1) == ':') {
-            /* Remove leading slashes if followed by drive specifier.
-               This hack is necessary to support file URLs containing drive
-               specifiers (e.g., "file://c:/path").  As a side effect,
-               "/c:/path" can be used as an alternative to "c:/path". */
-            sb.append(c);
-            sb.append(':');
-            src += 2;
-        } else {
-            src = 0;
-            if ((len >= 2)
-                && isSlash(path.charAt(0))
-                && isSlash(path.charAt(1))) {
-                /* UNC pathname: Retain first slash; leave src pointed at
-                   second slash so that further slashes will be collapsed
-                   into the second slash.  The result will be a pathname
-                   beginning with "\\\\" followed (most likely) by a host
-                   name. */
-                src = 1;
-                sb.append(slash);
-            }
-        }
-        return src;
-    }
-
-    /* Normalize the given pathname, whose length is len, starting at the given
-       offset; everything before this offset is already normal. */
-    private String normalize(String path, int len, int off) {
-        if (len == 0) return path;
-        if (off < 3) off = 0;   /* Avoid fencepost cases with UNC pathnames */
-        int src;
-        char slash = this.slash;
-        StringBuffer sb = new StringBuffer(len);
-
-        if (off == 0) {
-            /* Complete normalization, including prefix */
-            src = normalizePrefix(path, len, sb);
-        } else {
-            /* Partial normalization */
-            src = off;
-            sb.append(path.substring(0, off));
-        }
-
-        /* Remove redundant slashes from the remainder of the path, forcing all
-           slashes into the preferred slash */
-        while (src < len) {
-            char c = path.charAt(src++);
-            if (isSlash(c)) {
-                while ((src < len) && isSlash(path.charAt(src))) src++;
-                if (src == len) {
-                    /* Check for trailing separator */
-                    int sn = sb.length();
-                    if ((sn == 2) && (sb.charAt(1) == ':')) {
-                        /* "z:\\" */
-                        sb.append(slash);
-                        break;
-                    }
-                    if (sn == 0) {
-                        /* "\\" */
-                        sb.append(slash);
-                        break;
-                    }
-                    if ((sn == 1) && (isSlash(sb.charAt(0)))) {
-                        /* "\\\\" is not collapsed to "\\" because "\\\\" marks
-                           the beginning of a UNC pathname.  Even though it is
-                           not, by itself, a valid UNC pathname, we leave it as
-                           is in order to be consistent with the win32 APIs,
-                           which treat this case as an invalid UNC pathname
-                           rather than as an alias for the root directory of
-                           the current drive. */
-                        sb.append(slash);
-                        break;
-                    }
-                    /* Path does not denote a root directory, so do not append
-                       trailing slash */
-                    break;
-                } else {
-                    sb.append(slash);
-                }
-            } else {
-                sb.append(c);
-            }
-        }
-
-        String rv = sb.toString();
-        return rv;
-    }
-
-    /* Check that the given pathname is normal.  If not, invoke the real
-       normalizer on the part of the pathname that requires normalization.
-       This way we iterate through the whole pathname string only once. */
-    public String normalize(String path) {
-        int n = path.length();
-        char slash = this.slash;
-        char altSlash = this.altSlash;
-        char prev = 0;
-        for (int i = 0; i < n; i++) {
-            char c = path.charAt(i);
-            if (c == altSlash)
-                return normalize(path, n, (prev == slash) ? i - 1 : i);
-            if ((c == slash) && (prev == slash) && (i > 1))
-                return normalize(path, n, i - 1);
-            if ((c == ':') && (i > 1))
-                return normalize(path, n, 0);
-            prev = c;
-        }
-        if (prev == slash) return normalize(path, n, n - 1);
-        return path;
-    }
-
-    public int prefixLength(String path) {
-        char slash = this.slash;
-        int n = path.length();
-        if (n == 0) return 0;
-        char c0 = path.charAt(0);
-        char c1 = (n > 1) ? path.charAt(1) : 0;
-        if (c0 == slash) {
-            if (c1 == slash) return 2;  /* Absolute UNC pathname "\\\\foo" */
-            return 1;                   /* Drive-relative "\\foo" */
-        }
-        if (isLetter(c0) && (c1 == ':')) {
-            if ((n > 2) && (path.charAt(2) == slash))
-                return 3;               /* Absolute local pathname "z:\\foo" */
-            return 2;                   /* Directory-relative "z:foo" */
-        }
-        return 0;                       /* Completely relative */
-    }
-
-    public String resolve(String parent, String child) {
-        int pn = parent.length();
-        if (pn == 0) return child;
-        int cn = child.length();
-        if (cn == 0) return parent;
-
-        String c = child;
-        int childStart = 0;
-        int parentEnd = pn;
-
-        if ((cn > 1) && (c.charAt(0) == slash)) {
-            if (c.charAt(1) == slash) {
-                /* Drop prefix when child is a UNC pathname */
-                childStart = 2;
-            } else {
-                /* Drop prefix when child is drive-relative */
-                childStart = 1;
-
-            }
-            if (cn == childStart) { // Child is double slash
-                if (parent.charAt(pn - 1) == slash)
-                    return parent.substring(0, pn - 1);
-                return parent;
-            }
-        }
-
-        if (parent.charAt(pn - 1) == slash)
-            parentEnd--;
-
-        int strlen = parentEnd + cn - childStart;
-        char[] theChars = null;
-        if (child.charAt(childStart) == slash) {
-            theChars = new char[strlen];
-            parent.getChars(0, parentEnd, theChars, 0);
-            child.getChars(childStart, cn, theChars, parentEnd);
-        } else {
-            theChars = new char[strlen + 1];
-            parent.getChars(0, parentEnd, theChars, 0);
-            theChars[parentEnd] = slash;
-            child.getChars(childStart, cn, theChars, parentEnd + 1);
-        }
-        return new String(theChars);
-    }
-
-    public String getDefaultParent() {
-        return ("" + slash);
-    }
-
-    public String fromURIPath(String path) {
-        String p = path;
-        if ((p.length() > 2) && (p.charAt(2) == ':')) {
-            // "/c:/foo" --> "c:/foo"
-            p = p.substring(1);
-            // "c:/foo/" --> "c:/foo", but "c:/" --> "c:/"
-            if ((p.length() > 3) && p.endsWith("/"))
-                p = p.substring(0, p.length() - 1);
-        } else if ((p.length() > 1) && p.endsWith("/")) {
-            // "/foo/" --> "/foo"
-            p = p.substring(0, p.length() - 1);
-        }
-        return p;
-    }
-
-
-
-    /* -- Path operations -- */
-
-    public boolean isAbsolute(File f) {
-        int pl = f.getPrefixLength();
-        return (((pl == 2) && (f.getPath().charAt(0) == slash))
-                || (pl == 3));
-    }
-
-    protected native String getDriveDirectory(int drive);
-
-    private static String[] driveDirCache = new String[26];
-
-    private static int driveIndex(char d) {
-        if ((d >= 'a') && (d <= 'z')) return d - 'a';
-        if ((d >= 'A') && (d <= 'Z')) return d - 'A';
-        return -1;
-    }
-
-    private String getDriveDirectory(char drive) {
-        int i = driveIndex(drive);
-        if (i < 0) return null;
-        String s = driveDirCache[i];
-        if (s != null) return s;
-        s = getDriveDirectory(i + 1);
-        driveDirCache[i] = s;
-        return s;
-    }
-
-    private String getUserPath() {
-        /* For both compatibility and security,
-           we must look this up every time */
-        return normalize(System.getProperty("user.dir"));
-    }
-
-    private String getDrive(String path) {
-        int pl = prefixLength(path);
-        return (pl == 3) ? path.substring(0, 2) : null;
-    }
-
-    public String resolve(File f) {
-        String path = f.getPath();
-        int pl = f.getPrefixLength();
-        if ((pl == 2) && (path.charAt(0) == slash))
-            return path;                        /* UNC */
-        if (pl == 3)
-            return path;                        /* Absolute local */
-        if (pl == 0)
-            return getUserPath() + slashify(path); /* Completely relative */
-        if (pl == 1) {                          /* Drive-relative */
-            String up = getUserPath();
-            String ud = getDrive(up);
-            if (ud != null) return ud + path;
-            return up + path;                   /* User dir is a UNC path */
-        }
-        if (pl == 2) {                          /* Directory-relative */
-            String up = getUserPath();
-            String ud = getDrive(up);
-            if ((ud != null) && path.startsWith(ud))
-                return up + slashify(path.substring(2));
-            char drive = path.charAt(0);
-            String dir = getDriveDirectory(drive);
-            String np;
-            if (dir != null) {
-                /* When resolving a directory-relative path that refers to a
-                   drive other than the current drive, insist that the caller
-                   have read permission on the result */
-                String p = drive + (':' + dir + slashify(path.substring(2)));
-                SecurityManager security = System.getSecurityManager();
-                try {
-                    if (security != null) security.checkRead(p);
-                } catch (SecurityException x) {
-                    /* Don't disclose the drive's directory in the exception */
-                    throw new SecurityException("Cannot resolve path " + path);
-                }
-                return p;
-            }
-            return drive + ":" + slashify(path.substring(2)); /* fake it */
-        }
-        throw new InternalError("Unresolvable path: " + path);
-    }
-
-    // Caches for canonicalization results to improve startup performance.
-    // The first cache handles repeated canonicalizations of the same path
-    // name. The prefix cache handles repeated canonicalizations within the
-    // same directory, and must not create results differing from the true
-    // canonicalization algorithm in canonicalize_md.c. For this reason the
-    // prefix cache is conservative and is not used for complex path names.
-    private ExpiringCache cache       = new ExpiringCache();
-    private ExpiringCache prefixCache = new ExpiringCache();
-
-    public String canonicalize(String path) throws IOException {
-        // If path is a drive letter only then skip canonicalization
-        int len = path.length();
-        if ((len == 2) &&
-            (isLetter(path.charAt(0))) &&
-            (path.charAt(1) == ':')) {
-            char c = path.charAt(0);
-            if ((c >= 'A') && (c <= 'Z'))
-                return path;
-            return "" + ((char) (c-32)) + ':';
-        } else if ((len == 3) &&
-                   (isLetter(path.charAt(0))) &&
-                   (path.charAt(1) == ':') &&
-                   (path.charAt(2) == '\\')) {
-            char c = path.charAt(0);
-            if ((c >= 'A') && (c <= 'Z'))
-                return path;
-            return "" + ((char) (c-32)) + ':' + '\\';
-        }
-        if (!useCanonCaches) {
-            return canonicalize0(path);
-        } else {
-            String res = cache.get(path);
-            if (res == null) {
-                String dir = null;
-                String resDir = null;
-                if (useCanonPrefixCache) {
-                    dir = parentOrNull(path);
-                    if (dir != null) {
-                        resDir = prefixCache.get(dir);
-                        if (resDir != null) {
-                            // Hit only in prefix cache; full path is canonical,
-                            // but we need to get the canonical name of the file
-                            // in this directory to get the appropriate capitalization
-                            String filename = path.substring(1 + dir.length());
-                            res = canonicalizeWithPrefix(resDir, filename);
-                            cache.put(dir + File.separatorChar + filename, res);
-                        }
-                    }
-                }
-                if (res == null) {
-                    res = canonicalize0(path);
-                    cache.put(path, res);
-                    if (useCanonPrefixCache && dir != null) {
-                        resDir = parentOrNull(res);
-                        if (resDir != null) {
-                            File f = new File(res);
-                            if (f.exists() && !f.isDirectory()) {
-                                prefixCache.put(dir, resDir);
-                            }
-                        }
-                    }
-                }
-            }
-            return res;
-        }
-    }
-
-    protected native String canonicalize0(String path)
-                                                throws IOException;
-    protected String canonicalizeWithPrefix(String canonicalPrefix,
-                                            String filename) throws IOException
-    {
-        return canonicalizeWithPrefix0(canonicalPrefix,
-                                       canonicalPrefix + File.separatorChar + filename);
-    }
-    // Run the canonicalization operation assuming that the prefix
-    // (everything up to the last filename) is canonical; just gets
-    // the canonical name of the last element of the path
-    protected native String canonicalizeWithPrefix0(String canonicalPrefix,
-                                                    String pathWithCanonicalPrefix)
-                                                throws IOException;
-    // Best-effort attempt to get parent of this path; used for
-    // optimization of filename canonicalization. This must return null for
-    // any cases where the code in canonicalize_md.c would throw an
-    // exception or otherwise deal with non-simple pathnames like handling
-    // of "." and "..". It may conservatively return null in other
-    // situations as well. Returning null will cause the underlying
-    // (expensive) canonicalization routine to be called.
-    static String parentOrNull(String path) {
-        if (path == null) return null;
-        char sep = File.separatorChar;
-        char altSep = '/';
-        int last = path.length() - 1;
-        int idx = last;
-        int adjacentDots = 0;
-        int nonDotCount = 0;
-        while (idx > 0) {
-            char c = path.charAt(idx);
-            if (c == '.') {
-                if (++adjacentDots >= 2) {
-                    // Punt on pathnames containing . and ..
-                    return null;
-                }
-                if (nonDotCount == 0) {
-                    // Punt on pathnames ending in a .
-                    return null;
-                }
-            } else if (c == sep) {
-                if (adjacentDots == 1 && nonDotCount == 0) {
-                    // Punt on pathnames containing . and ..
-                    return null;
-                }
-                if (idx == 0 ||
-                    idx >= last - 1 ||
-                    path.charAt(idx - 1) == sep ||
-                    path.charAt(idx - 1) == altSep) {
-                    // Punt on pathnames containing adjacent slashes
-                    // toward the end
-                    return null;
-                }
-                return path.substring(0, idx);
-            } else if (c == altSep) {
-                // Punt on pathnames containing both backward and
-                // forward slashes
-                return null;
-            } else if (c == '*' || c == '?') {
-                // Punt on pathnames containing wildcards
-                return null;
-            } else {
-                ++nonDotCount;
-                adjacentDots = 0;
-            }
-            --idx;
-        }
-        return null;
-    }
-
-
-    /* -- Attribute accessors -- */
-
-    public native int getBooleanAttributes(File f);
-    public native boolean checkAccess(File f, int access);
-    public native long getLastModifiedTime(File f);
-    public native long getLength(File f);
-    public native boolean setPermission(File f, int access, boolean enable, boolean owneronly);
-
-    /* -- File operations -- */
-
-    public native boolean createFileExclusively(String path)
-        throws IOException;
-    public boolean delete(File f) {
-        // Keep canonicalization caches in sync after file deletion
-        // and renaming operations. Could be more clever than this
-        // (i.e., only remove/update affected entries) but probably
-        // not worth it since these entries expire after 30 seconds
-        // anyway.
-        cache.clear();
-        prefixCache.clear();
-        return delete0(f);
-    }
-    protected native boolean delete0(File f);
-    public native String[] list(File f);
-    public native boolean createDirectory(File f);
-    public boolean rename(File f1, File f2) {
-        // Keep canonicalization caches in sync after file deletion
-        // and renaming operations. Could be more clever than this
-        // (i.e., only remove/update affected entries) but probably
-        // not worth it since these entries expire after 30 seconds
-        // anyway.
-        cache.clear();
-        prefixCache.clear();
-        return rename0(f1, f2);
-    }
-    protected native boolean rename0(File f1, File f2);
-    public native boolean setLastModifiedTime(File f, long time);
-    public native boolean setReadOnly(File f);
-
-
-    /* -- Filesystem interface -- */
-
-    private boolean access(String path) {
-        try {
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) security.checkRead(path);
-            return true;
-        } catch (SecurityException x) {
-            return false;
-        }
-    }
-
-    private static native int listRoots0();
-
-    public File[] listRoots() {
-        int ds = listRoots0();
-        int n = 0;
-        for (int i = 0; i < 26; i++) {
-            if (((ds >> i) & 1) != 0) {
-                if (!access((char)('A' + i) + ":" + slash))
-                    ds &= ~(1 << i);
-                else
-                    n++;
-            }
-        }
-        File[] fs = new File[n];
-        int j = 0;
-        char slash = this.slash;
-        for (int i = 0; i < 26; i++) {
-            if (((ds >> i) & 1) != 0)
-                fs[j++] = new File((char)('A' + i) + ":" + slash);
-        }
-        return fs;
-    }
-
-
-    /* -- Disk usage -- */
-    public long getSpace(File f, int t) {
-        if (f.exists()) {
-            File file = (f.isDirectory() ? f : f.getParentFile());
-            return getSpace0(file, t);
-        }
-        return 0;
-    }
-
-    private native long getSpace0(File f, int t);
-
-
-    /* -- Basic infrastructure -- */
-
-    public int compare(File f1, File f2) {
-        return f1.getPath().compareToIgnoreCase(f2.getPath());
-    }
-
-    public int hashCode(File f) {
-        /* Could make this more efficient: String.hashCodeIgnoreCase */
-        return f.getPath().toLowerCase(Locale.ENGLISH).hashCode() ^ 1234321;
-    }
-
-
-    private static native void initIDs();
-
-    static {
-        initIDs();
-    }
-
-}
--- a/src/windows/classes/java/io/WinNTFileSystem.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/windows/classes/java/io/WinNTFileSystem.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,11 @@
  * questions.
  */
 
-/*
- */
+package java.io;
 
-package java.io;
+import java.security.AccessController;
+import java.util.Locale;
+import sun.security.action.GetPropertyAction;
 
 /**
  * Unicode-aware FileSystem for Windows NT/2000.
@@ -34,23 +35,589 @@
  * @author Konstantin Kladko
  * @since 1.4
  */
-class WinNTFileSystem extends Win32FileSystem {
+class WinNTFileSystem extends FileSystem {
+
+    private final char slash;
+    private final char altSlash;
+    private final char semicolon;
+
+    public WinNTFileSystem() {
+        slash = AccessController.doPrivileged(
+            new GetPropertyAction("file.separator")).charAt(0);
+        semicolon = AccessController.doPrivileged(
+            new GetPropertyAction("path.separator")).charAt(0);
+        altSlash = (this.slash == '\\') ? '/' : '\\';
+    }
+
+    private boolean isSlash(char c) {
+        return (c == '\\') || (c == '/');
+    }
+
+    private boolean isLetter(char c) {
+        return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
+    }
+
+    private String slashify(String p) {
+        if ((p.length() > 0) && (p.charAt(0) != slash)) return slash + p;
+        else return p;
+    }
+
+    /* -- Normalization and construction -- */
+
+    @Override
+    public char getSeparator() {
+        return slash;
+    }
+
+    @Override
+    public char getPathSeparator() {
+        return semicolon;
+    }
+
+    /* Check that the given pathname is normal.  If not, invoke the real
+       normalizer on the part of the pathname that requires normalization.
+       This way we iterate through the whole pathname string only once. */
+    @Override
+    public String normalize(String path) {
+        int n = path.length();
+        char slash = this.slash;
+        char altSlash = this.altSlash;
+        char prev = 0;
+        for (int i = 0; i < n; i++) {
+            char c = path.charAt(i);
+            if (c == altSlash)
+                return normalize(path, n, (prev == slash) ? i - 1 : i);
+            if ((c == slash) && (prev == slash) && (i > 1))
+                return normalize(path, n, i - 1);
+            if ((c == ':') && (i > 1))
+                return normalize(path, n, 0);
+            prev = c;
+        }
+        if (prev == slash) return normalize(path, n, n - 1);
+        return path;
+    }
+
+    /* Normalize the given pathname, whose length is len, starting at the given
+       offset; everything before this offset is already normal. */
+    private String normalize(String path, int len, int off) {
+        if (len == 0) return path;
+        if (off < 3) off = 0;   /* Avoid fencepost cases with UNC pathnames */
+        int src;
+        char slash = this.slash;
+        StringBuffer sb = new StringBuffer(len);
+
+        if (off == 0) {
+            /* Complete normalization, including prefix */
+            src = normalizePrefix(path, len, sb);
+        } else {
+            /* Partial normalization */
+            src = off;
+            sb.append(path.substring(0, off));
+        }
+
+        /* Remove redundant slashes from the remainder of the path, forcing all
+           slashes into the preferred slash */
+        while (src < len) {
+            char c = path.charAt(src++);
+            if (isSlash(c)) {
+                while ((src < len) && isSlash(path.charAt(src))) src++;
+                if (src == len) {
+                    /* Check for trailing separator */
+                    int sn = sb.length();
+                    if ((sn == 2) && (sb.charAt(1) == ':')) {
+                        /* "z:\\" */
+                        sb.append(slash);
+                        break;
+                    }
+                    if (sn == 0) {
+                        /* "\\" */
+                        sb.append(slash);
+                        break;
+                    }
+                    if ((sn == 1) && (isSlash(sb.charAt(0)))) {
+                        /* "\\\\" is not collapsed to "\\" because "\\\\" marks
+                           the beginning of a UNC pathname.  Even though it is
+                           not, by itself, a valid UNC pathname, we leave it as
+                           is in order to be consistent with the win32 APIs,
+                           which treat this case as an invalid UNC pathname
+                           rather than as an alias for the root directory of
+                           the current drive. */
+                        sb.append(slash);
+                        break;
+                    }
+                    /* Path does not denote a root directory, so do not append
+                       trailing slash */
+                    break;
+                } else {
+                    sb.append(slash);
+                }
+            } else {
+                sb.append(c);
+            }
+        }
+
+        String rv = sb.toString();
+        return rv;
+    }
+
+    /* A normal Win32 pathname contains no duplicate slashes, except possibly
+       for a UNC prefix, and does not end with a slash.  It may be the empty
+       string.  Normalized Win32 pathnames have the convenient property that
+       the length of the prefix almost uniquely identifies the type of the path
+       and whether it is absolute or relative:
+
+           0  relative to both drive and directory
+           1  drive-relative (begins with '\\')
+           2  absolute UNC (if first char is '\\'),
+                else directory-relative (has form "z:foo")
+           3  absolute local pathname (begins with "z:\\")
+     */
+    private int normalizePrefix(String path, int len, StringBuffer sb) {
+        int src = 0;
+        while ((src < len) && isSlash(path.charAt(src))) src++;
+        char c;
+        if ((len - src >= 2)
+            && isLetter(c = path.charAt(src))
+            && path.charAt(src + 1) == ':') {
+            /* Remove leading slashes if followed by drive specifier.
+               This hack is necessary to support file URLs containing drive
+               specifiers (e.g., "file://c:/path").  As a side effect,
+               "/c:/path" can be used as an alternative to "c:/path". */
+            sb.append(c);
+            sb.append(':');
+            src += 2;
+        } else {
+            src = 0;
+            if ((len >= 2)
+                && isSlash(path.charAt(0))
+                && isSlash(path.charAt(1))) {
+                /* UNC pathname: Retain first slash; leave src pointed at
+                   second slash so that further slashes will be collapsed
+                   into the second slash.  The result will be a pathname
+                   beginning with "\\\\" followed (most likely) by a host
+                   name. */
+                src = 1;
+                sb.append(slash);
+            }
+        }
+        return src;
+    }
+
+    @Override
+    public int prefixLength(String path) {
+        char slash = this.slash;
+        int n = path.length();
+        if (n == 0) return 0;
+        char c0 = path.charAt(0);
+        char c1 = (n > 1) ? path.charAt(1) : 0;
+        if (c0 == slash) {
+            if (c1 == slash) return 2;  /* Absolute UNC pathname "\\\\foo" */
+            return 1;                   /* Drive-relative "\\foo" */
+        }
+        if (isLetter(c0) && (c1 == ':')) {
+            if ((n > 2) && (path.charAt(2) == slash))
+                return 3;               /* Absolute local pathname "z:\\foo" */
+            return 2;                   /* Directory-relative "z:foo" */
+        }
+        return 0;                       /* Completely relative */
+    }
+
+    @Override
+    public String resolve(String parent, String child) {
+        int pn = parent.length();
+        if (pn == 0) return child;
+        int cn = child.length();
+        if (cn == 0) return parent;
+
+        String c = child;
+        int childStart = 0;
+        int parentEnd = pn;
+
+        if ((cn > 1) && (c.charAt(0) == slash)) {
+            if (c.charAt(1) == slash) {
+                /* Drop prefix when child is a UNC pathname */
+                childStart = 2;
+            } else {
+                /* Drop prefix when child is drive-relative */
+                childStart = 1;
+
+            }
+            if (cn == childStart) { // Child is double slash
+                if (parent.charAt(pn - 1) == slash)
+                    return parent.substring(0, pn - 1);
+                return parent;
+            }
+        }
+
+        if (parent.charAt(pn - 1) == slash)
+            parentEnd--;
+
+        int strlen = parentEnd + cn - childStart;
+        char[] theChars = null;
+        if (child.charAt(childStart) == slash) {
+            theChars = new char[strlen];
+            parent.getChars(0, parentEnd, theChars, 0);
+            child.getChars(childStart, cn, theChars, parentEnd);
+        } else {
+            theChars = new char[strlen + 1];
+            parent.getChars(0, parentEnd, theChars, 0);
+            theChars[parentEnd] = slash;
+            child.getChars(childStart, cn, theChars, parentEnd + 1);
+        }
+        return new String(theChars);
+    }
+
+    @Override
+    public String getDefaultParent() {
+        return ("" + slash);
+    }
 
-    protected native String canonicalize0(String path)
-                                                throws IOException;
-    protected native String canonicalizeWithPrefix0(String canonicalPrefix,
-                                                    String pathWithCanonicalPrefix)
-                                                throws IOException;
+    @Override
+    public String fromURIPath(String path) {
+        String p = path;
+        if ((p.length() > 2) && (p.charAt(2) == ':')) {
+            // "/c:/foo" --> "c:/foo"
+            p = p.substring(1);
+            // "c:/foo/" --> "c:/foo", but "c:/" --> "c:/"
+            if ((p.length() > 3) && p.endsWith("/"))
+                p = p.substring(0, p.length() - 1);
+        } else if ((p.length() > 1) && p.endsWith("/")) {
+            // "/foo/" --> "/foo"
+            p = p.substring(0, p.length() - 1);
+        }
+        return p;
+    }
+
+    /* -- Path operations -- */
+
+    @Override
+    public boolean isAbsolute(File f) {
+        int pl = f.getPrefixLength();
+        return (((pl == 2) && (f.getPath().charAt(0) == slash))
+                || (pl == 3));
+    }
+
+    @Override
+    public String resolve(File f) {
+        String path = f.getPath();
+        int pl = f.getPrefixLength();
+        if ((pl == 2) && (path.charAt(0) == slash))
+            return path;                        /* UNC */
+        if (pl == 3)
+            return path;                        /* Absolute local */
+        if (pl == 0)
+            return getUserPath() + slashify(path); /* Completely relative */
+        if (pl == 1) {                          /* Drive-relative */
+            String up = getUserPath();
+            String ud = getDrive(up);
+            if (ud != null) return ud + path;
+            return up + path;                   /* User dir is a UNC path */
+        }
+        if (pl == 2) {                          /* Directory-relative */
+            String up = getUserPath();
+            String ud = getDrive(up);
+            if ((ud != null) && path.startsWith(ud))
+                return up + slashify(path.substring(2));
+            char drive = path.charAt(0);
+            String dir = getDriveDirectory(drive);
+            String np;
+            if (dir != null) {
+                /* When resolving a directory-relative path that refers to a
+                   drive other than the current drive, insist that the caller
+                   have read permission on the result */
+                String p = drive + (':' + dir + slashify(path.substring(2)));
+                SecurityManager security = System.getSecurityManager();
+                try {
+                    if (security != null) security.checkRead(p);
+                } catch (SecurityException x) {
+                    /* Don't disclose the drive's directory in the exception */
+                    throw new SecurityException("Cannot resolve path " + path);
+                }
+                return p;
+            }
+            return drive + ":" + slashify(path.substring(2)); /* fake it */
+        }
+        throw new InternalError("Unresolvable path: " + path);
+    }
+
+    private String getUserPath() {
+        /* For both compatibility and security,
+           we must look this up every time */
+        return normalize(System.getProperty("user.dir"));
+    }
+
+    private String getDrive(String path) {
+        int pl = prefixLength(path);
+        return (pl == 3) ? path.substring(0, 2) : null;
+    }
+
+    private static String[] driveDirCache = new String[26];
+
+    private static int driveIndex(char d) {
+        if ((d >= 'a') && (d <= 'z')) return d - 'a';
+        if ((d >= 'A') && (d <= 'Z')) return d - 'A';
+        return -1;
+    }
+
+    private native String getDriveDirectory(int drive);
+
+    private String getDriveDirectory(char drive) {
+        int i = driveIndex(drive);
+        if (i < 0) return null;
+        String s = driveDirCache[i];
+        if (s != null) return s;
+        s = getDriveDirectory(i + 1);
+        driveDirCache[i] = s;
+        return s;
+    }
+
+    // Caches for canonicalization results to improve startup performance.
+    // The first cache handles repeated canonicalizations of the same path
+    // name. The prefix cache handles repeated canonicalizations within the
+    // same directory, and must not create results differing from the true
+    // canonicalization algorithm in canonicalize_md.c. For this reason the
+    // prefix cache is conservative and is not used for complex path names.
+    private ExpiringCache cache       = new ExpiringCache();
+    private ExpiringCache prefixCache = new ExpiringCache();
+
+    @Override
+    public String canonicalize(String path) throws IOException {
+        // If path is a drive letter only then skip canonicalization
+        int len = path.length();
+        if ((len == 2) &&
+            (isLetter(path.charAt(0))) &&
+            (path.charAt(1) == ':')) {
+            char c = path.charAt(0);
+            if ((c >= 'A') && (c <= 'Z'))
+                return path;
+            return "" + ((char) (c-32)) + ':';
+        } else if ((len == 3) &&
+                   (isLetter(path.charAt(0))) &&
+                   (path.charAt(1) == ':') &&
+                   (path.charAt(2) == '\\')) {
+            char c = path.charAt(0);
+            if ((c >= 'A') && (c <= 'Z'))
+                return path;
+            return "" + ((char) (c-32)) + ':' + '\\';
+        }
+        if (!useCanonCaches) {
+            return canonicalize0(path);
+        } else {
+            String res = cache.get(path);
+            if (res == null) {
+                String dir = null;
+                String resDir = null;
+                if (useCanonPrefixCache) {
+                    dir = parentOrNull(path);
+                    if (dir != null) {
+                        resDir = prefixCache.get(dir);
+                        if (resDir != null) {
+                            /*
+                             * Hit only in prefix cache; full path is canonical,
+                             * but we need to get the canonical name of the file
+                             * in this directory to get the appropriate
+                             * capitalization
+                             */
+                            String filename = path.substring(1 + dir.length());
+                            res = canonicalizeWithPrefix(resDir, filename);
+                            cache.put(dir + File.separatorChar + filename, res);
+                        }
+                    }
+                }
+                if (res == null) {
+                    res = canonicalize0(path);
+                    cache.put(path, res);
+                    if (useCanonPrefixCache && dir != null) {
+                        resDir = parentOrNull(res);
+                        if (resDir != null) {
+                            File f = new File(res);
+                            if (f.exists() && !f.isDirectory()) {
+                                prefixCache.put(dir, resDir);
+                            }
+                        }
+                    }
+                }
+            }
+            return res;
+        }
+    }
+
+    private native String canonicalize0(String path)
+            throws IOException;
+
+    private String canonicalizeWithPrefix(String canonicalPrefix,
+            String filename) throws IOException
+    {
+        return canonicalizeWithPrefix0(canonicalPrefix,
+                canonicalPrefix + File.separatorChar + filename);
+    }
+
+    // Run the canonicalization operation assuming that the prefix
+    // (everything up to the last filename) is canonical; just gets
+    // the canonical name of the last element of the path
+    private native String canonicalizeWithPrefix0(String canonicalPrefix,
+            String pathWithCanonicalPrefix)
+            throws IOException;
+
+    // Best-effort attempt to get parent of this path; used for
+    // optimization of filename canonicalization. This must return null for
+    // any cases where the code in canonicalize_md.c would throw an
+    // exception or otherwise deal with non-simple pathnames like handling
+    // of "." and "..". It may conservatively return null in other
+    // situations as well. Returning null will cause the underlying
+    // (expensive) canonicalization routine to be called.
+    private static String parentOrNull(String path) {
+        if (path == null) return null;
+        char sep = File.separatorChar;
+        char altSep = '/';
+        int last = path.length() - 1;
+        int idx = last;
+        int adjacentDots = 0;
+        int nonDotCount = 0;
+        while (idx > 0) {
+            char c = path.charAt(idx);
+            if (c == '.') {
+                if (++adjacentDots >= 2) {
+                    // Punt on pathnames containing . and ..
+                    return null;
+                }
+                if (nonDotCount == 0) {
+                    // Punt on pathnames ending in a .
+                    return null;
+                }
+            } else if (c == sep) {
+                if (adjacentDots == 1 && nonDotCount == 0) {
+                    // Punt on pathnames containing . and ..
+                    return null;
+                }
+                if (idx == 0 ||
+                    idx >= last - 1 ||
+                    path.charAt(idx - 1) == sep ||
+                    path.charAt(idx - 1) == altSep) {
+                    // Punt on pathnames containing adjacent slashes
+                    // toward the end
+                    return null;
+                }
+                return path.substring(0, idx);
+            } else if (c == altSep) {
+                // Punt on pathnames containing both backward and
+                // forward slashes
+                return null;
+            } else if (c == '*' || c == '?') {
+                // Punt on pathnames containing wildcards
+                return null;
+            } else {
+                ++nonDotCount;
+                adjacentDots = 0;
+            }
+            --idx;
+        }
+        return null;
+    }
 
     /* -- Attribute accessors -- */
 
+    @Override
     public native int getBooleanAttributes(File f);
+
+    @Override
     public native boolean checkAccess(File f, int access);
+
+    @Override
     public native long getLastModifiedTime(File f);
+
+    @Override
     public native long getLength(File f);
-    public native boolean setPermission(File f, int access, boolean enable, boolean owneronly);
+
+    @Override
+    public native boolean setPermission(File f, int access, boolean enable,
+            boolean owneronly);
+
+    /* -- File operations -- */
+
+    @Override
+    public native boolean createFileExclusively(String path)
+            throws IOException;
+
+    @Override
+    public native String[] list(File f);
+
+    @Override
+    public native boolean createDirectory(File f);
+
+    @Override
+    public native boolean setLastModifiedTime(File f, long time);
+
+    @Override
+    public native boolean setReadOnly(File f);
+
+    @Override
+    public boolean delete(File f) {
+        // Keep canonicalization caches in sync after file deletion
+        // and renaming operations. Could be more clever than this
+        // (i.e., only remove/update affected entries) but probably
+        // not worth it since these entries expire after 30 seconds
+        // anyway.
+        cache.clear();
+        prefixCache.clear();
+        return delete0(f);
+    }
+
+    private native boolean delete0(File f);
 
+    @Override
+    public boolean rename(File f1, File f2) {
+        // Keep canonicalization caches in sync after file deletion
+        // and renaming operations. Could be more clever than this
+        // (i.e., only remove/update affected entries) but probably
+        // not worth it since these entries expire after 30 seconds
+        // anyway.
+        cache.clear();
+        prefixCache.clear();
+        return rename0(f1, f2);
+    }
 
+    private native boolean rename0(File f1, File f2);
+
+    /* -- Filesystem interface -- */
+
+    @Override
+    public File[] listRoots() {
+        int ds = listRoots0();
+        int n = 0;
+        for (int i = 0; i < 26; i++) {
+            if (((ds >> i) & 1) != 0) {
+                if (!access((char)('A' + i) + ":" + slash))
+                    ds &= ~(1 << i);
+                else
+                    n++;
+            }
+        }
+        File[] fs = new File[n];
+        int j = 0;
+        char slash = this.slash;
+        for (int i = 0; i < 26; i++) {
+            if (((ds >> i) & 1) != 0)
+                fs[j++] = new File((char)('A' + i) + ":" + slash);
+        }
+        return fs;
+    }
+
+    private static native int listRoots0();
+
+    private boolean access(String path) {
+        try {
+            SecurityManager security = System.getSecurityManager();
+            if (security != null) security.checkRead(path);
+            return true;
+        } catch (SecurityException x) {
+            return false;
+        }
+    }
+
+    /* -- Disk usage -- */
+
+    @Override
     public long getSpace(File f, int t) {
         if (f.exists()) {
             return getSpace0(f, t);
@@ -60,20 +627,22 @@
 
     private native long getSpace0(File f, int t);
 
-    /* -- File operations -- */
+    /* -- Basic infrastructure -- */
+
+    @Override
+    public int compare(File f1, File f2) {
+        return f1.getPath().compareToIgnoreCase(f2.getPath());
+    }
 
-    public native boolean createFileExclusively(String path)
-                                               throws IOException;
-    protected native boolean delete0(File f);
-    public native String[] list(File f);
-    public native boolean createDirectory(File f);
-    protected native boolean rename0(File f1, File f2);
-    public native boolean setLastModifiedTime(File f, long time);
-    public native boolean setReadOnly(File f);
-    protected native String getDriveDirectory(int drive);
+    @Override
+    public int hashCode(File f) {
+        /* Could make this more efficient: String.hashCodeIgnoreCase */
+        return f.getPath().toLowerCase(Locale.ENGLISH).hashCode() ^ 1234321;
+    }
+
     private static native void initIDs();
 
     static {
-            initIDs();
+        initIDs();
     }
 }
--- a/src/windows/native/java/io/FileSystem_md.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/windows/native/java/io/FileSystem_md.c	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "jni.h"
 #include "jni_util.h"
 
-extern jboolean onNT;
-extern void initializeWindowsVersion();
-
 JNIEXPORT jobject JNICALL
 Java_java_io_FileSystem_getFileSystem(JNIEnv *env, jclass ignored)
 {
-    initializeWindowsVersion();
-    if (onNT) {
-        return JNU_NewObjectByName(env, "java/io/WinNTFileSystem", "()V");
-    } else {
-        return JNU_NewObjectByName(env, "java/io/Win32FileSystem", "()V");
-    }
+    return JNU_NewObjectByName(env, "java/io/WinNTFileSystem", "()V");
 }
--- a/src/windows/native/java/io/Win32FileSystem_md.c	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 1998, 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.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <direct.h>
-#include <windows.h>
-#include <io.h>
-
-#include "jvm.h"
-#include "jni.h"
-#include "jni_util.h"
-#include "jlong.h"
-#include "io_util.h"
-#include "dirent_md.h"
-#include "java_io_FileSystem.h"
-
-/* This macro relies upon the fact that JNU_GetStringPlatformChars always makes
-   a copy of the string */
-
-#define WITH_NATIVE_PATH(env, object, id, var)                                \
-    WITH_FIELD_PLATFORM_STRING(env, object, id, var)                          \
-        JVM_NativePath((char *)var);
-
-#define END_NATIVE_PATH(env, var)    END_PLATFORM_STRING(env, var)
-
-
-static struct {
-    jfieldID path;
-} ids;
-
-JNIEXPORT void JNICALL
-Java_java_io_Win32FileSystem_initIDs(JNIEnv *env, jclass cls)
-{
-    jclass fileClass = (*env)->FindClass(env, "java/io/File");
-    if (!fileClass) return;
-    ids.path = (*env)->GetFieldID(env, fileClass,
-                                  "path", "Ljava/lang/String;");
-}
-
-
-/* -- Path operations -- */
-
-
-extern int canonicalize(char *path, const char *out, int len);
-extern int canonicalizeWithPrefix(const char* canonicalPrefix, const char *pathWithCanonicalPrefix, char *out, int len);
-
-JNIEXPORT jstring JNICALL
-Java_java_io_Win32FileSystem_canonicalize0(JNIEnv *env, jobject this,
-                                           jstring pathname)
-{
-    jstring rv = NULL;
-
-    WITH_PLATFORM_STRING(env, pathname, path) {
-        char canonicalPath[JVM_MAXPATHLEN];
-        if (canonicalize(JVM_NativePath((char *)path),
-                         canonicalPath, JVM_MAXPATHLEN) < 0) {
-            JNU_ThrowIOExceptionWithLastError(env, "Bad pathname");
-        } else {
-            rv = JNU_NewStringPlatform(env, canonicalPath);
-        }
-    } END_PLATFORM_STRING(env, path);
-    return rv;
-}
-
-
-JNIEXPORT jstring JNICALL
-Java_java_io_Win32FileSystem_canonicalizeWithPrefix0(JNIEnv *env, jobject this,
-                                                     jstring canonicalPrefixString,
-                                                     jstring pathWithCanonicalPrefixString)
-{
-    jstring rv = NULL;
-    char canonicalPath[JVM_MAXPATHLEN];
-
-    WITH_PLATFORM_STRING(env, canonicalPrefixString, canonicalPrefix) {
-        WITH_PLATFORM_STRING(env, pathWithCanonicalPrefixString, pathWithCanonicalPrefix) {
-            if (canonicalizeWithPrefix(canonicalPrefix,
-                                       pathWithCanonicalPrefix,
-                                       canonicalPath, JVM_MAXPATHLEN) < 0) {
-                JNU_ThrowIOExceptionWithLastError(env, "Bad pathname");
-            } else {
-                rv = JNU_NewStringPlatform(env, canonicalPath);
-            }
-        } END_PLATFORM_STRING(env, pathWithCanonicalPrefix);
-    } END_PLATFORM_STRING(env, canonicalPrefix);
-    return rv;
-}
-
-
-
-/* -- Attribute accessors -- */
-
-/* Check whether or not the file name in "path" is a Windows reserved
-   device name (CON, PRN, AUX, NUL, COM[1-9], LPT[1-9]) based on the
-   returned result from GetFullPathName. If the file name in the path
-   is indeed a reserved device name GetFuulPathName returns
-   "\\.\[ReservedDeviceName]".
- */
-BOOL isReservedDeviceName(const char* path) {
-#define BUFSIZE 9
-    char buf[BUFSIZE];
-    char *lpf = NULL;
-    DWORD retLen = GetFullPathName(path,
-                                   BUFSIZE,
-                                   buf,
-                                   &lpf);
-    if ((retLen == BUFSIZE - 1 || retLen == BUFSIZE - 2) &&
-        buf[0] == '\\' && buf[1] == '\\' &&
-        buf[2] == '.' && buf[3] == '\\') {
-        char* dname = _strupr(buf + 4);
-        if (strcmp(dname, "CON") == 0 ||
-            strcmp(dname, "PRN") == 0 ||
-            strcmp(dname, "AUX") == 0 ||
-            strcmp(dname, "NUL") == 0)
-            return TRUE;
-        if ((strncmp(dname, "COM", 3) == 0 ||
-             strncmp(dname, "LPT", 3) == 0) &&
-            dname[3] - '0' > 0 &&
-            dname[3] - '0' <= 9)
-            return TRUE;
-    }
-    return FALSE;
-}
-
-JNIEXPORT jint JNICALL
-Java_java_io_Win32FileSystem_getBooleanAttributes(JNIEnv *env, jobject this,
-                                                  jobject file)
-{
-    jint rv = 0;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        WIN32_FILE_ATTRIBUTE_DATA wfad;
-        if (!isReservedDeviceName(path) &&
-            GetFileAttributesEx(path, GetFileExInfoStandard, &wfad)) {
-            rv = (java_io_FileSystem_BA_EXISTS
-                  | ((wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
-                     ? java_io_FileSystem_BA_DIRECTORY
-                     : java_io_FileSystem_BA_REGULAR)
-                  | ((wfad.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
-                     ? java_io_FileSystem_BA_HIDDEN : 0));
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_checkAccess(JNIEnv *env, jobject this,
-                                         jobject file, jint a)
-{
-    jboolean rv = JNI_FALSE;
-    int mode;
-    switch (a) {
-    case java_io_FileSystem_ACCESS_READ:
-    case java_io_FileSystem_ACCESS_EXECUTE:
-        mode = 4;
-        break;
-    case java_io_FileSystem_ACCESS_WRITE:
-        mode = 2;
-        break;
-    default: assert(0);
-    }
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        if (access(path, mode) == 0) {
-            rv = JNI_TRUE;
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_setPermission(JNIEnv *env, jobject this,
-                                           jobject file,
-                                           jint access,
-                                           jboolean enable,
-                                           jboolean owneronly)
-{
-    jboolean rv = JNI_FALSE;
-    if (access == java_io_FileSystem_ACCESS_READ ||
-        access == java_io_FileSystem_ACCESS_EXECUTE) {
-        return enable;
-    }
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        DWORD a;
-        a = GetFileAttributes(path);
-        if (a != INVALID_FILE_ATTRIBUTES) {
-            if (enable)
-                a =  a & ~FILE_ATTRIBUTE_READONLY;
-            else
-                a =  a | FILE_ATTRIBUTE_READONLY;
-            if (SetFileAttributes(path, a))
-                rv = JNI_TRUE;
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_io_Win32FileSystem_getLastModifiedTime(JNIEnv *env, jobject this,
-                                                 jobject file)
-{
-    jlong rv = 0;
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-    /* Win95, Win98, WinME */
-    WIN32_FIND_DATA fd;
-    jlong temp = 0;
-    LARGE_INTEGER modTime;
-    HANDLE h = FindFirstFile(path, &fd);
-    if (h != INVALID_HANDLE_VALUE) {
-        FindClose(h);
-        modTime.LowPart = (DWORD) fd.ftLastWriteTime.dwLowDateTime;
-        modTime.HighPart = (LONG) fd.ftLastWriteTime.dwHighDateTime;
-        rv = modTime.QuadPart / 10000;
-        rv -= 11644473600000;
-    }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_io_Win32FileSystem_getLength(JNIEnv *env, jobject this,
-                                       jobject file)
-{
-    jlong rv = 0;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        struct _stati64 sb;
-        if (_stati64(path, &sb) == 0) {
-            rv = sb.st_size;
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-
-/* -- File operations -- */
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_createFileExclusively(JNIEnv *env, jclass cls,
-                                                   jstring pathname)
-{
-    jboolean rv = JNI_FALSE;
-    DWORD a;
-
-    WITH_PLATFORM_STRING(env, pathname, path) {
-        int orv;
-        int error;
-        JVM_NativePath((char *)path);
-        orv = JVM_Open(path, JVM_O_RDWR | JVM_O_CREAT | JVM_O_EXCL, 0666);
-        if (orv < 0) {
-            if (orv != JVM_EEXIST) {
-                error = GetLastError();
-
-                // If a directory by the named path already exists,
-                // return false (behavior of solaris and linux) instead of
-                // throwing an exception
-                a = GetFileAttributes(path);
-
-                if ((a == INVALID_FILE_ATTRIBUTES) ||
-                        !(a & FILE_ATTRIBUTE_DIRECTORY)) {
-                    SetLastError(error);
-                    JNU_ThrowIOExceptionWithLastError(env, path);
-                }
-            }
-        } else {
-            JVM_Close(orv);
-            rv = JNI_TRUE;
-        }
-    } END_PLATFORM_STRING(env, path);
-    return rv;
-}
-
-
-static int
-removeFileOrDirectory(const char *path) /* Returns 0 on success */
-{
-    DWORD a;
-
-    SetFileAttributes(path, 0);
-    a = GetFileAttributes(path);
-    if (a == INVALID_FILE_ATTRIBUTES) {
-        return 1;
-    } else if (a & FILE_ATTRIBUTE_DIRECTORY) {
-        return !RemoveDirectory(path);
-    } else {
-        return !DeleteFile(path);
-    }
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_delete0(JNIEnv *env, jobject this,
-                                     jobject file)
-{
-    jboolean rv = JNI_FALSE;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        if (removeFileOrDirectory(path) == 0) {
-            rv = JNI_TRUE;
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-
-/* ## Clean this up to use direct Win32 calls */
-
-JNIEXPORT jobjectArray JNICALL
-Java_java_io_Win32FileSystem_list(JNIEnv *env, jobject this,
-                                  jobject file)
-{
-    DIR *dir;
-    struct dirent *ptr;
-    int len, maxlen;
-    jobjectArray rv, old;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        dir = opendir(path);
-    } END_NATIVE_PATH(env, path);
-    if (dir == NULL) return NULL;
-
-    /* Allocate an initial String array */
-    len = 0;
-    maxlen = 16;
-    rv = (*env)->NewObjectArray(env, maxlen, JNU_ClassString(env), NULL);
-    if (rv == NULL) goto error;
-
-    /* Scan the directory */
-    while ((ptr = readdir(dir)) != NULL) {
-        jstring name;
-        if (!strcmp(ptr->d_name, ".") || !strcmp(ptr->d_name, ".."))
-            continue;
-        if (len == maxlen) {
-            old = rv;
-            rv = (*env)->NewObjectArray(env, maxlen <<= 1,
-                                        JNU_ClassString(env), NULL);
-            if (rv == NULL) goto error;
-            if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
-            (*env)->DeleteLocalRef(env, old);
-        }
-        name = JNU_NewStringPlatform(env, ptr->d_name);
-        if (name == NULL) goto error;
-        (*env)->SetObjectArrayElement(env, rv, len++, name);
-        (*env)->DeleteLocalRef(env, name);
-    }
-    closedir(dir);
-
-    /* Copy the final results into an appropriately-sized array */
-    old = rv;
-    rv = (*env)->NewObjectArray(env, len, JNU_ClassString(env), NULL);
-    if (rv == NULL) goto error;
-    if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
-    return rv;
-
- error:
-    closedir(dir);
-    return NULL;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_createDirectory(JNIEnv *env, jobject this,
-                                             jobject file)
-{
-    jboolean rv = JNI_FALSE;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        if (mkdir(path) == 0) {
-            rv = JNI_TRUE;
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_rename0(JNIEnv *env, jobject this,
-                                     jobject from, jobject to)
-{
-    jboolean rv = JNI_FALSE;
-
-    WITH_NATIVE_PATH(env, from, ids.path, fromPath) {
-        WITH_NATIVE_PATH(env, to, ids.path, toPath) {
-            if (rename(fromPath, toPath) == 0) {
-                rv = JNI_TRUE;
-            }
-        } END_NATIVE_PATH(env, toPath);
-    } END_NATIVE_PATH(env, fromPath);
-    return rv;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_setLastModifiedTime(JNIEnv *env, jobject this,
-                                                 jobject file, jlong time)
-{
-    jboolean rv = JNI_FALSE;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        HANDLE h;
-        h = CreateFile(path, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
-                       FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, 0);
-        if (h != INVALID_HANDLE_VALUE) {
-            LARGE_INTEGER modTime;
-            FILETIME t;
-            modTime.QuadPart = (time + 11644473600000L) * 10000L;
-            t.dwLowDateTime = (DWORD)modTime.LowPart;
-            t.dwHighDateTime = (DWORD)modTime.HighPart;
-            if (SetFileTime(h, NULL, NULL, &t)) {
-                rv = JNI_TRUE;
-            }
-            CloseHandle(h);
-        }
-    } END_NATIVE_PATH(env, path);
-
-    return rv;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_Win32FileSystem_setReadOnly(JNIEnv *env, jobject this,
-                                         jobject file)
-{
-    jboolean rv = JNI_FALSE;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        DWORD a;
-        a = GetFileAttributes(path);
-        if (a != INVALID_FILE_ATTRIBUTES) {
-            if (SetFileAttributes(path, a | FILE_ATTRIBUTE_READONLY))
-                rv = JNI_TRUE;
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
-
-
-/* -- Filesystem interface -- */
-
-
-JNIEXPORT jobject JNICALL
-Java_java_io_Win32FileSystem_getDriveDirectory(JNIEnv *env, jclass ignored,
-                                               jint drive)
-{
-    char buf[_MAX_PATH];
-    char *p = _getdcwd(drive, buf, sizeof(buf));
-    if (p == NULL) return NULL;
-    if (isalpha(*p) && (p[1] == ':')) p += 2;
-    return JNU_NewStringPlatform(env, p);
-}
-
-
-JNIEXPORT jint JNICALL
-Java_java_io_Win32FileSystem_listRoots0(JNIEnv *env, jclass ignored)
-{
-    return GetLogicalDrives();
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_io_Win32FileSystem_getSpace0(JNIEnv *env, jobject this,
-                                       jobject file, jint t)
-{
-    jlong rv = 0L;
-
-    WITH_NATIVE_PATH(env, file, ids.path, path) {
-        ULARGE_INTEGER totalSpace, freeSpace, usableSpace;
-        if (GetDiskFreeSpaceEx(path, &usableSpace, &totalSpace, &freeSpace)) {
-            switch(t) {
-            case java_io_FileSystem_SPACE_TOTAL:
-                rv = long_to_jlong(totalSpace.QuadPart);
-                break;
-            case java_io_FileSystem_SPACE_FREE:
-                rv = long_to_jlong(freeSpace.QuadPart);
-                break;
-            case java_io_FileSystem_SPACE_USABLE:
-                rv = long_to_jlong(usableSpace.QuadPart);
-                break;
-            default:
-                assert(0);
-            }
-        }
-    } END_NATIVE_PATH(env, path);
-    return rv;
-}
--- a/src/windows/native/java/io/WinNTFileSystem_md.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/windows/native/java/io/WinNTFileSystem_md.c	Tue Oct 23 09:41:52 2012 -0700
@@ -828,6 +828,12 @@
     return ret;
 }
 
+JNIEXPORT jint JNICALL
+Java_java_io_WinNTFileSystem_listRoots0(JNIEnv *env, jclass ignored)
+{
+    return GetLogicalDrives();
+}
+
 JNIEXPORT jlong JNICALL
 Java_java_io_WinNTFileSystem_getSpace0(JNIEnv *env, jobject this,
                                        jobject file, jint t)
--- a/src/windows/native/java/io/io_util_md.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/windows/native/java/io/io_util_md.c	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,22 +40,8 @@
 #include <limits.h>
 #include <wincon.h>
 
-extern jboolean onNT = JNI_FALSE;
-
 static DWORD MAX_INPUT_EVENTS = 2000;
 
-void
-initializeWindowsVersion() {
-    OSVERSIONINFO ver;
-    ver.dwOSVersionInfoSize = sizeof(ver);
-    GetVersionEx(&ver);
-    if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
-        onNT = JNI_TRUE;
-    } else {
-        onNT = JNI_FALSE;
-    }
-}
-
 /* If this returns NULL then an exception is pending */
 WCHAR*
 fileToNTPath(JNIEnv *env, jobject file, jfieldID id) {
@@ -247,27 +233,21 @@
     const DWORD flagsAndAttributes = maybeWriteThrough | maybeDeleteOnClose;
     HANDLE h = NULL;
 
-    if (onNT) {
-        WCHAR *pathbuf = pathToNTPath(env, path, JNI_TRUE);
-        if (pathbuf == NULL) {
-            /* Exception already pending */
-            return -1;
-        }
-        h = CreateFileW(
-            pathbuf,            /* Wide char path name */
-            access,             /* Read and/or write permission */
-            sharing,            /* File sharing flags */
-            NULL,               /* Security attributes */
-            disposition,        /* creation disposition */
-            flagsAndAttributes, /* flags and attributes */
-            NULL);
-        free(pathbuf);
-    } else {
-        WITH_PLATFORM_STRING(env, path, _ps) {
-            h = CreateFile(_ps, access, sharing, NULL, disposition,
-                           flagsAndAttributes, NULL);
-        } END_PLATFORM_STRING(env, _ps);
+    WCHAR *pathbuf = pathToNTPath(env, path, JNI_TRUE);
+    if (pathbuf == NULL) {
+        /* Exception already pending */
+        return -1;
     }
+    h = CreateFileW(
+        pathbuf,            /* Wide char path name */
+        access,             /* Read and/or write permission */
+        sharing,            /* File sharing flags */
+        NULL,               /* Security attributes */
+        disposition,        /* creation disposition */
+        flagsAndAttributes, /* flags and attributes */
+        NULL);
+    free(pathbuf);
+
     if (h == INVALID_HANDLE_VALUE) {
         int error = GetLastError();
         if (error == ERROR_TOO_MANY_OPEN_FILES) {
--- a/src/windows/native/java/lang/ProcessImpl_md.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/windows/native/java/lang/ProcessImpl_md.c	Tue Oct 23 09:41:52 2012 -0700
@@ -40,72 +40,6 @@
  */
 #define PIPE_SIZE (4096+24)
 
-char *
-extractExecutablePath(JNIEnv *env, char *source)
-{
-    char *p, *r;
-
-    /* If no spaces, then use entire thing */
-    if ((p = strchr(source, ' ')) == NULL)
-        return source;
-
-    /* If no quotes, or quotes after space, return up to space */
-    if (((r = strchr(source, '"')) == NULL) || (r > p)) {
-        *p = 0;
-        return source;
-    }
-
-    /* Quotes before space, return up to space after next quotes */
-    p = strchr(r, '"');
-    if ((p = strchr(p, ' ')) == NULL)
-        return source;
-    *p = 0;
-    return source;
-}
-
-DWORD
-selectProcessFlag(JNIEnv *env, jstring cmd0)
-{
-    char buf[MAX_PATH];
-    DWORD newFlag = 0;
-    char *exe, *p, *name;
-    unsigned char buffer[2];
-    long headerLoc = 0;
-    int fd = 0;
-
-    exe = (char *)JNU_GetStringPlatformChars(env, cmd0, 0);
-    exe = extractExecutablePath(env, exe);
-
-    if (exe != NULL) {
-        if ((p = strchr(exe, '\\')) == NULL) {
-            SearchPath(NULL, exe, ".exe", MAX_PATH, buf, &name);
-        } else {
-            p = strrchr(exe, '\\');
-            *p = 0;
-            p++;
-            SearchPath(exe, p, ".exe", MAX_PATH, buf, &name);
-        }
-    }
-
-    fd = _open(buf, _O_RDONLY);
-    if (fd > 0) {
-        _read(fd, buffer, 2);
-        if (buffer[0] == 'M' && buffer[1] == 'Z') {
-            _lseek(fd, 60L, SEEK_SET);
-            _read(fd, buffer, 2);
-            headerLoc = (long)buffer[1] << 8 | (long)buffer[0];
-            _lseek(fd, headerLoc, SEEK_SET);
-            _read(fd, buffer, 2);
-            if (buffer[0] == 'P' && buffer[1] == 'E') {
-                newFlag = DETACHED_PROCESS;
-            }
-        }
-        _close(fd);
-    }
-    JNU_ReleaseStringPlatformChars(env, cmd0, exe);
-    return newFlag;
-}
-
 static void
 win32Error(JNIEnv *env, const char *functionName)
 {
@@ -151,15 +85,8 @@
     const jchar*  penvBlock = NULL;
     jlong  *handles = NULL;
     jlong ret = 0;
-    OSVERSIONINFO ver;
-    jboolean onNT = JNI_FALSE;
     DWORD processFlag;
 
-    ver.dwOSVersionInfoSize = sizeof(ver);
-    GetVersionEx(&ver);
-    if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT)
-        onNT = JNI_TRUE;
-
     assert(cmd != NULL);
     pcmd = (*env)->GetStringChars(env, cmd, NULL);
     if (pcmd == NULL) goto Catch;
@@ -229,10 +156,7 @@
     }
     SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, TRUE);
 
-    if (onNT)
-        processFlag = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT;
-    else
-        processFlag = selectProcessFlag(env, cmd) | CREATE_UNICODE_ENVIRONMENT;
+    processFlag = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT;
     ret = CreateProcessW(0,                /* executable name */
                          (LPWSTR)pcmd,     /* command line */
                          0,                /* process security attribute */
--- a/src/windows/native/java/util/TimeZone_md.c	Tue Oct 23 09:40:06 2012 -0700
+++ b/src/windows/native/java/util/TimeZone_md.c	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +65,6 @@
 #define STANDARD_NAME           0
 #define STD_NAME                2
 
-static int isNT = FALSE;        /* TRUE if it is NT. */
-
 /*
  * Calls RegQueryValueEx() to get the value for the specified key. If
  * the platform is NT, 2000 or XP, it calls the Unicode
@@ -95,12 +93,10 @@
     int len;
 
     *typePtr = 0;
-    if (isNT) {
-        ret = RegQueryValueExW(hKey, (WCHAR *) keyNames[keyIndex], NULL,
-                               typePtr, buf, bufLengthPtr);
-        if (ret == ERROR_SUCCESS && *typePtr == REG_SZ) {
-            return ret;
-        }
+    ret = RegQueryValueExW(hKey, (WCHAR *) keyNames[keyIndex], NULL,
+                           typePtr, buf, bufLengthPtr);
+    if (ret == ERROR_SUCCESS && *typePtr == REG_SZ) {
+        return ret;
     }
 
     valSize = sizeof(val);
@@ -180,8 +176,7 @@
      */
     ver.dwOSVersionInfoSize = sizeof(ver);
     GetVersionEx(&ver);
-    isNT = ver.dwPlatformId == VER_PLATFORM_WIN32_NT;
-    isVista = isNT && ver.dwMajorVersion >= 6;
+    isVista = ver.dwMajorVersion >= 6;
 
     ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
                        KEY_READ, (PHKEY)&hKey);
--- a/test/Makefile	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/Makefile	Tue Oct 23 09:41:52 2012 -0700
@@ -477,25 +477,21 @@
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_lang
 JDK_DEFAULT_TARGETS += jdk_lang
-jdk_lang: $(call TestDirs, java/lang)
+jdk_lang: $(call TestDirs, java/lang sun/invoke sun/misc vm)
 	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
-JDK_ALL_TARGETS += jdk_management1
-jdk_management1: $(call TestDirs, javax/management)
+JDK_ALL_TARGETS += jdk_jmx
+jdk_jmx: $(call TestDirs, javax/management com/sun/jmx)
 	$(call RunOthervmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
-JDK_ALL_TARGETS += jdk_management2
-jdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
+JDK_ALL_TARGETS += jdk_management
+jdk_management: $(call TestDirs, com/sun/management sun/management)
 	$(call RunOthervmBatch)
 
-# All management tests
-jdk_management: jdk_management1 jdk_management2
-	@$(SummaryInfo)
-
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_math
 JDK_DEFAULT_TARGETS += jdk_math
@@ -503,52 +499,42 @@
 	$(call RunAgentvmBatch)
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_misc
-JDK_DEFAULT_TARGETS += jdk_misc
-jdk_misc: $(call TestDirs, \
-          demo/jvmti demo/zipfs javax/naming javax/script \
-          javax/smartcardio com/sun/jndi com/sun/xml \
-          com/sun/corba sun/misc)
+JDK_ALL_TARGETS += jdk_other
+JDK_DEFAULT_TARGETS += jdk_other
+jdk_other: $(call TestDirs, \
+          demo/jvmti demo/zipfs sample \
+          javax/naming com/sun/jndi \
+          javax/script \
+	  javax/sql \
+          javax/smartcardio \
+	  javax/xml/ws com/sun/internal/ws \
+	  jdk/asm \
+	  com/sun/org/apache/xerces \
+          com/sun/corba \
+	  com/sun/servicetag \
+	  com/sun/tracing \
+	  sun/usagetracker)
 	$(call RunAgentvmBatch)
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_net
 JDK_DEFAULT_TARGETS += jdk_net
-jdk_net: $(call TestDirs, com/sun/net java/net sun/net)
-	$(call RunAgentvmBatch)
-
-# Stable agentvm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_nio1
-JDK_DEFAULT_TARGETS += jdk_nio1
-jdk_nio1: $(call TestDirs, java/nio/file)
+jdk_net: $(call TestDirs, com/sun/net java/net sun/net com/oracle/net)
 	$(call RunAgentvmBatch)
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_nio2
-JDK_DEFAULT_TARGETS += jdk_nio2
-jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
-          java/nio/channels java/nio/MappedByteBuffer sun/nio/ch)
+jdk_nio: $(call TestDirs, java/nio sun/nio com/oracle/nio)
 	$(call SharedLibraryPermissions,java/nio/channels)
 	$(call RunAgentvmBatch)
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_nio3
-JDK_DEFAULT_TARGETS += jdk_nio3
-jdk_nio3: $(call TestDirs, java/nio/charset sun/nio/cs)
-	$(call RunAgentvmBatch)
-
-# All nio tests
-jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
-	@$(SummaryInfo)
-
-# Stable agentvm testruns (minus items from PROBLEM_LIST)
 jdk_sctp: $(call TestDirs, com/sun/nio/sctp)
 	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_rmi
-jdk_rmi: $(call TestDirs, java/rmi javax/rmi sun/rmi)
+jdk_rmi: $(call TestDirs, java/rmi sun/rmi javax/rmi/ssl)
 	$(call RunOthervmBatch)
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
@@ -566,7 +552,7 @@
 JDK_ALL_TARGETS += jdk_security3
 jdk_security3: $(call TestDirs, com/sun/security lib/security javax/security \
         sun/security com/sun/org/apache/xml/internal/security \
-        com/oracle/security/ucrypto)
+        com/oracle/security)
 	$(call SharedLibraryPermissions,sun/security)
 	$(call RunAgentvmBatch)
 
@@ -593,23 +579,17 @@
 	$(call RunAgentvmBatch)
 
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
-JDK_ALL_TARGETS += jdk_tools1
-jdk_tools1: $(call TestDirs, com/sun/jdi)
+JDK_ALL_TARGETS += jdk_jdi
+jdk_jdi: $(call TestDirs, com/sun/jdi)
 	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
-JDK_ALL_TARGETS += jdk_tools2
-jdk_tools2: $(call TestDirs, \
-            com/sun/tools sun/jvmstat sun/tools tools vm \
-            com/sun/servicetag com/sun/tracing)
+JDK_ALL_TARGETS += jdk_tools
+jdk_tools: $(call TestDirs, com/sun/tools sun/jvmstat sun/tools tools)
 	$(call SharedLibraryPermissions,tools/launcher)
 	$(call RunAgentvmBatch)
 
-# All tools tests
-jdk_tools: jdk_tools1 jdk_tools2
-	@$(SummaryInfo)
-
 # Stable othervm testruns (minus items from PROBLEM_LIST)
 #   Using agentvm has serious problems with these tests
 ifdef OPENJDK
--- a/test/ProblemList.txt	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/ProblemList.txt	Tue Oct 23 09:41:52 2012 -0700
@@ -147,6 +147,10 @@
 
 # jdk_management
 
+############################################################################
+
+# jdk_jmx
+
 # 6959636
 javax/management/loading/LibraryLoader/LibraryLoaderTest.java	windows-all
 
@@ -162,7 +166,7 @@
 
 ############################################################################
 
-# jdk_misc
+# jdk_other
 
 # 6988950
 demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java	generic-all
@@ -310,6 +314,9 @@
 sun/security/tools/keytool/selfissued.sh                        solaris-all
 sun/security/tools/keytool/standard.sh                          solaris-all
 
+# 8000439: NPG: REGRESSION : sun/security/krb5/auto/MaxRetries.java fails with timeout
+sun/security/krb5/auto/MaxRetries.java                          solaris-sparcv9
+
 ############################################################################
 
 # jdk_sound
@@ -324,6 +331,7 @@
 
 # 7196199
 java/text/Bidi/Bug6665028.java                                  generic-all
+
 ############################################################################
 
 # jdk_tools
@@ -331,6 +339,24 @@
 # 6461635
 com/sun/tools/attach/BasicTests.sh                              generic-all
 
+# 7172176
+sun/tools/jconsole/ResourceCheckTest.sh                         generic-all
+sun/tools/jconsole/ImmutableResourceTest.sh                     generic-all
+
+# 7132203
+sun/jvmstat/monitor/MonitoredVm/CR6672135.java                  generic-all
+
+# Tests take too long, see 7143279
+tools/pack200/CommandLineTests.java                             generic-all
+tools/pack200/Pack200Test.java                                  generic-all
+
+# 7150569
+tools/launcher/UnicodeTest.java                                 macosx-all
+
+############################################################################
+
+# jdk_jdi
+
 # Filed 6952105
 com/sun/jdi/SuspendThreadTest.java                              generic-all
 
@@ -346,20 +372,6 @@
 # Filed 6402201
 com/sun/jdi/ProcessAttachTest.sh                                generic-all
 
-# Filed 7172176
-sun/tools/jconsole/ResourceCheckTest.sh                         generic-all
-sun/tools/jconsole/ImmutableResourceTest.sh			generic-all
-
-# 7132203
-sun/jvmstat/monitor/MonitoredVm/CR6672135.java			generic-all
-
-# Tests take too long, see 7143279
-tools/pack200/CommandLineTests.java                         	generic-all
-tools/pack200/Pack200Test.java                              	generic-all
-
-# 7150569
-tools/launcher/UnicodeTest.java                                 macosx-all
-
 ############################################################################
 
 # jdk_util
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,177 @@
+/*
+ * 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 7094377 8000487 6176036 7056489
+ * @summary Timeout tests for ldap
+ */
+
+import java.net.Socket;
+import java.net.ServerSocket;
+import java.net.SocketTimeoutException;
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+public class LdapTimeoutTest {
+    private static final ScheduledExecutorService pool =
+        Executors.newScheduledThreadPool(1);
+    static volatile int passed = 0, failed = 0;
+    static void pass() {passed++;}
+    static void fail() {failed++; Thread.dumpStack();}
+
+    public static void main(String[] args) throws Exception {
+        ServerSocket serverSock = new ServerSocket(0);
+        Server s = new Server(serverSock);
+        s.start();
+        Thread.sleep(200);
+
+        Hashtable env = new Hashtable(11);
+        env.put(Context.INITIAL_CONTEXT_FACTORY,
+            "com.sun.jndi.ldap.LdapCtxFactory");
+        env.put(Context.PROVIDER_URL, "ldap://localhost:" +
+            serverSock.getLocalPort());
+
+        env.put(Context.SECURITY_AUTHENTICATION,"simple");
+
+        env.put(Context.SECURITY_PRINCIPAL, "user");
+        env.put(Context.SECURITY_CREDENTIALS, "password");
+
+        env.put("com.sun.jndi.ldap.connect.timeout", "10");
+        env.put("com.sun.jndi.ldap.read.timeout", "3000");
+
+        InitialContext ctx = null;
+        try {
+            new LdapTimeoutTest().ldapReadTimeoutTest(env, false);
+            new LdapTimeoutTest().ldapReadTimeoutTest(env, true);
+            new LdapTimeoutTest().simpleAuthConnectTest(env);
+        } finally {
+            s.interrupt();
+            LdapTimeoutTest.pool.shutdown();
+        }
+
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");
+    }
+
+    void ldapReadTimeoutTest(Hashtable env, boolean ssl) {
+        InitialContext ctx = null;
+        if (ssl) env.put(Context.SECURITY_PROTOCOL, "ssl");
+        ScheduledFuture killer = killSwitch();
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            SearchControls scl = new SearchControls();
+            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+            NamingEnumeration<SearchResult> answer = ((InitialDirContext)ctx)
+                .search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+            // shouldn't reach here
+            fail();
+        } catch (NamingException e) {
+            if (ssl) {
+                if (e.getCause() instanceof SocketTimeoutException) {
+                    pass();
+                } else if (e.getCause() instanceof InterruptedIOException) {
+                    Thread.interrupted();
+                    fail();
+                }
+            } else {
+                pass();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
+    void simpleAuthConnectTest(Hashtable env) {
+        InitialContext ctx = null;
+        ScheduledFuture killer = killSwitch();
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            // shouldn't reach here
+            System.err.println("Fail: InitialDirContext succeeded");
+            fail();
+        } catch (NamingException e) {
+            long end = System.nanoTime();
+            if (e.getCause() instanceof SocketTimeoutException) {
+                if (TimeUnit.NANOSECONDS.toMillis(end - start) < 2900) {
+                    pass();
+                } else {
+                    System.err.println("Fail: Waited too long");
+                    fail();
+                }
+            } else if (e.getCause() instanceof InterruptedIOException) {
+                Thread.interrupted();
+                fail();
+            } else {
+                fail();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
+    boolean shutItDown(ScheduledFuture killer, InitialContext ctx) {
+        killer.cancel(true);
+        try {
+            if (ctx != null) ctx.close();
+            return true;
+        } catch (NamingException ex) {
+            return false;
+        }
+    }
+
+    ScheduledFuture killSwitch() {
+        final Thread current = Thread.currentThread();
+        return LdapTimeoutTest.pool.schedule(new Callable<Void>() {
+            public Void call() throws Exception {
+                System.err.println("Fail: killSwitch()");
+                current.interrupt();
+                return null;
+            }
+        }, 5000, TimeUnit.MILLISECONDS);
+    }
+
+    static class Server extends Thread {
+        final ServerSocket serverSock;
+
+        Server(ServerSocket serverSock) {
+            this.serverSock = serverSock;
+        }
+
+        public void run() {
+            try {
+                Socket socket = serverSock.accept();
+            } catch (IOException e) {}
+        }
+    }
+}
+
--- a/test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * 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 7094377
- * @summary Com.sun.jndi.ldap.read.timeout doesn't work with ldaps.
- */
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.*;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-public class LdapsReadTimeoutTest {
-
-    public static void main(String[] args) throws Exception {
-        boolean passed = false;
-
-        // create the server
-        try (Server server = Server.create()) {
-            // Set up the environment for creating the initial context
-            Hashtable<String,Object> env = new Hashtable<>(11);
-            env.put(Context.INITIAL_CONTEXT_FACTORY,
-                "com.sun.jndi.ldap.LdapCtxFactory");
-            env.put("com.sun.jndi.ldap.connect.timeout", "1000");
-            env.put("com.sun.jndi.ldap.read.timeout", "1000");
-            env.put(Context.PROVIDER_URL, "ldaps://localhost:" + server.port());
-
-
-            // Create initial context
-            DirContext ctx = new InitialDirContext(env);
-            try {
-                System.out.println("LDAP Client: Connected to the Server");
-
-                SearchControls scl = new SearchControls();
-                scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
-                System.out.println("Performing Search");
-                NamingEnumeration<SearchResult> answer =
-                    ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
-            } finally {
-                // Close the context when we're done
-                ctx.close();
-            }
-        } catch (NamingException e) {
-            passed = true;
-            e.printStackTrace();
-        }
-
-        if (!passed) {
-            throw new Exception("Read timeout test failed," +
-                         " read timeout exception not thrown");
-        }
-        System.out.println("The test PASSED");
-    }
-
-    static class Server implements Runnable, Closeable {
-        private final ServerSocket ss;
-        private Socket sref;
-
-        private Server(ServerSocket ss) {
-            this.ss = ss;
-        }
-
-        static Server create() throws IOException {
-            Server server = new Server(new ServerSocket(0));
-            new Thread(server).start();
-            return server;
-        }
-
-        int port() {
-            return ss.getLocalPort();
-        }
-
-        public void run() {
-            try (Socket s = ss.accept()) {
-                sref = s;
-                System.out.println("Server: Connection accepted");
-                BufferedInputStream bis =
-                    new BufferedInputStream(s.getInputStream());
-                byte[] buf = new byte[100];
-                int n;
-                do {
-                    n = bis.read(buf);
-                } while (n > 0);
-            } catch (IOException e) {
-                // ignore
-            }
-        }
-
-        public void close() throws IOException {
-            ss.close();
-            sref.close();
-        }
-    }
-}
--- a/test/com/sun/jndi/ldap/ReadTimeoutTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * 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 6176036 7056489
- * @summary Read-timeout specification for LDAP operations
- */
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.*;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-public class ReadTimeoutTest {
-
-    public static void main(String[] args) throws Exception {
-        boolean passed = false;
-
-        // create the server
-        try (Server server = Server.create()) {
-            // Set up the environment for creating the initial context
-            Hashtable<String,Object> env = new Hashtable<>(11);
-            env.put(Context.INITIAL_CONTEXT_FACTORY,
-                "com.sun.jndi.ldap.LdapCtxFactory");
-            env.put("com.sun.jndi.ldap.read.timeout", "1000");
-            env.put(Context.PROVIDER_URL, "ldap://localhost:" + server.port());
-
-
-            // Create initial context
-            DirContext ctx = new InitialDirContext(env);
-            try {
-                System.out.println("LDAP Client: Connected to the Server");
-
-                SearchControls scl = new SearchControls();
-                scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
-                System.out.println("Performing Search");
-                NamingEnumeration<SearchResult> answer =
-                    ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
-            } finally {
-                // Close the context when we're done
-                ctx.close();
-            }
-        } catch (NamingException e) {
-            passed = true;
-            e.printStackTrace();
-        }
-
-        if (!passed) {
-            throw new Exception("Read timeout test failed," +
-                         " read timeout exception not thrown");
-        }
-        System.out.println("The test PASSED");
-    }
-
-    static class Server implements Runnable, Closeable {
-        private final ServerSocket ss;
-
-        private Server(ServerSocket ss) {
-            this.ss = ss;
-        }
-
-        static Server create() throws IOException {
-            Server server = new Server(new ServerSocket(0));
-            new Thread(server).start();
-            return server;
-        }
-
-        int port() {
-            return ss.getLocalPort();
-        }
-
-        public void run() {
-            try (Socket s = ss.accept()) {
-                System.out.println("Server: Connection accepted");
-                BufferedInputStream bis = new BufferedInputStream(s.getInputStream());
-                byte[] buf = new byte[100];
-                int n;
-                do {
-                    n = bis.read(buf);
-                } while (n > 0);
-            } catch (IOException e) {
-                // ignore
-            }
-        }
-
-        public void close() throws IOException {
-            ss.close();
-        }
-    }
-}
--- a/test/java/io/pathNames/win32/bug6344646.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/io/pathNames/win32/bug6344646.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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 6344646
- * @summary tests that Win32FileSystem.hashCode() uses
+ * @summary tests that WinNTFileSystem.hashCode() uses
  *    locale independent case mapping.
  */
 
--- a/test/java/lang/ProcessBuilder/Basic.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/lang/ProcessBuilder/Basic.java	Tue Oct 23 09:41:52 2012 -0700
@@ -36,10 +36,12 @@
 import static java.lang.ProcessBuilder.Redirect.*;
 
 import java.io.*;
+import java.lang.reflect.Field;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.security.*;
+import sun.misc.Unsafe;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 import static java.lang.System.getenv;
@@ -1938,17 +1940,21 @@
                 final byte[] bytes = new byte[10];
                 final Process p = new ProcessBuilder(childArgs).start();
                 final CountDownLatch latch = new CountDownLatch(1);
+                final InputStream s;
+                switch (action & 0x1) {
+                    case 0: s = p.getInputStream(); break;
+                    case 1: s = p.getErrorStream(); break;
+                    default: throw new Error();
+                }
                 final Thread thread = new Thread() {
                     public void run() {
                         try {
+                            int r;
                             latch.countDown();
-                            int r;
-                            switch (action) {
-                            case 0: r = p.getInputStream().read(); break;
-                            case 1: r = p.getErrorStream().read(); break;
-                            case 2: r = p.getInputStream().read(bytes); break;
-                            case 3: r = p.getErrorStream().read(bytes); break;
-                            default: throw new Error();
+                            switch (action & 0x2) {
+                                case 0: r = s.read(); break;
+                                case 2: r = s.read(bytes); break;
+                                default: throw new Error();
                             }
                             equal(-1, r);
                         } catch (Throwable t) { unexpected(t); }}};
@@ -1956,6 +1962,40 @@
                 thread.start();
                 latch.await();
                 Thread.sleep(10);
+
+                String os = System.getProperty("os.name");
+                if (os.equalsIgnoreCase("Solaris") ||
+                    os.equalsIgnoreCase("SunOS"))
+                {
+                    final Object deferred;
+                    Class<?> c = s.getClass();
+                    if (c.getName().equals(
+                        "java.lang.UNIXProcess$DeferredCloseInputStream"))
+                    {
+                        deferred = s;
+                    } else {
+                        Field deferredField = p.getClass().
+                            getDeclaredField("stdout_inner_stream");
+                        deferredField.setAccessible(true);
+                        deferred = deferredField.get(p);
+                    }
+                    Field useCountField = deferred.getClass().
+                        getDeclaredField("useCount");
+                    useCountField.setAccessible(true);
+
+                    while (useCountField.getInt(deferred) <= 0) {
+                        Thread.yield();
+                    }
+                } else if (s instanceof BufferedInputStream) {
+                    Field f = Unsafe.class.getDeclaredField("theUnsafe");
+                    f.setAccessible(true);
+                    Unsafe unsafe = (Unsafe)f.get(null);
+
+                    while (unsafe.tryMonitorEnter(s)) {
+                        unsafe.monitorExit(s);
+                        Thread.sleep(1);
+                    }
+                }
                 p.destroy();
                 thread.join();
             }
--- a/test/java/lang/ref/Basic.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/lang/ref/Basic.java	Tue Oct 23 09:41:52 2012 -0700
@@ -105,6 +105,7 @@
             System.err.println("GC " + i);
             Thread.sleep(10);
             System.gc();
+            System.runFinalization();
 
             showReferences();
             while ((r = q2.poll()) != null) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/Socket/SocketGrowth.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 7181793
+ * @summary getOutputStream create streams that cannot be GC'ed until Socket is closed
+ * @run main/othervm -Xmx32m SocketGrowth
+ */
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+public class SocketGrowth {
+
+    public static void main(String[] args) throws IOException {
+
+        try (ServerSocket ss = new ServerSocket(0)) {
+            try (Socket s = new Socket("localhost", ss.getLocalPort());
+                    Socket peer = ss.accept()) {
+                for (int i=0; i<1000000; i++) {
+                    // buggy JDK will run out of memory in this loop
+                    s.getOutputStream();
+                    // test InputStream also while we're here
+                    s.getInputStream();
+                    if (i % 100000 == 0) System.out.println(i);
+                }
+            }
+        }
+    }
+}
--- a/test/java/util/Locale/LocaleProviders.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/Locale/LocaleProviders.java	Tue Oct 23 09:41:52 2012 -0700
@@ -47,6 +47,10 @@
                 bug7198834Test();
                 break;
 
+            case "tzNameTest":
+                tzNameTest(args[1]);
+                break;
+
             default:
                 throw new RuntimeException("Test method '"+methodName+"' not found.");
         }
@@ -81,4 +85,12 @@
             System.out.println("Windows HOST locale adapter not found. Ignoring this test.");
         }
     }
+
+    static void tzNameTest(String id) {
+        TimeZone tz = TimeZone.getTimeZone(id);
+        String tzName = tz.getDisplayName(false, TimeZone.SHORT, Locale.US);
+        if (tzName.startsWith("GMT")) {
+            throw new RuntimeException("JRE's localized time zone name for "+id+" could not be retrieved. Returned name was: "+tzName);
+        }
+    }
 }
--- a/test/java/util/Locale/LocaleProviders.sh	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/Locale/LocaleProviders.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -23,7 +23,7 @@
 #!/bin/sh
 #
 # @test
-# @bug 6336885 7196799 7197573 7198834
+# @bug 6336885 7196799 7197573 7198834 8000245 8000615
 # @summary tests for "java.locale.providers" system property
 # @compile -XDignore.symbol.file LocaleProviders.java
 # @run shell/timeout=600 LocaleProviders.sh
@@ -65,6 +65,36 @@
     ;;
 esac
 
+# create an SPI implementation
+mk() {
+  d=`dirname $1`
+  if [ ! -d $d ]; then mkdir -p $d; fi
+  cat - >$1
+}
+
+SPIDIR=${TESTCLASSES}${FS}spi
+rm -rf ${SPIDIR}
+mk ${SPIDIR}${FS}src${FS}tznp.java << EOF
+import java.util.spi.TimeZoneNameProvider;
+import java.util.Locale;
+
+public class tznp extends TimeZoneNameProvider {
+    public String getDisplayName(String ID, boolean daylight, int style, Locale locale) {
+        return "tznp";
+    }
+
+    public Locale[] getAvailableLocales() {
+        Locale[] locales = {Locale.GERMAN, Locale.US, Locale.JAPANESE, Locale.CHINESE};
+        return locales;
+    }
+}
+EOF
+mk ${SPIDIR}${FS}dest${FS}META-INF${FS}services${FS}java.util.spi.TimeZoneNameProvider << EOF
+tznp
+EOF
+${TESTJAVA}${FS}bin${FS}javac -d ${SPIDIR}${FS}dest ${SPIDIR}${FS}src${FS}tznp.java
+${TESTJAVA}${FS}bin${FS}jar cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
+
 # get the platform default locales
 PLATDEF=`${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
 DEFLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
@@ -199,4 +229,20 @@
 PARAM3=
 runTest
 
+# testing 8000245 fix.
+METHODNAME=tzNameTest
+PREFLIST="JRE -Djava.ext.dirs=${SPIDIR}"
+PARAM1=Europe/Moscow
+PARAM2=
+PARAM3=
+runTest
+
+# testing 8000615 fix.
+METHODNAME=tzNameTest
+PREFLIST="JRE -Djava.ext.dirs=${SPIDIR}"
+PARAM1=America/Los_Angeles
+PARAM2=
+PARAM3=
+runTest
+
 exit $result
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Map/EntryHashCode.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 8000955
+ * @summary Map.Entry implementations need to comply with Map.Entry.hashCode() defined behaviour.
+ * @author ngmr
+ */
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
+
+public class EntryHashCode {
+    private static final int TEST_SIZE = 100;
+
+    static final Object[][] entryData = {
+        new Object[TEST_SIZE],
+        new Object[TEST_SIZE]
+    };
+
+    @SuppressWarnings("unchecked")
+    static final Map<Object,Object>[] maps = (Map<Object,Object>[])new Map[] {
+        new HashMap<>(),
+        new Hashtable<>(),
+        new IdentityHashMap<>(),
+        new LinkedHashMap<>(),
+        new TreeMap<>(),
+        new WeakHashMap<>(),
+        new ConcurrentHashMap<>(),
+        new ConcurrentSkipListMap<>()
+    };
+
+    static {
+        for (int i = 0; i < entryData[0].length; i++) {
+            // key objects need to be Comparable for use in TreeMap
+            entryData[0][i] = new Comparable<Object>() {
+                public int compareTo(Object o) {
+                    return (hashCode() - o.hashCode());
+                }
+            };
+            entryData[1][i] = new Object();
+        }
+    }
+
+    private static void addTestData(Map<Object,Object> map) {
+        for (int i = 0; i < entryData[0].length; i++) {
+            map.put(entryData[0][i], entryData[1][i]);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Exception failure = null;
+        for (Map<Object,Object> map: maps) {
+            addTestData(map);
+
+            try {
+                for (Map.Entry<Object,Object> e: map.entrySet()) {
+                    Object key = e.getKey();
+                    Object value = e.getValue();
+                    int expectedEntryHashCode =
+                        (Objects.hashCode(key) ^ Objects.hashCode(value));
+
+                    if (e.hashCode() != expectedEntryHashCode) {
+                        throw new Exception("FAILURE: " +
+                                e.getClass().getName() +
+                                ".hashCode() does not conform to defined" +
+                                " behaviour of java.util.Map.Entry.hashCode()");
+                    }
+                }
+            } catch (Exception e) {
+                if (failure == null) {
+                    failure = e;
+                } else {
+                    failure.addSuppressed(e);
+                }
+            } finally {
+                map.clear();
+            }
+        }
+        if (failure != null) {
+            throw failure;
+        }
+    }
+}
--- a/test/java/util/PluggableLocale/CurrencyNameProviderTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/CurrencyNameProviderTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -50,12 +50,13 @@
         com.bar.CurrencyNameProviderImpl cnp = new com.bar.CurrencyNameProviderImpl();
         Locale[] availloc = Locale.getAvailableLocales();
         Locale[] testloc = availloc.clone();
+        List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getCurrencyNameProvider().getAvailableLocales());
         List<Locale> providerloc = Arrays.asList(cnp.getAvailableLocales());
 
         for (Locale target: availloc) {
             // pure JRE implementation
             OpenListResourceBundle rb = (OpenListResourceBundle)LocaleProviderAdapter.forJRE().getLocaleData().getCurrencyNames(target);
-            boolean jreHasBundle = rb.getLocale().equals(target);
+            boolean jreSupportsTarget = jreimplloc.contains(target);
 
             for (Locale test: testloc) {
                 // get a Currency instance
@@ -82,27 +83,24 @@
                     providersname = cnp.getDisplayName(c.getCurrencyCode(), target);
                 }
 
-                // JRE's name (if any)
+                // JRE's name
                 String jrescurrency = null;
                 String jresname = null;
                 String key = c.getCurrencyCode();
                 String nameKey = key.toLowerCase(Locale.ROOT);
-                if (jreHasBundle) {
+                if (jreSupportsTarget) {
                     try {
                         jrescurrency = rb.getString(key);
-                    } catch (MissingResourceException mre) {
-                        // JRE does not have any resource, "jrescurrency" should remain null
-                    }
+                    } catch (MissingResourceException mre) {}
                     try {
                         jresname = rb.getString(nameKey);
-                    } catch (MissingResourceException mre) {
-                        // JRE does not have any resource, "jresname" should remain null
-                    }
+                    } catch (MissingResourceException mre) {}
                 }
 
-                checkValidity(target, jrescurrency, providerscurrency, currencyresult, jrescurrency!=null);
+                checkValidity(target, jrescurrency, providerscurrency, currencyresult,
+                              jreSupportsTarget && jrescurrency != null);
                 checkValidity(target, jresname, providersname, nameresult,
-                              jreHasBundle && rb.handleGetKeys().contains(nameKey));
+                              jreSupportsTarget && jresname != null);
             }
         }
     }
--- a/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -44,6 +44,7 @@
     DateFormatSymbolsProviderTest() {
         availableLocalesTest();
         objectValidityTest();
+        hashCodeTest();
     }
 
     void availableLocalesTest() {
@@ -124,4 +125,17 @@
             }
         }
     }
+
+    // Bug 7200341.
+    void hashCodeTest() {
+        for (Locale target: availloc) {
+            // look for provider's object
+            DateFormatSymbols dfs = DateFormatSymbols.getInstance(target);
+            if (dfs.getClass().getSimpleName().equals("FooDateFormatSymbols")) {
+                // call its hashCode(). success if no ArrayIndexOutOfBoundsException is thrown.
+                dfs.hashCode();
+                break;
+            }
+        }
+    }
 }
--- a/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.sh	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -23,6 +23,6 @@
 #!/bin/sh
 #
 # @test
-# @bug 4052440
+# @bug 4052440 7200341
 # @summary DateFormatSymbolsProvider tests
 # @run shell ExecTest.sh foo DateFormatSymbolsProviderTest true
--- a/test/java/util/PluggableLocale/LocaleNameProviderTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/LocaleNameProviderTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -36,15 +36,21 @@
     }
 
     LocaleNameProviderTest() {
+        checkAvailLocValidityTest();
+        variantFallbackTest();
+    }
+
+    void checkAvailLocValidityTest() {
         com.bar.LocaleNameProviderImpl lnp = new com.bar.LocaleNameProviderImpl();
         Locale[] availloc = Locale.getAvailableLocales();
         Locale[] testloc = availloc.clone();
+        List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getLocaleNameProvider().getAvailableLocales());
         List<Locale> providerloc = Arrays.asList(lnp.getAvailableLocales());
 
         for (Locale target: availloc) {
             // pure JRE implementation
             OpenListResourceBundle rb = LocaleProviderAdapter.forJRE().getLocaleData().getLocaleNames(target);
-            boolean jreHasBundle = rb.getLocale().equals(target);
+            boolean jreSupportsTarget = jreimplloc.contains(target);
 
             for (Locale test: testloc) {
                 // codes
@@ -67,7 +73,7 @@
                     providersvrnt = lnp.getDisplayVariant(vrnt, target);
                 }
 
-                // JRE's name (if any)
+                // JRE's name
                 String jreslang = null;
                 String jresctry = null;
                 String jresvrnt = null;
@@ -84,18 +90,41 @@
                 if (!vrnt.equals("")) {
                     try {
                         jresvrnt = rb.getString("%%"+vrnt);
-                    } catch (MissingResourceException mre) {
-                        jresvrnt = vrnt;
-                    }
+                    } catch (MissingResourceException mre) {}
                 }
 
+                System.out.print("For key: "+lang+" ");
                 checkValidity(target, jreslang, providerslang, langresult,
-                    jreHasBundle && rb.handleGetKeys().contains(lang));
+                    jreSupportsTarget && jreslang != null);
+                System.out.print("For key: "+ctry+" ");
                 checkValidity(target, jresctry, providersctry, ctryresult,
-                    jreHasBundle && rb.handleGetKeys().contains(ctry));
+                    jreSupportsTarget && jresctry != null);
+                System.out.print("For key: "+vrnt+" ");
                 checkValidity(target, jresvrnt, providersvrnt, vrntresult,
-                    jreHasBundle && rb.handleGetKeys().contains("%%"+vrnt));
+                    jreSupportsTarget && jresvrnt != null);
             }
         }
     }
+
+    void variantFallbackTest() {
+        Locale YY = new Locale("yy", "YY", "YYYY");
+        Locale YY_suffix = new Locale("yy", "YY", "YYYY_suffix");
+        String retVrnt = null;
+        String message = "variantFallbackTest() succeeded.";
+
+
+        try {
+            YY.getDisplayVariant(YY_suffix);
+            message = "variantFallbackTest() failed. Either provider wasn't invoked, or invoked without suffix.";
+        } catch (RuntimeException re) {
+            retVrnt = re.getMessage();
+            if (YY_suffix.getVariant().equals(retVrnt)) {
+                System.out.println(message);
+                return;
 }
+            message = "variantFallbackTest() failed. Returned variant: "+retVrnt;
+        }
+
+        throw new RuntimeException(message);
+    }
+}
--- a/test/java/util/PluggableLocale/LocaleNameProviderTest.sh	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/LocaleNameProviderTest.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -23,6 +23,6 @@
 #!/bin/sh
 #
 # @test
-# @bug 4052440
+# @bug 4052440 8000273
 # @summary LocaleNameProvider tests
 # @run shell ExecTest.sh bar LocaleNameProviderTest true
--- a/test/java/util/PluggableLocale/ProviderTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/ProviderTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -42,5 +42,7 @@
                     "result do not match with provider's result. target: "+target+" result: "+result+" providers: "+providers);
             }
         }
+
+        System.out.println("checkValidity succeeded. target: "+target+" result: "+result+" jre's: "+jres+" providers: "+providers+" jre-preferred: "+jresPreferred);
     }
 }
--- a/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -45,13 +45,14 @@
 
     void test1() {
         Locale[] available = Locale.getAvailableLocales();
+        List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getTimeZoneNameProvider().getAvailableLocales());
         List<Locale> providerLocales = Arrays.asList(tznp.getAvailableLocales());
         String[] ids = TimeZone.getAvailableIDs();
 
         for (Locale target: available) {
             // pure JRE implementation
             OpenListResourceBundle rb = LocaleProviderAdapter.forJRE().getLocaleData().getTimeZoneNames(target);
-            boolean jreHasBundle = rb.getLocale().equals(target);
+            boolean jreSupportsTarget = jreimplloc.contains(target);
 
             for (String id: ids) {
                 // the time zone
@@ -59,7 +60,7 @@
 
                 // JRE string array for the id
                 String[] jrearray = null;
-                if (jreHasBundle) {
+                if (jreSupportsTarget) {
                     try {
                         jrearray = rb.getStringArray(id);
                     } catch (MissingResourceException mre) {}
@@ -75,14 +76,14 @@
                         providersname = tznp.getDisplayName(id, i>=3, i%2, target);
                     }
 
-                    // JRE's name (if any)
+                    // JRE's name
                     String jresname = null;
                     if (jrearray != null) {
                         jresname = jrearray[i];
                     }
 
                     checkValidity(target, jresname, providersname, name,
-                        jreHasBundle && rb.handleGetKeys().contains(id));
+                        jreSupportsTarget && jresname != null);
                 }
             }
         }
Binary file test/java/util/PluggableLocale/barprovider.jar has changed
Binary file test/java/util/PluggableLocale/fooprovider.jar has changed
--- a/test/java/util/PluggableLocale/providersrc/DateFormatSymbolsProviderImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/providersrc/DateFormatSymbolsProviderImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -221,5 +221,10 @@
         public void setAmPmStrings(String[] newAmpms) {
             ampms = newAmpms;
         }
+
+        @Override
+        public String[][] getZoneStrings() {
+            return new String[0][0];
+        }
     }
 }
--- a/test/java/util/PluggableLocale/providersrc/LocaleNameProviderImpl.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/PluggableLocale/providersrc/LocaleNameProviderImpl.java	Tue Oct 23 09:41:52 2012 -0700
@@ -37,57 +37,64 @@
                              Locale.JAPAN,
                              new Locale("ja", "JP", "osaka"),
                              new Locale("ja", "JP", "kyoto"),
-                             new Locale("xx")};
+                             new Locale("xx"),
+                             new Locale("yy", "YY", "YYYY")};
     static List<Locale> availList = Arrays.asList(avail);
     public Locale[] getAvailableLocales() {
         return avail;
     }
 
+    @Override
     public String getDisplayLanguage(String lang, Locale target) {
+        return getDisplayString(lang, target);
+    }
+
+    @Override
+    public String getDisplayCountry(String ctry, Locale target) {
+        return getDisplayString(ctry, target);
+    }
+
+    @Override
+    public String getDisplayVariant(String vrnt, Locale target) {
+        return getDisplayString(vrnt, target);
+    }
+
+    private String getDisplayString(String key, Locale target) {
         if (!Utils.supportsLocale(availList, target)) {
             throw new IllegalArgumentException("locale is not supported: "+target);
         }
 
         String ret = null;
 
+        if (target.getLanguage().equals("yy") &&
+            target.getCountry().equals("YY")) {
+            String vrnt = target.getVariant();
+            if (vrnt.startsWith("YYYY")) {
+                switch (key) {
+                    case "yy":
+                    case "YY":
+                        ret = "waiwai";
+                        break;
+
+                    case "YYYY":
+                        if (vrnt.equals("YYYY_suffix")) {
+                            // for LocaleNameProviderTest.variantFallbackTest()
+                            throw new RuntimeException(vrnt);
+                        } else {
+                            ret = "waiwai";
+                        }
+                        break;
+                }
+            }
+        } else {
+            // resource bundle based (allows fallback)
         try {
             ResourceBundle rb = ResourceBundle.getBundle("com.bar.LocaleNames", target);
-            ret = rb.getString(lang);
+                ret = rb.getString(key);
         } catch (MissingResourceException mre) {
         }
+        }
 
         return ret;
     }
-
-    public String getDisplayCountry(String ctry, Locale target) {
-        if (!Utils.supportsLocale(availList, target)) {
-            throw new IllegalArgumentException("locale is not supported: "+target);
         }
-
-        String ret = null;
-
-        try {
-            ResourceBundle rb = ResourceBundle.getBundle("LocaleNames", target);
-            ret = rb.getString(ctry);
-        } catch (MissingResourceException mre) {
-        }
-
-        return ret;
-    }
-
-    public String getDisplayVariant(String vrnt, Locale target) {
-        if (!Utils.supportsLocale(availList, target)) {
-            throw new IllegalArgumentException("locale is not supported: "+target);
-        }
-
-        String ret = null;
-
-        try {
-            ResourceBundle rb = ResourceBundle.getBundle("LocaleNames", target);
-            ret = rb.getString(vrnt);
-        } catch (MissingResourceException mre) {
-        }
-
-        return ret;
-    }
-}
--- a/test/java/util/Properties/LoadAndStoreXML.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/Properties/LoadAndStoreXML.java	Tue Oct 23 09:41:52 2012 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8000354
+ * @bug 8000354 8000685
  * @summary Basic test of storeToXML and loadToXML
  */
 
@@ -66,13 +66,13 @@
      * Sanity test that properties saved with Properties#storeToXML can be
      * read with Properties#loadFromXML.
      */
-    static void test() throws IOException {
+    static void testLoadAndStore(String encoding) throws IOException {
         Properties props = new Properties();
         props.put("k1", "foo");
         props.put("k2", "bar");
 
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        props.storeToXML(out, "no comment");
+        props.storeToXML(out, null, encoding);
 
         Properties p = new Properties();
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
@@ -85,19 +85,74 @@
         }
     }
 
+    /**
+     * Test loadFromXML with a document that does not have an encoding declaration
+     */
+    static void testLoadWithoutEncoding() throws IOException {
+        Properties expected = new Properties();
+        expected.put("foo", "bar");
+
+        String s = "<?xml version=\"1.0\"?>" +
+                   "<!DOCTYPE properties SYSTEM \"http://java.sun.com/dtd/properties.dtd\">" +
+                   "<properties>" +
+                   "<entry key=\"foo\">bar</entry>" +
+                   "</properties>";
+        ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes("UTF-8"));
+        Properties props = new Properties();
+        props.loadFromXML(in);
+
+        if (!props.equals(expected)) {
+            System.err.println("loaded: " + props + ", expected: " + expected);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+     /**
+      * Test loadFromXML with unsupported encoding
+      */
+     static void testLoadWithBadEncoding() throws IOException {
+        String s = "<?xml version=\"1.0\" encoding=\"BAD\"?>" +
+                   "<!DOCTYPE properties SYSTEM \"http://java.sun.com/dtd/properties.dtd\">" +
+                   "<properties>" +
+                   "<entry key=\"foo\">bar</entry>" +
+                   "</properties>";
+        ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes("UTF-8"));
+        Properties props = new Properties();
+        try {
+            props.loadFromXML(in);
+            throw new RuntimeException("UnsupportedEncodingException expected");
+        } catch (UnsupportedEncodingException expected) { }
+    }
+
+    /**
+     * Test storeToXML with unsupported encoding
+     */
+    static void testStoreWithBadEncoding() throws IOException {
+        Properties props = new Properties();
+        props.put("foo", "bar");
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try {
+            props.storeToXML(out, null, "BAD");
+            throw new RuntimeException("UnsupportedEncodingException expected");
+        } catch (UnsupportedEncodingException expected) { }
+    }
+
     public static void main(String[] args) throws IOException {
 
-        // run test without security manager
-        test();
+        testLoadAndStore("UTF-8");
+        testLoadAndStore("UTF-16");
+        testLoadWithoutEncoding();
+        testLoadWithBadEncoding();
+        testStoreWithBadEncoding();
 
-        // re-run test with security manager
+        // re-run sanity test with security manager
         Policy orig = Policy.getPolicy();
         Policy p = new SimplePolicy(new RuntimePermission("setSecurityManager"),
                                     new PropertyPermission("line.separator", "read"));
         Policy.setPolicy(p);
         System.setSecurityManager(new SecurityManager());
         try {
-            test();
+            testLoadAndStore("UTF-8");
         } finally {
             // turn off security manager and restore policy
             System.setSecurityManager(null);
--- a/test/java/util/ServiceLoader/Basic.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/ServiceLoader/Basic.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,10 +44,41 @@
                                                      eq, s1, s2));
     }
 
-    public static void main(String[] args) {
+    static abstract class TestLoader {
+        String name;
+
+        TestLoader(String name) { this.name = name; }
+
+        abstract ServiceLoader<FooService> load();
+    }
+
+    static TestLoader tcclLoader = new TestLoader("Thread context class loader") {
+        ServiceLoader<FooService> load() {
+            return ServiceLoader.load(FooService.class);
+        }
+    };
 
-        ServiceLoader<FooService> sl = ServiceLoader.load(FooService.class);
-        out.format("%s%n", sl);
+    static TestLoader systemClLoader = new TestLoader("System class loader") {
+        ServiceLoader<FooService> load() {
+            return ServiceLoader.load(FooService.class, ClassLoader.getSystemClassLoader());
+        }
+    };
+
+    static TestLoader nullClLoader = new TestLoader("null (defer to system class loader)") {
+        ServiceLoader<FooService> load() {
+            return ServiceLoader.load(FooService.class, null);
+        }
+    };
+
+    public static void main(String[] args) {
+        for (TestLoader tl : Arrays.asList(tcclLoader, systemClLoader, nullClLoader)) {
+            test(tl);
+        }
+    }
+
+    static void test(TestLoader tl) {
+        ServiceLoader<FooService> sl = tl.load();
+        out.format("%s: %s%n", tl.name, sl);
 
         // Providers are cached
         Set<FooService> ps = setOf(sl);
@@ -58,5 +89,4 @@
         checkEquals(ps, setOf(sl), false);
 
     }
-
 }
--- a/test/java/util/ServiceLoader/basic.sh	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/ServiceLoader/basic.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -22,7 +22,7 @@
 #
 
 # @test
-# @bug 4640520 6354623
+# @bug 4640520 6354623 7198496
 # @summary Unit test for java.util.ServiceLoader
 #
 # @build Basic Load FooService FooProvider1 FooProvider2 FooProvider3
--- a/test/java/util/logging/LoggingMXBeanTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/logging/LoggingMXBeanTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
     ObjectName objectName = null;
     static String LOGGER_NAME_1 = "com.sun.management.Logger1";
     static String LOGGER_NAME_2 = "com.sun.management.Logger2";
+    static Logger logger1;
+    static Logger logger2;
 
     public LoggingMXBeanTest() throws Exception {
 
@@ -131,8 +133,8 @@
         System.out.println( "*********** Phase 3 ***********" );
         System.out.println( "*******************************" );
         System.out.println( " Create and test new Loggers" );
-        Logger logger1 = Logger.getLogger( LOGGER_NAME_1 );
-        Logger logger2 = Logger.getLogger( LOGGER_NAME_2 );
+        logger1 = Logger.getLogger( LOGGER_NAME_1 );
+        logger2 = Logger.getLogger( LOGGER_NAME_2 );
 
         // check that Level object are returned properly
         try {
--- a/test/java/util/logging/LoggingMXBeanTest2.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/java/util/logging/LoggingMXBeanTest2.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +42,14 @@
     static String LOGGER_NAME_1 = "com.sun.management.Logger";
     static String LOGGER_NAME_2 = "com.sun.management.Logger.Logger2";
     static String UNKNOWN_LOGGER_NAME = "com.sun.management.Unknown";
+    static Logger logger1;
+    static Logger logger2;
 
     public LoggingMXBeanTest2() throws Exception {
 
-        Logger logger1 = Logger.getLogger( LOGGER_NAME_1 );
+        logger1 = Logger.getLogger( LOGGER_NAME_1 );
         logger1.setLevel(Level.FINE);
-        Logger logger2 = Logger.getLogger( LOGGER_NAME_2 );
+        logger2 = Logger.getLogger( LOGGER_NAME_2 );
         logger2.setLevel(null);
 
         /*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefFirst.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.util.prefs.Preferences;
+
+/**
+ *
+ * @author khazra
+ * First class called by CheckUserPrefsStorage.sh to create and
+ * store a user preference
+ */
+
+public class CheckUserPrefFirst {
+
+    public static void main(String[] args) throws Exception {
+        Preferences prefs = Preferences.userNodeForPackage(CheckUserPrefFirst.class);
+        prefs.put("Check", "Success");
+        prefs.flush();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefLater.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.util.prefs.Preferences;
+
+/**
+ * CheckUserPrefsStorage.sh uses this to check that preferences stored
+ * by CheckUserPrefFirst.java can be retrieved
+ * @author khazra
+ */
+
+public class CheckUserPrefLater {
+
+    public static void main(String[] args) throws Exception {
+        Preferences prefs = Preferences.userNodeForPackage(CheckUserPrefFirst.class);
+        String result = prefs.get("Check", null);
+        if ((result == null) || !(result.equals("Success")))
+            throw new RuntimeException("User pref not stored!");
+        prefs.remove("Check");
+        prefs.flush();
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefsStorage.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute 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 7198073
+# @build CheckUserPrefFirst CheckUserPrefLater
+# @run shell CheckUserPrefsStorage.sh
+# @summary Tests that user preferences are stored in the 
+#          permanent storage
+#
+
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  CYGWIN* )
+    PS=";"
+    FS="/"
+    ;;
+  Windows* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+# run CheckUserPrefFirst - creates and stores a user pref
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} CheckUserPrefFirst
+result=$?
+if [ "$result" -ne "0" ]; then
+    exit 1
+fi
+
+# run CheckUserPrefLater - Looks for the stored pref
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} CheckUserPrefLater
+result=$?
+if [ "$result" -ne "0" ]; then
+    exit 1
+fi
+
+# no failures, exit.
+exit 0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/management/timer/MissingNotificationTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 6809322
+ * @summary Test for missing notifications in a high concurrency environment
+ * @author Jaroslav Bachorik
+ * @run clean MissingNotificationTest
+ * @run build MissingNotificationTest
+ * @run main MissingNotificationTest
+ */
+
+import java.util.Date;
+import java.util.Random;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import javax.management.timer.Timer;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+
+public class MissingNotificationTest {
+    private static int TASK_COUNT = 10000;
+    private static long fixedDelay = 0;// anything bigger than 100 and no alarms remain unfired
+
+    private static class NotifListener implements NotificationListener {
+
+        int count;
+
+        public synchronized void handleNotification(Notification notification, Object handback) {
+            count++;
+        }
+
+        synchronized int getCount() {
+            return count;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        System.out.println(
+            ">>> Test for missing notifications.");
+
+        System.out.println(">>> Create a Timer object.");
+        final Timer timer = new Timer();
+
+        timer.start();
+
+        NotifListener listener = new NotifListener();
+        timer.addNotificationListener(listener, null, null);
+
+        ExecutorService executor = Executors.newFixedThreadPool(100);
+        final Random rand = new Random();
+
+
+        for (int i = 0; i < TASK_COUNT; i++) {
+            executor.execute(new Runnable() {
+                public void run() {
+                    long dateMillis = System.currentTimeMillis() + fixedDelay + rand.nextInt(2000);
+                    Date date = new Date(dateMillis);
+                    timer.addNotification("type", "msg", "userData", date);
+                }
+            });
+
+        }
+
+        executor.shutdown();
+        executor.awaitTermination(20, TimeUnit.SECONDS);
+
+        waitForNotificationsToEnd(listener);
+
+        timer.stop();
+
+        if (listener.count < TASK_COUNT) {
+            throw new RuntimeException("Not fired: " + (TASK_COUNT - listener.count));
+        } else {
+            System.out.println(">>> All notifications handled OK");
+        }
+
+        System.out.println(">>> Bye bye!");
+    }
+
+    /**
+     * Will return when all notifications are handled or after 10sec. of no new
+     * notifications
+     *
+     * @param listener
+     * @throws InterruptedException
+     */
+    private static void waitForNotificationsToEnd(NotifListener listener)
+            throws InterruptedException {
+        int oldCout = listener.getCount();
+        int noChangeCounter = 1;
+        while (listener.getCount() < TASK_COUNT) {
+            Thread.sleep(1000);
+            System.out.print('.');
+            if (oldCout == listener.getCount())//no change
+            {
+                if (++noChangeCounter > 10) {
+                    break;
+                }
+            } else {
+                noChangeCounter = 1;
+            }
+
+            oldCout = listener.getCount();
+        }
+        System.out.println();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/asm/AsmSanity.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 7197401
+ * @summary Add a subset of the org.objectweb.asm packages to jdk8
+ * This test doesn't test asm functionality, it just tests the presence of
+ * asm in the jdk.
+ * These compile/run commands do the following:
+ * - Verify that asm is not in ct.sym so user code that refs it won't compile.
+ * - Verify that asm really is in rt.jar and can be accessed when ct.sym is not used.
+ * - Verify that if user code is compiled without ct.sym, it can't access asm classes
+ *   at runtime when a security manager is in use.
+ *
+ * @compile/fail AsmSanity.java
+ *
+ * @compile -XDignore.symbol.file=true AsmSanity.java
+ * @run main/othervm AsmSanity
+ *
+ * @run main/othervm/fail AsmSanity secure
+ *
+ */
+
+
+// Verify that the expected asm pkgs are present
+import jdk.internal.org.objectweb.asm.*;
+import jdk.internal.org.objectweb.asm.commons.*;
+import jdk.internal.org.objectweb.asm.signature.*;
+import jdk.internal.org.objectweb.asm.tree.*;
+import jdk.internal.org.objectweb.asm.tree.analysis.*;
+import jdk.internal.org.objectweb.asm.util.*;
+
+// Verify that we can actually run some of the asm code.
+public class AsmSanity {
+
+    static public void main(String[] args) {
+        if (args.length == 0) {
+            System.out.println("-- Running without SecurityManager");
+            new Label();
+            System.out.println("-- Passed");
+            return;
+        }
+
+        if (args[0].equals("secure")) {
+            System.out.println("-- Running with SecurityManager");
+            java.lang.SecurityManager sm = new SecurityManager();
+            System.setSecurityManager(sm);
+            // This should cause an accessClassInPackage exception
+            new Label();
+            return;
+        }
+        throw new Error("-- Failed:  Unknown argument to main: " + args[0]);
+    }
+}
--- a/test/sun/security/krb5/ccache/EmptyCC.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/krb5/ccache/EmptyCC.java	Tue Oct 23 09:41:52 2012 -0700
@@ -24,9 +24,11 @@
 /*
  * @test
  * @bug 7158329
+ * @bug 8001208
  * @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds()
  * @compile -XDignore.symbol.file EmptyCC.java
- * @run main EmptyCC
+ * @run main EmptyCC tmpcc
+ * @run main EmptyCC FILE:tmpcc
  */
 import java.io.File;
 import java.io.InputStream;
@@ -40,9 +42,9 @@
 public class EmptyCC {
     public static void main(String[] args) throws Exception {
         final PrincipalName pn = new PrincipalName("dummy@FOO.COM");
-        final String ccache = "tmpcc";
+        final String ccache = args[0];
 
-        if (args.length == 0) {
+        if (args.length == 1) {
             // Main process, write the ccache and launch sub process
             CredentialsCache cache = CredentialsCache.create(pn, ccache);
             cache.save();
@@ -54,6 +56,7 @@
                     "-cp",
                     System.getProperty("test.classes"),
                     "EmptyCC",
+                    ccache,
                     "readcc"
                     );
 
@@ -77,6 +80,14 @@
             if (!cc.equals(ccache)) {
                 throw new Exception("env not set correctly");
             }
+            // 8001208: Fix for KRB5CCNAME not complete
+            // Make sure the ccache is created with bare file name
+            if (CredentialsCache.getInstance() == null) {
+                throw new Exception("Cache not instantiated");
+            }
+            if (!new File("tmpcc").exists()) {
+                throw new Exception("File not found");
+            }
             Credentials.acquireTGTFromCache(pn, null);
         }
     }
--- a/test/sun/security/pkcs12/PKCS12SameKeyId.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/pkcs12/PKCS12SameKeyId.java	Tue Oct 23 09:41:52 2012 -0700
@@ -25,6 +25,8 @@
  * @test
  * @bug 6958026
  * @summary Problem with PKCS12 keystore
+ * @compile -XDignore.symbol.file PKCS12SameKeyId.java
+ * @run main PKCS12SameKeyId
  */
 
 import java.io.File;
@@ -40,7 +42,6 @@
 import javax.crypto.spec.PBEKeySpec;
 import javax.crypto.spec.PBEParameterSpec;
 import sun.security.pkcs.EncryptedPrivateKeyInfo;
-import sun.security.tools.KeyTool;
 import sun.security.util.ObjectIdentifier;
 import sun.security.x509.AlgorithmId;
 import sun.security.x509.X500Name;
@@ -61,7 +62,7 @@
             String cmd = "-keystore " + JKSFILE
                     + " -storepass changeit -keypass changeit "
                     + "-genkeypair -alias p" + i + " -dname CN=" + i;
-            KeyTool.main(cmd.split(" "));
+            sun.security.tools.keytool.Main.main(cmd.split(" "));
         }
 
         // Prepare EncryptedPrivateKeyInfo parameters, copied from various
--- a/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargePacket.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/LargePacket.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,13 +21,18 @@
  * questions.
  */
 
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
 /*
  * @test
  *
  * @bug 6388456
  * @summary Need adjustable TLS max record size for interoperability
  *      with non-compliant
- * @run main/othervm -Djsse.enableCBCProtection=false LargePacket
+ * @run main/othervm LargePacket
  *
  * @author Xuelei Fan
  */
@@ -83,12 +88,12 @@
         SocketChannel sc = ssc.accept();
 
         // Complete connection.
-        while (!sc.finishConnect() ) {
+        while (!sc.finishConnect()) {
             // waiting for the connection completed.
         }
 
         // handshaking
-        handshaking(ssle, sc);
+        handshaking(ssle, sc, null);
 
         // receive application data
         receive(ssle, sc);
@@ -131,7 +136,7 @@
         }
 
         // handshaking
-        handshaking(ssle, sc);
+        handshaking(ssle, sc, null);
 
         // send out application data
         deliver(ssle, sc);
@@ -169,6 +174,8 @@
      * Fork off the other side, then do your work.
      */
     LargePacket() throws Exception {
+        super("../../../../../etc");
+
         if (separateServerThread) {
             startServer(true);
             startClient(false);
--- a/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/SSLEngineService.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/SSLEngineService.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,6 @@
  */
 
 /*
- *
- *
  * @bug 6388456
  * @summary Need adjustable TLS max record size for interoperability
  *      with non-compliant stacks
@@ -42,17 +40,31 @@
 
 public class SSLEngineService {
 
-    private static String pathToStores = "../../../../../etc";
     private static String keyStoreFile = "keystore";
     private static String trustStoreFile = "truststore";
     private static char[] passphrase = "passphrase".toCharArray();
 
-    private static String keyFilename =
+    private String pathToStores;
+    private String keyFilename;
+    private String trustFilename;
+
+    protected SSLEngineService() {
+        init("../../../../../etc");
+    }
+
+    protected SSLEngineService(String pathToStores) {
+        init(pathToStores);
+    }
+
+    private void init(String pathToStores) {
+        this.pathToStores = pathToStores;
+        this.keyFilename =
             System.getProperty("test.src", "./") + "/" + pathToStores +
                 "/" + keyStoreFile;
-    private static String trustFilename =
+        this.trustFilename =
             System.getProperty("test.src", "./") + "/" + pathToStores +
                 "/" + trustStoreFile;
+    }
 
     // deliver local application data.
     protected static void deliver(SSLEngine ssle, SocketChannel sc)
@@ -143,9 +155,12 @@
         ByteBuffer peerNetData = ByteBuffer.allocate(netBufferMax/2);
         int received = -1;
 
+        boolean needToReadMore = true;
         while (received != 0) {
-            if (ssle.isInboundDone() || sc.read(peerNetData) < 0) {
-                break;
+            if (needToReadMore) {
+                if (ssle.isInboundDone() || sc.read(peerNetData) < 0) {
+                    break;
+                }
             }
 
             peerNetData.flip();
@@ -186,6 +201,8 @@
                         " bytes large packet ");
                 }
 
+                needToReadMore = (peerNetData.position() > 0) ? false : true;
+
                 break;
 
             case BUFFER_OVERFLOW :
@@ -206,6 +223,8 @@
                         " bytes for BUFFER_UNDERFLOW");
                     peerNetData = enlargeBuffer(peerNetData, size);
                 }
+
+                needToReadMore = true;
                 break;
 
             default : // CLOSED :
@@ -215,8 +234,8 @@
         }
     }
 
-    protected static void handshaking(SSLEngine ssle, SocketChannel sc)
-        throws Exception {
+    protected static void handshaking(SSLEngine ssle, SocketChannel sc,
+            ByteBuffer additional) throws Exception {
 
         int appBufferMax = ssle.getSession().getApplicationBufferSize();
         int netBufferMax = ssle.getSession().getPacketBufferSize();
@@ -232,15 +251,39 @@
         SSLEngineResult.HandshakeStatus hs = ssle.getHandshakeStatus();
 
         // start handshaking from unwrap
+        byte[] buffer = new byte[0xFF];
+        boolean underflow = false;
         do {
             switch (hs) {
 
             case NEED_UNWRAP :
                 if (peerNetData.position() == 0) {
+                    if (additional != null && additional.hasRemaining()) {
+                        do {
+                            int len = Math.min(buffer.length,
+                                                peerNetData.remaining());
+                            len = Math.min(len, additional.remaining());
+                            if (len != 0) {
+                                additional.get(buffer, 0, len);
+                                peerNetData.put(buffer, 0, len);
+                            }
+                        } while (peerNetData.remaining() > 0 &&
+                                    additional.hasRemaining());
+                    } else {
+                        if (sc.read(peerNetData) < 0) {
+                            ssle.closeInbound();
+                            return;
+                        }
+                    }
+                }
+
+                if (underflow) {
                     if (sc.read(peerNetData) < 0) {
                         ssle.closeInbound();
                         return;
                     }
+
+                    underflow = false;
                 }
 
                 peerNetData.flip();
@@ -259,6 +302,8 @@
                                 size + " bytes for BUFFER_UNDERFLOW");
                         peerNetData = enlargeBuffer(peerNetData, size);
                     }
+
+                    underflow = true;
                     break;
                 case BUFFER_OVERFLOW :
                     // maybe need to enlarge the peer application data buffer.
@@ -339,7 +384,7 @@
     /*
      * Create an initialized SSLContext to use for this test.
      */
-    protected static SSLEngine createSSLEngine(boolean mode) throws Exception {
+    protected SSLEngine createSSLEngine(boolean mode) throws Exception {
 
         SSLEngine ssle;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLEngineExplorer.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,335 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../NewAPIs/SSLEngine ../../../../templates
+ * @build SSLEngineService SSLCapabilities SSLExplorer
+ * @run main/othervm SSLEngineExplorer SSLv2Hello,SSLv3
+ * @run main/othervm SSLEngineExplorer SSLv3
+ * @run main/othervm SSLEngineExplorer TLSv1
+ * @run main/othervm SSLEngineExplorer TLSv1.1
+ * @run main/othervm SSLEngineExplorer TLSv1.2
+ */
+
+import javax.net.ssl.*;
+import java.nio.*;
+import java.net.*;
+import java.util.*;
+import java.nio.channels.*;
+
+public class SSLEngineExplorer extends SSLEngineService {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    // Is the server ready to serve?
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(false);
+
+        // Create a server socket channel.
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.socket().bind(isa);
+        serverPort = ssc.socket().getLocalPort();
+
+        // Signal Client, we're ready for his connect.
+        serverReady = true;
+
+        // Accept a socket channel.
+        SocketChannel sc = ssc.accept();
+        sc.configureBlocking(false);
+
+        // Complete connection.
+        while (!sc.finishConnect()) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        ByteBuffer buffer = ByteBuffer.allocate(0xFF);
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        buffer.limit(SSLExplorer.RECORD_HEADER_SIZE);
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer);
+        if (buffer.capacity() < recordLength) {
+            ByteBuffer oldBuffer = buffer;
+            buffer = ByteBuffer.allocate(recordLength);
+            buffer.put(oldBuffer);
+        }
+
+        buffer.position(SSLExplorer.RECORD_HEADER_SIZE);
+        buffer.limit(buffer.capacity());
+        while (position < recordLength) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        capabilities = SSLExplorer.explore(buffer);
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        // handshaking
+        handshaking(ssle, sc, buffer);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkCapabilities(capabilities, session);
+
+        // close the socket channel.
+        sc.close();
+        ssc.close();
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(true);
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        // Create a non-blocking socket channel.
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        sc.connect(isa);
+
+        // Complete connection.
+        while (!sc.finishConnect() ) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        // enable the specified TLS protocol
+        ssle.setEnabledProtocols(supportedProtocols);
+
+        // handshaking
+        handshaking(ssle, sc, null);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // close the socket channel.
+        sc.close();
+    }
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+    }
+
+    private static String[] supportedProtocols;    // supported protocols
+
+    private static void parseArguments(String[] args) {
+        supportedProtocols = args[0].split(",");
+    }
+
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    public static void main(String args[]) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        new SSLEngineExplorer();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLEngineExplorer() throws Exception {
+        super("../../../../etc");
+
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null) {
+            System.out.print("Server Exception:");
+            throw serverException;
+        }
+        if (clientException != null) {
+            System.out.print("Client Exception:");
+            throw clientException;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        System.err.println(e);
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLEngineExplorerMatchedSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,393 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../NewAPIs/SSLEngine ../../../../templates
+ * @build SSLEngineService SSLCapabilities SSLExplorer
+ * @run main/othervm SSLEngineExplorerMatchedSNI www.example.com
+ *     www\.example\.com
+ * @run main/othervm SSLEngineExplorerMatchedSNI www.example.com
+ *     www\.example\.(com|org)
+ * @run main/othervm SSLEngineExplorerMatchedSNI example.com
+ *     (.*\.)*example\.(com|org)
+ * @run main/othervm SSLEngineExplorerMatchedSNI www.example.com
+ *     (.*\.)*example\.(com|org)
+ * @run main/othervm SSLEngineExplorerMatchedSNI www.us.example.com
+ *     (.*\.)*example\.(com|org)
+ */
+
+import javax.net.ssl.*;
+import java.nio.*;
+import java.net.*;
+import java.util.*;
+import java.nio.channels.*;
+
+public class SSLEngineExplorerMatchedSNI extends SSLEngineService {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    // Is the server ready to serve?
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(false);
+
+        // Create a server socket channel.
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.socket().bind(isa);
+        serverPort = ssc.socket().getLocalPort();
+
+        // Signal Client, we're ready for his connect.
+        serverReady = true;
+
+        // Accept a socket channel.
+        SocketChannel sc = ssc.accept();
+
+        // Complete connection.
+        while (!sc.finishConnect()) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        ByteBuffer buffer = ByteBuffer.allocate(0xFF);
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        buffer.limit(SSLExplorer.RECORD_HEADER_SIZE);
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer);
+        if (buffer.capacity() < recordLength) {
+            ByteBuffer oldBuffer = buffer;
+            buffer = ByteBuffer.allocate(recordLength);
+            buffer.put(oldBuffer);
+        }
+
+        buffer.position(SSLExplorer.RECORD_HEADER_SIZE);
+        buffer.limit(buffer.capacity());
+        while (position < recordLength) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        capabilities = SSLExplorer.explore(buffer);
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        // enable server name indication checking
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = ssle.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        ssle.setSSLParameters(params);
+
+        // handshaking
+        handshaking(ssle, sc, buffer);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        // check server name indication
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkCapabilities(capabilities, session);
+
+        // close the socket channel.
+        sc.close();
+        ssc.close();
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(true);
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        // Create a non-blocking socket channel.
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        sc.connect(isa);
+
+        // Complete connection.
+        while (!sc.finishConnect() ) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = ssle.getSSLParameters();
+        params.setServerNames(serverNames);
+        ssle.setSSLParameters(params);
+
+        // handshaking
+        handshaking(ssle, sc, null);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // check server name indication
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkSNIInSession(session);
+
+        // close the socket channel.
+        sc.close();
+    }
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "unexpected empty request server name indication");
+        }
+
+        if (sessionSNI.size() != 1) {
+            throw new Exception(
+                    "unexpected request server name indication");
+        }
+
+        SNIServerName serverName = sessionSNI.get(0);
+        if (!(serverName instanceof SNIHostName)) {
+            throw new Exception(
+                    "unexpected instance of request server name indication");
+        }
+
+        String hostname = ((SNIHostName)serverName).getAsciiName();
+        if (!clientRequestedHostname.equalsIgnoreCase(hostname)) {
+            throw new Exception(
+                    "unexpected request server name indication value");
+        }
+    }
+
+    private static String clientRequestedHostname;
+    private static String serverAcceptableHostname;
+
+    private static void parseArguments(String[] args) {
+        clientRequestedHostname = args[0];
+        serverAcceptableHostname = args[1];
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    public static void main(String args[]) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        new SSLEngineExplorerMatchedSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLEngineExplorerMatchedSNI() throws Exception {
+        super("../../../../etc");
+
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null) {
+            System.out.print("Server Exception:");
+            throw serverException;
+        }
+        if (clientException != null) {
+            System.out.print("Client Exception:");
+            throw clientException;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        System.err.println(e);
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLEngineExplorerUnmatchedSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../NewAPIs/SSLEngine ../../../../templates
+ * @build SSLEngineService SSLCapabilities SSLExplorer
+ * @run main/othervm SSLEngineExplorerUnmatchedSNI www.example.com
+ *                                                 www\.example\.org
+ */
+
+import javax.net.ssl.*;
+import java.io.*;
+import java.nio.*;
+import java.net.*;
+import java.util.*;
+import java.nio.channels.*;
+
+public class SSLEngineExplorerUnmatchedSNI extends SSLEngineService {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    // Is the server ready to serve?
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(false);
+
+        // Create a server socket channel.
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.socket().bind(isa);
+        serverPort = ssc.socket().getLocalPort();
+
+        // Signal Client, we're ready for his connect.
+        serverReady = true;
+
+        // Accept a socket channel.
+        SocketChannel sc = ssc.accept();
+
+        // Complete connection.
+        while (!sc.finishConnect()) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        ByteBuffer buffer = ByteBuffer.allocate(0xFF);
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        buffer.limit(SSLExplorer.RECORD_HEADER_SIZE);
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer);
+        if (buffer.capacity() < recordLength) {
+            ByteBuffer oldBuffer = buffer;
+            buffer = ByteBuffer.allocate(recordLength);
+            buffer.put(oldBuffer);
+        }
+
+        buffer.position(SSLExplorer.RECORD_HEADER_SIZE);
+        buffer.limit(buffer.capacity());
+        while (position < recordLength) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        capabilities = SSLExplorer.explore(buffer);
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        // enable server name indication checking
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = ssle.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        ssle.setSSLParameters(params);
+
+        try {
+            // handshaking
+            handshaking(ssle, sc, buffer);
+
+            // receive application data
+            receive(ssle, sc);
+
+            // send out application data
+            deliver(ssle, sc);
+
+            // check server name indication
+            ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+            checkCapabilities(capabilities, session);
+
+            throw new Exception(
+                "Mismatched server name indication was accepted");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected unrecognized server name indication exception
+        } catch (IOException ioe) {
+            // the peer may have closed the socket because of the unmatched
+            // server name indication.
+        } finally {
+            // close the socket channel.
+            sc.close();
+            ssc.close();
+        }
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(true);
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        // Create a non-blocking socket channel.
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        sc.connect(isa);
+
+        // Complete connection.
+        while (!sc.finishConnect() ) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = ssle.getSSLParameters();
+        params.setServerNames(serverNames);
+        ssle.setSSLParameters(params);
+
+        try {
+            // handshaking
+            handshaking(ssle, sc, null);
+
+            // send out application data
+            deliver(ssle, sc);
+
+            // receive application data
+            receive(ssle, sc);
+
+            // check server name indication
+            ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+            checkSNIInSession(session);
+
+            throw new Exception(
+                "Mismatched server name indication was accepted");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected unrecognized server name indication exception
+        } catch (IOException ioe) {
+            // the peer may have closed the socket because of the unmatched
+            // server name indication.
+        } finally {
+            // close the socket channel.
+            sc.close();
+        }
+    }
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "unexpected empty request server name indication");
+        }
+
+        if (sessionSNI.size() != 1) {
+            throw new Exception(
+                    "unexpected request server name indication");
+        }
+
+        SNIServerName serverName = sessionSNI.get(0);
+        if (!(serverName instanceof SNIHostName)) {
+            throw new Exception(
+                    "unexpected instance of request server name indication");
+        }
+
+        String hostname = ((SNIHostName)serverName).getAsciiName();
+        if (!clientRequestedHostname.equalsIgnoreCase(hostname)) {
+            throw new Exception(
+                    "unexpected request server name indication value");
+        }
+    }
+
+    private static String clientRequestedHostname;
+    private static String serverAcceptableHostname;
+
+    private static void parseArguments(String[] args) {
+        clientRequestedHostname = args[0];
+        serverAcceptableHostname = args[1];
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    public static void main(String args[]) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        new SSLEngineExplorerUnmatchedSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLEngineExplorerUnmatchedSNI() throws Exception {
+        super("../../../../etc");
+
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null) {
+            System.out.print("Server Exception:");
+            throw serverException;
+        }
+        if (clientException != null) {
+            System.out.print("Client Exception:");
+            throw clientException;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        System.err.println(e);
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLEngineExplorerWithCli.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../NewAPIs/SSLEngine ../../../../templates
+ * @build SSLEngineService SSLCapabilities SSLExplorer
+ * @run main/othervm SSLEngineExplorerWithCli
+ */
+
+import javax.net.ssl.*;
+import java.nio.*;
+import java.net.*;
+import java.util.*;
+import java.nio.channels.*;
+
+public class SSLEngineExplorerWithCli extends SSLEngineService {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    // Is the server ready to serve?
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(false);
+
+        // Create a server socket channel.
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.socket().bind(isa);
+        serverPort = ssc.socket().getLocalPort();
+
+        // Signal Client, we're ready for his connect.
+        serverReady = true;
+
+        // Accept a socket channel.
+        SocketChannel sc = ssc.accept();
+
+        // Complete connection.
+        while (!sc.finishConnect()) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        ByteBuffer buffer = ByteBuffer.allocate(0xFF);
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        buffer.limit(SSLExplorer.RECORD_HEADER_SIZE);
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer);
+        if (buffer.capacity() < recordLength) {
+            ByteBuffer oldBuffer = buffer;
+            buffer = ByteBuffer.allocate(recordLength);
+            buffer.put(oldBuffer);
+        }
+
+        buffer.position(SSLExplorer.RECORD_HEADER_SIZE);
+        buffer.limit(buffer.capacity());
+        while (position < recordLength) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        capabilities = SSLExplorer.explore(buffer);
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        // handshaking
+        handshaking(ssle, sc, buffer);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkCapabilities(capabilities, session);
+
+        // close the socket channel.
+        sc.close();
+        ssc.close();
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(true);
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        // Create a non-blocking socket channel.
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        sc.connect(isa);
+
+        // Complete connection.
+        while (!sc.finishConnect() ) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = ssle.getSSLParameters();
+        params.setServerNames(serverNames);
+        ssle.setSSLParameters(params);
+
+        // handshaking
+        handshaking(ssle, sc, null);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // check server name indication
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkSNIInSession(session);
+
+        // close the socket channel.
+        sc.close();
+    }
+
+    private static String clientRequestedHostname = "www.example.com";
+    private static String serverAcceptableHostname =
+                                                "www\\.example\\.(com|org)";
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "unexpected empty request server name indication");
+        }
+
+        if (sessionSNI.size() != 1) {
+            throw new Exception(
+                    "unexpected request server name indication");
+        }
+
+        SNIServerName serverName = sessionSNI.get(0);
+        if (!(serverName instanceof SNIHostName)) {
+            throw new Exception(
+                    "unexpected instance of request server name indication");
+        }
+
+        String hostname = ((SNIHostName)serverName).getAsciiName();
+        if (!clientRequestedHostname.equalsIgnoreCase(hostname)) {
+            throw new Exception(
+                    "unexpected request server name indication value");
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    public static void main(String args[]) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        new SSLEngineExplorerWithCli();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLEngineExplorerWithCli() throws Exception {
+        super("../../../../etc");
+
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null) {
+            System.out.print("Server Exception:");
+            throw serverException;
+        }
+        if (clientException != null) {
+            System.out.print("Client Exception:");
+            throw clientException;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        System.err.println(e);
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLEngineExplorerWithSrv.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,351 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../NewAPIs/SSLEngine ../../../../templates
+ * @build SSLEngineService SSLCapabilities SSLExplorer
+ * @run main/othervm SSLEngineExplorerWithSrv
+ */
+
+import javax.net.ssl.*;
+import java.nio.*;
+import java.net.*;
+import java.util.*;
+import java.nio.channels.*;
+
+public class SSLEngineExplorerWithSrv extends SSLEngineService {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    // Is the server ready to serve?
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(false);
+
+        // Create a server socket channel.
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.socket().bind(isa);
+        serverPort = ssc.socket().getLocalPort();
+
+        // Signal Client, we're ready for his connect.
+        serverReady = true;
+
+        // Accept a socket channel.
+        SocketChannel sc = ssc.accept();
+
+        // Complete connection.
+        while (!sc.finishConnect()) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        ByteBuffer buffer = ByteBuffer.allocate(0xFF);
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        buffer.limit(SSLExplorer.RECORD_HEADER_SIZE);
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer);
+        if (buffer.capacity() < recordLength) {
+            ByteBuffer oldBuffer = buffer;
+            buffer = ByteBuffer.allocate(recordLength);
+            buffer.put(oldBuffer);
+        }
+
+        buffer.position(SSLExplorer.RECORD_HEADER_SIZE);
+        buffer.limit(buffer.capacity());
+        while (position < recordLength) {
+            int n = sc.read(buffer);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+        buffer.flip();
+
+        capabilities = SSLExplorer.explore(buffer);
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        // enable server name indication checking
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = ssle.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        ssle.setSSLParameters(params);
+
+        // handshaking
+        handshaking(ssle, sc, buffer);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        // check server name indication
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkCapabilities(capabilities, session);
+
+        // close the socket channel.
+        sc.close();
+        ssc.close();
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+        // create SSLEngine.
+        SSLEngine ssle = createSSLEngine(true);
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        // Create a non-blocking socket channel.
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        InetSocketAddress isa =
+                new InetSocketAddress(InetAddress.getLocalHost(), serverPort);
+        sc.connect(isa);
+
+        // Complete connection.
+        while (!sc.finishConnect() ) {
+            Thread.sleep(50);
+            // waiting for the connection completed.
+        }
+
+        // handshaking
+        handshaking(ssle, sc, null);
+
+        // send out application data
+        deliver(ssle, sc);
+
+        // receive application data
+        receive(ssle, sc);
+
+        // check server name indication
+        ExtendedSSLSession session = (ExtendedSSLSession)ssle.getSession();
+        checkSNIInSession(session);
+
+        // close the socket channel.
+        sc.close();
+    }
+
+    private static String clientRequestedHostname = "www.example.com";
+    private static String serverAcceptableHostname =
+                                                "www\\.example\\.(com|org)";
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "should be empty request server name indication");
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    public static void main(String args[]) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        new SSLEngineExplorerWithSrv();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLEngineExplorerWithSrv() throws Exception {
+        super("../../../../etc");
+
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null) {
+            System.out.print("Server Exception:");
+            throw serverException;
+        }
+        if (clientException != null) {
+            System.out.print("Client Exception:");
+            throw clientException;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        System.err.println(e);
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketConsistentSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @run main/othervm SSLSocketConsistentSNI
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketConsistentSNI {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLServerSocketFactory sslssf =
+            (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket) sslssf.createServerSocket(serverPort);
+
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = sslServerSocket.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        sslServerSocket.setSSLParameters(params);
+
+        serverPort = sslServerSocket.getLocalPort();
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslIS.read();
+            sslOS.write(85);
+            sslOS.flush();
+
+            ExtendedSSLSession session =
+                    (ExtendedSSLSession)sslSocket.getSession();
+            checkSNIInSession(session);
+        } finally {
+            sslSocket.close();
+            sslServerSocket.close();
+        }
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setServerNames(serverNames);
+        sslSocket.setSSLParameters(params);
+
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslOS.write(280);
+            sslOS.flush();
+            sslIS.read();
+
+            ExtendedSSLSession session =
+                    (ExtendedSSLSession)sslSocket.getSession();
+            checkSNIInSession(session);
+        } finally {
+            sslSocket.close();
+        }
+    }
+
+    private static String clientRequestedHostname = "www.example.com";
+    private static String serverAcceptableHostname = "www\\.example\\.com";
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "unexpected empty request server name indication");
+        }
+
+        if (sessionSNI.size() != 1) {
+            throw new Exception(
+                    "unexpected request server name indication");
+        }
+
+        SNIServerName serverName = sessionSNI.get(0);
+        if (!(serverName instanceof SNIHostName)) {
+            throw new Exception(
+                    "unexpected instance of request server name indication");
+        }
+
+        String hostname = ((SNIHostName)serverName).getAsciiName();
+        if (!clientRequestedHostname.equalsIgnoreCase(hostname)) {
+            throw new Exception(
+                    "unexpected request server name indication value");
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketConsistentSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketConsistentSNI() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketExplorer.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../../../../templates
+ * @build SSLCapabilities SSLExplorer
+ * @run main/othervm SSLSocketExplorer SSLv2Hello,SSLv3
+ * @run main/othervm SSLSocketExplorer SSLv3
+ * @run main/othervm SSLSocketExplorer TLSv1
+ * @run main/othervm SSLSocketExplorer TLSv1.1
+ * @run main/othervm SSLSocketExplorer TLSv1.2
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketExplorer {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        ServerSocket serverSocket = new ServerSocket(serverPort);
+
+        // Signal Client, we're ready for his connect.
+        serverPort = serverSocket.getLocalPort();
+        serverReady = true;
+
+        Socket socket = serverSocket.accept();
+        InputStream ins = socket.getInputStream();
+
+        byte[] buffer = new byte[0xFF];
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int count = SSLExplorer.RECORD_HEADER_SIZE - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer, 0, position);
+        if (buffer.length < recordLength) {
+            buffer = Arrays.copyOf(buffer, recordLength);
+        }
+
+        while (position < recordLength) {
+            int count = recordLength - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        capabilities = SSLExplorer.explore(buffer, 0, recordLength);;
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        ByteArrayInputStream bais =
+            new ByteArrayInputStream(buffer, 0, position);
+        SSLSocket sslSocket = (SSLSocket)sslsf.createSocket(socket, bais, true);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslIS.read();
+        sslOS.write(85);
+        sslOS.flush();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkCapabilities(capabilities, session);
+
+        sslSocket.close();
+        serverSocket.close();
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        // enable the specified TLS protocol
+        sslSocket.setEnabledProtocols(supportedProtocols);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslOS.write(280);
+        sslOS.flush();
+        sslIS.read();
+
+        sslSocket.close();
+    }
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+    }
+
+    private static String[] supportedProtocols;    // supported protocols
+
+    private static void parseArguments(String[] args) {
+        supportedProtocols = args[0].split(",");
+    }
+
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketExplorer();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketExplorer() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../../../../templates
+ * @build SSLCapabilities SSLExplorer
+ * @run main/othervm SSLSocketExplorerFailure SSLv2Hello,SSLv3
+ * @run main/othervm SSLSocketExplorerFailure SSLv3
+ * @run main/othervm SSLSocketExplorerFailure TLSv1
+ * @run main/othervm SSLSocketExplorerFailure TLSv1.1
+ * @run main/othervm SSLSocketExplorerFailure TLSv1.2
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketExplorerFailure {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        ServerSocket serverSocket = new ServerSocket(serverPort);
+
+        // Signal Client, we're ready for his connect.
+        serverPort = serverSocket.getLocalPort();
+        serverReady = true;
+
+        Socket socket = serverSocket.accept();
+        InputStream ins = socket.getInputStream();
+
+        byte[] buffer = new byte[0xFF];
+        int position = 0;
+        SSLCapabilities capabilities = null;
+        boolean failed = false;
+        try {
+            // Read the header of TLS record
+            while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+                int count = SSLExplorer.RECORD_HEADER_SIZE - position;
+                int n = ins.read(buffer, position, count);
+                if (n < 0) {
+                    throw new Exception("unexpected end of stream!");
+                }
+                position += n;
+            }
+
+            int recordLength = SSLExplorer.getRequiredSize(buffer, 0, position);
+            if (buffer.length < recordLength) {
+                buffer = Arrays.copyOf(buffer, recordLength);
+            }
+
+            while (position < recordLength) {
+                int count = recordLength - position;
+                int n = ins.read(buffer, position, count);
+                if (n < 0) {
+                    throw new Exception("unexpected end of stream!");
+                }
+                position += n;
+            }
+
+            capabilities = SSLExplorer.explore(buffer, 0, recordLength);;
+            if (capabilities != null) {
+                System.out.println("Record version: " +
+                        capabilities.getRecordVersion());
+                System.out.println("Hello version: " +
+                        capabilities.getHelloVersion());
+            }
+
+            // want an I/O exception
+            throw new IOException("We just want a I/O exception");
+        } catch (Exception e) {
+            failed =  true;
+        }
+
+        // off course, the above explore failed. Faile to failure handler
+        SSLContext context = SSLContext.getInstance("TLS");
+        context.init(null, null, null);
+        SSLSocketFactory sslsf = context.getSocketFactory();
+        ByteArrayInputStream bais =
+            new ByteArrayInputStream(buffer, 0, position);
+        SSLSocket sslSocket = (SSLSocket)sslsf.createSocket(socket, bais, true);
+
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslIS.read();
+            if (!failed) {
+                sslOS.write(85);
+                sslOS.flush();
+            } else {
+                sslSocket.close();
+            }
+        } catch (Exception e) {
+            System.out.println("server exception " + e);
+        } finally {
+            sslSocket.close();
+            serverSocket.close();
+        }
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        // enable the specified TLS protocol
+        sslSocket.setEnabledProtocols(supportedProtocols);
+
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslOS.write(280);
+            sslOS.flush();
+            sslIS.read();
+        } catch (Exception e) {
+            System.out.println("client exception " + e);
+        } finally {
+            sslSocket.close();
+        }
+    }
+
+    private static String[] supportedProtocols;    // supported protocols
+
+    private static void parseArguments(String[] args) {
+        supportedProtocols = args[0].split(",");
+    }
+
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketExplorerFailure();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketExplorerFailure() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketExplorerMatchedSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,435 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../../../../templates
+ * @build SSLCapabilities SSLExplorer
+ * @run main/othervm SSLSocketExplorerMatchedSNI www.example.com
+ *     www\.example\.com
+ * @run main/othervm SSLSocketExplorerMatchedSNI www.example.com
+ *     www\.example\.(com|org)
+ * @run main/othervm SSLSocketExplorerMatchedSNI example.com
+ *     (.*\.)*example\.(com|org)
+ * @run main/othervm SSLSocketExplorerMatchedSNI www.example.com
+ *     (.*\.)*example\.(com|org)
+ * @run main/othervm SSLSocketExplorerMatchedSNI www.us.example.com
+ *     (.*\.)*example\.(com|org)
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketExplorerMatchedSNI {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        ServerSocket serverSocket = new ServerSocket(serverPort);
+
+        // Signal Client, we're ready for his connect.
+        serverPort = serverSocket.getLocalPort();
+        serverReady = true;
+
+        Socket socket = serverSocket.accept();
+        InputStream ins = socket.getInputStream();
+
+        byte[] buffer = new byte[0xFF];
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int count = SSLExplorer.RECORD_HEADER_SIZE - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer, 0, position);
+        if (buffer.length < recordLength) {
+            buffer = Arrays.copyOf(buffer, recordLength);
+        }
+
+        while (position < recordLength) {
+            int count = recordLength - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        capabilities = SSLExplorer.explore(buffer, 0, recordLength);;
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        ByteArrayInputStream bais =
+            new ByteArrayInputStream(buffer, 0, position);
+        SSLSocket sslSocket = (SSLSocket)sslsf.createSocket(socket, bais, true);
+
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslIS.read();
+        sslOS.write(85);
+        sslOS.flush();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkCapabilities(capabilities, session);
+
+        sslSocket.close();
+        serverSocket.close();
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setServerNames(serverNames);
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslOS.write(280);
+        sslOS.flush();
+        sslIS.read();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkSNIInSession(session);
+
+        sslSocket.close();
+    }
+
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "unexpected empty request server name indication");
+        }
+
+        if (sessionSNI.size() != 1) {
+            throw new Exception(
+                    "unexpected request server name indication");
+        }
+
+        SNIServerName serverName = sessionSNI.get(0);
+        if (!(serverName instanceof SNIHostName)) {
+            throw new Exception(
+                    "unexpected instance of request server name indication");
+        }
+
+        String hostname = ((SNIHostName)serverName).getAsciiName();
+        if (!clientRequestedHostname.equalsIgnoreCase(hostname)) {
+            throw new Exception(
+                    "unexpected request server name indication value");
+        }
+    }
+
+    private static String clientRequestedHostname;
+    private static String serverAcceptableHostname;
+
+    private static void parseArguments(String[] args) {
+        clientRequestedHostname = args[0];
+        serverAcceptableHostname = args[1];
+    }
+
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketExplorerMatchedSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketExplorerMatchedSNI() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketExplorerUnmatchedSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../../../../templates
+ * @build SSLCapabilities SSLExplorer
+ * @run main/othervm SSLSocketExplorerUnmatchedSNI www.example.com
+ *                                                 www\.example\.org
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketExplorerUnmatchedSNI {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        ServerSocket serverSocket = new ServerSocket(serverPort);
+
+        // Signal Client, we're ready for his connect.
+        serverPort = serverSocket.getLocalPort();
+        serverReady = true;
+
+        Socket socket = serverSocket.accept();
+        InputStream ins = socket.getInputStream();
+
+        byte[] buffer = new byte[0xFF];
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int count = SSLExplorer.RECORD_HEADER_SIZE - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer, 0, position);
+        if (buffer.length < recordLength) {
+            buffer = Arrays.copyOf(buffer, recordLength);
+        }
+
+        while (position < recordLength) {
+            int count = recordLength - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        capabilities = SSLExplorer.explore(buffer, 0, recordLength);;
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        ByteArrayInputStream bais =
+            new ByteArrayInputStream(buffer, 0, position);
+        SSLSocket sslSocket = (SSLSocket)sslsf.createSocket(socket, bais, true);
+
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        try {
+            sslIS.read();
+            sslOS.write(85);
+            sslOS.flush();
+
+            throw new Exception(
+                "Mismatched server name indication was accepted");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected unrecognized server name indication exception
+        } catch (IOException ioe) {
+            // the peer may have closed the socket because of the unmatched
+            // server name indication.
+        } finally {
+            sslSocket.close();
+            serverSocket.close();
+        }
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setServerNames(serverNames);
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        try {
+            sslOS.write(280);
+            sslOS.flush();
+            sslIS.read();
+
+            throw new Exception(
+                "Mismatched server name indication was accepted");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected unrecognized server name indication exception
+        } catch (IOException ioe) {
+            // the peer may have closed the socket because of the unmatched
+            // server name indication.
+        } finally {
+            sslSocket.close();
+        }
+    }
+
+    private static String clientRequestedHostname;
+    private static String serverAcceptableHostname;
+
+    private static void parseArguments(String[] args) {
+        clientRequestedHostname = args[0];
+        serverAcceptableHostname = args[1];
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketExplorerUnmatchedSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketExplorerUnmatchedSNI() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketExplorerWithCliSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,407 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../../../../templates
+ * @build SSLCapabilities SSLExplorer
+ * @run main/othervm SSLSocketExplorerWithCliSNI
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketExplorerWithCliSNI {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        ServerSocket serverSocket = new ServerSocket(serverPort);
+
+        // Signal Client, we're ready for his connect.
+        serverPort = serverSocket.getLocalPort();
+        serverReady = true;
+
+        Socket socket = serverSocket.accept();
+        InputStream ins = socket.getInputStream();
+
+        byte[] buffer = new byte[0xFF];
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int count = SSLExplorer.RECORD_HEADER_SIZE - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer, 0, position);
+        if (buffer.length < recordLength) {
+            buffer = Arrays.copyOf(buffer, recordLength);
+        }
+
+        while (position < recordLength) {
+            int count = recordLength - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        capabilities = SSLExplorer.explore(buffer, 0, recordLength);;
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        ByteArrayInputStream bais =
+            new ByteArrayInputStream(buffer, 0, position);
+        SSLSocket sslSocket = (SSLSocket)sslsf.createSocket(socket, bais, true);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslIS.read();
+        sslOS.write(85);
+        sslOS.flush();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkCapabilities(capabilities, session);
+
+        sslSocket.close();
+        serverSocket.close();
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setServerNames(serverNames);
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslOS.write(280);
+        sslOS.flush();
+        sslIS.read();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkSNIInSession(session);
+
+        sslSocket.close();
+    }
+
+    private static String clientRequestedHostname = "www.example.com";
+    private static String serverAcceptableHostname =
+                                                "www\\.example\\.(com|org)";
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "unexpected empty request server name indication");
+        }
+
+        if (sessionSNI.size() != 1) {
+            throw new Exception(
+                    "unexpected request server name indication");
+        }
+
+        SNIServerName serverName = sessionSNI.get(0);
+        if (!(serverName instanceof SNIHostName)) {
+            throw new Exception(
+                    "unexpected instance of request server name indication");
+        }
+
+        String hostname = ((SNIHostName)serverName).getAsciiName();
+        if (!clientRequestedHostname.equalsIgnoreCase(hostname)) {
+            throw new Exception(
+                    "unexpected request server name indication value");
+        }
+    }
+
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketExplorerWithCliSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketExplorerWithCliSNI() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketExplorerWithSrvSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,390 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @library ../../../../templates
+ * @build SSLCapabilities SSLExplorer
+ * @run main/othervm SSLSocketExplorerWithSrvSNI
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketExplorerWithSrvSNI {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+
+        ServerSocket serverSocket = new ServerSocket(serverPort);
+
+        // Signal Client, we're ready for his connect.
+        serverPort = serverSocket.getLocalPort();
+        serverReady = true;
+
+        Socket socket = serverSocket.accept();
+        InputStream ins = socket.getInputStream();
+
+        byte[] buffer = new byte[0xFF];
+        int position = 0;
+        SSLCapabilities capabilities = null;
+
+        // Read the header of TLS record
+        while (position < SSLExplorer.RECORD_HEADER_SIZE) {
+            int count = SSLExplorer.RECORD_HEADER_SIZE - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        int recordLength = SSLExplorer.getRequiredSize(buffer, 0, position);
+        if (buffer.length < recordLength) {
+            buffer = Arrays.copyOf(buffer, recordLength);
+        }
+
+        while (position < recordLength) {
+            int count = recordLength - position;
+            int n = ins.read(buffer, position, count);
+            if (n < 0) {
+                throw new Exception("unexpected end of stream!");
+            }
+            position += n;
+        }
+
+        capabilities = SSLExplorer.explore(buffer, 0, recordLength);;
+        if (capabilities != null) {
+            System.out.println("Record version: " +
+                    capabilities.getRecordVersion());
+            System.out.println("Hello version: " +
+                    capabilities.getHelloVersion());
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        ByteArrayInputStream bais =
+            new ByteArrayInputStream(buffer, 0, position);
+        SSLSocket sslSocket = (SSLSocket)sslsf.createSocket(socket, bais, true);
+
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        sslSocket.setSSLParameters(params);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslIS.read();
+        sslOS.write(85);
+        sslOS.flush();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkCapabilities(capabilities, session);
+
+        sslSocket.close();
+        serverSocket.close();
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        InputStream sslIS = sslSocket.getInputStream();
+        OutputStream sslOS = sslSocket.getOutputStream();
+
+        sslOS.write(280);
+        sslOS.flush();
+        sslIS.read();
+
+        ExtendedSSLSession session = (ExtendedSSLSession)sslSocket.getSession();
+        checkSNIInSession(session);
+
+        sslSocket.close();
+    }
+
+    private static String clientRequestedHostname = "www.example.com";
+    private static String serverAcceptableHostname =
+                                                "www\\.example\\.(com|org)";
+
+    void checkCapabilities(SSLCapabilities capabilities,
+            ExtendedSSLSession session) throws Exception {
+
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.equals(capabilities.getServerNames())) {
+            for (SNIServerName sni : sessionSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            List<SNIServerName> capaSNI = capabilities.getServerNames();
+            for (SNIServerName sni : capaSNI) {
+                System.out.println("SNI in session is " + sni);
+            }
+
+            throw new Exception(
+                    "server name indication does not match capabilities");
+        }
+
+        checkSNIInSession(session);
+    }
+
+    void checkSNIInSession(ExtendedSSLSession session) throws Exception {
+        List<SNIServerName> sessionSNI = session.getRequestedServerNames();
+        if (!sessionSNI.isEmpty()) {
+            throw new Exception(
+                    "should be empty request server name indication");
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketExplorerWithSrvSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketExplorerWithSrvSNI() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketInconsistentSNI.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/**
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @run main/othervm SSLSocketInconsistentSNI
+ */
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.util.*;
+import java.net.*;
+import javax.net.ssl.*;
+
+public class SSLSocketInconsistentSNI {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = true;
+
+    /*
+     * Where do we find the keystores?
+     */
+    static String pathToStores = "../../../../etc";
+    static String keyStoreFile = "keystore";
+    static String trustStoreFile = "truststore";
+    static String passwd = "passphrase";
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * If the client or server is doing some kind of object creation
+     * that the other side depends on, and that thread prematurely
+     * exits, you may experience a hang.  The test harness will
+     * terminate all hung threads after its timeout has expired,
+     * currently 3 minutes by default, but you might try to be
+     * smart about it....
+     */
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLServerSocketFactory sslssf =
+            (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket) sslssf.createServerSocket(serverPort);
+
+        SNIMatcher matcher = SNIHostName.createSNIMatcher(
+                                                serverAcceptableHostname);
+        Collection<SNIMatcher> matchers = new ArrayList<>(1);
+        matchers.add(matcher);
+        SSLParameters params = sslServerSocket.getSSLParameters();
+        params.setSNIMatchers(matchers);
+        sslServerSocket.setSSLParameters(params);
+
+        serverPort = sslServerSocket.getLocalPort();
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslIS.read();
+            sslOS.write(85);
+            sslOS.flush();
+
+            throw new Exception(
+                "Mismatched server name indication was accepted");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected unrecognized server name indication exception
+        } catch (IOException ioe) {
+            // the peer may have closed the socket because of the unmatched
+            // server name indication.
+        } finally {
+            sslSocket.close();
+            sslServerSocket.close();
+        }
+    }
+
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLSocketFactory sslsf =
+            (SSLSocketFactory) SSLSocketFactory.getDefault();
+        SSLSocket sslSocket = (SSLSocket)
+            sslsf.createSocket("localhost", serverPort);
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setServerNames(serverNames);
+        sslSocket.setSSLParameters(params);
+
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslOS.write(280);
+            sslOS.flush();
+            sslIS.read();
+
+            throw new Exception(
+                "Mismatched server name indication was accepted");
+        } catch (SSLHandshakeException sslhe) {
+            // the expected unrecognized server name indication exception
+        } catch (IOException ioe) {
+            // the peer may have closed the socket because of the unmatched
+            // server name indication.
+        } finally {
+            sslSocket.close();
+        }
+    }
+
+    private static String clientRequestedHostname = "www.example.com";
+    private static String serverAcceptableHostname = "www\\.example\\.org";
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        String keyFilename =
+            System.getProperty("test.src", ".") + "/" + pathToStores +
+                "/" + keyStoreFile;
+        String trustFilename =
+            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);
+
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketInconsistentSNI();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketInconsistentSNI() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/ServerName/SSLSocketSNISensitive.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 7068321
+ * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
+ * @run main/othervm SSLSocketSNISensitive PKIX www.example.com
+ * @run main/othervm SSLSocketSNISensitive SunX509 www.example.com
+ * @run main/othervm SSLSocketSNISensitive PKIX www.example.net
+ * @run main/othervm SSLSocketSNISensitive SunX509 www.example.net
+ * @run main/othervm SSLSocketSNISensitive PKIX www.invalid.com
+ * @run main/othervm SSLSocketSNISensitive SunX509 www.invalid.com
+ */
+
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import javax.net.ssl.*;
+import java.security.KeyStore;
+import java.security.KeyFactory;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.*;
+import java.security.interfaces.*;
+import sun.misc.BASE64Decoder;
+
+
+public class SSLSocketSNISensitive {
+
+    /*
+     * =============================================================
+     * Set the various variables needed for the tests, then
+     * specify what tests to run on each side.
+     */
+
+    /*
+     * Should we run the client or server in a separate thread?
+     * Both sides can throw exceptions, but do you have a preference
+     * as to which side should be the main thread.
+     */
+    static boolean separateServerThread = false;
+
+    /*
+     * Where do we find the keystores?
+     */
+    // Certificates and key used in the test.
+    static String trustedCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICkjCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTIwNDE3MTIwNjA3WhcNMzMwMzI4MTIwNjA3WjA7MQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwgZ8wDQYJ\n" +
+        "KoZIhvcNAQEBBQADgY0AMIGJAoGBANY+7Enp+1S566kLcKk+qe4Ki6BxaHGZ+v7r\n" +
+        "vLksx9IQZCbAEf4YLbrZhKzKD3SPIJXyxPFwknAknIh3Knk8mViOZks7T8L3GnJr\n" +
+        "TBaVvDyTzDJum/QYiahfO2qpfN/Oya2UILmqsBAeLyWpzbQsAyWBXfoUtkOUgnzK\n" +
+        "fk6QAKYrAgMBAAGjgaUwgaIwHQYDVR0OBBYEFEtmQi7jT1ijXOafPsfkrLwSVu9e\n" +
+        "MGMGA1UdIwRcMFqAFEtmQi7jT1ijXOafPsfkrLwSVu9eoT+kPTA7MQswCQYDVQQG\n" +
+        "EwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2\n" +
+        "Y2WCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEE\n" +
+        "BQADgYEAkKWxMc4+ODk5WwLXXweB8/IKfVfrizNn0KLEgsZ6xNXFIXDpiPGAFcgl\n" +
+        "MzFO424JgyvUulsUc/X16Cnuwwntkk6KUG7vEV7h4o9sAV7Cax3gfQE/EZFb4ybn\n" +
+        "aBm1UsujMKd/ovqbbbxJbmOWzCeo0QfIGleDEyh3NBBZ0i11Kiw=\n" +
+        "-----END CERTIFICATE-----";
+
+    // web server certificate, www.example.com
+    static String targetCertStr_A =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICVTCCAb6gAwIBAgIBAjANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTIwNDE3MTIwNjA4WhcNMzIwMTAzMTIwNjA4WjBVMQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxGDAWBgNV\n" +
+        "BAMTD3d3dy5leGFtcGxlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA\n" +
+        "4zFp3PZNzsd3ZwG6FNNWO9eSN+UBymlf8oCwpKJM2tIinmMWvWIXnlx/2UXIfSAq\n" +
+        "QEG3aXkAFyEiGGpQlBbqcfrESsHsiz2pnnm5dG2v/eS0Bwz1jmcuNmwnh3UQw2Vl\n" +
+        "+BLk8ukdrLjiCT8jARiHExYf1Xg+wUqQ9y8NV26hdaUCAwEAAaNPME0wCwYDVR0P\n" +
+        "BAQDAgPoMB0GA1UdDgQWBBQwtx+gqzn2w4y82brXlp7tqBYEZDAfBgNVHSMEGDAW\n" +
+        "gBRLZkIu409Yo1zmnz7H5Ky8ElbvXjANBgkqhkiG9w0BAQQFAAOBgQAJWo8B6Ud+\n" +
+        "/OU+UcZLihlfMX02OSlK2ZB7mfqpj2G3JT9yb0A+VbY3uuajmaYYIIxl3kXGz/n8\n" +
+        "M2Q/Ux/MDxG+IFKHC26Kuj4dAQgzjq2pILVPTE2QnaQTNCsgVZtTaC47SG9FRSoC\n" +
+        "qvnIvn/oTpKSqus76I1cR4joDtiV2OEuVw==\n" +
+        "-----END CERTIFICATE-----";
+
+    // Private key in the format of PKCS#8
+    static String targetPrivateKey_A =
+        "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOMxadz2Tc7Hd2cB\n" +
+        "uhTTVjvXkjflAcppX/KAsKSiTNrSIp5jFr1iF55cf9lFyH0gKkBBt2l5ABchIhhq\n" +
+        "UJQW6nH6xErB7Is9qZ55uXRtr/3ktAcM9Y5nLjZsJ4d1EMNlZfgS5PLpHay44gk/\n" +
+        "IwEYhxMWH9V4PsFKkPcvDVduoXWlAgMBAAECgYAqX2nuIyXp3fvgA0twXOYlbRRB\n" +
+        "Rn3qAXM6qFPJsNeCrFR2k+aG1cev6nKR1FkLNTeMGnWZv06MAcr5IML8i7WXyG4C\n" +
+        "LY/C0gedn94FDKFlln+bTENwQTGjn4lKysDA+IuNpasTeMCajbic+dPByhIdTOjZ\n" +
+        "iMCyxbLfpk40zQopVQJBAPyfGmkeHB3GjdbdgujWCGKb2UxBa4O8dy3O4l2yizTn\n" +
+        "uUqMGcwGY4ciNSVvZQ7jKo4vDmkSuYib4/woPChaNfMCQQDmO0BQuSWYGNtSwV35\n" +
+        "lafZfX1dNCLKm1iNA6A12evXgvQiE9WT4mqionig0VZW16HtiY4/BkHOcos/K9Um\n" +
+        "ARQHAkA8mkaRtSF1my5nv1gqVz5Hua+VdZQ/VDUbDiiL5cszc+ulkJqXsWirAG/T\n" +
+        "fTe3LJQG7A7+8fkEZrF4yoY0AAA1AkEAotokezULj5N9iAL5SzL9wIzQYV4ggfny\n" +
+        "YATBjXXxKccakwQ+ndWZIiMUeoS4ssLialhTgucVI0fIkU2a/r/ifwJAc6e+5Pvh\n" +
+        "MghQj/U788Od/v6rgqz/NGsduZ7uilCMcWiwA73OR2MHMH/OIuoofuEPrfuV9isV\n" +
+        "xVXhgpKfP/pdOA==";
+
+    // web server certificate, www.example.net
+    static String targetCertStr_B =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICVTCCAb6gAwIBAgIBBDANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTIwNDE3MTIwNjA5WhcNMzIwMTAzMTIwNjA5WjBVMQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxGDAWBgNV\n" +
+        "BAMTD3d3dy5leGFtcGxlLm5ldDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA\n" +
+        "2VlzF1fvWYczDChrUeJiLJ1M/dIShCaOTfYGiXfQGEZCAWTacUclwr+rVMnZ75/c\n" +
+        "wwg5pNdXRijxMil8DBTS1gFcIFQhosLHvzIAe6ULlg/xB+/L6KBz+NTWfo/2KF6t\n" +
+        "xatmcToNrCcwi7eUOfbzQje65Tizs56jJYem2m7Rk0ECAwEAAaNPME0wCwYDVR0P\n" +
+        "BAQDAgPoMB0GA1UdDgQWBBQT/FR0cAWcZQ7h0X79KGki34OSQjAfBgNVHSMEGDAW\n" +
+        "gBRLZkIu409Yo1zmnz7H5Ky8ElbvXjANBgkqhkiG9w0BAQQFAAOBgQB67cPIT6fz\n" +
+        "6Ws8fBpYgW2ad4ci66i1WduBD9CpGFE+jRK2feRj6hvYBXocKj0AMWUFIEB2E3hA\n" +
+        "oIjxcf1GxIpHVl9DjlhxqXbA0Ktl7/NGNRlDSLTizOTl3FB1mMTlOGvXDVmpcFhl\n" +
+        "HuoP1hYvhTsBwPx5igGNchuPtDIUzL2mXw==\n" +
+        "-----END CERTIFICATE-----";
+
+    static String targetPrivateKey_B =
+        "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANlZcxdX71mHMwwo\n" +
+        "a1HiYiydTP3SEoQmjk32Bol30BhGQgFk2nFHJcK/q1TJ2e+f3MMIOaTXV0Yo8TIp\n" +
+        "fAwU0tYBXCBUIaLCx78yAHulC5YP8Qfvy+igc/jU1n6P9ihercWrZnE6DawnMIu3\n" +
+        "lDn280I3uuU4s7OeoyWHptpu0ZNBAgMBAAECgYEAl19H26sfhD+32rDPxZCgBShs\n" +
+        "dZ33zVe45i0Bcn4iTLWpxKTDyf7eGps4rO2DvfKdYqt40ggzvSZIjUH9JcDe8GmG\n" +
+        "d3m0ILB7pg4jsFlpyeHpTO8grPLxA1G9s3o0DoFpz/rooqgFfe/DrRDmRoOSkgfV\n" +
+        "/gseIbgJHRO/Ctyvdh0CQQD6uFd0HxhH1jl/JzvPzIH4LSnPcdEh9zsMEb6uzh75\n" +
+        "9qL+IHD5N2I/pYZTKqDFIwhJf701+LKag55AX/zrDt7rAkEA3e00AbnwanDMa6Wj\n" +
+        "+gFekUQveSVra38LiihzCkyVvQpFjbiF1rUhSNQ0dpU5/hmrYF0C6H9VXAesfkUY\n" +
+        "WhpDgwJAYjgZOop77piDycZK7isFt32p5XSHIzFBVocVFlH1XKM8UyXOXDNQL/Le\n" +
+        "XnJSrSf+NRzvuNcG0PVC56Ey6brXpQJAY4M4vcltt5zq3R5CQBmbGRJ1IyKXX3Vx\n" +
+        "bDslEqoyvri7ZYgnY5aG3UxiVgYmIf3KrgQnCLAIS6MZQumiuMxsFwJAK5pEG063\n" +
+        "9ngUof4fDMvZphqZjZR1zMKz/V/9ge0DWBINaqFgsgebNu+MyImsC8C6WKjGmV/2\n" +
+        "f1MY0D7sC2vU/Q==";
+
+    // web server certificate, www.invalid.com
+    static String targetCertStr_C =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICVTCCAb6gAwIBAgIBAzANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTIwNDE3MTIwNjA5WhcNMzIwMTAzMTIwNjA5WjBVMQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxGDAWBgNV\n" +
+        "BAMTD3d3dy5pbnZhbGlkLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA\n" +
+        "q6MyQwzCr2nJ41l0frmHL0qULSyW51MhevBC+1W28i0LE/efrmpwV3LdnlQEGFak\n" +
+        "DLDwtnff3iru8dSMcA7KdWVkivsE7ZTP+qFDaWBAy7XXiSsv6yZ2Nh4jJb0YcD28\n" +
+        "45zk2nAl5Az1/PuoTi1vpQxzFZKuBm1HGgz3MEZvBvMCAwEAAaNPME0wCwYDVR0P\n" +
+        "BAQDAgPoMB0GA1UdDgQWBBRRMifrND015Nm8N6gV5X7cg1YjjjAfBgNVHSMEGDAW\n" +
+        "gBRLZkIu409Yo1zmnz7H5Ky8ElbvXjANBgkqhkiG9w0BAQQFAAOBgQBjkUO6Ri/B\n" +
+        "uDC2gDMIyL5+NTe/1dPPQYM4HhCNa/KQYvU5lzCKO9Vpa+i+nyrUNNXUu8Tkyq4Y\n" +
+        "A+aGSm6+FT/i9rFwkYUdorBtD3KfQiwTIWrVERXBkWI5iZNaVZhx0TFy4vUpf65d\n" +
+        "QtwkbHpC66fdKc2EdLXkuY9KkmtZZJJ7YA==\n" +
+        "-----END CERTIFICATE-----";
+
+    static String targetPrivateKey_C =
+        "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKujMkMMwq9pyeNZ\n" +
+        "dH65hy9KlC0sludTIXrwQvtVtvItCxP3n65qcFdy3Z5UBBhWpAyw8LZ3394q7vHU\n" +
+        "jHAOynVlZIr7BO2Uz/qhQ2lgQMu114krL+smdjYeIyW9GHA9vOOc5NpwJeQM9fz7\n" +
+        "qE4tb6UMcxWSrgZtRxoM9zBGbwbzAgMBAAECgYASJDK40Y12Wvki1Z6xkkyOnBRj\n" +
+        "XfYpRykfxGtgA2RN3qLwHlk7Zzaul46DIKA6LlYynTUkJDF+Ww1cdDnP0lBlwcmM\n" +
+        "iD0ck3zYyYBLhQHuVbkK3SYE+ANRhM0icvvqANP2at/U4awQcPNEae/KCiecLNu3\n" +
+        "CJGqyhPDdrEAqPuJGQJBAN46pQC6l3yrcSYE2s53jSmsm2HVVOFlFXjU6k/RMTxG\n" +
+        "FfDJtGUAOQ37rPQ06ugr/gjLAmmPp+FXozaBdA32D80CQQDFuGRgv3WYqbglIcRL\n" +
+        "JRs6xlj9w1F97s/aiUenuwhIPNiUoRbV7mnNuZ/sGF0svOVE7SazRjuFX6UqL9Y9\n" +
+        "HzG/AkEA170pCI8cl4w8eUNHRB9trGKEKjMXhwVCFh7lJf2ZBcGodSzr8w2HVhrZ\n" +
+        "Ke7hiemDYffrbJ1oxmv05+o+x3r0lQJBAL6adVm2+FyFMFnLZXmzeb59O4jWY5bt\n" +
+        "Qz6/HG6bpO5OidMuP99YCHMkQQDOs/PO3Y5GuAoW6IY4n/Y9S2B80+0CQBl1/H9/\n" +
+        "0n/vrb6vW6Azds49tuS82RFAnOhtwTyBEajs08WF8rZQ3WD2RHJnH0+jjfL0anIp\n" +
+        "dQBSeNN7s7b6rRk=";
+
+    // This is a certificate for client
+    static String targetCertStr_D=
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICVDCCAb2gAwIBAgIBBTANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" +
+        "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" +
+        "MTIwNDE3MTIwNjEwWhcNMzIwMTAzMTIwNjEwWjBUMQswCQYDVQQGEwJVUzENMAsG\n" +
+        "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxFzAVBgNV\n" +
+        "BAMTDkludGVyT3AgVGVzdGVyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo\n" +
+        "Q/KoAIAC2ljFfW2KwjnxTzi4NQJeUuk2seqKpsAY8x4O5dvixzUl6142zmljapqi\n" +
+        "bJloQVpfB+CEc5/l4h5gzGRVzkuqP1oPzDrpZ5GsvmvuHenV/TzCIgX1cLETzQVt\n" +
+        "6Rk06okoBPnw3hDJEJiEc1Rv7HCE8p/p+SaiHrskwwIDAQABo08wTTALBgNVHQ8E\n" +
+        "BAMCA+gwHQYDVR0OBBYEFPr91O33RIGfFSqza2AwQIgE4QswMB8GA1UdIwQYMBaA\n" +
+        "FEtmQi7jT1ijXOafPsfkrLwSVu9eMA0GCSqGSIb3DQEBBAUAA4GBANIDFYgAhoj3\n" +
+        "B8u1YpqeoEp2Lt9TwrYBshaIrbmBPCwCGio0JIsoov3n8BCSg5F+8MnOtPl+TjeO\n" +
+        "0Ug+7guPdCk/wg8YNxLHgSsQlpcNJDjWiErqmUPVrg5BPPQb65qMund6KTmMN0y6\n" +
+        "4EbSmxRpZO/N0/5oK4umTk0EeXKNekBj\n" +
+        "-----END CERTIFICATE-----";
+
+    static String targetPrivateKey_D =
+        "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAOhD8qgAgALaWMV9\n" +
+        "bYrCOfFPOLg1Al5S6Tax6oqmwBjzHg7l2+LHNSXrXjbOaWNqmqJsmWhBWl8H4IRz\n" +
+        "n+XiHmDMZFXOS6o/Wg/MOulnkay+a+4d6dX9PMIiBfVwsRPNBW3pGTTqiSgE+fDe\n" +
+        "EMkQmIRzVG/scITyn+n5JqIeuyTDAgMBAAECgYBw37yIKp4LRONJLnhSq6sO+0n8\n" +
+        "Mz6waiiN/Q6XTQwj09pysQAYCGlqwSRrDAqpVsBJWO+Ae+oYLrLMi4hUZnwN75v3\n" +
+        "pe1nXlrD11RmPLXwBxqFxNSvAs2FgLHZEtwHI7Bn8KybT/8bGkQ8csLceInYtMDD\n" +
+        "MuTyy2KRk/pj60zIKQJBAPgebQiAH6viFQ88AwHaNvQhlUfwmSC1i6f8LVoeqaHC\n" +
+        "lnP0LJBwlyDeeEInhHrCR2ibnCB6I/Pig+49XQgabK8CQQDvpJwuGEbsOO+3rkJJ\n" +
+        "OpOw4toG0QJZdRnT6l8I6BlboQRZSfFh+lGGahvFXkxc4KdUpJ7QPtXU7HHk6Huk\n" +
+        "8RYtAkA9CW8VGj+wTuuTVdX/jKjcIa7RhbSFwWNbrcOSWdys+Gt+luCnn6rt4QyA\n" +
+        "aaxDbquWZkFgE+voQR7nap0KM0XtAkAznd0WAJymHM1lXt9gLoHJQ9N6TGKZKiPa\n" +
+        "BU1a+cMcfV4WbVrUo7oTnZ9Fr73681iXXq3mZOJh7lvJ1llreZIxAkBEnbiTgEf4\n" +
+        "tvku68jHcRbRPmdS7CBSWNEBaHLOm4pUSTcxVTKKMHw7vmM5/UYUxJ8QNKCYxn6O\n" +
+        "+vtiBwBawwzN";
+
+    static String[] serverCerts = {targetCertStr_A,
+                                targetCertStr_B, targetCertStr_C};
+    static String[] serverKeys  = {targetPrivateKey_A,
+                                targetPrivateKey_B, targetPrivateKey_C};
+    static String[] clientCerts = {targetCertStr_D};
+    static String[] clientKeys  = {targetPrivateKey_D};
+
+    static char passphrase[] = "passphrase".toCharArray();
+
+    /*
+     * Is the server ready to serve?
+     */
+    volatile static boolean serverReady = false;
+
+    /*
+     * Turn on SSL debugging?
+     */
+    static boolean debug = false;
+
+    /*
+     * Define the server side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doServerSide() throws Exception {
+        SSLContext context = generateSSLContext(false);
+        SSLServerSocketFactory sslssf = context.getServerSocketFactory();
+        SSLServerSocket sslServerSocket =
+            (SSLServerSocket)sslssf.createServerSocket(serverPort);
+        serverPort = sslServerSocket.getLocalPort();
+
+        /*
+         * Signal Client, we're ready for his connect.
+         */
+        serverReady = true;
+
+        SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept();
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslIS.read();
+            sslOS.write('A');
+            sslOS.flush();
+
+            SSLSession session = sslSocket.getSession();
+            checkCertificate(session.getLocalCertificates(),
+                                                clientRequestedHostname);
+        } finally {
+            sslSocket.close();
+            sslServerSocket.close();
+        }
+    }
+
+    /*
+     * Define the client side of the test.
+     *
+     * If the server prematurely exits, serverReady will be set to true
+     * to avoid infinite hangs.
+     */
+    void doClientSide() throws Exception {
+
+        /*
+         * Wait for server to get started.
+         */
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        SSLContext context = generateSSLContext(true);
+        SSLSocketFactory sslsf = context.getSocketFactory();
+
+        SSLSocket sslSocket =
+            (SSLSocket)sslsf.createSocket("localhost", serverPort);
+
+        SNIHostName serverName = new SNIHostName(clientRequestedHostname);
+        List<SNIServerName> serverNames = new ArrayList<>(1);
+        serverNames.add(serverName);
+        SSLParameters params = sslSocket.getSSLParameters();
+        params.setServerNames(serverNames);
+        sslSocket.setSSLParameters(params);
+
+        try {
+            InputStream sslIS = sslSocket.getInputStream();
+            OutputStream sslOS = sslSocket.getOutputStream();
+
+            sslOS.write('B');
+            sslOS.flush();
+            sslIS.read();
+
+            SSLSession session = sslSocket.getSession();
+            checkCertificate(session.getPeerCertificates(),
+                                                clientRequestedHostname);
+        } finally {
+            sslSocket.close();
+        }
+    }
+
+    private static void checkCertificate(Certificate[] certs,
+            String hostname) throws Exception {
+        if (certs != null && certs.length != 0) {
+            X509Certificate x509Cert = (X509Certificate)certs[0];
+
+            String subject = x509Cert.getSubjectX500Principal().getName();
+
+            if (!subject.contains(hostname)) {
+                throw new Exception(
+                        "Not the expected certificate: " + subject);
+            }
+        }
+    }
+
+    /*
+     * =============================================================
+     * The remainder is just support stuff
+     */
+    private static String tmAlgorithm;             // trust manager
+    private static String clientRequestedHostname; // server name indication
+
+    private static void parseArguments(String[] args) {
+        tmAlgorithm = args[0];
+        clientRequestedHostname = args[1];
+    }
+
+    private static SSLContext generateSSLContext(boolean isClient)
+            throws Exception {
+
+        // generate certificate from cert string
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        // create a key store
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(null, null);
+
+        // import the trused cert
+        ByteArrayInputStream is =
+                    new ByteArrayInputStream(trustedCertStr.getBytes());
+        Certificate trusedCert = cf.generateCertificate(is);
+        is.close();
+
+        ks.setCertificateEntry("RSA Export Signer", trusedCert);
+
+        String[] certStrs = null;
+        String[] keyStrs = null;
+        if (isClient) {
+            certStrs = clientCerts;
+            keyStrs = clientKeys;
+        } else {
+            certStrs = serverCerts;
+            keyStrs = serverKeys;
+        }
+
+        for (int i = 0; i < certStrs.length; i++) {
+            // generate the private key.
+            String keySpecStr = keyStrs[i];
+            PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec(
+                                new BASE64Decoder().decodeBuffer(keySpecStr));
+            KeyFactory kf = KeyFactory.getInstance("RSA");
+            RSAPrivateKey priKey =
+                    (RSAPrivateKey)kf.generatePrivate(priKeySpec);
+
+            // generate certificate chain
+            String keyCertStr = certStrs[i];
+            is = new ByteArrayInputStream(keyCertStr.getBytes());
+            Certificate keyCert = cf.generateCertificate(is);
+            is.close();
+
+            Certificate[] chain = new Certificate[2];
+            chain[0] = keyCert;
+            chain[1] = trusedCert;
+
+            // import the key entry.
+            ks.setKeyEntry("key-entry-" + i, priKey, passphrase, chain);
+        }
+
+        // create SSL context
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlgorithm);
+        tmf.init(ks);
+
+        SSLContext ctx = SSLContext.getInstance("TLS");
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
+        kmf.init(ks, passphrase);
+
+        ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+        ks = null;
+
+        return ctx;
+    }
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    public static void main(String[] args) throws Exception {
+        if (debug)
+            System.setProperty("javax.net.debug", "all");
+
+        /*
+         * Get the customized arguments.
+         */
+        parseArguments(args);
+
+        /*
+         * Start the tests.
+         */
+        new SSLSocketSNISensitive();
+    }
+
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    /*
+     * Primary constructor, used to drive remainder of the test.
+     *
+     * Fork off the other side, then do your work.
+     */
+    SSLSocketSNISensitive() throws Exception {
+        try {
+            if (separateServerThread) {
+                startServer(true);
+                startClient(false);
+            } else {
+                startClient(true);
+                startServer(false);
+            }
+        } catch (Exception e) {
+            // swallow for now.  Show later
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         * Which side threw the error?
+         */
+        Exception local;
+        Exception remote;
+        String whichRemote;
+
+        if (separateServerThread) {
+            remote = serverException;
+            local = clientException;
+            whichRemote = "server";
+        } else {
+            remote = clientException;
+            local = serverException;
+            whichRemote = "client";
+        }
+
+        /*
+         * If both failed, return the curthread's exception, but also
+         * print the remote side Exception
+         */
+        if ((local != null) && (remote != null)) {
+            System.out.println(whichRemote + " also threw:");
+            remote.printStackTrace();
+            System.out.println();
+            throw local;
+        }
+
+        if (remote != null) {
+            throw remote;
+        }
+
+        if (local != null) {
+            throw local;
+        }
+    }
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            try {
+                doServerSide();
+            } catch (Exception e) {
+                serverException = e;
+            } finally {
+                serverReady = true;
+            }
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            try {
+                doClientSide();
+            } catch (Exception e) {
+                clientException = e;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/templates/SSLCapabilities.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.util.List;
+import javax.net.ssl.SNIServerName;
+
+/**
+ * Encapsulates the security capabilities of an SSL/TLS connection.
+ * <P>
+ * The security capabilities are the list of ciphersuites to be accepted in
+ * an SSL/TLS handshake, the record version, the hello version, and server
+ * name indication, etc., of an SSL/TLS connection.
+ * <P>
+ * <code>SSLCapabilities</code> can be retrieved by exploring the network
+ * data of an SSL/TLS connection via {@link SSLExplorer#explore(ByteBuffer)}
+ * or {@link SSLExplorer#explore(byte[], int, int)}.
+ *
+ * @see SSLExplorer
+ */
+public abstract class SSLCapabilities {
+
+    /**
+     * Returns the record version of an SSL/TLS connection
+     *
+     * @return a non-null record version
+     */
+    public abstract String getRecordVersion();
+
+    /**
+     * Returns the hello version of an SSL/TLS connection
+     *
+     * @return a non-null hello version
+     */
+    public abstract String getHelloVersion();
+
+    /**
+     * Returns a <code>List</code> containing all {@link SNIServerName}s
+     * of the server name indication.
+     *
+     * @return a non-null immutable list of {@link SNIServerName}s
+     *         of the server name indication parameter, may be empty
+     *         if no server name indication.
+     *
+     * @see SNIServerName
+     */
+    public abstract List<SNIServerName> getServerNames();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/templates/SSLExplorer.java	Tue Oct 23 09:41:52 2012 -0700
@@ -0,0 +1,615 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please 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.nio.ByteBuffer;
+import java.nio.BufferUnderflowException;
+import java.io.IOException;
+import javax.net.ssl.*;
+import java.util.*;
+
+import sun.misc.HexDumpEncoder;
+
+/**
+ * Instances of this class acts as an explorer of the network data of an
+ * SSL/TLS connection.
+ */
+public final class SSLExplorer {
+
+    // Private constructor prevents construction outside this class.
+    private SSLExplorer() {
+    }
+
+    /**
+     * The header size of TLS/SSL records.
+     * <P>
+     * The value of this constant is {@value}.
+     */
+    public final static int RECORD_HEADER_SIZE = 0x05;
+
+    /**
+     * Returns the required number of bytes in the {@code source}
+     * {@link ByteBuffer} necessary to explore SSL/TLS connection.
+     * <P>
+     * This method tries to parse as few bytes as possible from
+     * {@code source} byte buffer to get the length of an
+     * SSL/TLS record.
+     * <P>
+     * This method accesses the {@code source} parameter in read-only
+     * mode, and does not update the buffer's properties such as capacity,
+     * limit, position, and mark values.
+     *
+     * @param  source
+     *         a {@link ByteBuffer} containing
+     *         inbound or outbound network data for an SSL/TLS connection.
+     * @throws BufferUnderflowException if less than {@code RECORD_HEADER_SIZE}
+     *         bytes remaining in {@code source}
+     * @return the required size in byte to explore an SSL/TLS connection
+     */
+    public final static int getRequiredSize(ByteBuffer source) {
+
+        ByteBuffer input = source.duplicate();
+
+        // Do we have a complete header?
+        if (input.remaining() < RECORD_HEADER_SIZE) {
+            throw new BufferUnderflowException();
+        }
+
+        // Is it a handshake message?
+        byte firstByte = input.get();
+        byte secondByte = input.get();
+        byte thirdByte = input.get();
+        if ((firstByte & 0x80) != 0 && thirdByte == 0x01) {
+            // looks like a V2ClientHello
+            // return (((firstByte & 0x7F) << 8) | (secondByte & 0xFF)) + 2;
+            return RECORD_HEADER_SIZE;   // Only need the header fields
+        } else {
+            return (((input.get() & 0xFF) << 8) | (input.get() & 0xFF)) + 5;
+        }
+    }
+
+    /**
+     * Returns the required number of bytes in the {@code source} byte array
+     * necessary to explore SSL/TLS connection.
+     * <P>
+     * This method tries to parse as few bytes as possible from
+     * {@code source} byte array to get the length of an
+     * SSL/TLS record.
+     *
+     * @param  source
+     *         a byte array containing inbound or outbound network data for
+     *         an SSL/TLS connection.
+     * @param  offset
+     *         the start offset in array {@code source} at which the
+     *         network data is read from.
+     * @param  length
+     *         the maximum number of bytes to read.
+     *
+     * @throws BufferUnderflowException if less than {@code RECORD_HEADER_SIZE}
+     *         bytes remaining in {@code source}
+     * @return the required size in byte to explore an SSL/TLS connection
+     */
+    public final static int getRequiredSize(byte[] source,
+            int offset, int length) throws IOException {
+
+        ByteBuffer byteBuffer =
+            ByteBuffer.wrap(source, offset, length).asReadOnlyBuffer();
+        return getRequiredSize(byteBuffer);
+    }
+
+    /**
+     * Launch and explore the security capabilities from byte buffer.
+     * <P>
+     * This method tries to parse as few records as possible from
+     * {@code source} byte buffer to get the {@link SSLCapabilities}
+     * of an SSL/TLS connection.
+     * <P>
+     * Please NOTE that this method must be called before any handshaking
+     * occurs.  The behavior of this method is not defined in this release
+     * if the handshake has begun, or has completed.
+     * <P>
+     * This method accesses the {@code source} parameter in read-only
+     * mode, and does not update the buffer's properties such as capacity,
+     * limit, position, and mark values.
+     *
+     * @param  source
+     *         a {@link ByteBuffer} containing
+     *         inbound or outbound network data for an SSL/TLS connection.
+     *
+     * @throws IOException on network data error
+     * @throws BufferUnderflowException if not enough source bytes available
+     *         to make a complete exploration.
+     *
+     * @return the explored {@link SSLCapabilities} of the SSL/TLS
+     *         connection
+     */
+    public final static SSLCapabilities explore(ByteBuffer source)
+            throws IOException {
+
+        ByteBuffer input = source.duplicate();
+
+        // Do we have a complete header?
+        if (input.remaining() < RECORD_HEADER_SIZE) {
+            throw new BufferUnderflowException();
+        }
+
+        // Is it a handshake message?
+        byte firstByte = input.get();
+        byte secondByte = input.get();
+        byte thirdByte = input.get();
+        if ((firstByte & 0x80) != 0 && thirdByte == 0x01) {
+            // looks like a V2ClientHello
+            return exploreV2HelloRecord(input,
+                                    firstByte, secondByte, thirdByte);
+        } else if (firstByte == 22) {   // 22: handshake record
+            return exploreTLSRecord(input,
+                                    firstByte, secondByte, thirdByte);
+        } else {
+            throw new SSLException("Not handshake record");
+        }
+    }
+
+    /**
+     * Launch and explore the security capabilities from byte array.
+     * <P>
+     * Please NOTE that this method must be called before any handshaking
+     * occurs.  The behavior of this method is not defined in this release
+     * if the handshake has begun, or has completed.  Once handshake has
+     * begun, or has completed, the security capabilities can not and
+     * should not be launched with this method.
+     *
+     * @param  source
+     *         a byte array containing inbound or outbound network data for
+     *         an SSL/TLS connection.
+     * @param  offset
+     *         the start offset in array {@code source} at which the
+     *         network data is read from.
+     * @param  length
+     *         the maximum number of bytes to read.
+     *
+     * @throws IOException on network data error
+     * @throws BufferUnderflowException if not enough source bytes available
+     *         to make a complete exploration.
+     * @return the explored {@link SSLCapabilities} of the SSL/TLS
+     *         connection
+     *
+     * @see #explore(ByteBuffer)
+     */
+    public final static SSLCapabilities explore(byte[] source,
+            int offset, int length) throws IOException {
+        ByteBuffer byteBuffer =
+            ByteBuffer.wrap(source, offset, length).asReadOnlyBuffer();
+        return explore(byteBuffer);
+    }
+
+    /*
+     * uint8 V2CipherSpec[3];
+     * struct {
+     *     uint16 msg_length;         // The highest bit MUST be 1;
+     *                                // the remaining bits contain the length
+     *                                // of the following data in bytes.
+     *     uint8 msg_type;            // MUST be 1
+     *     Version version;
+     *     uint16 cipher_spec_length; // It cannot be zero and MUST be a
+     *                                // multiple of the V2CipherSpec length.
+     *     uint16 session_id_length;  // This field MUST be empty.
+     *     uint16 challenge_length;   // SHOULD use a 32-byte challenge
+     *     V2CipherSpec cipher_specs[V2ClientHello.cipher_spec_length];
+     *     opaque session_id[V2ClientHello.session_id_length];
+     *     opaque challenge[V2ClientHello.challenge_length;
+     * } V2ClientHello;
+     */
+    private static SSLCapabilities exploreV2HelloRecord(
+            ByteBuffer input, byte firstByte, byte secondByte,
+            byte thirdByte) throws IOException {
+
+        // We only need the header. We have already had enough source bytes.
+        // int recordLength = (firstByte & 0x7F) << 8) | (secondByte & 0xFF);
+        try {
+            // Is it a V2ClientHello?
+            if (thirdByte != 0x01) {
+                throw new SSLException(
+                        "Unsupported or Unrecognized SSL record");
+            }
+
+            // What's the hello version?
+            byte helloVersionMajor = input.get();
+            byte helloVersionMinor = input.get();
+
+            // 0x00: major version of SSLv20
+            // 0x02: minor version of SSLv20
+            //
+            // SNIServerName is an extension, SSLv20 doesn't support extension.
+            return new SSLCapabilitiesImpl((byte)0x00, (byte)0x02,
+                        helloVersionMajor, helloVersionMinor,
+                        Collections.<SNIServerName>emptyList());
+        } catch (BufferUnderflowException bufe) {
+            throw new SSLProtocolException(
+                        "Invalid handshake record");
+        }
+    }
+
+    /*
+     * struct {
+     *     uint8 major;
+     *     uint8 minor;
+     * } ProtocolVersion;
+     *
+     * enum {
+     *     change_cipher_spec(20), alert(21), handshake(22),
+     *     application_data(23), (255)
+     * } ContentType;
+     *
+     * struct {
+     *     ContentType type;
+     *     ProtocolVersion version;
+     *     uint16 length;
+     *     opaque fragment[TLSPlaintext.length];
+     * } TLSPlaintext;
+     */
+    private static SSLCapabilities exploreTLSRecord(
+            ByteBuffer input, byte firstByte, byte secondByte,
+            byte thirdByte) throws IOException {
+
+        // Is it a handshake message?
+        if (firstByte != 22) {        // 22: handshake record
+            throw new SSLException("Not handshake record");
+        }
+
+        // We need the record version to construct SSLCapabilities.
+        byte recordMajorVersion = secondByte;
+        byte recordMinorVersion = thirdByte;
+
+        // Is there enough data for a full record?
+        int recordLength = getInt16(input);
+        if (recordLength > input.remaining()) {
+            throw new BufferUnderflowException();
+        }
+
+        // We have already had enough source bytes.
+        try {
+            return exploreHandshake(input,
+                recordMajorVersion, recordMinorVersion, recordLength);
+        } catch (BufferUnderflowException bufe) {
+            throw new SSLProtocolException(
+                        "Invalid handshake record");
+        }
+    }
+
+    /*
+     * enum {
+     *     hello_request(0), client_hello(1), server_hello(2),
+     *     certificate(11), server_key_exchange (12),
+     *     certificate_request(13), server_hello_done(14),
+     *     certificate_verify(15), client_key_exchange(16),
+     *     finished(20)
+     *     (255)
+     * } HandshakeType;
+     *
+     * struct {
+     *     HandshakeType msg_type;
+     *     uint24 length;
+     *     select (HandshakeType) {
+     *         case hello_request:       HelloRequest;
+     *         case client_hello:        ClientHello;
+     *         case server_hello:        ServerHello;
+     *         case certificate:         Certificate;
+     *         case server_key_exchange: ServerKeyExchange;
+     *         case certificate_request: CertificateRequest;
+     *         case server_hello_done:   ServerHelloDone;
+     *         case certificate_verify:  CertificateVerify;
+     *         case client_key_exchange: ClientKeyExchange;
+     *         case finished:            Finished;
+     *     } body;
+     * } Handshake;
+     */
+    private static SSLCapabilities exploreHandshake(
+            ByteBuffer input, byte recordMajorVersion,
+            byte recordMinorVersion, int recordLength) throws IOException {
+
+        // What is the handshake type?
+        byte handshakeType = input.get();
+        if (handshakeType != 0x01) {   // 0x01: client_hello message
+            throw new IllegalStateException("Not initial handshaking");
+        }
+
+        // What is the handshake body length?
+        int handshakeLength = getInt24(input);
+
+        // Theoretically, a single handshake message might span multiple
+        // records, but in practice this does not occur.
+        if (handshakeLength > (recordLength - 4)) { // 4: handshake header size
+            throw new SSLException("Handshake message spans multiple records");
+        }
+
+        input = input.duplicate();
+        input.limit(handshakeLength + input.position());
+        return exploreClientHello(input,
+                                    recordMajorVersion, recordMinorVersion);
+    }
+
+    /*
+     * struct {
+     *     uint32 gmt_unix_time;
+     *     opaque random_bytes[28];
+     * } Random;
+     *
+     * opaque SessionID<0..32>;
+     *
+     * uint8 CipherSuite[2];
+     *
+     * enum { null(0), (255) } CompressionMethod;
+     *
+     * struct {
+     *     ProtocolVersion client_version;
+     *     Random random;
+     *     SessionID session_id;
+     *     CipherSuite cipher_suites<2..2^16-2>;
+     *     CompressionMethod compression_methods<1..2^8-1>;
+     *     select (extensions_present) {
+     *         case false:
+     *             struct {};
+     *         case true:
+     *             Extension extensions<0..2^16-1>;
+     *     };
+     * } ClientHello;
+     */
+    private static SSLCapabilities exploreClientHello(
+            ByteBuffer input,
+            byte recordMajorVersion,
+            byte recordMinorVersion) throws IOException {
+
+        List<SNIServerName> snList = Collections.<SNIServerName>emptyList();
+
+        // client version
+        byte helloMajorVersion = input.get();
+        byte helloMinorVersion = input.get();
+
+        // ignore random
+        int position = input.position();
+        input.position(position + 32);  // 32: the length of Random
+
+        // ignore session id
+        ignoreByteVector8(input);
+
+        // ignore cipher_suites
+        ignoreByteVector16(input);
+
+        // ignore compression methods
+        ignoreByteVector8(input);
+
+        if (input.remaining() > 0) {
+            snList = exploreExtensions(input);
+        }
+
+        return new SSLCapabilitiesImpl(
+                recordMajorVersion, recordMinorVersion,
+                helloMajorVersion, helloMinorVersion, snList);
+    }
+
+    /*
+     * struct {
+     *     ExtensionType extension_type;
+     *     opaque extension_data<0..2^16-1>;
+     * } Extension;
+     *
+     * enum {
+     *     server_name(0), max_fragment_length(1),
+     *     client_certificate_url(2), trusted_ca_keys(3),
+     *     truncated_hmac(4), status_request(5), (65535)
+     * } ExtensionType;
+     */
+    private static List<SNIServerName> exploreExtensions(ByteBuffer input)
+            throws IOException {
+
+        int length = getInt16(input);           // length of extensions
+        while (length > 0) {
+            int extType = getInt16(input);      // extenson type
+            int extLen = getInt16(input);       // length of extension data
+
+            if (extType == 0x00) {      // 0x00: type of server name indication
+                return exploreSNIExt(input, extLen);
+            } else {                    // ignore other extensions
+                ignoreByteVector(input, extLen);
+            }
+
+            length -= extLen + 4;
+        }
+
+        return Collections.<SNIServerName>emptyList();
+    }
+
+    /*
+     * struct {
+     *     NameType name_type;
+     *     select (name_type) {
+     *         case host_name: HostName;
+     *     } name;
+     * } ServerName;
+     *
+     * enum {
+     *     host_name(0), (255)
+     * } NameType;
+     *
+     * opaque HostName<1..2^16-1>;
+     *
+     * struct {
+     *     ServerName server_name_list<1..2^16-1>
+     * } ServerNameList;
+     */
+    private static List<SNIServerName> exploreSNIExt(ByteBuffer input,
+            int extLen) throws IOException {
+
+        Map<Integer, SNIServerName> sniMap = new LinkedHashMap<>();
+
+        int remains = extLen;
+        if (extLen >= 2) {     // "server_name" extension in ClientHello
+            int listLen = getInt16(input);     // length of server_name_list
+            if (listLen == 0 || listLen + 2 != extLen) {
+                throw new SSLProtocolException(
+                    "Invalid server name indication extension");
+            }
+
+            remains -= 2;     // 0x02: the length field of server_name_list
+            while (remains > 0) {
+                int code = getInt8(input);      // name_type
+                int snLen = getInt16(input);    // length field of server name
+                if (snLen > remains) {
+                    throw new SSLProtocolException(
+                        "Not enough data to fill declared vector size");
+                }
+                byte[] encoded = new byte[snLen];
+                input.get(encoded);
+
+                SNIServerName serverName;
+                switch (code) {
+                    case StandardConstants.SNI_HOST_NAME:
+                        if (encoded.length == 0) {
+                            throw new SSLProtocolException(
+                                "Empty HostName in server name indication");
+                        }
+                        serverName = new SNIHostName(encoded);
+                        break;
+                    default:
+                        serverName = new UnknownServerName(code, encoded);
+                }
+                // check for duplicated server name type
+                if (sniMap.put(serverName.getType(), serverName) != null) {
+                    throw new SSLProtocolException(
+                            "Duplicated server name of type " +
+                            serverName.getType());
+                }
+
+                remains -= encoded.length + 3;  // NameType: 1 byte
+                                                // HostName length: 2 bytes
+            }
+        } else if (extLen == 0) {     // "server_name" extension in ServerHello
+            throw new SSLProtocolException(
+                        "Not server name indication extension in client");
+        }
+
+        if (remains != 0) {
+            throw new SSLProtocolException(
+                        "Invalid server name indication extension");
+        }
+
+        return Collections.<SNIServerName>unmodifiableList(
+                                            new ArrayList<>(sniMap.values()));
+    }
+
+    private static int getInt8(ByteBuffer input) {
+        return input.get();
+    }
+
+    private static int getInt16(ByteBuffer input) {
+        return ((input.get() & 0xFF) << 8) | (input.get() & 0xFF);
+    }
+
+    private static int getInt24(ByteBuffer input) {
+        return ((input.get() & 0xFF) << 16) | ((input.get() & 0xFF) << 8) |
+                (input.get() & 0xFF);
+    }
+
+    private static void ignoreByteVector8(ByteBuffer input) {
+        ignoreByteVector(input, getInt8(input));
+    }
+
+    private static void ignoreByteVector16(ByteBuffer input) {
+        ignoreByteVector(input, getInt16(input));
+    }
+
+    private static void ignoreByteVector24(ByteBuffer input) {
+        ignoreByteVector(input, getInt24(input));
+    }
+
+    private static void ignoreByteVector(ByteBuffer input, int length) {
+        if (length != 0) {
+            int position = input.position();
+            input.position(position + length);
+        }
+    }
+
+    private static class UnknownServerName extends SNIServerName {
+        UnknownServerName(int code, byte[] encoded) {
+            super(code, encoded);
+        }
+    }
+
+    private static final class SSLCapabilitiesImpl extends SSLCapabilities {
+        private final static Map<Integer, String> versionMap = new HashMap<>(5);
+
+        private final String recordVersion;
+        private final String helloVersion;
+        List<SNIServerName> sniNames;
+
+        static {
+            versionMap.put(0x0002, "SSLv2Hello");
+            versionMap.put(0x0300, "SSLv3");
+            versionMap.put(0x0301, "TLSv1");
+            versionMap.put(0x0302, "TLSv1.1");
+            versionMap.put(0x0303, "TLSv1.2");
+        }
+
+        SSLCapabilitiesImpl(byte recordMajorVersion, byte recordMinorVersion,
+                byte helloMajorVersion, byte helloMinorVersion,
+                List<SNIServerName> sniNames) {
+
+            int version = (recordMajorVersion << 8) | recordMinorVersion;
+            this.recordVersion = versionMap.get(version) != null ?
+                        versionMap.get(version) :
+                        unknownVersion(recordMajorVersion, recordMinorVersion);
+
+            version = (helloMajorVersion << 8) | helloMinorVersion;
+            this.helloVersion = versionMap.get(version) != null ?
+                        versionMap.get(version) :
+                        unknownVersion(helloMajorVersion, helloMinorVersion);
+
+            this.sniNames = sniNames;
+        }
+
+        @Override
+        public String getRecordVersion() {
+            return recordVersion;
+        }
+
+        @Override
+        public String getHelloVersion() {
+            return helloVersion;
+        }
+
+        @Override
+        public List<SNIServerName> getServerNames() {
+            if (!sniNames.isEmpty()) {
+                return Collections.<SNIServerName>unmodifiableList(sniNames);
+            }
+
+            return sniNames;
+        }
+
+        private static String unknownVersion(byte major, byte minor) {
+            return "Unknown-" + ((int)major) + "." + ((int)minor);
+        }
+    }
+}
+
--- a/test/sun/security/tools/jarsigner/JarSigningNonAscii.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/jarsigner/JarSigningNonAscii.java	Tue Oct 23 09:41:52 2012 -0700
@@ -62,7 +62,7 @@
                         "-signedJar", signedJar,
                         unsignedJar, "b"
                         };
-        JarSigner.main(jsArgs);
+        sun.security.tools.jarsigner.Main.main(jsArgs);
 
         //  verify the signed jar file
 
--- a/test/sun/security/tools/jarsigner/LargeJarEntry.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/jarsigner/LargeJarEntry.java	Tue Oct 23 09:41:52 2012 -0700
@@ -35,7 +35,6 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 import java.util.zip.CRC32;
-import sun.security.tools.JarSigner;
 
 public class LargeJarEntry {
 
@@ -73,7 +72,7 @@
                 jarName, "b" };
         // now, try to sign it
         try {
-            JarSigner.main(jsArgs);
+            sun.security.tools.jarsigner.Main.main(jsArgs);
         } catch (OutOfMemoryError err) {
             throw new Exception("Test failed with OutOfMemoryError", err);
         } finally {
--- a/test/sun/security/tools/keytool/CloseFile.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/CloseFile.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,13 @@
  * @bug 6489721
  * @summary keytool has not closed several file streams
  * @author weijun.wang
+ * @compile -XDignore.symbol.file CloseFile.java
+ * @run main CloseFile
  *
  * This test is only useful on Windows, which fails before the fix and succeeds
  * after it. On other platforms, it always passes.
  */
 
-import sun.security.tools.KeyTool;
 import java.io.*;
 
 public class CloseFile {
@@ -58,7 +59,7 @@
     }
 
     static void run(String s) throws Exception {
-        KeyTool.main((s+" -debug").split(" "));
+        sun.security.tools.keytool.Main.main((s+" -debug").split(" "));
     }
     static void remove(String filename, boolean check) {
         new File(filename).delete();
--- a/test/sun/security/tools/keytool/KeyToolTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/KeyToolTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -56,7 +56,6 @@
  */
 
 import java.security.KeyStore;
-import sun.security.tools.KeyTool;
 import sun.security.x509.*;
 import java.io.*;
 import java.security.KeyPairGenerator;
@@ -149,12 +148,13 @@
             System.setOut(new PrintStream(b1));
             System.setErr(new PrintStream(b2));
 
-            // since System.in is overrided, the KeyTool.main() method will
+            // since System.in is overrided, the
+            // sun.security.tools.keytool.Main.main() method will
             // never block at user input
 
-            // use -debug so that KeyTool.main() will throw an Exception
+            // use -debug so that main() will throw an Exception
             // instead of calling System.exit()
-            KeyTool.main(("-debug "+cmd).split("\\s+"));
+            sun.security.tools.keytool.Main.main(("-debug "+cmd).split("\\s+"));
         } finally {
             out = b1.toString();
             err = b2.toString();
--- a/test/sun/security/tools/keytool/NewSize7.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/NewSize7.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
  * @test
  * @bug 6561126
  * @summary keytool should use larger default keysize for keypairs
+ * @compile -XDignore.symbol.file NewSize7.java
+ * @run main NewSize7
  */
 
 import java.io.File;
@@ -34,13 +36,13 @@
 import java.security.KeyStore;
 import java.security.cert.X509Certificate;
 import java.security.interfaces.RSAPublicKey;
-import sun.security.tools.KeyTool;
 
 public class NewSize7 {
     public static void main(String[] args) throws Exception {
         String FILE = "newsize7-ks";
         new File(FILE).delete();
-        KeyTool.main(("-debug -genkeypair -keystore " + FILE +
+        sun.security.tools.keytool.Main.main(("-debug -genkeypair -keystore " +
+                FILE +
                 " -alias a -dname cn=c -storepass changeit" +
                 " -keypass changeit -keyalg rsa").split(" "));
         KeyStore ks = KeyStore.getInstance("JKS");
--- a/test/sun/security/tools/keytool/StartDateTest.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/StartDateTest.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
  * @test
  * @bug 6468285
  * @summary keytool ability to backdate self-signed certificates to compensate for clock skew
+ * @compile -XDignore.symbol.file StartDateTest.java
+ * @run main StartDateTest
  */
 
 import java.io.File;
@@ -35,7 +37,6 @@
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
-import sun.security.tools.KeyTool;
 
 public class StartDateTest {
     public static void main(String[] args) throws Exception {
@@ -66,7 +67,8 @@
         new File("jks").delete();
 
         // Part 2: Test format
-        Method m = KeyTool.class.getDeclaredMethod("getStartDate", String.class);
+        Method m = sun.security.tools.keytool.Main.class.getDeclaredMethod(
+                   "getStartDate", String.class);
         m.setAccessible(true);
         for (String s: new String[] {
                 null,       //NOW!
@@ -127,7 +129,7 @@
     }
 
     static void run(String s) throws Exception {
-        KeyTool.main((s+" -debug").split(" "));
+        sun.security.tools.keytool.Main.main((s+" -debug").split(" "));
     }
 
     static Date getIssueDate() throws Exception {
--- a/test/sun/security/tools/keytool/UnknownAndUnparseable.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/UnknownAndUnparseable.java	Tue Oct 23 09:41:52 2012 -0700
@@ -25,12 +25,13 @@
  * @test
  * @bug 7192202
  * @summary Make sure keytool prints both unknown and unparseable extensions
+ * @compile -XDignore.symbol.file UnknownAndUnparseable.java
+ * @run main UnknownAndUnparseable
  */
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.PrintStream;
-import sun.security.tools.KeyTool;
 import sun.security.x509.PKIXExtensions;
 
 public class UnknownAndUnparseable {
@@ -44,14 +45,14 @@
         String genkey = s
                 + "-genkeypair -alias a -dname CN=A -ext 1.2.3.4=1234 "
                 + "-ext " + PKIXExtensions.KeyUsage_Id.toString() + "=5678";
-        KeyTool.main(genkey.split(" "));
+        sun.security.tools.keytool.Main.main(genkey.split(" "));
 
         // Get the list output to a string
         String list = s + "-list -v";
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
         PrintStream oldOut = System.out;
         System.setOut(new PrintStream(bout));
-        KeyTool.main(list.split(" "));
+        sun.security.tools.keytool.Main.main(list.split(" "));
         System.setOut(oldOut);
         String out = bout.toString();
         System.out.println(out);
--- a/test/sun/security/tools/keytool/autotest.sh	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/autotest.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -78,7 +78,7 @@
 esac
 
 if [ "$LIBNAME" = "" ]; then
-  echo "Cannot find LIBNAME"
+  echo "Cannot find libsoftokn3.so"
   exit 1
 fi
 
--- a/test/sun/security/tools/keytool/standard.sh	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/tools/keytool/standard.sh	Tue Oct 23 09:41:52 2012 -0700
@@ -56,7 +56,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}KeyToolTest.java || exit 10
+${TESTJAVA}${FS}bin${FS}javac -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
 
 echo | ${TESTJAVA}${FS}bin${FS}java -Dfile KeyToolTest
 status=$?
--- a/test/sun/security/util/Resources/Format.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/util/Resources/Format.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -150,7 +150,7 @@
             s.getPrivateCredentials().add(new Format());
             System.out.println("Test 12, s.toString() = " + s.toString());
         } catch (Exception e) {
-            throw new SecurityException("test 12 failed: e.toString()");
+            throw new SecurityException("test 12 failed: e.toString()", e);
         }
 
         try {
--- a/test/sun/security/util/Resources/NewNamesFormat.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/util/Resources/NewNamesFormat.java	Tue Oct 23 09:41:52 2012 -0700
@@ -40,7 +40,9 @@
     public static void main(String[] args) throws Exception {
         checkRes("sun.security.util.Resources");
         checkRes("sun.security.util.AuthResources");
-        checkRes("sun.security.tools.JarSignerResources");
+        checkRes("sun.security.tools.jarsigner.Resources");
+        checkRes("sun.security.tools.keytool.Resources");
+        checkRes("sun.security.tools.policytool.Resources");
     }
 
     private static void checkRes(String resName) throws Exception {
--- a/test/sun/security/util/Resources/NewResourcesNames.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/util/Resources/NewResourcesNames.java	Tue Oct 23 09:41:52 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
  * 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,9 @@
     static int MAXLEN = 127;
 
     static String[] resources = {
-        "sun/security/tools/JarSignerResources.java",
+        "sun/security/tools/jarsigner/Resources.java",
+        "sun/security/tools/keytool/Resources.java",
+        "sun/security/tools/policytool/Resources.java",
         "sun/security/util/Resources.java",
         "sun/security/util/AuthResources.java",
     };
@@ -94,7 +96,7 @@
         //
         // This means a " exists right after getString(. Sometimes you see
         //
-        //      Working on sun/security/tools/KeyTool.java
+        //      Working on sun/security/tools/keytool/Main.java
         //          BAD!! pmatch != match: 212 != 209
         //      Working on sun/security/provider/PolicyFile.java
         //          BAD!! pmatch != match: 14 != 10
@@ -165,7 +167,7 @@
 
         Set<String> names = new HashSet<String>();
 
-        String file = "sun/security/tools/KeyTool.java";
+        String file = "sun/security/tools/keytool/Main.java";
         System.err.println("Working on " + file);
         File origFile = new File(file);
         File tmpFile = new File(file + ".tmp");
--- a/test/sun/security/x509/AlgorithmId/NonStandardNames.java	Tue Oct 23 09:40:06 2012 -0700
+++ b/test/sun/security/x509/AlgorithmId/NonStandardNames.java	Tue Oct 23 09:41:52 2012 -0700
@@ -25,6 +25,8 @@
  * @test
  * @bug 7180907
  * @summary Jarsigner -verify fails if rsa file used sha-256 with authenticated attributes
+ * @compile -XDignore.symbol.file NonStandardNames.java
+ * @run main NonStandardNames
  */
 
 import java.security.MessageDigest;
@@ -35,7 +37,7 @@
 import sun.security.pkcs.PKCS9Attribute;
 import sun.security.pkcs.PKCS9Attributes;
 import sun.security.pkcs.SignerInfo;
-import sun.security.tools.CertAndKeyGen;
+import sun.security.tools.keytool.CertAndKeyGen;
 import sun.security.x509.AlgorithmId;
 import sun.security.x509.X500Name;