Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeLibraryLoader.java throws inconsistent exceptions when failing to open Jar files #1999

Closed
drhaozhong opened this issue Apr 26, 2023 · 1 comment · Fixed by #2001
Closed
Labels
defect Something that is supposed to work, but doesn't. Less severe than a "bug"
Milestone

Comments

@drhaozhong
Copy link

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?

@stephengold
Copy link
Member

Thank you for reporting this issue.

@stephengold stephengold added this to the Future Release milestone May 7, 2023
@stephengold stephengold added the defect Something that is supposed to work, but doesn't. Less severe than a "bug" label May 7, 2023
@stephengold stephengold modified the milestones: Future Release, v3.6.1 May 29, 2023
@stephengold stephengold modified the milestones: v3.6.1, Future Release Jun 7, 2023
@stephengold stephengold modified the milestones: Future Release, v3.7.0 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something that is supposed to work, but doesn't. Less severe than a "bug"
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants