--- 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 \n"); + } catch (IOException e) { sb.append("\t \n"); } } @@ -307,7 +309,9 @@ .encodeBuffer(s2kparams)); } } - } catch (IOException|Asn1Exception e) { + } catch (IOException e) { + sb.append("\t \n"); + } catch (Asn1Exception e) { sb.append("\t \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); } }