--- old/src/java.base/share/classes/java/net/JarURLConnection.java 2020-05-11 23:52:38.912390973 +0100 +++ new/src/java.base/share/classes/java/net/JarURLConnection.java 2020-05-11 23:52:38.803390189 +0100 @@ -215,7 +215,8 @@ * * @return the JAR file for this connection. If the connection is * a connection to an entry of a JAR file, the JAR file object is - * returned + * returned. The JAR file is also returned if the connection to + * a JAR file entry fails, but the JAR file itself is accessible. * * @throws IOException if an IOException occurs while trying to * connect to the JAR file for this connection. @@ -228,7 +229,10 @@ * Returns the Manifest for this connection, or null if none. * * @return the manifest object corresponding to the JAR file object - * for this connection. + * for this connection. If the connection is a connection to an + * entry of a JAR file, the manifest object is also returned if the + * connection to a JAR file entry fails, but the JAR file itself is + * accessible. * * @throws IOException if getting the JAR file for this * connection causes an IOException to be thrown. @@ -248,7 +252,8 @@ * the JAR URL for this connection points to a JAR file. * * @throws IOException if getting the JAR file for this - * connection causes an IOException to be thrown. + * connection causes an IOException to be thrown, or if the + * connection to a JAR file entry fails. * * @see #getJarFile * @see #getJarEntry --- old/src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java 2020-05-11 23:52:39.323393929 +0100 +++ new/src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java 2020-05-11 23:52:39.214393145 +0100 @@ -89,8 +89,16 @@ } public JarFile getJarFile() throws IOException { - connect(); - return jarFile; + try { + connect(); + return jarFile; + } catch (IOException e) { + if (jarFile != null) { + return jarFile; + } else { + throw e; + } + } } public JarEntry getJarEntry() throws IOException {