Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub code attribute in ijar instead of deleting it #25322

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlessandroPatti
Copy link
Contributor

Ijar simply drops the body of all public methods. However this might generate classes that are considered invalid per JVM specs. Tools that try and inspect the jar, might fail because of that. Instead of dropping the code, we can replace it with a fixed one. Particularly, throwing an unchecked exception is a valid code for all method signatures, so we just sub all code attributes with throw new java.jang.UnsupportedOperationException(). We have been using this internally for a long time, it fixes #13546

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Feb 19, 2025
@fmeum
Copy link
Collaborator

fmeum commented Feb 19, 2025

@cushon

@sgowroji sgowroji added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ijar should produce valid class files with code attributes
3 participants