Explicitly pass null filter when creating SecureJar/UnionFS #19
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.
UnionFileSystem.testFilter
contains an optimization intended for the case where no path filter is set:https://github.com/McModLauncher/securejarhandler/blob/1dedb0655d9f4b8cf310ea7095b38c7a978a42ab/src/main/java/cpw/mods/niofs/union/UnionFileSystem.java#L397
However, all of the code paths creating commonly-used UnionFS instances in FML are passing non-null
(a, b) -> true
lambdas, defeating this optimization. I have frequently seentestFilter
appearing as a hotspot in my profiling while working on ModernFix.The solution is quite simple: start passing
null
instead of a lambda. I've gone through the codebase and replaced all the lambdas matching this pattern.Would appreciate review from someone familiar with this part of the codebase.