Repository navigation
Fix UnSatisfiedLinkError when trying to load non-existent libraries - #47
Conversation
…action for the incremental loading criterion
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 2 minor |
🟢 Metrics 140 complexity · 4 duplication
Metric Results Complexity 140 Duplication 4
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
@stephengold You shouldn't catch exceptions anymore, the standard way to deal with exceptions and errors thrown from the API is to use both EDIT: Btw, it appears that the techdemos that demonstrate the library features using |
Of course. I have many projects that use jSnapLoader. Can you be specific about which projects are broken and how they are broken? |
Please consider checking the output of the |
|
I reproduced the failure seen in the "Build and Test jSnapLoader" workflow on ubuntu-latest-19 on my local machine.
I don't yet understand jSnapLoader well enough to submit a fix. |
Sorry, I forgot that someone may try to load from a classpath. The jarPath has to be excluded from that validation. |
…exception handlers
I re-examined the API, and decided to keep the exceptions and remove the failure functions; as the exceptions could create rate limiting or application end-points which terminate the process at a particular failure point detectable by the debuggers and JRE, unlike failure functions which are mute unless implemented... Conclusion: the primary way to deal with errors is to catch the thrown exceptions. The only left-over failure function is the |
|
@stephengold I appreciate your contributions. Expect a release very soon. |
|
Thanks. Prioer to the release, may I suggest a few other changes? |
Sure. You may open new issues and let's discuss them. |
This PR introduces
LibraryNotFoundExceptionas a guard against directly loading non-existent file regardless of whether they are actual binaries or corrupted files.Furthermore, the PR introduces a way to antagonize the effect of initializing a
FileOutputStreamby theFileExtractorAPI that by default creates a blank file (or opaque file); bypassing the formerly mentioned "LibraryNotFoundException".In addition, it also introduces an example that shows how to deal with broken features using
FileExtractionListenerinterface.