Handle the case of a Multi-Release Jar not actually containing Multi-Release Classes#42
Merged
marchermans merged 2 commits intoMcModLauncher:mainfrom Feb 14, 2024
Merged
Conversation
Contributor
|
Why not use |
Contributor
Author
|
That's definitely an option (and probably the superior one), A few of us went through several options over on Discord fairly quickly, but I don't think that was raised. It would require to change the code flow slightly around the setting of the final |
Contributor
|
This needs to be updated after the recent refactor of this code to |
3dbf856 to
34ff48d
Compare
Technici4n
approved these changes
Nov 27, 2023
marchermans
approved these changes
Feb 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seen a couple of people encounter this in mod dev (when adding dependencies):
SJH considers a Jar to be
Multi-Releasebased on theManifestsecurejarhandler/src/main/java/cpw/mods/jarhandling/impl/Jar.java
Line 124 in 96a7b6a
If it is then it resolves a path to
/META-INF/versionssecurejarhandler/src/main/java/cpw/mods/jarhandling/impl/Jar.java
Line 126 in 96a7b6a
And tries to walk it
securejarhandler/src/main/java/cpw/mods/jarhandling/impl/Jar.java
Line 127 in 96a7b6a
This works for most Jars, however it does not consider the case where a Jar is erroneously marked as
Multi-Release, with/META-INF/versionsnot existing.If this is the case,
Files.walkwill throw aUnionFileSystem$NoSuchFileExceptionwhich is then wrapped and rethrown as aUncheckedIOExceptionsecurejarhandler/src/main/java/cpw/mods/jarhandling/impl/Jar.java
Line 138 in 96a7b6a
Attached Example Stacktrace, https://gist.github.com/AterAnimAvis/35ded98d52a78c2f257d59173c86366c
Current implementation of a fix is from a bit of spitballing in Discord