view patches/boot/ecj-multicatch.patch @ 2601:04d2a30a17cf

Include latest security patches. 2013-06-27 Andrew John Hughes <gnu.andrew@member.fsf.org> * Makefile.am, (HOTSPOT_CHANGESET): Update to IcedTea7 2.2.9 tag, bringing in latest security patches. (CORBA_CHANGESET): Likewise. (JAXP_CHANGESET): Likewise. (JAXWS_CHANGESET): Likewise. (JDK_CHANGESET): Likewise. (LANGTOOLS_CHANGESET): Likewise. (OPENJDK_CHANGESET): Likewise. (HOTSPOT_SHA256SUM): Likewise. (CORBA_SHA256SUM): Likewise. (JAXP_SHA256SUM): Likewise. (JAXWS_SHA256SUM): Likewise. (JDK_SHA256SUM): Likewise. (LANGTOOLS_SHA256SUM): Likewise. (OPENJDK_SHA256SUM): Likewise. * patches/boot/ecj-diamond.patch, * patches/boot/ecj-multicatch.patch: Add new cases. * patches/boot/ecj-stringswitch.patch: Update MethodHandleNatives patch, including adding new case. * patches/boot/tobin.patch: Update following move from sun.awt.X11 to sun.awt.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Fri, 28 Jun 2013 02:33:43 +0100
parents 39a069b2d432
children
line wrap: on
line source

--- openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java
@@ -91,7 +91,10 @@
         requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            // UnsupportedEncodingException should be thrown
+            throw new UnsupportedEncodingException(csn);
+        } catch (UnsupportedCharsetException unused) {
             // UnsupportedEncodingException should be thrown
             throw new UnsupportedEncodingException(csn);
         }
--- openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java
@@ -85,7 +85,10 @@
         Objects.requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            // UnsupportedEncodingException should be thrown
+            throw new UnsupportedEncodingException(csn);
+        } catch (UnsupportedCharsetException unused) {
             // UnsupportedEncodingException should be thrown
             throw new UnsupportedEncodingException(csn);
         }
--- openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java
@@ -606,7 +606,9 @@
             // create an MXBean proxy
             return JMX.newMXBeanProxy(connection, objName, mxbeanInterface,
                                       emitter);
-        } catch (InstanceNotFoundException|MalformedObjectNameException e) {
+        } catch (InstanceNotFoundException e) {
+            throw new IllegalArgumentException(e);
+        } catch (MalformedObjectNameException e) {
             throw new IllegalArgumentException(e);
         }
     }
--- openjdk-boot/jdk/src/share/classes/java/util/Formatter.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/util/Formatter.java
@@ -1857,7 +1857,10 @@
         Objects.requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            // UnsupportedEncodingException should be thrown
+            throw new UnsupportedEncodingException(csn);
+        } catch (UnsupportedCharsetException unused) {
             // UnsupportedEncodingException should be thrown
             throw new UnsupportedEncodingException(csn);
         }
--- openjdk-boot/jdk/src/share/classes/java/util/Scanner.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/util/Scanner.java
@@ -633,7 +633,10 @@
         Objects.requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException e) {
+        } catch (IllegalCharsetNameException e) {
+            // IllegalArgumentException should be thrown
+            throw new IllegalArgumentException(e);
+        } catch (UnsupportedCharsetException e) {
             // IllegalArgumentException should be thrown
             throw new IllegalArgumentException(e);
         }
@@ -684,7 +687,9 @@
         Objects.requireNonNull(charsetName, "charsetName");
         try {
             return Charset.forName(charsetName).newDecoder();
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            throw new IllegalArgumentException(charsetName);
+        } catch (UnsupportedCharsetException unused) {
             throw new IllegalArgumentException(charsetName);
         }
     }
--- openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java.orig
+++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java
@@ -676,7 +676,11 @@
             IGNORE = IMPL_LOOKUP.findStatic(THIS_CLASS, "ignore", ignoreType);
             EMPTY = IMPL_LOOKUP.findStatic(THIS_CLASS, "empty", ignoreType.dropParameterTypes(0, 1));
             NEW_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "newArray", MethodType.methodType(Object[].class, int.class));
-        } catch (NoSuchMethodException | IllegalAccessException ex) {
+        } catch (NoSuchMethodException ex) {
+            Error err = new InternalError("uncaught exception");
+            err.initCause(ex);
+            throw err;
+        } catch (IllegalAccessException ex) {
             Error err = new InternalError("uncaught exception");
             err.initCause(ex);
             throw err;
--- openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java.orig
+++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java
@@ -280,7 +280,9 @@
                                     .append(info.getSalt())
                                     .append('\n');
                         }
-                    } catch (IOException|Asn1Exception e) {
+                    } catch (Asn1Exception e) {
+                        sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
+                    } catch (IOException e) {
                         sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
                     }
                 }
@@ -307,7 +309,9 @@
                                         .encodeBuffer(s2kparams));
                             }
                         }
-                    } catch (IOException|Asn1Exception e) {
+                    } catch (IOException e) {
+                        sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
+                    } catch (Asn1Exception e) {
                         sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
                     }
                 }
--- openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java.orig
+++ openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java
@@ -3477,7 +3477,9 @@
             try {
                 Field f = clazz.getField(name);
                 return f.get(null);
-            } catch (NoSuchFieldException | IllegalAccessException x) {
+            } catch (NoSuchFieldException x) {
+                throw new AssertionError(x);
+            } catch (IllegalAccessException x) {
                 throw new AssertionError(x);
             }
         }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/tools/jcmd/JCmd.java openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java
--- openjdk-boot.orig/jdk/src/share/classes/sun/tools/jcmd/JCmd.java	2012-03-22 10:00:56.029260268 +0000
+++ openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java	2012-03-22 10:02:41.275789667 +0000
@@ -94,7 +94,7 @@
                         && mainClass.indexOf(arg.getProcessSubstring()) != -1) {
                             pids.add(vmd.id());
                     }
-                } catch (MonitorException|URISyntaxException e) {
+                } catch (MonitorException e) {
                     if (e.getMessage() != null) {
                         System.err.println(e.getMessage());
                     } else {
@@ -105,7 +105,18 @@
                             e.printStackTrace();
                         }
                     }
-                }
+                } catch (URISyntaxException e) {
+                    if (e.getMessage() != null) {
+                        System.err.println(e.getMessage());
+                    } else {
+                        Throwable cause = e.getCause();
+                        if ((cause != null) && (cause.getMessage() != null)) {
+                            System.err.println(cause.getMessage());
+                        } else {
+                            e.printStackTrace();
+                        }
+                    }
+		}
             }
             if (pids.isEmpty()) {
                 System.err.println("Could not find any processes matching : '"
@@ -185,9 +196,11 @@
         try {
             String mainClass = getMainClass(vmd);
             return mainClass != null && mainClass.equals(JCmd.class.getName());
-        } catch (URISyntaxException|MonitorException ex) {
+        } catch (URISyntaxException ex) {
             return false;
-        }
+        } catch (MonitorException ex) {
+	    return false;
+	}
     }
 
     private static String getMainClass(VirtualMachineDescriptor vmd)
diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java openjdk-boot/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java
--- openjdk-boot.orig/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java	2012-05-02 20:50:17.549643066 +0100
+++ openjdk-boot/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java	2012-05-02 20:52:03.435320716 +0100
@@ -65,7 +65,10 @@
                 throw new RuntimeException("Duplicate untrusted certificate: " +
                     cert.getSubjectX500Principal());
             }
-        } catch (CertificateException | IOException e) {
+	} catch (CertificateException e) {
+            throw new RuntimeException(
+                        "Incorrect untrusted certificate: " + alias, e);
+	} catch (IOException e) {
             throw new RuntimeException(
                         "Incorrect untrusted certificate: " + alias, e);
         }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/reflect/Proxy.java openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/reflect/Proxy.java	2013-02-02 16:14:27.971429681 +0000
+++ openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java	2013-02-02 16:14:58.283922372 +0000
@@ -738,7 +738,9 @@
     private static Object newInstance(Constructor<?> cons, InvocationHandler h) {
         try {
             return cons.newInstance(new Object[] {h} );
-        } catch (IllegalAccessException | InstantiationException e) {
+        } catch (IllegalAccessException e) {
+            throw new InternalError(e.toString());
+        } catch (InstantiationException e) {
             throw new InternalError(e.toString());
         } catch (InvocationTargetException e) {
             Throwable t = e.getCause();
diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java openjdk-boot/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java
--- openjdk-boot.orig/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java	2013-06-27 15:56:57.456088537 +0100
+++ openjdk-boot/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java	2013-06-27 16:02:12.857102777 +0100
@@ -402,7 +402,13 @@
                         try {
                             ServerNotifForwarder.checkMBeanPermission(this.mBeanServer,
                                                       candidate.getObjectName(),"addNotificationListener");
-                        } catch (InstanceNotFoundException | SecurityException e) {
+                        } catch (InstanceNotFoundException e) {
+                            if (logger.debugOn()) {
+                                logger.debug("fetchNotifications", "candidate: " + candidate + " skipped. exception " + e);
+                            }
+                            ++nextSeq;
+                            continue;
+                        } catch (SecurityException e) {
                             if (logger.debugOn()) {
                                 logger.debug("fetchNotifications", "candidate: " + candidate + " skipped. exception " + e);
                             }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/ProcessBuilder.java openjdk-boot/jdk/src/share/classes/java/lang/ProcessBuilder.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/ProcessBuilder.java	2013-06-27 15:56:27.295609027 +0100
+++ openjdk-boot/jdk/src/share/classes/java/lang/ProcessBuilder.java	2013-06-27 16:00:59.631938678 +0100
@@ -1024,10 +1024,10 @@
                                      dir,
                                      redirects,
                                      redirectErrorStream);
-        } catch (IOException | IllegalArgumentException e) {
+        } catch (IOException e) {
             String exceptionInfo = ": " + e.getMessage();
             Throwable cause = e;
-            if ((e instanceof IOException) && security != null) {
+            if (security != null) {
                 // Can not disclose the fail reason for read-protected files.
                 try {
                     security.checkRead(prog);
@@ -1039,6 +1039,16 @@
             // It's much easier for us to create a high-quality error
             // message than the low-level C code which found the problem.
             throw new IOException(
+                "Cannot run program \"" + prog + "\""
+                + (dir == null ? "" : " (in directory \"" + dir + "\")")
+                + exceptionInfo,
+                cause);
+        } catch (IllegalArgumentException e) {
+            String exceptionInfo = ": " + e.getMessage();
+            Throwable cause = e;
+            // It's much easier for us to create a high-quality error
+            // message than the low-level C code which found the problem.
+            throw new IOException(
                 "Cannot run program \"" + prog + "\""
                 + (dir == null ? "" : " (in directory \"" + dir + "\")")
                 + exceptionInfo,