Skip to content

Handle corrupt constant pools - #242

Merged
elharo merged 7 commits into
masterfrom
145
Jul 16, 2025
Merged

elharo merged 7 commits into
masterfrom
145

Conversation

@elharo

@elharo elharo commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Previously this would result in a raw runtime exception nothing was catching.

fixes #145

@elharo
elharo requested a review from gnodet July 16, 2025 10:51
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.text.ParseException;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ParseException does not make much sense here imho.
There's a VisitClassException defined in the package, should we use it ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, if we're assuming this is only used from a visitor. Currently that's true. I'm not sure it fits semantically though.

The other possibility is to define a new UnrecognizedConstantType exception.

@elharo
elharo marked this pull request as ready for review July 16, 2025 11:00
@elharo
elharo merged commit c2ca295 into master Jul 16, 2025
@elharo
elharo deleted the 145 branch July 16, 2025 13:35
@github-actions

Copy link
Copy Markdown

@elharo The PR can't be associated to a milestone, because there are multiple open milestones. Please add the text "branch: master" to the description to the milestone where this PR belongs to.

@github-actions

Copy link
Copy Markdown

@elharo Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConstantPoolParser throws raw RuntimeException

3 participants