Mercurial > hg > release > icedtea7-2.6
view patches/boot/ecj-multicatch.patch @ 3006:7befa259c1f2
Bump to 2.6.20.
Upstream changes:
- Bump to icedtea-2.6.20
- S7050570: (fs) FileSysteProvider fails to initializes if run with file.encoding set to Cp037
- S7068616: NIO libraries do not build with javac -Xlint:all,-deprecation -Werror
- S7068617: Core libraries don't build with javac -Xlint:all -Werror
- S7077389: Reflection classes do not build with javac -Xlint:all -Werror
- S7116997: fix warnings in java.util.PropertyPermission
- S7117487: Warnings Cleanup: some i18n classes in java.util and sun.util
- S7157893: Warnings Cleanup in java.util.*
- S7193406: Clean-up JDK Build Warnings in java.util, java.io
- S8017626: [OGL] Translucent VolatileImages don't paint correctly
- S8026876: (fs) Build issue with src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java
- S8029253: [macosx] Performance problems with Retina display on Mac OS X
- S8041129: [OGL] surface->sw blit is extremely slow
- S8167646: Better invalid FilePermission
- S8213429: Windows file handling redux
- S8216965: crash in freetypeScaler.c CopyBW2Grey8
- S8218573: Better socket support
- S8218877: Help transform transformers
- S8220186: Improve use of font temporary files
- S8221497: Optional Panes in Swing
- S8221858: Build Better Processes
- S8222684: Better support for patterns
- S8222690: Better Glyph Images
- S8223163: Better pattern recognition
- S8223505: Better pattern compilation
- S8223892: Improved handling of jar files
- S8224532: Better Path supports
- S8224915: Better serial attributes
- S8225286: Better rendering of native glyphs
- S8225292: Better Graphics2D drawing
- S8225298: Improve TLS connection support
- S8225597: Enhance font glyph mapping
- S8226318: Class Loader Dependencies improvements
- S8226765: Commentary on Javadoc comments
- S8227129: Better ligature for subtables
- S8227601: Better collection of references
- S8228825: Enhance ECDSA operations
ChangeLog:
2019-11-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
Bump to 2.6.20.
* patches/rh1022017.patch:
Removed as included upstream as 8228825 / CVE-2019-2894.
* Makefile.am:
(CORBA_CHANGESET): Update to icedtea-2.6.19.
(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.
(ICEDTEA_PATCHES): Drop RH1022017 patch.
* NEWS: Updated.
* acinclude.m4:
(JDK_UPDATE_VERSION): Bump to 241.
* configure.ac: Bump to 2.6.20.
* hotspot.map.in: Update to icedtea-2.6.20.
* patches/boot/ecj-diamond.patch:
Regenerated. Add new cases in
java.util.Calendar, java.util.Collections,
java.util.Currency,
java.util.JapaneseImperialCalendar,
java.util.Observable, java.util.Properties,
java.util.PropertyPermission,
java.util.ResourceBundle, java.util.TimeZone,
java.util.TreeMap, java.util.TreeSet,
sun.java2d.opengl.OGLBlitLoops,
sun.nio.cs.ThreadLocalCoders,
sun.reflect.Label, sun.reflect.Reflection,
sun.util.calendar.CalendarSystem,
sun.util.calendar.LocalGregorianCalendar,
sun.util.calendar.ZoneInfoFile,
sun.util.calendar.ZoneInfo,
sun.util.resources.OpenListResourceBundle and
sun.util.resources.TimeZoneNamesBundle.
* patches/boot/ecj-multicatch.patch:
Regenerated. Add new cases in
java.util.ResourceBundle,
sun.nio.ch.Reflect, sun.nio.ch.Util,
sun.nio.cs.FastCharsetProvider,
sun.reflect.MethodAccessGenerator,
sun.rmi.registry.RegistryImpl_Skel,
sun.rmi.registry.RegistryImpl_Stub,
sun.rmi.transport.DGCImpl_Skel and
sun.rmi.transport.DGCImpl_Stub.
* patches/boot/ecj-stringswitch.patch:
Add new case in java.util.ResourceBundle.
* patches/boot/ecj-trywithresources.patch:
Regenerated.
author | Andrew John Hughes <gnu_andrew@member.fsf.org> |
---|---|
date | Thu, 14 Nov 2019 02:36:21 +0000 |
parents | fccb67cea959 |
children | f213ed00466c |
line wrap: on
line source
diff -Nru openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java --- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java 2019-10-14 19:21:38.000000000 +0100 +++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java 2019-11-13 20:15:18.219099267 +0000 @@ -1001,9 +1001,11 @@ public Object run() { try { return cons.newInstance(); - } catch (InstantiationException - | InvocationTargetException - | IllegalAccessException x) { + } catch (InstantiationException x) { + throw new UndeclaredThrowableException(x); + } catch (InvocationTargetException x) { + throw new UndeclaredThrowableException(x); + } catch (IllegalAccessException x) { throw new UndeclaredThrowableException(x); } } 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 2019-10-14 19:21:38.000000000 +0100 +++ openjdk-boot/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java 2019-11-13 20:15:18.219099267 +0000 @@ -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/jaxp/src/javax/xml/transform/TransformerException.java openjdk-boot/jaxp/src/javax/xml/transform/TransformerException.java --- openjdk-boot.orig/jaxp/src/javax/xml/transform/TransformerException.java 2019-10-14 19:21:38.000000000 +0100 +++ openjdk-boot/jaxp/src/javax/xml/transform/TransformerException.java 2019-11-13 20:15:18.219099267 +0000 @@ -360,10 +360,13 @@ } else { exception = null; } - } catch (InvocationTargetException | IllegalAccessException - | NoSuchMethodException e) { + } catch (InvocationTargetException e) { exception = null; - } + } catch (IllegalAccessException e) { + exception = null; + } catch (NoSuchMethodException e) { + exception = null; + } } // insure output is written s.flush(); diff -Nru openjdk-boot.orig/jaxp/src/jdk/xml/internal/JdkXmlUtils.java openjdk-boot/jaxp/src/jdk/xml/internal/JdkXmlUtils.java --- openjdk-boot.orig/jaxp/src/jdk/xml/internal/JdkXmlUtils.java 2019-10-14 19:21:38.000000000 +0100 +++ openjdk-boot/jaxp/src/jdk/xml/internal/JdkXmlUtils.java 2019-11-13 20:15:18.235099019 +0000 @@ -113,7 +113,12 @@ Object value, boolean warn) { try { reader.setProperty(property, value); - } catch (SAXNotRecognizedException | SAXNotSupportedException e) { + } catch (SAXNotRecognizedException e) { + if (warn) { + XMLSecurityManager.printWarning(reader.getClass().getName(), + property, e); + } + } catch (SAXNotSupportedException e) { if (warn) { XMLSecurityManager.printWarning(reader.getClass().getName(), property, e); @@ -166,7 +171,9 @@ try { reader = saxFactory.newSAXParser().getXMLReader(); - } catch (ParserConfigurationException | SAXException ex) { + } catch (ParserConfigurationException ex) { + // shall not happen with the system-default reader + } catch (SAXException ex) { // shall not happen with the system-default reader } return reader; @@ -253,7 +260,9 @@ SAXParserFactory saxFactory = getSAXFactory(overrideDefaultParser); try { return saxFactory.newSAXParser().getXMLReader(); - } catch (ParserConfigurationException | SAXException ex) { + } catch (ParserConfigurationException ex) { + return getXMLReaderWXMLReaderFactory(); + } catch (SAXException ex) { return getXMLReaderWXMLReaderFactory(); } } 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 2019-10-14 19:21:39.000000000 +0100 +++ openjdk-boot/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java 2019-11-13 20:15:18.219099267 +0000 @@ -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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java 2019-11-13 20:15:18.223099205 +0000 @@ -212,7 +212,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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2019-11-13 20:15:18.223099205 +0000 @@ -395,7 +395,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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java 2019-11-13 20:15:18.223099205 +0000 @@ -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/com/sun/jndi/dns/ResourceRecord.java openjdk-boot/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecord.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecord.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecord.java 2019-11-13 20:15:18.235099019 +0000 @@ -371,7 +371,12 @@ } else throw new IOException("Invalid label type: " + typeAndLen); } - } catch (IOException | InvalidNameException e) { + } catch (IOException e) { + CommunicationException ce =new CommunicationException( + "DNS error: malformed packet"); + ce.initCause(e); + throw ce; + } catch (InvalidNameException e) { CommunicationException ce =new CommunicationException( "DNS error: malformed packet"); ce.initCause(e); 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java 2019-11-13 20:15:18.223099205 +0000 @@ -267,10 +267,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 2019-11-13 19:38:52.252903717 +0000 +++ openjdk-boot/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java 2019-11-13 20:15:18.223099205 +0000 @@ -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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java 2019-11-13 20:15:18.223099205 +0000 @@ -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/com/sun/net/httpserver/spi/HttpServerProvider.java openjdk-boot/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java --- openjdk-boot.orig/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java 2019-11-13 20:15:18.223099205 +0000 @@ -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); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/io/ObjectStreamClass.java openjdk-boot/jdk/src/share/classes/java/io/ObjectStreamClass.java --- openjdk-boot.orig/jdk/src/share/classes/java/io/ObjectStreamClass.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/ObjectStreamClass.java 2019-11-13 20:15:18.223099205 +0000 @@ -1096,9 +1096,11 @@ public Object run() { try { return cons.newInstance(); - } catch (InstantiationException - | InvocationTargetException - | IllegalAccessException x) { + } catch (InstantiationException x) { + throw new UndeclaredThrowableException(x); + } catch (InvocationTargetException x) { + throw new UndeclaredThrowableException(x); + } catch (IllegalAccessException x) { throw new UndeclaredThrowableException(x); } } 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/LambdaForm.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MemberName.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-11-13 19:38:52.352902177 +0000 +++ openjdk-boot/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java 2019-11-13 20:15:18.223099205 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/ProcessBuilder.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/nio/charset/Charset.java 2019-11-13 20:15:18.227099143 +0000 @@ -441,8 +441,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/nio/file/FileTreeWalker.java openjdk-boot/jdk/src/share/classes/java/nio/file/FileTreeWalker.java --- openjdk-boot.orig/jdk/src/share/classes/java/nio/file/FileTreeWalker.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/nio/file/FileTreeWalker.java 2019-11-13 20:15:18.235099019 +0000 @@ -237,7 +237,9 @@ // cycle detected return true; } - } catch (IOException | SecurityException x) { + } catch (IOException x) { + // ignore + } catch (SecurityException x) { // ignore } } 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/util/Formatter.java 2019-11-13 20:15:18.227099143 +0000 @@ -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/ResourceBundle.java openjdk-boot/jdk/src/share/classes/java/util/ResourceBundle.java --- openjdk-boot.orig/jdk/src/share/classes/java/util/ResourceBundle.java 2019-11-13 21:33:20.050908059 +0000 +++ openjdk-boot/jdk/src/share/classes/java/util/ResourceBundle.java 2019-11-13 21:40:14.972521141 +0000 @@ -590,7 +590,8 @@ // treat it as unequal && (loader != null) && (loader == otherEntry.loaderRef.get()); - } catch ( NullPointerException | ClassCastException e) { + } catch ( NullPointerException e) { + } catch ( ClassCastException e) { } return false; } 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/java/util/Scanner.java 2019-11-13 20:15:18.227099143 +0000 @@ -637,7 +637,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); } @@ -688,7 +691,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/CipherInputStream.java 2019-11-13 20:15:18.227099143 +0000 @@ -123,7 +123,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); } @@ -329,7 +332,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/CipherOutputStream.java 2019-11-13 20:15:18.227099143 +0000 @@ -216,7 +216,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/EncryptedPrivateKeyInfo.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/crypto/SealedObject.java 2019-11-13 20:15:18.227099143 +0000 @@ -344,7 +344,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java 2019-11-13 20:15:18.227099143 +0000 @@ -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/management/Agent.java openjdk-boot/jdk/src/share/classes/sun/management/Agent.java --- openjdk-boot.orig/jdk/src/share/classes/sun/management/Agent.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/management/Agent.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java 2019-11-13 20:15:18.227099143 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/management/GcInfoCompositeData.java 2019-11-13 20:15:18.227099143 +0000 @@ -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/misc/URLClassPath.java openjdk-boot/jdk/src/share/classes/sun/misc/URLClassPath.java --- openjdk-boot.orig/jdk/src/share/classes/sun/misc/URLClassPath.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/misc/URLClassPath.java 2019-11-13 20:15:18.239098957 +0000 @@ -1104,7 +1104,9 @@ } } } - } catch (MalformedURLException | IllegalArgumentException e) {} + } catch (MalformedURLException e) { + } catch (IllegalArgumentException e) { + } if (DEBUG_CP_URL_CHECK) { System.err.println("Class-Path entry: \"" + path + "\" ignored in JAR file " + base); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java openjdk-boot/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java --- openjdk-boot.orig/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/net/ftp/FtpClientProvider.java 2019-11-13 20:15:18.227099143 +0000 @@ -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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2019-11-13 20:15:18.231099081 +0000 @@ -907,7 +907,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; } @@ -1674,8 +1675,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/nio/ch/Reflect.java openjdk-boot/jdk/src/share/classes/sun/nio/ch/Reflect.java --- openjdk-boot.orig/jdk/src/share/classes/sun/nio/ch/Reflect.java 2019-11-13 21:33:20.058907936 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/nio/ch/Reflect.java 2019-11-13 21:39:24.605296285 +0000 @@ -58,7 +58,9 @@ Constructor<?> c = cl.getDeclaredConstructor(paramTypes); setAccessible(c); return c; - } catch (ClassNotFoundException | NoSuchMethodException x) { + } catch (ClassNotFoundException x) { + throw new ReflectionError(x); + } catch (NoSuchMethodException x) { throw new ReflectionError(x); } } @@ -66,9 +68,11 @@ static Object invoke(Constructor<?> c, Object[] args) { try { return c.newInstance(args); - } catch (InstantiationException | - IllegalAccessException | - InvocationTargetException x) { + } catch (InstantiationException x) { + throw new ReflectionError(x); + } catch (IllegalAccessException x) { + throw new ReflectionError(x); + } catch (InvocationTargetException x) { throw new ReflectionError(x); } } @@ -82,7 +86,9 @@ Method m = cl.getDeclaredMethod(methodName, paramTypes); setAccessible(m); return m; - } catch (ClassNotFoundException | NoSuchMethodException x) { + } catch (ClassNotFoundException x) { + throw new ReflectionError(x); + } catch (NoSuchMethodException x) { throw new ReflectionError(x); } } @@ -90,7 +96,9 @@ static Object invoke(Method m, Object ob, Object[] args) { try { return m.invoke(ob, args); - } catch (IllegalAccessException | InvocationTargetException x) { + } catch (IllegalAccessException x) { + throw new ReflectionError(x); + } catch (InvocationTargetException x) { throw new ReflectionError(x); } } @@ -115,7 +123,9 @@ Field f = cl.getDeclaredField(fieldName); setAccessible(f); return f; - } catch (ClassNotFoundException | NoSuchFieldException x) { + } catch (ClassNotFoundException x) { + throw new ReflectionError(x); + } catch (NoSuchFieldException x) { throw new ReflectionError(x); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/nio/ch/Util.java openjdk-boot/jdk/src/share/classes/sun/nio/ch/Util.java --- openjdk-boot.orig/jdk/src/share/classes/sun/nio/ch/Util.java 2019-11-13 21:33:20.070907751 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/nio/ch/Util.java 2019-11-13 21:37:46.230810299 +0000 @@ -369,10 +369,13 @@ Runnable.class }); ctor.setAccessible(true); directByteBufferConstructor = ctor; - } catch (ClassNotFoundException | - NoSuchMethodException | - IllegalArgumentException | - ClassCastException x) { + } catch (ClassNotFoundException x) { + throw new InternalError(); + } catch (NoSuchMethodException x) { + throw new InternalError(); + } catch (IllegalArgumentException x) { + throw new InternalError(); + } catch (ClassCastException x) { throw new InternalError(); } return null; @@ -392,9 +395,11 @@ new Long(addr), fd, unmapper }); - } catch (InstantiationException | - IllegalAccessException | - InvocationTargetException e) { + } catch (InstantiationException e) { + throw new InternalError(); + } catch (IllegalAccessException e) { + throw new InternalError(); + } catch (InvocationTargetException e) { throw new InternalError(); } return dbb; @@ -414,10 +419,13 @@ Runnable.class }); ctor.setAccessible(true); directByteBufferRConstructor = ctor; - } catch (ClassNotFoundException | - NoSuchMethodException | - IllegalArgumentException | - ClassCastException x) { + } catch (ClassNotFoundException x) { + throw new InternalError(); + } catch (NoSuchMethodException x) { + throw new InternalError(); + } catch (IllegalArgumentException x) { + throw new InternalError(); + } catch (ClassCastException x) { throw new InternalError(); } return null; @@ -437,9 +445,11 @@ new Long(addr), fd, unmapper }); - } catch (InstantiationException | - IllegalAccessException | - InvocationTargetException e) { + } catch (InstantiationException e) { + throw new InternalError(); + } catch (IllegalAccessException e) { + throw new InternalError(); + } catch (InvocationTargetException e) { throw new InternalError(); } return dbb; diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/nio/cs/FastCharsetProvider.java openjdk-boot/jdk/src/share/classes/sun/nio/cs/FastCharsetProvider.java --- openjdk-boot.orig/jdk/src/share/classes/sun/nio/cs/FastCharsetProvider.java 2019-11-13 21:33:20.082907566 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/nio/cs/FastCharsetProvider.java 2019-11-13 21:34:20.393978589 +0000 @@ -121,9 +121,11 @@ cs = (Charset)c.newInstance(); cache.put(csn, cs); return cs; - } catch (ClassNotFoundException | - IllegalAccessException | - InstantiationException x) { + } catch (ClassNotFoundException x) { + return null; + } catch (IllegalAccessException x) { + return null; + } catch (InstantiationException x) { return null; } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java openjdk-boot/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java --- openjdk-boot.orig/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java 2019-11-13 21:33:20.090907443 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java 2019-11-13 21:39:44.660987633 +0000 @@ -401,8 +401,10 @@ 0, bytes.length, declaringClass.getClassLoader()).newInstance(); - } catch (InstantiationException | - IllegalAccessException e) { + } catch (InstantiationException e) { + throw (InternalError) + new InternalError().initCause(e); + } catch (IllegalAccessException e) { throw (InternalError) new InternalError().initCause(e); } 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/reflect/ReflectionFactory.java 2019-11-13 20:15:18.231099081 +0000 @@ -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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Skel.java 2019-11-13 20:22:10.744709194 +0000 @@ -86,7 +86,13 @@ java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); $param_Remote_2 = (java.rmi.Remote) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { @@ -120,7 +126,13 @@ try { java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { @@ -147,7 +159,13 @@ java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); $param_Remote_2 = (java.rmi.Remote) in.readObject(); - } catch (ClassCastException | IOException | java.lang.ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (java.lang.ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { @@ -171,7 +189,13 @@ try { java.io.ObjectInput in = call.getInputStream(); $param_String_1 = (java.lang.String) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Stub.java openjdk-boot/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Stub.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Stub.java 2019-11-13 23:07:44.683855040 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/registry/RegistryImpl_Stub.java 2019-11-13 23:11:29.560397517 +0000 @@ -93,7 +93,13 @@ try { java.io.ObjectInput in = call.getInputStream(); $result = (java.lang.String[]) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling return", e); } finally { @@ -125,7 +131,13 @@ try { java.io.ObjectInput in = call.getInputStream(); $result = (java.rmi.Remote) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling return", e); } finally { 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/ActivationGroupImpl.java 2019-11-13 20:15:18.231099081 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java 2019-11-13 20:15:18.231099081 +0000 @@ -263,11 +263,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/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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/UnicastRef.java 2019-11-13 20:15:18.231099081 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java 2019-11-13 20:15:18.231099081 +0000 @@ -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( diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Skel.java openjdk-boot/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Skel.java --- openjdk-boot.orig/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Skel.java 2019-11-13 23:07:44.699854794 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Skel.java 2019-11-13 23:09:49.061942667 +0000 @@ -65,7 +65,13 @@ $param_long_2 = in.readLong(); $param_VMID_3 = (java.rmi.dgc.VMID) in.readObject(); $param_boolean_4 = in.readBoolean(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { @@ -90,7 +96,13 @@ $param_arrayOf_ObjID_1 = (java.rmi.server.ObjID[]) in.readObject(); $param_long_2 = in.readLong(); $param_Lease_3 = (java.rmi.dgc.Lease) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (IOException e) { + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); + } catch (ClassNotFoundException e) { call.discardPendingRefs(); throw new java.rmi.UnmarshalException("error unmarshalling arguments", e); } finally { 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/DGCImpl_Stub.java 2019-11-13 20:17:16.905260814 +0000 @@ -125,7 +125,21 @@ java.io.ObjectInput in = call.getInputStream(); $result = (java.rmi.dgc.Lease) in.readObject(); - } catch (ClassCastException | IOException | ClassNotFoundException e) { + } catch (ClassCastException e) { + if (connection instanceof TCPConnection) { + // Modified to prevent re-use of the connection after an exception + ((TCPConnection) connection).getChannel().free(connection, false); + } + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (IOException e) { + if (connection instanceof TCPConnection) { + // Modified to prevent re-use of the connection after an exception + ((TCPConnection) connection).getChannel().free(connection, false); + } + call.discardPendingRefs(); + throw new java.rmi.UnmarshalException("error unmarshalling return", e); + } catch (ClassNotFoundException e) { if (connection instanceof TCPConnection) { // Modified to prevent re-use of the connection after an exception ((TCPConnection) connection).getChannel().free(connection, false); 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/proxy/RMIMasterSocketFactory.java 2019-11-13 20:15:18.231099081 +0000 @@ -209,7 +209,9 @@ return initialSocket; - } catch (UnknownHostException | NoRouteToHostException e) { + } catch (UnknownHostException e) { + initialFailure = e; + } catch (NoRouteToHostException e) { initialFailure = e; } catch (SocketException e) { if (eagerHttpFallback) { @@ -274,7 +276,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java 2019-11-13 20:15:18.231099081 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java 2019-11-13 20:15:18.231099081 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/PrincipalName.java 2019-11-13 20:15:18.231099081 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java 2019-11-13 20:15:18.231099081 +0000 @@ -326,7 +326,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); @@ -451,7 +453,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)); @@ -557,7 +561,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); } } @@ -759,7 +765,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); } } @@ -839,7 +849,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); } } @@ -1029,7 +1043,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); } @@ -1091,7 +1107,9 @@ storePkey(alias, (KeyStore.PrivateKeyEntry)entry); } - } catch (PKCS11Exception | CertificateException pe) { + } catch (PKCS11Exception pe) { + throw new KeyStoreException(pe); + } catch (CertificateException pe) { throw new KeyStoreException(pe); } @@ -1129,7 +1147,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java 2019-11-13 20:15:18.231099081 +0000 @@ -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/CertStoreHelper.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java 2019-11-13 19:38:52.360902053 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java 2019-11-13 20:15:18.231099081 +0000 @@ -83,8 +83,9 @@ = (CertStoreHelper)c.newInstance(); cache.put(type, csh); return csh; - } catch (InstantiationException | - IllegalAccessException e) { + } catch (InstantiationException e) { + throw new AssertionError(e); + } catch (IllegalAccessException e) { throw new AssertionError(e); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java 2019-11-13 20:15:18.231099081 +0000 @@ -159,7 +159,9 @@ debug.println("Returning " + results.size() + " CRLs"); } return results; - } catch (CertificateException | IOException e) { + } catch (CertificateException e) { + return Collections.emptySet(); + } catch (IOException e) { return Collections.emptySet(); } } @@ -243,7 +245,13 @@ trustAnchors, certStores, validity, variant)) { crls.add(crl); } - } catch (IOException | CRLException e) { + } catch (IOException e) { + // don't add the CRL + if (debug != null) { + debug.println("Exception verifying CRL: " + e.getMessage()); + e.printStackTrace(); + } + } catch (CRLException e) { // don't add the CRL if (debug != null) { debug.println("Exception verifying CRL: " + e.getMessage()); @@ -266,8 +274,12 @@ try { ucs = URICertStore.getInstance (new URICertStore.URICertStoreParameters(uri)); - } catch (InvalidAlgorithmParameterException | - NoSuchAlgorithmException e) { + } catch (InvalidAlgorithmParameterException e) { + if (debug != null) { + debug.println("Can't create URICertStore: " + e.getMessage()); + } + return null; + } catch (NoSuchAlgorithmException e) { if (debug != null) { debug.println("Can't create URICertStore: " + e.getMessage()); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java 2019-11-13 20:15:18.231099081 +0000 @@ -148,7 +148,10 @@ try { X509CertImpl certImpl = X509CertImpl.toImpl(cert); certId = new CertId(issuerCert, certImpl.getSerialNumberObject()); - } catch (CertificateException | IOException e) { + } catch (CertificateException e) { + throw new CertPathValidatorException + ("Exception while encoding OCSPRequest", e); + } catch (IOException e) { throw new CertPathValidatorException ("Exception while encoding OCSPRequest", e); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java 2019-11-13 20:15:18.231099081 +0000 @@ -641,9 +641,11 @@ } return false; } - } catch (InvalidKeyException | NoSuchAlgorithmException | - SignatureException e) - { + } catch (InvalidKeyException e) { + throw new CertPathValidatorException(e); + } catch (NoSuchAlgorithmException e) { + throw new CertPathValidatorException(e); + } catch (SignatureException e) { throw new CertPathValidatorException(e); } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java 2019-11-13 20:15:18.231099081 +0000 @@ -102,7 +102,9 @@ X509CertImpl firstCertImpl = X509CertImpl.toImpl(firstCert); selector.parseAuthorityKeyIdentifierExtension( firstCertImpl.getAuthorityKeyIdentifierExtension()); - } catch (CertificateException | IOException e) { + } catch (CertificateException e) { + // ignore + } catch (IOException e) { // ignore } } diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java 2019-11-13 19:38:52.360902053 +0000 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java 2019-11-13 20:15:18.235099019 +0000 @@ -148,8 +148,14 @@ try { this.certStores.add(CertStore.getInstance("Collection", new CollectionCertStoreParameters(params.certificates()))); - } catch (InvalidAlgorithmParameterException | - NoSuchAlgorithmException e) { + } catch (InvalidAlgorithmParameterException e) { + // should never occur but not necessarily fatal, so log it, + // ignore and continue + if (debug != null) { + debug.println("RevocationChecker: " + + "error creating Collection CertStore: " + e); + } + } catch (NoSuchAlgorithmException e) { // should never occur but not necessarily fatal, so log it, // ignore and continue if (debug != null) { @@ -831,7 +837,19 @@ break; } return results; - } catch (CertificateException | CRLException | IOException e) { + } catch (CertificateException e) { + if (debug != null) { + debug.println("Exception while verifying CRL: "+e.getMessage()); + e.printStackTrace(); + } + return Collections.emptySet(); + } catch (CRLException e) { + if (debug != null) { + debug.println("Exception while verifying CRL: "+e.getMessage()); + e.printStackTrace(); + } + return Collections.emptySet(); + } catch (IOException e) { if (debug != null) { debug.println("Exception while verifying CRL: "+e.getMessage()); e.printStackTrace(); diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java 2019-11-13 20:15:18.235099019 +0000 @@ -165,7 +165,16 @@ } else { buildReverse(adjList, certPathList); } - } catch (GeneralSecurityException | IOException e) { + } catch (GeneralSecurityException e) { + if (debug != null) { + debug.println("SunCertPathBuilder.engineBuild() exception in " + + "build"); + e.printStackTrace(); + } + throw new SunCertPathBuilderException("unable to find valid " + + "certification path to requested target", e, + new AdjacencyList(adjList)); + } catch (IOException e) { if (debug != null) { debug.println("SunCertPathBuilder.engineBuild() exception in " + "build"); @@ -262,7 +271,13 @@ depthFirstSearchReverse(null, currentState, new ReverseBuilder(buildParams), adjacencyList, certPathList); - } catch (GeneralSecurityException | IOException e) { + } catch (GeneralSecurityException e) { + // continue on error if more anchors to try + if (iter.hasNext()) + continue; + else + throw e; + } catch (IOException e) { // continue on error if more anchors to try if (iter.hasNext()) continue; 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java 2019-11-13 20:15:18.235099019 +0000 @@ -308,7 +308,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(); @@ -420,7 +425,17 @@ 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(); + } + // exception, forget previous values + lastModified = 0; + crl = null; + throw new PKIX.CertStoreTypeException("URI", + new CertStoreException(e)); + } 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/KeyStoreDelegator.java openjdk-boot/jdk/src/share/classes/sun/security/provider/KeyStoreDelegator.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/provider/KeyStoreDelegator.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/KeyStoreDelegator.java 2019-11-13 20:15:18.235099019 +0000 @@ -204,7 +204,9 @@ try { keystore = primaryKeyStore.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + } catch (InstantiationException e) { + // can safely ignore + } catch (IllegalAccessException e) { // can safely ignore } type = primaryType; @@ -244,17 +246,15 @@ "keystore security level"); } - } catch (InstantiationException | - IllegalAccessException e2) { + } catch (InstantiationException e2) { + // can safely ignore + } catch (IllegalAccessException e2) { // can safely ignore - } catch (IOException | - NoSuchAlgorithmException | - CertificateException e3) { + } catch (IOException e3) { // incorrect password - if (e3 instanceof IOException && - e3.getCause() instanceof + if (e3.getCause() instanceof UnrecoverableKeyException) { throw (IOException)e3; } @@ -266,7 +266,25 @@ } else if (e instanceof NoSuchAlgorithmException) { throw (NoSuchAlgorithmException)e; } - } + } catch (NoSuchAlgorithmException e3) { + // rethrow the outer exception + if (e instanceof IOException) { + throw (IOException)e; + } else if (e instanceof CertificateException) { + throw (CertificateException)e; + } else if (e instanceof NoSuchAlgorithmException) { + throw (NoSuchAlgorithmException)e; + } + } catch (CertificateException e3) { + // rethrow the outer exception + if (e instanceof IOException) { + throw (IOException)e; + } else if (e instanceof CertificateException) { + throw (CertificateException)e; + } else if (e instanceof NoSuchAlgorithmException) { + throw (NoSuchAlgorithmException)e; + } + } } if (debug != null) { 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/provider/SecureRandom.java 2019-11-13 20:15:18.235099019 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java 2019-11-13 20:15:18.235099019 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/Handshaker.java 2019-11-13 20:15:18.235099019 +0000 @@ -1200,8 +1200,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 @@ -1209,6 +1208,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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/ssl/RSAClientKeyExchange.java 2019-11-13 20:15:18.235099019 +0000 @@ -173,14 +173,20 @@ 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 nsae) { + // unlikely to happen, otherwise, must be a provider exception + if (debug != null && Debug.isOn("handshake")) { + System.out.println("RSA premaster secret generation error:"); + nsae.printStackTrace(System.out); + } + throw new RuntimeException("Could not generate premaster secret", nsae); } } 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/tools/keytool/Main.java 2019-11-13 20:15:18.235099019 +0000 @@ -2736,7 +2736,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/security/util/ECUtil.java openjdk-boot/jdk/src/share/classes/sun/security/util/ECUtil.java --- openjdk-boot.orig/jdk/src/share/classes/sun/security/util/ECUtil.java 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/util/ECUtil.java 2019-11-13 20:15:18.239098957 +0000 @@ -92,7 +92,9 @@ private static KeyFactory getKeyFactory() { try { return KeyFactory.getInstance("EC", "SunEC"); - } catch (NoSuchAlgorithmException | NoSuchProviderException e) { + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } catch (NoSuchProviderException e) { throw new RuntimeException(e); } } 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/security/x509/X509CertImpl.java 2019-11-13 20:15:18.235099019 +0000 @@ -1962,7 +1962,9 @@ byte2hex(digest[i], buf); } fingerPrint = buf.toString(); - } catch (NoSuchAlgorithmException | CertificateEncodingException e) { + } catch (NoSuchAlgorithmException e) { + // ignored + } catch (CertificateEncodingException e) { // ignored } return fingerPrint; 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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java 2019-11-13 20:15:18.235099019 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java 2019-11-13 20:15:18.235099019 +0000 @@ -94,7 +94,7 @@ && mainClass.indexOf(arg.getProcessSubstring()) != -1) { pids.add(vmd.id()); } - } catch (MonitorException|URISyntaxException e) { + } catch (MonitorException e) { if (e.getMessage() != null) { System.err.println(e.getMessage()); } else { @@ -105,7 +105,18 @@ e.printStackTrace(); } } - } + } catch (URISyntaxException e) { + if (e.getMessage() != null) { + System.err.println(e.getMessage()); + } else { + Throwable cause = e.getCause(); + if ((cause != null) && (cause.getMessage() != null)) { + System.err.println(cause.getMessage()); + } else { + e.printStackTrace(); + } + } + } } if (pids.isEmpty()) { System.err.println("Could not find any processes matching : '" @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/classes/sun/tools/jconsole/Resources.java 2019-11-13 20:15:18.235099019 +0000 @@ -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 2019-10-14 19:21:40.000000000 +0100 +++ openjdk-boot/jdk/src/share/demo/jfc/Notepad/Notepad.java 2019-11-13 20:15:18.235099019 +0000 @@ -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);