Open
Conversation
Refactor ClassParser to use instanceof for ZIP/JAR detection Removed reflection-based input stream detection (getClass().getName()). Replaced with instanceof checks for ZipInputStream and JarInputStream. Added missing imports for ZipInputStream and JarInputStream. Improved maintainability by eliminating unnecessary string operations. Enhanced performance by using a direct type check instead of string comparisons.
Member
|
The breaking change is what would happen if a class happens to be using that package but is not one of the two specific classes the PR now requires. The behavior is different, from package testing to 2 specific classes. I think we can leave this alone for now. Any talk of performance is inappropriate without numbers. |
Member
|
If you're looking for something to do here, you could see why |
Author
|
Thanks I will look into it, sorry for the delay response. I will start
working on it this week
…On Mon, Feb 3, 2025 at 8:33 AM Gary Gregory ***@***.***> wrote:
If you're looking for something to do here, you could see why
ConstantPoolModuleAccessTestCase fails on Java 23.
—
Reply to this email directly, view it on GitHub
<#406 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQULTMTSV3KTEBTFOLBKZEL2N5V37AVCNFSM6AAAAABWICIVP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZRGAZDAOBUGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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.
Refactored
ClassParserto Use instanceof for ZIP/JAR DetectionProblem:
The previous implementation used
getClass().getName()to detect if anInputStreamwas from a ZIP/JAR file. This approach relied on string matching, which was inefficient and prone to break if class names changed.Solution:
instanceofchecks forZipInputStreamandJarInputStream.ZipInputStreamandJarInputStream.Testing:
mvn clean installsuccessfully.