Mercurial > hg > icedtea7
view patches/boot/ecj-multicatch.patch @ 2923:e9659e584b7c icedtea-2.7.0pre14
Bump to icedtea-2.7.0pre14.
Upstream changes:
- Bump to icedtea-2.7.0pre14
- S7117357: Warnings in sun.instrument, tools and other sun.* classes
- S7117570: Warnings in sun.mangement.* and its subpackages
- S7143230: fix warnings in java.util.jar, sun.tools.jar, zipfs demo, etc.
- S8022440: suppress deprecation warnings in sun.rmi
- S8024069: replace_in_map() should operate on parent maps
- S8026796: Make replace_in_map() on parent maps generic
- S8030787: [Parfait] JNI-related warnings from b119 for jdk/src/share/native/sun/awt/image
- S8030875: Macros for checking and returning on exceptions
- S8031737: CHECK_NULL and CHECK_EXCEPTION macros cleanup
- S8034912: backport of 8031737 to jdk8u breaks linux buld.
- S8035629: [parfait] JNI exc pending in jdk/src/windows/native/sun/windows/ShellFolder2.cpp
- S8037287: Windows build failed after JDK-8030787
- S8048703: ReplacedNodes dumps it's content to tty
- S8080492: [Parfait] Uninitialised variable in jdk/src/java/desktop/windows/native/libawt/
- S8139870: sun.management.LazyCompositeData.isTypeMatched() fails for composite types with items of ArrayType
- S8143377: Test PKCS8Test.java fails
- S8144028, PR3431: Use AArch64 bit-test instructions in C2
- S8145438, PR3443, RH1482244: Guarantee failures since 8144028: Use AArch64 bit-test instructions in C2
- S8149450: LdapCtx.processReturnCode() throwing Null Pointer Exception
- S8152537, PR3431: aarch64: Make use of CBZ and CBNZ when comparing unsigned values with zero.
- S8155690: Update libPNG library to the latest up-to-date
- S8156804: Better constraint checking
- S8162461: Hang due to JNI up-call made whilst holding JNI critical lock
- S8163958: Improved garbage collection
- S8165231: java.nio.Bits.unaligned() doesn't return true on ppc
- S8165367: Additional tests for JEP 288: Disable SHA-1 Certificates
- S8167228: Update to libpng 1.6.28
- S8169209: Improved image post-processing steps
- S8169392: Additional jar validation steps
- S8170966: Right parenthesis issue
- S8172204: Better Thread Pool execution
- S8172461: Service Registration Lifecycle
- S8172465: Better handling of channel groups
- S8172469: Transform Transformer Exceptions
- S8173145: Menu is activated after using mnemonic Alt/Key combination
- S8173286: Better reading of text catalogs
- S8173697: Less Active Activations
- S8173770: Image conversion improvements
- S8174098: Better image fetching
- S8174105: Better naming attribution
- S8174113: Better sourcing of code
- S8174164: SafePointNode::_replaced_nodes breaks with irreducible loops
- S8174729: Race Condition in java.lang.reflect.WeakCache
- S8174770: Check registry registration location
- S8174873: Improved certificate procesing
- S8175097: [TESTBUG] 8174164 fix missed the test
- S8175106: Higher quality DSA operations
- S8175110: Higher quality ECDSA operations
- S8175251: Failed to load RSA private key from pkcs12
- S8176055: JMX diagnostic improvements
- S8176067: Proper directory lookup processing
- S8176731: JCK tests in api/javax_xml/transform/ spec conformance started failing after 8172469
- S8176760: Better handling of PKCS8 material
- S8176769: Remove accidental spec change in jdk8u
- S8177449: (tz) Support tzdata2017b
- S8178135: Additional elliptic curve support
- S8178996: [macos] JComboBox doesn't display popup in mixed JavaFX Swing Application on 8u131 and Mac OS 10.12
- S8179014: JFileChooser with Windows look and feel crashes on win 10
- S8179887: Build failure with glibc >= 2.24: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated
- S8180582: The bind to rmiregistry is rejected by registryFilter even though registryFilter is set
- S8181420: PPC: Image conversion improvements
- S8181591: 8u141 L10n resource file update
- S8182054: Improve wsdl support
- S8183551, PR3431: AArch64: Image conversion improvements
- S8184119: Incorrect return processing for the LF editor of MethodHandles.permuteArguments
- S8184993: Jar file verification failing with SecurityException: digest missing xxx
- S8185501: Missing import in JAXP code
- S8185502: No overflow operator on OpenJDK 7
- S8185716: OpenJDK 7 PPC64 port uses a different ins_encode format in ppc.ad
ChangeLog:
2017-09-08 Andrew John Hughes <gnu_andrew@member.fsf.org>
Bump to icedtea-2.7.0pre14.
* Makefile.am:
(JDK_UPDATE_VERSION): Bump to 151.
(BUILD_VERSION): Reset to b01.
(CORBA_CHANGESET): Update to icedtea-2.7.0pre14.
(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.7.0pre14.
* hotspot.map.in: Update to icedtea-2.7.0pre14.
* patches/boot/ecj-diamond.patch:
Regenerated. Add cases in
java.util.jar.Attributes, java.util.jar.JarVerifier,
javax.imageio.spi.ServiceRegistry,
sun.management.ConnectorAddressLink,
sun.management.counter.perf.PerfInstrumentation,
sun.management.Flag,
sun.management.GarbageCollectionNotifInfoCompositeData,
sun.management.HotspotCompilation,
sun.management.HotspotDiagnostic,
sun.management.HotspotThread,
sun.management.jmxremote.ConnectorBootstrap,
sun.management.ManagementFactoryHelper,
sun.management.MappedMXBeanType,
sun.management.NotificationEmitterSupport,
sun.management.RuntimeImpl,
sun.net.RegisterDomain,
sun.tools.jar.CommandLine,
sun.tools.jar.Manifest and sun.tools.jar.SignatureFile
* patches/boot/ecj-multicatch.patch:
Add cases in
com.sun.imageio.plugins.jpeg.JPEGImageReader,
sun.management.Agent,
sun.management.GarbageCollectionNotifInfoCompositeData,
sun.management.GcInfoCompositeData,
sun.rmi.server.UnicastRef, sun.rmi.server.UnicastServerRef,
javax.xml.transform.TransformerException,
com.sun.xml.internal.ws.util.xml.XmlUtil,
sun.rmi.registry.RegistryImpl_Skel and
sun.rmi.transport.DGCImpl_Stub
* patches/boot/ecj-stringswitch.patch:
Regenerated.
* patches/boot/ecj-trywithresources.patch:
Add cases in
sun.management.jmxremote.ConnectorBootstrap.
author | Andrew John Hughes <gnu_andrew@member.fsf.org> |
---|---|
date | Fri, 08 Sep 2017 18:31:37 +0100 |
parents | df0f259a2fcc |
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 2017-03-30 18:03:44.000000000 +0100 +++ openjdk-boot/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java 2017-04-04 18:32:33.537730981 +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/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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java 2017-04-04 18:32:33.537730981 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java 2017-04-04 18:32:33.537730981 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java 2017-04-04 18:32:33.537730981 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/LambdaForm.java 2017-04-04 18:32:33.541730919 +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/MemberName.java openjdk-boot/jdk/src/share/classes/java/lang/invoke/MemberName.java --- openjdk-boot.orig/jdk/src/share/classes/java/lang/invoke/MemberName.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MemberName.java 2017-04-04 18:32:33.545730857 +0100 @@ -862,7 +862,12 @@ m = MethodHandleNatives.resolve(m, lookupClass); m.checkForTypeAlias(m.getDeclaringClass()); m.resolution = null; - } catch (ClassNotFoundException | LinkageError ex) { + } catch (ClassNotFoundException ex) { + // JVM reports that the "bytecode behavior" would get an error + assert(!m.isResolved()); + m.resolution = ex; + return m; + } catch (LinkageError ex) { // JVM reports that the "bytecode behavior" would get an error assert(!m.isResolved()); m.resolution = ex; 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 2017-04-04 13:20:52.128968527 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/ProcessBuilder.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/nio/charset/Charset.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/util/Formatter.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/util/Scanner.java 2017-04-04 18:32:33.541730919 +0100 @@ -638,7 +638,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); } @@ -689,7 +692,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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/CipherInputStream.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/CipherOutputStream.java 2017-04-04 18:32:33.541730919 +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/javax/crypto/EncryptedPrivateKeyInfo.java openjdk-boot/jdk/src/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java --- openjdk-boot.orig/jdk/src/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java 2017-04-04 18:32:33.545730857 +0100 @@ -249,9 +249,13 @@ try { encoded = cipher.doFinal(encryptedData); checkPKCS8Encoding(encoded); - } catch (GeneralSecurityException | - IOException | - IllegalStateException ex) { + } catch (GeneralSecurityException ex) { + throw new InvalidKeySpecException( + "Cannot retrieve the PKCS8EncodedKeySpec", ex); + } catch (IOException ex) { + throw new InvalidKeySpecException( + "Cannot retrieve the PKCS8EncodedKeySpec", ex); + } catch (IllegalStateException ex) { throw new InvalidKeySpecException( "Cannot retrieve the PKCS8EncodedKeySpec", ex); } @@ -276,7 +280,10 @@ } catch (NoSuchAlgorithmException nsae) { // rethrow throw nsae; - } catch (GeneralSecurityException | IOException ex) { + } catch (GeneralSecurityException ex) { + throw new InvalidKeyException( + "Cannot retrieve the PKCS8EncodedKeySpec", ex); + } catch (IOException ex) { throw new InvalidKeyException( "Cannot retrieve the PKCS8EncodedKeySpec", ex); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/javax/crypto/SealedObject.java openjdk-boot/jdk/src/share/classes/javax/crypto/SealedObject.java --- openjdk-boot.orig/jdk/src/share/classes/javax/crypto/SealedObject.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/SealedObject.java 2017-04-04 18:32:33.545730857 +0100 @@ -353,7 +353,9 @@ try { return unseal(key, provider); - } catch (IllegalBlockSizeException | BadPaddingException ex) { + } catch (IllegalBlockSizeException ex) { + throw new InvalidKeyException(ex.getMessage()); + } catch (BadPaddingException ex) { throw new InvalidKeyException(ex.getMessage()); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java openjdk-boot/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java --- openjdk-boot.orig/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java 2017-04-04 18:32:33.541730919 +0100 @@ -113,7 +113,10 @@ Method m = c.getDeclaredMethod("legacyMergeSort", new Class[]{Object[].class, Comparator.class}); m.setAccessible(true); return m; - } catch (ClassNotFoundException | NoSuchMethodException e) { + } catch (ClassNotFoundException e) { + // using default sorting algo + return null; + } catch (NoSuchMethodException e) { // using default sorting algo return null; } @@ -181,7 +184,9 @@ Object[] a = l.toArray(); try { legacyMergeSortMethod.invoke(null, a, c); - } catch (IllegalAccessException | InvocationTargetException e) { + } catch (InvocationTargetException e) { + return false; + } catch (IllegalAccessException e) { return false; } ListIterator<Component> i = l.listIterator(); 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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2017-04-04 18:32:33.541730919 +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/invoke/util/VerifyAccess.java openjdk-boot/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java --- openjdk-boot.orig/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java 2017-04-04 18:32:33.545730857 +0100 @@ -222,7 +222,9 @@ public Class<?> run() { try { return Class.forName(name, false, refcLoader); - } catch (ClassNotFoundException | LinkageError e) { + } catch (ClassNotFoundException e) { + return null; // Assume the class is not found + } catch (LinkageError e) { return null; // Assume the class is not found } } 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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/ActivationGroupImpl.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java 2017-04-04 18:32:33.541730919 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java 2017-04-04 18:32:33.545730857 +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/krb5/PrincipalName.java openjdk-boot/jdk/src/share/classes/sun/security/krb5/PrincipalName.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/krb5/PrincipalName.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/PrincipalName.java 2017-04-04 18:32:33.545730857 +0100 @@ -421,7 +421,9 @@ hostName.toLowerCase(Locale.ENGLISH)+".")) { hostName = canonicalized; } - } catch (UnknownHostException | SecurityException e) { + } catch (UnknownHostException e) { + // not canonicalized or no permission to do so, use old + } catch (SecurityException e) { // not canonicalized or no permission to do so, use old } nameParts[1] = hostName.toLowerCase(Locale.ENGLISH); diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java openjdk-boot/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java 2017-04-04 18:32:33.545730857 +0100 @@ -325,7 +325,9 @@ // did not find anything return null; - } catch (PKCS11Exception | KeyStoreException e) { + } catch (PKCS11Exception e) { + throw new ProviderException(e); + } catch (KeyStoreException e) { throw new ProviderException(e); } finally { token.releaseSession(session); @@ -450,7 +452,9 @@ } else if (key instanceof SecretKey) { entry = new KeyStore.SecretKeyEntry((SecretKey)key); } - } catch (NullPointerException | IllegalArgumentException e) { + } catch (NullPointerException e) { + throw new KeyStoreException(e); + } catch (IllegalArgumentException e) { throw new KeyStoreException(e); } engineSetEntry(alias, entry, new KeyStore.PasswordProtection(password)); @@ -556,7 +560,9 @@ } else { throw new KeyStoreException("unexpected entry type"); } - } catch (PKCS11Exception | CertificateException e) { + } catch (PKCS11Exception e) { + throw new KeyStoreException(e); + } catch (CertificateException e) { throw new KeyStoreException(e); } } @@ -758,7 +764,11 @@ if (debug != null) { dumpTokenMap(); } - } catch (LoginException | KeyStoreException | PKCS11Exception e) { + } catch (LoginException e) { + throw new IOException("load failed", e); + } catch (KeyStoreException e) { + throw new IOException("load failed", e); + } catch (PKCS11Exception e) { throw new IOException("load failed", e); } } @@ -838,7 +848,11 @@ if (debug != null) { dumpTokenMap(); } - } catch (LoginException | KeyStoreException | PKCS11Exception e) { + } catch (LoginException e) { + throw new IOException("load failed", e); + } catch (KeyStoreException e) { + throw new IOException("load failed", e); + } catch (PKCS11Exception e) { throw new IOException("load failed", e); } } @@ -1028,7 +1042,9 @@ storeCert(alias, xcert); module.setTrust(token, xcert); mapLabels(); - } catch (PKCS11Exception | CertificateException e) { + } catch (PKCS11Exception e) { + throw new KeyStoreException(e); + } catch (CertificateException e) { throw new KeyStoreException(e); } @@ -1090,7 +1106,9 @@ storePkey(alias, (KeyStore.PrivateKeyEntry)entry); } - } catch (PKCS11Exception | CertificateException pe) { + } catch (PKCS11Exception pe) { + throw new KeyStoreException(pe); + } catch (CertificateException pe) { throw new KeyStoreException(pe); } @@ -1128,7 +1146,9 @@ if (debug != null) { dumpTokenMap(); } - } catch (PKCS11Exception | CertificateException pe) { + } catch (PKCS11Exception pe) { + throw new KeyStoreException(pe); + } catch (CertificateException pe) { throw new KeyStoreException(pe); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java openjdk-boot/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java 2017-04-04 18:32:33.545730857 +0100 @@ -130,7 +130,10 @@ rs.getModulus(), rs.getPublicExponent() ); - } catch (PKCS11Exception | InvalidKeyException e) { + } catch (PKCS11Exception e) { + throw new InvalidKeySpecException + ("Could not create RSA public key", e); + } catch (InvalidKeyException e) { throw new InvalidKeySpecException ("Could not create RSA public key", e); } @@ -174,7 +177,10 @@ throw new InvalidKeySpecException("Only RSAPrivate(Crt)KeySpec " + "and PKCS8EncodedKeySpec supported for RSA private keys"); } - } catch (PKCS11Exception | InvalidKeyException e) { + } catch (PKCS11Exception e) { + throw new InvalidKeySpecException + ("Could not create RSA private key", e); + } catch (InvalidKeyException e) { throw new InvalidKeySpecException ("Could not create RSA private key", e); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java 2017-04-04 18:32:33.545730857 +0100 @@ -307,7 +307,12 @@ factory.generateCertificates(in); } return getMatchingCerts(certs, selector); - } catch (IOException | CertificateException e) { + } catch (IOException e) { + if (debug != null) { + debug.println("Exception fetching certificates:"); + e.printStackTrace(); + } + } catch (CertificateException e) { if (debug != null) { debug.println("Exception fetching certificates:"); e.printStackTrace(); @@ -414,7 +419,12 @@ crl = (X509CRL) factory.generateCRL(in); } return getMatchingCRLs(crl, selector); - } catch (IOException | CRLException e) { + } catch (IOException e) { + if (debug != null) { + debug.println("Exception fetching CRL:"); + e.printStackTrace(); + } + } catch (CRLException e) { if (debug != null) { debug.println("Exception fetching CRL:"); e.printStackTrace(); 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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/SecureRandom.java 2017-04-04 18:32:33.545730857 +0100 @@ -100,7 +100,15 @@ * performance overhead. */ digest = MessageDigest.getInstance("SHA", "SUN"); - } catch (NoSuchProviderException | NoSuchAlgorithmException e) { + } catch (NoSuchProviderException e) { + // Fallback to any available. + try { + digest = MessageDigest.getInstance("SHA"); + } catch (NoSuchAlgorithmException exc) { + throw new InternalError( + "internal error: SHA-1 not available."); + } + } catch (NoSuchAlgorithmException e) { // Fallback to any available. try { digest = MessageDigest.getInstance("SHA"); @@ -274,7 +282,15 @@ * performance overhead. */ digest = MessageDigest.getInstance("SHA", "SUN"); - } catch (NoSuchProviderException | NoSuchAlgorithmException e) { + } catch (NoSuchProviderException e) { + // Fallback to any available. + try { + digest = MessageDigest.getInstance("SHA"); + } catch (NoSuchAlgorithmException exc) { + throw new InternalError( + "internal error: SHA-1 not available."); + } + } catch (NoSuchAlgorithmException e) { // 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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java 2017-04-04 18:32:33.545730857 +0100 @@ -119,7 +119,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); } @@ -145,7 +148,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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/Handshaker.java 2017-04-04 18:32:33.545730857 +0100 @@ -1144,8 +1144,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 @@ -1153,6 +1152,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/ssl/RSAClientKeyExchange.java openjdk-boot/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java 2017-04-04 18:32:33.545730857 +0100 @@ -173,8 +173,14 @@ clientVersion, serverVersion, encodedSecret), generator); return kg.generateKey(); - } catch (InvalidAlgorithmParameterException | - NoSuchAlgorithmException iae) { + } catch (InvalidAlgorithmParameterException iae) { + // unlikely to happen, otherwise, must be a provider exception + if (debug != null && Debug.isOn("handshake")) { + System.out.println("RSA premaster secret generation error:"); + iae.printStackTrace(System.out); + } + throw new RuntimeException("Could not generate premaster secret", iae); + } catch (NoSuchAlgorithmException iae) { // unlikely to happen, otherwise, must be a provider exception if (debug != null && Debug.isOn("handshake")) { System.out.println("RSA premaster secret generation error:"); diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/tools/keytool/Main.java openjdk-boot/jdk/src/share/classes/sun/security/tools/keytool/Main.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/tools/keytool/Main.java 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/tools/keytool/Main.java 2017-04-04 18:32:33.545730857 +0100 @@ -2533,7 +2533,9 @@ X509Certificate cert = null; try { cert = (X509Certificate)cf.generateCertificate(in); - } catch (ClassCastException | CertificateException ce) { + } catch (ClassCastException ce) { + throw new Exception(rb.getString("Input.not.an.X.509.certificate")); + } catch (CertificateException ce) { throw new Exception(rb.getString("Input.not.an.X.509.certificate")); } 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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java 2017-04-04 18:32:33.545730857 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java 2017-04-04 18:32:33.545730857 +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 2016-09-19 11:44:50.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/tools/jconsole/Resources.java 2017-04-04 18:32:33.545730857 +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/classes/com/sun/naming/internal/ResourceManager.java openjdk-boot/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java 2017-04-05 06:24:02.686583433 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java 2017-04-05 06:27:36.255186614 +0100 @@ -165,8 +165,9 @@ throw new ClassCastException(applet.getClass().getName()); try { return getMethod.invoke(applet, name); - } catch (InvocationTargetException | - IllegalAccessException e) { + } catch (InvocationTargetException e) { + throw new AssertionError(e); + } catch (IllegalAccessException e) { throw new AssertionError(e); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java openjdk-boot/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java --- openjdk-boot.orig/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2017-04-05 06:24:02.694583307 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2017-04-05 06:34:54.984207303 +0100 @@ -883,7 +883,8 @@ InetAddress a1 = InetAddress.getByName(h1); InetAddress a2 = InetAddress.getByName(h2); result[0] = a1.equals(a2); - } catch(UnknownHostException | SecurityException e) { + } catch (UnknownHostException e) { + } catch (SecurityException e) { } return null; } @@ -1650,8 +1651,9 @@ // HttpsURLConnection instance saved in // DelegateHttpsURLConnection uconn = (URLConnection)this.getClass().getField("httpsURLConnection").get(this); - } catch (IllegalAccessException | - NoSuchFieldException e) { + } catch (IllegalAccessException e) { + // ignored; use 'this' + } catch (NoSuchFieldException e) { // ignored; use 'this' } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/reflect/ReflectionFactory.java openjdk-boot/jdk/src/share/classes/sun/reflect/ReflectionFactory.java --- openjdk-boot.orig/jdk/src/share/classes/sun/reflect/ReflectionFactory.java 2017-04-05 06:24:02.702583180 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/reflect/ReflectionFactory.java 2017-04-05 06:26:19.276411016 +0100 @@ -598,7 +598,10 @@ } try { return (Boolean) m.invoke(null, cl); - } catch (InvocationTargetException | IllegalAccessException ex) { + } catch (InvocationTargetException ex) { + throw (InternalError) + new InternalError("Exception invoking hasStaticInitializer").initCause(ex); + } catch (IllegalAccessException ex) { throw (InternalError) new InternalError("Exception invoking hasStaticInitializer").initCause(ex); } @@ -616,8 +619,16 @@ OptionalDataException.class.getDeclaredConstructor(Boolean.TYPE); boolCtor.setAccessible(true); return boolCtor.newInstance(bool); - } catch (NoSuchMethodException | InstantiationException| - IllegalAccessException|InvocationTargetException ex) { + } catch (NoSuchMethodException ex) { + throw (InternalError) + new InternalError("unable to create OptionalDataException").initCause(ex); + } catch (InstantiationException ex) { + throw (InternalError) + new InternalError("unable to create OptionalDataException").initCause(ex); + } catch (IllegalAccessException ex) { + throw (InternalError) + new InternalError("unable to create OptionalDataException").initCause(ex); + } catch (InvocationTargetException ex) { throw (InternalError) new InternalError("unable to create OptionalDataException").initCause(ex); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/x509/X509CertImpl.java openjdk-boot/jdk/src/share/classes/sun/security/x509/X509CertImpl.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/x509/X509CertImpl.java 2017-04-05 06:24:02.710583053 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/x509/X509CertImpl.java 2017-04-05 06:24:53.541774619 +0100 @@ -1936,7 +1936,9 @@ byte2hex(digest[i], buf); } fingerPrint = buf.toString(); - } catch (NoSuchAlgorithmException | CertificateEncodingException e) { + } catch (NoSuchAlgorithmException e) { + // ignored + } catch (CertificateEncodingException e) { // ignored } return fingerPrint; --- openjdk-boot.orig/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java 2017-04-06 00:49:26.316084950 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java 2017-04-06 00:50:37.090952124 +0100 @@ -85,10 +85,13 @@ ClassLoader.getSystemClassLoader()); provider = (HttpServerProvider)c.newInstance(); return true; - } catch (ClassNotFoundException | - IllegalAccessException | - InstantiationException | - SecurityException x) { + } catch (ClassNotFoundException x) { + throw new ServiceConfigurationError(x); + } catch (IllegalAccessException x) { + throw new ServiceConfigurationError(x); + } catch (InstantiationException x) { + throw new ServiceConfigurationError(x); + } catch (SecurityException x) { throw new ServiceConfigurationError(x); } } --- openjdk-boot.orig/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java 2017-04-06 04:24:15.396440889 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java 2017-04-06 04:25:03.467669795 +0100 @@ -70,10 +70,13 @@ Class<?> c = Class.forName(cm, true, null); provider = (FtpClientProvider) c.newInstance(); return true; - } catch (ClassNotFoundException | - IllegalAccessException | - InstantiationException | - SecurityException x) { + } catch (ClassNotFoundException x) { + throw new ServiceConfigurationError(x.toString()); + } catch (IllegalAccessException x) { + throw new ServiceConfigurationError(x.toString()); + } catch (InstantiationException x) { + throw new ServiceConfigurationError(x.toString()); + } catch (SecurityException x) { throw new ServiceConfigurationError(x.toString()); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java 2017-04-06 05:07:07.423235486 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java 2017-04-06 05:11:36.834917914 +0100 @@ -147,7 +147,9 @@ // convert referrals into a chain of LdapReferralException homeCtx.processReturnCode(res, listArg); - } catch (LimitExceededException | PartialResultException e) { + } catch (LimitExceededException e) { + setNamingException(e); + } catch (PartialResultException e) { setNamingException(e); } @@ -226,9 +228,13 @@ // try to process another referral return hasMoreReferrals(); - } catch (LdapReferralException | - LimitExceededException | - PartialResultException e) { + } catch (LdapReferralException e) { + cleanup(); + throw e; + } catch (LimitExceededException e) { + cleanup(); + throw e; + } catch (PartialResultException e) { cleanup(); throw e; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java 2017-04-06 05:07:07.435235294 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java 2017-04-06 05:10:34.611915195 +0100 @@ -251,10 +251,13 @@ return inetSocketAddressCons.newInstance(new Object[]{ host, new Integer(port)}); - } catch (ClassNotFoundException | - InstantiationException | - InvocationTargetException | - IllegalAccessException e) { + } catch (ClassNotFoundException e) { + throw new NoSuchMethodException(); + } catch (InstantiationException e) { + throw new NoSuchMethodException(); + } catch (InvocationTargetException e) { + throw new NoSuchMethodException(); + } catch (IllegalAccessException e) { throw new NoSuchMethodException(); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java 2017-04-06 05:07:07.447235101 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java 2017-04-06 05:09:56.288529396 +0100 @@ -560,7 +560,9 @@ if (answer.resControls != null) { respCtls = appendVector(respCtls, answer.resControls); } - } catch (NamingException | IOException ae) { + } catch (NamingException ae) { + addEx = ae; + } catch (IOException ae) { addEx = ae; } diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java openjdk-boot/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2017-09-07 03:47:44.242316551 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2017-09-07 03:53:29.764864665 +0100 @@ -392,7 +392,8 @@ try { gotoImage(imageIndex); skipImage(); - } catch (IOException | IndexOutOfBoundsException e) { + } catch (IOException e) { + } catch (IndexOutOfBoundsException e) { } finally { cbLock.unlock(); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/management/Agent.java openjdk-boot/jdk/src/share/classes/sun/management/Agent.java --- openjdk-boot.orig/jdk/src/share/classes/sun/management/Agent.java 2017-09-07 03:47:44.250316424 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/management/Agent.java 2017-09-07 03:53:01.977303193 +0100 @@ -383,7 +383,13 @@ adaptorClass.getMethod("initialize", String.class, Properties.class); initializeMethod.invoke(null,snmpPort,props); - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException x) { + } catch (ClassNotFoundException x) { + // snmp runtime doesn't exist - initialization fails + throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x); + } catch (NoSuchMethodException x) { + // snmp runtime doesn't exist - initialization fails + throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x); + } catch (IllegalAccessException x) { // snmp runtime doesn't exist - initialization fails throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x); } catch (InvocationTargetException x) { diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java openjdk-boot/jdk/src/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java --- openjdk-boot.orig/jdk/src/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java 2017-09-07 03:47:44.262316235 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java 2017-09-07 03:51:29.918755914 +0100 @@ -69,7 +69,11 @@ Field f = cl.getDeclaredField("builder"); f.setAccessible(true); return (GcInfoBuilder)f.get(gcNotifInfo.getGcInfo()); - } catch(ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + } catch(ClassNotFoundException e) { + return null; + } catch(NoSuchFieldException e) { + return null; + } catch(IllegalAccessException e) { return null; } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/management/GcInfoCompositeData.java openjdk-boot/jdk/src/share/classes/sun/management/GcInfoCompositeData.java --- openjdk-boot.orig/jdk/src/share/classes/sun/management/GcInfoCompositeData.java 2017-09-07 03:47:44.270316109 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/management/GcInfoCompositeData.java 2017-09-07 03:51:00.055227142 +0100 @@ -76,7 +76,11 @@ Field f = cl.getDeclaredField("builder"); f.setAccessible(true); return (GcInfoBuilder)f.get(info); - } catch(ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + } catch(ClassNotFoundException e) { + return null; + } catch(NoSuchFieldException e) { + return null; + } catch(IllegalAccessException e) { return null; } } @@ -88,7 +92,11 @@ Field f = cl.getDeclaredField("extAttributes"); f.setAccessible(true); return (Object[])f.get(info); - } catch(ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + } catch(ClassNotFoundException e) { + return null; + } catch(NoSuchFieldException e) { + return null; + } catch(IllegalAccessException e) { return null; } } @@ -172,7 +180,10 @@ Method m = GcInfo.class.getMethod("getMemoryUsageBeforeGc"); memoryUsageMapType = MappedMXBeanType.getMappedType(m.getGenericReturnType()); - } catch (NoSuchMethodException | OpenDataException e) { + } catch (NoSuchMethodException e) { + // Should never reach here + throw new AssertionError(e); + } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } @@ -214,7 +225,10 @@ try { TabularData td = (TabularData) cd.get(MEMORY_USAGE_BEFORE_GC); return cast(memoryUsageMapType.toJavaTypeData(td)); - } catch (InvalidObjectException | OpenDataException e) { + } catch (InvalidObjectException e) { + // Should never reach here + throw new AssertionError(e); + } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } @@ -230,7 +244,10 @@ TabularData td = (TabularData) cd.get(MEMORY_USAGE_AFTER_GC); //return (Map<String,MemoryUsage>) return cast(memoryUsageMapType.toJavaTypeData(td)); - } catch (InvalidObjectException | OpenDataException e) { + } catch (InvalidObjectException e) { + // Should never reach here + throw new AssertionError(e); + } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/UnicastRef.java openjdk-boot/jdk/src/share/classes/sun/rmi/server/UnicastRef.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/UnicastRef.java 2017-09-07 03:47:44.294315730 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/UnicastRef.java 2017-09-07 03:48:45.477350498 +0100 @@ -186,7 +186,13 @@ return returnValue; - } catch (IOException | ClassNotFoundException e) { + } catch (IOException e) { + // disable saving any refs in the inputStream for GC + ((StreamRemoteCall)call).discardPendingRefs(); + clientRefLog.log(Log.BRIEF, + e.getClass().getName() + " unmarshalling return: ", e); + throw new UnmarshalException("error unmarshalling return", e); + } catch (ClassNotFoundException e) { // disable saving any refs in the inputStream for GC ((StreamRemoteCall)call).discardPendingRefs(); clientRefLog.log(Log.BRIEF, diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java openjdk-boot/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java 2017-09-07 03:47:44.306315541 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java 2017-09-07 03:48:13.373856976 +0100 @@ -342,7 +342,12 @@ // disable saving any refs in the inputStream for GC ((StreamRemoteCall) call).discardPendingRefs(); throw aex; - } catch (java.io.IOException | ClassNotFoundException e) { + } catch (java.io.IOException e) { + // disable saving any refs in the inputStream for GC + ((StreamRemoteCall) call).discardPendingRefs(); + throw new UnmarshalException( + "error unmarshalling arguments", e); + } catch (ClassNotFoundException e) { // disable saving any refs in the inputStream for GC ((StreamRemoteCall) call).discardPendingRefs(); throw new UnmarshalException( --- openjdk-boot.orig/jaxp/src/javax/xml/transform/TransformerException.java 2017-09-07 23:14:15.753519500 +0100 +++ openjdk-boot/jaxp/src/javax/xml/transform/TransformerException.java 2017-09-08 00:24:00.930751154 +0100 @@ -360,8 +360,11 @@ } else { exception = null; } - } catch (InvocationTargetException | IllegalAccessException - | NoSuchMethodException e) { + } catch (InvocationTargetException e) { + exception = null; + } catch (IllegalAccessException e) { + exception = null; + } catch (NoSuchMethodException e) { exception = null; } } diff -Nru openjdk-boot.orig/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java openjdk-boot/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java --- openjdk-boot.orig/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2017-09-08 06:41:56.439818933 +0100 +++ openjdk-boot/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2017-09-08 06:42:37.147171694 +0100 @@ -440,7 +440,11 @@ featureToSet = LOAD_EXTERNAL_DTD; factory.setFeature(featureToSet, false); } - } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) { + } catch (ParserConfigurationException e) { + LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support "+featureToSet+" feature!", new Object[]{factory.getClass().getName()}); + } catch (SAXNotRecognizedException e) { + LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support "+featureToSet+" feature!", new Object[]{factory.getClass().getName()}); + } catch (SAXNotSupportedException e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support "+featureToSet+" feature!", new Object[]{factory.getClass().getName()}); } return factory; diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java openjdk-boot/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java 2017-09-08 14:21:09.292659912 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java 2017-09-08 14:22:33.471324133 +0100 @@ -74,7 +74,9 @@ java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); $param_Remote_2 = (java.rmi.Remote) in.readObject(); - } catch (java.io.IOException | java.lang.ClassNotFoundException e) { + } catch (java.io.IOException e) { + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (java.lang.ClassNotFoundException e) { throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { call.releaseInputStream(); @@ -107,7 +109,9 @@ try { java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); - } catch (java.io.IOException | java.lang.ClassNotFoundException e) { + } catch (java.io.IOException e) { + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (java.lang.ClassNotFoundException e) { throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { call.releaseInputStream(); @@ -133,7 +137,9 @@ java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); $param_Remote_2 = (java.rmi.Remote) in.readObject(); - } catch (java.io.IOException | java.lang.ClassNotFoundException e) { + } catch (java.io.IOException e) { + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (java.lang.ClassNotFoundException e) { throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { call.releaseInputStream(); @@ -156,7 +162,9 @@ try { java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); - } catch (java.io.IOException | java.lang.ClassNotFoundException e) { + } catch (java.io.IOException e) { + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (java.lang.ClassNotFoundException e) { throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { call.releaseInputStream(); diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Stub.java openjdk-boot/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Stub.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Stub.java 2017-09-08 14:21:09.308659658 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Stub.java 2017-09-08 14:23:08.670765574 +0100 @@ -132,7 +132,13 @@ }); } $result = (java.rmi.dgc.Lease) in.readObject(); - } catch (java.io.IOException | java.lang.ClassNotFoundException e) { + } catch (java.io.IOException e) { + if (connection instanceof TCPConnection) { + // Modified to prevent re-use of the connection after an exception + ((TCPConnection) connection).getChannel().free(connection, false); + } + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (java.lang.ClassNotFoundException e) { if (connection instanceof TCPConnection) { // Modified to prevent re-use of the connection after an exception ((TCPConnection) connection).getChannel().free(connection, false);