diff -up openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java.sav openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java --- openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java.sav 2011-07-29 12:21:02.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java 2011-07-29 13:22:07.405902338 -0400 @@ -350,18 +350,15 @@ class ClassReader { if (attrCommands != null) { Attribute.Layout lkey = Attribute.keyForLookup(ctype, name); String cmd = attrCommands.get(lkey); - if (cmd != null) { - switch (cmd) { - case "pass": - String message1 = "passing attribute bitwise in " + h; - throw new Attribute.FormatException(message1, ctype, name, cmd); - case "error": - String message2 = "attribute not allowed in " + h; - throw new Attribute.FormatException(message2, ctype, name, cmd); - case "strip": - skip(length, name + " attribute in " + h); - continue; - } + if ("pass".equals(cmd)) { + String message1 = "passing attribute bitwise in " + h; + throw new Attribute.FormatException(message1, ctype, name, cmd); + } else if ("error".equals(cmd)) { + String message2 = "attribute not allowed in " + h; + throw new Attribute.FormatException(message2, ctype, name, cmd); + } else if ("strip".equals(cmd)) { + skip(length, name + " attribute in " + h); + continue; } } // Find canonical instance of the requested attribute. diff -up openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java.sav openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java --- openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java.sav 2011-07-29 12:21:02.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java 2011-07-29 13:22:07.405902338 -0400 @@ -71,16 +71,14 @@ class Driver { { // Non-standard, undocumented "--unpack" switch enables unpack mode. String arg0 = av.isEmpty() ? "" : av.get(0); - switch (arg0) { - case "--pack": + if ("--pack".equals(arg0)) av.remove(0); - break; - case "--unpack": - av.remove(0); - doPack = false; - doUnpack = true; - break; - } + else if ("--unpack".equals(arg0)) + { + av.remove(0); + doPack = false; + doUnpack = true; + } } // Collect engine properties here: @@ -180,21 +178,16 @@ class Driver { // Deal with remaining non-engine properties: for (String opt : avProps.keySet()) { String val = avProps.get(opt); - switch (opt) { - case "--repack": - doRepack = true; - break; - case "--no-gzip": - doZip = (val == null); - break; - case "--log-file=": - logFile = val; - break; - default: - throw new InternalError(MessageFormat.format( - RESOURCE.getString(DriverResource.BAD_OPTION), - opt, avProps.get(opt))); - } + if ("--repack".equals(opt)) + doRepack = true; + else if ("--no-gzip".equals(opt)) + doZip = (val == null); + else if ("--log-file=".equals(opt)) + logFile = val; + else + throw new InternalError(MessageFormat.format( + RESOURCE.getString(DriverResource.BAD_OPTION), + opt, avProps.get(opt))); } if (logFile != null && !logFile.equals("")) { diff -up openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java.sav openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java --- openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java.sav 2011-07-29 12:21:02.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java 2011-07-29 13:22:07.406902324 -0400 @@ -1107,30 +1107,25 @@ class Package { // what is one of { Debug, Compile, Constant, Exceptions, InnerClasses } if (verbose > 0) Utils.log.info("Stripping "+what.toLowerCase()+" data and attributes..."); - switch (what) { - case "Debug": - strip("SourceFile"); - strip("LineNumberTable"); - strip("LocalVariableTable"); - strip("LocalVariableTypeTable"); - break; - case "Compile": - // Keep the inner classes normally. - // Although they have no effect on execution, - // the Reflection API exposes them, and JCK checks them. - // NO: // strip("InnerClasses"); - strip("Deprecated"); - strip("Synthetic"); - break; - case "Exceptions": - // Keep the exceptions normally. - // Although they have no effect on execution, - // the Reflection API exposes them, and JCK checks them. - strip("Exceptions"); - break; - case "Constant": - stripConstantFields(); - break; + if ("Debug".equals(what)) { + strip("SourceFile"); + strip("LineNumberTable"); + strip("LocalVariableTable"); + strip("LocalVariableTypeTable"); + } else if ("Compile".equals(what)) { + // Keep the inner classes normally. + // Although they have no effect on execution, + // the Reflection API exposes them, and JCK checks them. + // NO: // strip("InnerClasses"); + strip("Deprecated"); + strip("Synthetic"); + } else if ("Exceptions".equals(what)) { + // Keep the exceptions normally. + // Although they have no effect on execution, + // the Reflection API exposes them, and JCK checks them. + strip("Exceptions"); + } else if ("Constant".equals(what)) { + stripConstantFields(); } } diff -up openjdk-boot/jdk/src/share/classes/com/sun/security/ntlm/NTLM.java.sav openjdk-boot/jdk/src/share/classes/com/sun/security/ntlm/NTLM.java --- openjdk-boot/jdk/src/share/classes/com/sun/security/ntlm/NTLM.java.sav 2011-07-29 12:21:06.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/com/sun/security/ntlm/NTLM.java 2011-07-29 13:22:07.406902324 -0400 @@ -64,17 +64,23 @@ class NTLM { protected NTLM(String version) throws NTLMException { if (version == null) version = "LMv2/NTLMv2"; - switch (version) { - case "LM": v = NTLM; writeLM = true; writeNTLM = false; break; - case "NTLM": v = NTLM; writeLM = false; writeNTLM = true; break; - case "LM/NTLM": v = NTLM; writeLM = writeNTLM = true; break; - case "NTLM2": v = NTLM2; writeLM = writeNTLM = true; break; - case "LMv2": v = NTLMv2; writeLM = true; writeNTLM = false; break; - case "NTLMv2": v = NTLMv2; writeLM = false; writeNTLM = true; break; - case "LMv2/NTLMv2": v = NTLMv2; writeLM = writeNTLM = true; break; - default: throw new NTLMException(NTLMException.BAD_VERSION, - "Unknown version " + version); - } + if (version.equals("LM")) + { v = NTLM; writeLM = true; writeNTLM = false; } + else if (version.equals("NTLM")) + { v = NTLM; writeLM = false; writeNTLM = true; } + else if (version.equals("LM/NTLM")) + { v = NTLM; writeLM = writeNTLM = true; } + else if (version.equals("NTLM2")) + { v = NTLM2; writeLM = writeNTLM = true; } + else if (version.equals("LMv2")) + { v = NTLMv2; writeLM = true; writeNTLM = false; } + else if (version.equals("NTLMv2")) + { v = NTLMv2; writeLM = false; writeNTLM = true; } + else if (version.equals("LMv2/NTLMv2")) + { v = NTLMv2; writeLM = writeNTLM = true; } + else + throw new NTLMException(NTLMException.BAD_VERSION, + "Unknown version " + version); try { fac = SecretKeyFactory.getInstance ("DES"); cipher = Cipher.getInstance ("DES/ECB/NoPadding"); diff -up openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java.sav openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java --- openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java.sav 2011-07-29 12:21:11.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java 2011-07-29 13:22:07.406902324 -0400 @@ -211,14 +211,16 @@ public class MethodHandleProxies { private static boolean isObjectMethod(Method m) { - switch (m.getName()) { - case "toString": + String name = m.getName(); + if ("toString".equals(name)) { return (m.getReturnType() == String.class && m.getParameterTypes().length == 0); - case "hashCode": + } + if ("hashCode".equals(name)) { return (m.getReturnType() == int.class && m.getParameterTypes().length == 0); - case "equals": + } + if ("equals".equals(name)) { return (m.getReturnType() == boolean.class && m.getParameterTypes().length == 1 && m.getParameterTypes()[0] == Object.class); @@ -229,12 +231,14 @@ public class MethodHandleProxies { private static Object callObjectMethod(Object self, Method m, Object[] args) { assert(isObjectMethod(m)) : m; - switch (m.getName()) { - case "toString": + String name = m.getName(); + if ("toString".equals(name)) { return self.getClass().getName() + "@" + Integer.toHexString(self.hashCode()); - case "hashCode": + } + if ("hashCode".equals(name)) { return System.identityHashCode(self); - case "equals": + } + if ("equals".equals(name)) { return (self == args[0]); } return null; diff -up openjdk-boot/jdk/src/share/classes/sun/launcher/LauncherHelper.java.sav openjdk-boot/jdk/src/share/classes/sun/launcher/LauncherHelper.java --- openjdk-boot/jdk/src/share/classes/sun/launcher/LauncherHelper.java.sav 2011-07-29 12:21:24.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/sun/launcher/LauncherHelper.java 2011-07-29 13:22:07.407902309 -0400 @@ -117,24 +117,20 @@ public enum LauncherHelper { String optStr = (opts.length > 1 && opts[1] != null) ? opts[1].trim() : "all"; - switch (optStr) { - case "vm": + if ("vm".equals(optStr)) + printVmSettings(ostream, initialHeapSize, maxHeapSize, + stackSize, isServer); + else if ("properties".equals(optStr)) + printProperties(ostream); + else if ("locale".equals(optStr)) + printLocale(ostream); + else + { printVmSettings(ostream, initialHeapSize, maxHeapSize, - stackSize, isServer); - break; - case "properties": - printProperties(ostream); - break; - case "locale": - printLocale(ostream); - break; - default: - printVmSettings(ostream, initialHeapSize, maxHeapSize, - stackSize, isServer); + stackSize, isServer); printProperties(ostream); printLocale(ostream); - break; - } + } } /* diff -up openjdk-boot/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java.sav openjdk-boot/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java --- openjdk-boot/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java.sav 2011-07-29 12:21:30.000000000 -0400 +++ openjdk-boot/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java 2011-07-29 13:22:07.407902309 -0400 @@ -383,19 +383,23 @@ public class DisabledAlgorithmConstraint GE; // ">=" static Operator of(String s) { - switch (s) { - case "==": - return EQ; - case "!=": - return NE; - case "<": - return LT; - case "<=": - return LE; - case ">": - return GT; - case ">=": - return GE; + if ("==".equals(s)) { + return EQ; + } + if ("!=".equals(s)) { + return NE; + } + if ("<".equals(s)) { + return LT; + } + if ("<=".equals(s)) { + return LE; + } + if (">".equals(s)) { + return GT; + } + if (">=".equals(s)) { + return GE; } throw new IllegalArgumentException(