NativeLibraryLoader.java throws inconsistent exceptions when failing to open Jar files #1999
Labels
defect
Something that is supposed to work, but doesn't. Less severe than a "bug"
Milestone
If this class fails to open a jar file, computeNativesHash throws UnsupportedOperationException:
try{ ... conn = url.openConnection(); } catch (IOException ex) { throw new UnsupportedOperationException(ex); } finally { if (conn != null) { try { conn.getInputStream().close(); conn.getOutputStream().close(); } catch (IOException ex) { } } }
However, loadNativeLibrary throws UncheckedIOException
try { conn = url.openConnection(); in = conn.getInputStream(); } catch (IOException ex) { // Maybe put more detail here? Not sure.. throw new UncheckedIOException("Failed to open file: '" + url + "'. Error: " + ex, ex); }
This is confusing. Can this problem be fixed?
The text was updated successfully, but these errors were encountered: