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

Fix invalid class generated when extracting ABI from enum type #31437

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

lptr
Copy link
Member

@lptr lptr commented Nov 27, 2024

Fixes #31436

This fixes the problem with annotated enum constructors where the constructor would end up having one more RuntimeVisibleAnnotations entry recorded, causing compilation errors when trying to compile against the extracted class.

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@lptr lptr self-assigned this Nov 27, 2024
@lptr lptr added the a:bug label Nov 27, 2024
@lptr lptr added this to the 8.12 RC1 milestone Nov 27, 2024
@lptr lptr force-pushed the lptr/execution/fix-abi-extraction-bug-2 branch from 8ec2f5e to 3cf2b85 Compare November 27, 2024 15:38
@lptr lptr force-pushed the lptr/execution/fix-abi-extraction-bug-2 branch from 3cf2b85 to 41011f2 Compare November 27, 2024 15:38
@lptr lptr marked this pull request as ready for review November 27, 2024 15:49
@lptr lptr requested review from a team as code owners November 27, 2024 15:49
@lptr lptr requested a review from jvandort November 27, 2024 15:49
@lptr lptr force-pushed the lptr/execution/fix-abi-extraction-bug-2 branch from 41011f2 to 2dd07e1 Compare November 27, 2024 15:51
Comment on lines +114 to +117
if ((classMember.getAccess() & ACC_ENUM) == ACC_ENUM) {
// Enum constructors have an implicit String and int parameter containing
// the name and ordinal of the value that is non-annotable.
return Optional.of(2);
Copy link
Member Author

Choose a reason for hiding this comment

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

💭 This is the main change in the PR: we are now also handling enum constructors.

@lptr lptr requested a review from asodja November 27, 2024 15:52
Copy link
Member

@asodja asodja left a comment

Choose a reason for hiding this comment

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

LGTM

@lptr lptr added this pull request to the merge queue Nov 27, 2024
Merged via the queue into master with commit 1ab1000 Nov 27, 2024
22 checks passed
@lptr lptr deleted the lptr/execution/fix-abi-extraction-bug-2 branch November 27, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid class generated when extracting ABI from enum type
2 participants