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

Support ElementType MODULE and RECORD_COMPONENT on annotations #10002

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

niloc132
Copy link
Member

While GWT has no use for JPMS modules, sources that rely on this target fail to compile with GWT (causing an error in JDT that results in a hard-to-interpret asm stack trace).

Fixes #10001

While GWT has no use for JPMS modules, sources that rely on this target
fail to compile with GWT (causing an error in JDT that results in a
hard-to-interpret asm stack trace).

Fixes gwtproject#10001
@niloc132 niloc132 added this to the 2.12 milestone Sep 11, 2024
Copy link
Member

@tbroyer tbroyer left a comment

Choose a reason for hiding this comment

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

Maybe add RECORD_COMPONENT too now that records are supported or the issue will pop again for those annotations.

Otherwise approved, and wow what a debug journey it was! 👏👏👏

@@ -22,5 +22,5 @@
*/
public enum ElementType {
ANNOTATION_TYPE, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE,
PARAMETER, TYPE, TYPE_PARAMETER, TYPE_USE,
PARAMETER, TYPE, TYPE_PARAMETER, TYPE_USE, MODULE,
Copy link
Member

Choose a reason for hiding this comment

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

We don't seem to care about the exact ordinal so maybe keep them alphabetically sorted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I had intended to keep them in the original order (MODULE was the new last element as of Java 11).

I'll re-order just in case something silly happens with ordinal values... though as my trip into bytecode shows, the name of the enum constant is what matters for annotation values.

Copy link
Member Author

Choose a reason for hiding this comment

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

On second thought, I do see that the entire list is alphabetical, my spot check of "hmm, TYPE_USE is last, so it must be append-only" was faulty. I'll stick with that ordering for now, and add RECORD_COMPONENT.

@niloc132 niloc132 changed the title Support Java9+'s ElementType.MODULE Support ElementType MODULE and RECORD_COMPONENT on annotations Sep 11, 2024
@niloc132 niloc132 merged commit 6307e79 into gwtproject:main Sep 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GWT Compiler failure with type-use annotations
2 participants