Mercurial > hg > release > icedtea7-2.5
view patches/boot/ecj-multicatch.patch @ 2801:9e3486e15837
Bump to icedtea-2.5.6.
Upstream changes:
- OPENJDK7-03: Only apply PaX-marking when needed by a running PaX kernel
- OPENJDK7-04: Revert introduction of lambda expression in sun.lwawt.macosx.LWCToolkit
- OPENJDK7-05: Fix mistake in 8075374 backport
- PR2487: Make jdk8 mode the default for jdk.tls.ephemeralDHKeySize
- PR2502: Remove -fno-tree-vectorize workaround now http://gcc.gnu.org/PR63341 is fixed
- S7124253: [macosx] Flavor change notification not coming
- S8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display
- S8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
- S8020210: [macosx] JVM crashes in CWrapper$NSWindow.screen(long)
- S8027058: sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh Failed to initialize connector
- S8027561: [macosx] Cleanup "may not respond to selector" warnings in native code
- S8028617: Dvorak keyboard mapping not honored when ctrl key pressed
- S8029868: Fix KSS issues in sun.lwawt.macosx
- S8042205: javax/management/monitor/*: some tests didn't get all the notifications
- S8042982: Unexpected RuntimeExceptions being thrown by SSLEngine
- S8043201: Deprecate RC4 in SunJSSE provider
- S8043202: Prohibit RC4 cipher suites
- S8046817: JDK 8 schemagen tool does not generate xsd files for enum types
- S8048194: GSSContext.acceptSecContext fails when a supported mech is not initiator preferred
- S8062923: XSL: Run-time internal error in 'substring()'
- S8062924: XSL: wrong answer from substring() function
- S8064546: CipherInputStream throws BadPaddingException if stream is not fully read
- S8065764: javax/management/monitor/CounterMonitorTest.java hangs
- S8066952: [TEST-BUG] javax/management/monitor/CounterMonitorTest.java hangs
- S8067694: Improved certification checking
- S8071668: [macosx] Clipboard does not work with 3rd parties Clipboard Managers
- S8071715: Tune font layout engine
- S8071731: Better scaling for C1
- S8072490: Better font morphing redux
- S8072887: Better font handling improvements
- S8073334: Improved font substitutions
- S8073357: schema1.xsd has wrong content. Sequence of the enum values has been changed
- S8073385: Bad error message on parsing illegal character in XML attribute
- S8073773: Presume path preparedness
- S8073894: Getting to the root of certificate chains
- S8074098: 2D_Font/Bug8067699 test fails with SIGBUS crash on Solaris Sparc
- S8074297: substring in XSLT returns wrong character if string contains supplementary chars
- S8074330: Set font anchors more solidly
- S8074335: Substitute for substitution formats
- S8074865: General crypto resilience changes
- S8074871: Adjust device table handling
- S8075374: Responding to OCSP responses
- S8075378: JNDI DnsClient Exception Handling
- S8075575: com/sun/security/auth/login/ConfigFile/InconsistentError.java failed in certain env.
- S8075576: com/sun/security/auth/module/KeyStoreLoginModule/OptionTest.java failed in certain env.
- S8075667: (tz) Support tzdata2015b
- S8075738: Better multi-JVM sharing
- S8075833: Straighter Elliptic Curves
- S8075838: Method for typing MethodTypes
- S8075853: Proxy for MBean proxies
- S8076290: JCK test api/xsl/conf/string/string17 starts failing after JDK-8074297
- S8076328: Enforce key exchange constraints
- S8076376: Enhance IIOP operations
- S8076397: Better MBean connections
- S8076401: Serialize OIS data
- S8076405: Improve serial serialization
- S8076409: Reinforce RMI framework
- S8077520: Morph tables into improved form
- S8077685: (tz) Support tzdata2015d
- S8078348: sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java fails with BindException
- S8078439: SPNEGO auth fails if client proposes MS krb5 OID
- S8078562: Add modified dates
- S8080318: jdk8u51 l10n resource file translation update
- S8081386: Test sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh test has RC4 dependencies
- S8081775: two lib/testlibrary tests are failing with "Error. failed to clean up files after test" with jtreg 4.1 b12
2015-07-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Makefile.am:
(CORBA_CHANGESET): Update to icedtea-2.5.6.
(JAXP_CHANGESET): Likewise.
(JAXWS_CHANGESET): Likewise.
(JDK_CHANGESET): Likewise.
(LANGTOOLS_CHANGESET): Likewise.
(OPENJDK_CHANGESET): Likewise.
(CORBA_SHA256SUM): Likewise.
(JAXP_SHA256SUM): Likewise.
(JAXWS_SHA256SUM): Likewise.
(JDK_SHA256SUM): Likewise.
(LANGTOOLS_SHA256SUM): Likewise.
(OPENJDK_SHA256SUM): Likewise.
* NEWS: Updated.
* configure.ac: Bump to 2.5.6.
* hotspot.map.in: Update to icedtea-2.5.6.
* patches/boot/ecj-diamond.patch:
Add new cases in sun.security.ssl and
sun.security.util.
* patches/boot/ecj-multicatch.patch:
Add cases in com.apple.laf.AquaUtils,
sun.security.ssl.ECDHCrypt and Notepad.java
demo code. Update CipherInputStream case.
author | Andrew John Hughes <gnu_andrew@member.fsf.org> |
---|---|
date | Mon, 20 Jul 2015 16:37:23 +0100 |
parents | 5078409f15b9 |
children |
line wrap: on
line source
diff -Nru openjdk-boot.orig/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java openjdk-boot/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java --- openjdk-boot.orig/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java 2015-05-18 18:05:09.000000000 +0100 +++ openjdk-boot/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java 2015-07-20 03:48:15.575928590 +0100 @@ -145,7 +145,9 @@ final String name = c.name(); ei = new EncodingInfo(name, name); _encodingInfos.putEncoding(normalizedEncoding, ei); - } catch (IllegalCharsetNameException | UnsupportedCharsetException x) { + } catch (IllegalCharsetNameException x) { + ei = new EncodingInfo(null,null); + } catch (UnsupportedCharsetException x) { ei = new EncodingInfo(null,null); } } diff -Nru openjdk-boot.orig/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java openjdk-boot/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java --- openjdk-boot.orig/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java 2015-07-20 14:38:53.471462269 +0100 +++ openjdk-boot/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java 2015-07-20 14:39:12.463131226 +0100 @@ -200,7 +200,8 @@ try { ReflectUtil.checkPackageAccess(clazz); return clazz.newInstance(); - } catch (InstantiationException | IllegalAccessException ignored) { + } catch (InstantiationException ignored) { + } catch (IllegalAccessException ignored) { } return null; } 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 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java 2015-07-20 03:48:15.575928590 +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/io/PrintStream.java openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java --- openjdk-boot.orig/jdk/src/share/classes/java/io/PrintStream.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java 2015-07-20 03:48:15.575928590 +0100 @@ -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); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/io/PrintWriter.java openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java --- openjdk-boot.orig/jdk/src/share/classes/java/io/PrintWriter.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java 2015-07-20 03:48:15.575928590 +0100 @@ -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); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java --- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java 2015-07-20 03:48:15.575928590 +0100 @@ -748,7 +748,9 @@ Class<?> fieldType = Wrapper.forBasicType(types.charAt(index)).primitiveType(); try { return LOOKUP.findGetter(cbmhClass, fieldName, fieldType); - } catch (NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldException e) { + throw newInternalError(e); + } catch (IllegalAccessException e) { throw newInternalError(e); } } @@ -802,7 +804,13 @@ static MethodHandle makeCbmhCtor(Class<? extends BoundMethodHandle> cbmh, String types) { try { return linkConstructor(LOOKUP.findConstructor(cbmh, MethodType.fromMethodDescriptorString(makeSignature(types, true), null))); - } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) { + } catch (NoSuchMethodException e) { + throw newInternalError(e); + } catch (IllegalAccessException e) { + throw newInternalError(e); + } catch (IllegalArgumentException e) { + throw newInternalError(e); + } catch (TypeNotPresentException e) { throw newInternalError(e); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/LambdaForm.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/LambdaForm.java --- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/LambdaForm.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/LambdaForm.java 2015-07-20 03:48:15.575928590 +0100 @@ -456,9 +456,11 @@ traceInterpreter("compileToBytecode", this); isCompiled = true; return vmentry; - } catch (Error | Exception ex) { + } catch (Error ex) { throw newInternalError(this.toString(), ex); - } + } catch (Exception ex) { + throw newInternalError(this.toString(), ex); + } } private static final ConcurrentHashMap<String,LambdaForm> PREPARED_FORMS; @@ -1548,9 +1550,11 @@ MemberName zmem = new MemberName(LambdaForm.class, "zero"+bt, MethodType.methodType(wrap.primitiveType()), REF_invokeStatic); try { zmem = IMPL_NAMES.resolveOrFail(REF_invokeStatic, zmem, null, NoSuchMethodException.class); - } catch (IllegalAccessException|NoSuchMethodException ex) { + } catch (IllegalAccessException ex) { throw newInternalError(ex); - } + } catch (NoSuchMethodException ex) { + throw newInternalError(ex); + } NamedFunction zcon = new NamedFunction(zmem); Name n = new Name(zcon).newIndex(0); assert(n.type == ALL_TYPES.charAt(tn)); diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java --- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java 2015-07-20 03:48:15.575928590 +0100 @@ -264,7 +264,12 @@ continue; } throw new InternalError(err); - } catch (NoSuchFieldException | IllegalAccessException ex) { + } catch (NoSuchFieldException ex) { + String err = (name+": JVM has "+vmval+" which Java does not define"); + // ignore exotic ops the JVM cares about; we just wont issue them + //System.err.println("warning: "+err); + continue; + } catch (IllegalAccessException ex) { String err = (name+": JVM has "+vmval+" which Java does not define"); // ignore exotic ops the JVM cares about; we just wont issue them //System.err.println("warning: "+err); diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/management/ManagementFactory.java openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java --- openjdk-boot.orig/jdk/src/share/classes/java/lang/management/ManagementFactory.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java 2015-07-20 03:48:15.575928590 +0100 @@ -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); } } 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 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/ProcessBuilder.java 2015-07-20 03:48:15.575928590 +0100 @@ -1030,10 +1030,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); @@ -1045,6 +1045,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, 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 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java 2015-07-20 03:48:15.575928590 +0100 @@ -762,7 +762,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/java/nio/charset/Charset.java openjdk-boot/jdk/src/share/classes/java/nio/charset/Charset.java --- openjdk-boot.orig/jdk/src/share/classes/java/nio/charset/Charset.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/nio/charset/Charset.java 2015-07-20 03:48:15.575928590 +0100 @@ -440,8 +440,9 @@ } catch (ClassNotFoundException x) { // Extended charsets not available // (charsets.jar not present) - } catch (InstantiationException | - IllegalAccessException x) { + } catch (InstantiationException x) { + throw new Error(x); + } catch (IllegalAccessException x) { throw new Error(x); } return null; diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/util/Formatter.java openjdk-boot/jdk/src/share/classes/java/util/Formatter.java --- openjdk-boot.orig/jdk/src/share/classes/java/util/Formatter.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/util/Formatter.java 2015-07-20 03:48:15.579928519 +0100 @@ -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); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/util/Scanner.java openjdk-boot/jdk/src/share/classes/java/util/Scanner.java --- openjdk-boot.orig/jdk/src/share/classes/java/util/Scanner.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/util/Scanner.java 2015-07-20 03:48:15.579928519 +0100 @@ -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); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/javax/crypto/CipherInputStream.java openjdk-boot/jdk/src/share/classes/javax/crypto/CipherInputStream.java --- openjdk-boot.orig/jdk/src/share/classes/javax/crypto/CipherInputStream.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/CipherInputStream.java 2015-07-20 04:22:43.007891354 +0100 @@ -116,7 +116,10 @@ done = true; try { obuffer = cipher.doFinal(); - } catch (IllegalBlockSizeException | BadPaddingException e) { + } catch (IllegalBlockSizeException e) { + obuffer = null; + throw new IOException(e); + } catch (BadPaddingException e) { obuffer = null; throw new IOException(e); } @@ -322,7 +325,10 @@ try { cipher.doFinal(); } - catch (BadPaddingException | IllegalBlockSizeException ex) { + catch (BadPaddingException ex) { + // Catch exceptions as the rest of the stream is unused. + } + catch (IllegalBlockSizeException ex) { // Catch exceptions as the rest of the stream is unused. } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/javax/crypto/CipherOutputStream.java openjdk-boot/jdk/src/share/classes/javax/crypto/CipherOutputStream.java --- openjdk-boot.orig/jdk/src/share/classes/javax/crypto/CipherOutputStream.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/CipherOutputStream.java 2015-07-20 03:48:15.579928519 +0100 @@ -208,7 +208,9 @@ closed = true; try { obuffer = cipher.doFinal(); - } catch (IllegalBlockSizeException | BadPaddingException e) { + } catch (IllegalBlockSizeException e) { + obuffer = null; + } catch (BadPaddingException e) { obuffer = null; } try { diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java --- openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2015-07-20 03:48:15.579928519 +0100 @@ -482,7 +482,9 @@ FILL_NEW_TYPED_ARRAY = IMPL_LOOKUP .findStatic(THIS_CLASS, "fillNewTypedArray", MethodType.methodType(Object[].class, Object[].class, Integer.class, Object[].class)); - } catch (NoSuchMethodException | IllegalAccessException ex) { + } catch (NoSuchMethodException ex) { + throw newInternalError("uncaught exception", ex); + } catch (IllegalAccessException ex) { throw newInternalError("uncaught exception", ex); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/ActivationGroupImpl.java openjdk-boot/jdk/src/share/classes/sun/rmi/server/ActivationGroupImpl.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/ActivationGroupImpl.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/ActivationGroupImpl.java 2015-07-20 03:48:15.579928519 +0100 @@ -296,7 +296,16 @@ active.put(id, entry); return entry.mobj; - } catch (NoSuchMethodException | NoSuchMethodError e) { + } catch (NoSuchMethodException e) { + /* user forgot to provide activatable constructor? + * or code recompiled and user forgot to provide + * activatable constructor? + */ + throw new ActivationException + ("Activatable object must provide an activation"+ + " constructor", e ); + + } catch (NoSuchMethodError e) { /* user forgot to provide activatable constructor? * or code recompiled and user forgot to provide * activatable constructor? diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java openjdk-boot/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java 2015-07-20 03:48:15.579928519 +0100 @@ -262,11 +262,14 @@ annotation = urlsToPath(urls); } - } catch (SecurityException | IOException e) { + } catch (SecurityException e) { /* * SecurityException: If access was denied to the knowledge of * the class loader's URLs, fall back to the default behavior. * + */ + } catch (IOException e) { + /* * IOException: This shouldn't happen, although it is declared * to be thrown by openConnection() and getPermission(). If it * does happen, forget about this class loader's URLs and diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java openjdk-boot/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java 2015-07-20 03:48:15.579928519 +0100 @@ -208,7 +208,9 @@ return initialSocket; - } catch (UnknownHostException | NoRouteToHostException e) { + } catch (UnknownHostException e) { + initialFailure = e; + } catch (NoRouteToHostException e) { initialFailure = e; } catch (SocketException e) { if (eagerHttpFallback) { @@ -273,7 +275,9 @@ } // if connector ever does get socket, it won't be used connector.notUsed(); - } catch (UnknownHostException | NoRouteToHostException e) { + } catch (UnknownHostException e) { + initialFailure = e; + } catch (NoRouteToHostException e) { initialFailure = e; } catch (SocketException e) { if (eagerHttpFallback) { diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java openjdk-boot/jdk/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java 2015-07-20 03:48:15.579928519 +0100 @@ -623,7 +623,10 @@ try { TCPEndpoint.shedConnectionCaches(); // REMIND: should we retry createSocket? - } catch (OutOfMemoryError | Exception mem) { + } catch (OutOfMemoryError mem) { + // don't quit if out of memory + // or shed fails non-catastrophically + } catch (Exception mem) { // don't quit if out of memory // or shed fails non-catastrophically } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/krb5/internal/PAData.java openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/krb5/internal/PAData.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java 2015-07-20 03:48:15.579928519 +0100 @@ -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"); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/SecureRandom.java openjdk-boot/jdk/src/share/classes/sun/security/provider/SecureRandom.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/SecureRandom.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/SecureRandom.java 2015-07-20 03:48:15.583928450 +0100 @@ -94,14 +94,22 @@ * and sets the seed, if given. */ private void init(byte[] seed) { + Exception ex = null; + try { /* * Use the local SUN implementation to avoid native * performance overhead. */ digest = MessageDigest.getInstance("SHA", "SUN"); - } catch (NoSuchProviderException | NoSuchAlgorithmException e) { - // Fallback to any available. + } catch (NoSuchProviderException e) { + ex = e; + } catch (NoSuchAlgorithmException e) { + ex = e; + } + + // Fallback to any available. + if (ex != null) { try { digest = MessageDigest.getInstance("SHA"); } catch (NoSuchAlgorithmException exc) { @@ -265,6 +273,7 @@ */ private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { + Exception ex = null; s.defaultReadObject (); @@ -274,7 +283,13 @@ * performance overhead. */ digest = MessageDigest.getInstance("SHA", "SUN"); - } catch (NoSuchProviderException | NoSuchAlgorithmException e) { + } catch (NoSuchProviderException e) { + ex = e; + } catch (NoSuchAlgorithmException e) { + ex = e; + } + + if (ex != null) { // Fallback to any available. try { digest = MessageDigest.getInstance("SHA"); diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java openjdk-boot/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java 2015-07-20 14:32:17.942356703 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java 2015-07-20 14:32:58.397651532 +0100 @@ -118,7 +118,10 @@ ECPublicKeySpec spec = new ECPublicKeySpec(point, params); PublicKey peerPublicKey = kf.generatePublic(spec); return getAgreedSecret(peerPublicKey); - } catch (GeneralSecurityException | java.io.IOException e) { + } catch (GeneralSecurityException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(e); + } catch (java.io.IOException e) { throw (SSLHandshakeException) new SSLHandshakeException( "Could not generate secret").initCause(e); } @@ -144,7 +147,10 @@ throw new SSLHandshakeException( "ECPublicKey does not comply to algorithm constraints"); } - } catch (GeneralSecurityException | java.io.IOException e) { + } catch (GeneralSecurityException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate ECPublicKey").initCause(e); + } catch (java.io.IOException e) { throw (SSLHandshakeException) new SSLHandshakeException( "Could not generate ECPublicKey").initCause(e); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/ssl/Handshaker.java openjdk-boot/jdk/src/share/classes/sun/security/ssl/Handshaker.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/ssl/Handshaker.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/Handshaker.java 2015-07-20 03:48:15.579928519 +0100 @@ -1084,8 +1084,7 @@ KeyGenerator kg = JsseJce.getKeyGenerator(masterAlg); kg.init(spec); return kg.generateKey(); - } catch (InvalidAlgorithmParameterException | - NoSuchAlgorithmException iae) { + } catch (InvalidAlgorithmParameterException iae) { // unlikely to happen, otherwise, must be a provider exception // // For RSA premaster secrets, do not signal a protocol error @@ -1093,6 +1092,12 @@ if (debug != null && Debug.isOn("handshake")) { System.out.println("RSA master secret generation error:"); iae.printStackTrace(System.out); + } + throw new ProviderException(iae); + } catch (NoSuchAlgorithmException iae) { + if (debug != null && Debug.isOn("handshake")) { + System.out.println("RSA master secret generation error:"); + iae.printStackTrace(System.out); } throw new ProviderException(iae); } 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 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java 2015-07-20 03:48:15.583928450 +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/sun/text/bidi/BidiBase.java openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java --- openjdk-boot.orig/jdk/src/share/classes/sun/text/bidi/BidiBase.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java 2015-07-20 03:48:15.583928450 +0100 @@ -3478,7 +3478,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 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java 2015-07-20 03:48:15.583928450 +0100 @@ -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 : '" @@ -191,9 +202,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/tools/jconsole/Resources.java openjdk-boot/jdk/src/share/classes/sun/tools/jconsole/Resources.java --- openjdk-boot.orig/jdk/src/share/classes/sun/tools/jconsole/Resources.java 2015-07-09 11:44:04.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/tools/jconsole/Resources.java 2015-07-20 03:48:15.583928450 +0100 @@ -129,7 +129,9 @@ private static void setFieldValue(Field field, String value) { try { field.set(null, value); - } catch (IllegalArgumentException | IllegalAccessException e) { + } catch (IllegalArgumentException e) { + throw new Error("Unable to access or set message for field " + field.getName()); + } catch (IllegalAccessException e) { throw new Error("Unable to access or set message for field " + field.getName()); } } @@ -200,8 +202,16 @@ try { return KeyEvent.class.getDeclaredField("VK_" + c.toUpperCase()) .getInt(null); - } catch (IllegalArgumentException | IllegalAccessException - | NoSuchFieldException | SecurityException e) { + } catch (IllegalArgumentException e) { + // Missing VK is okay + return 0; + } catch (IllegalAccessException e) { + // Missing VK is okay + return 0; + } catch (NoSuchFieldException e) { + // Missing VK is okay + return 0; + } catch (SecurityException e) { // Missing VK is okay return 0; } diff -Nru openjdk-boot.orig/jdk/src/share/demo/jfc/Notepad/Notepad.java openjdk-boot/jdk/src/share/demo/jfc/Notepad/Notepad.java --- openjdk-boot.orig/jdk/src/share/demo/jfc/Notepad/Notepad.java 2015-07-20 14:36:15.170221605 +0100 +++ openjdk-boot/jdk/src/share/demo/jfc/Notepad/Notepad.java 2015-07-20 14:36:38.825809267 +0100 @@ -80,7 +80,11 @@ "resources/NotepadSystem.properties")); resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault()); - } catch (MissingResourceException | IOException e) { + } catch (MissingResourceException e) { + System.err.println("resources/Notepad.properties " + + "or resources/NotepadSystem.properties not found"); + System.exit(1); + } catch (IOException e) { System.err.println("resources/Notepad.properties " + "or resources/NotepadSystem.properties not found"); System.exit(1);