Skip to content

Do not emulate annotations #10132

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

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

Do not emulate annotations #10132

wants to merge 2 commits into from

Conversation

zbynek
Copy link
Collaborator

@zbynek zbynek commented May 13, 2025

Fixes #10131

As pointed out the annotation doesn't have to be emulated at all since #10020 was fixed.

@zbynek zbynek marked this pull request as draft May 13, 2025 22:05
@zbynek zbynek changed the title Do not emulate Deprecated annotation Do not emulate annotations May 18, 2025
@zbynek zbynek marked this pull request as ready for review May 18, 2025 07:40
@zbynek
Copy link
Collaborator Author

zbynek commented May 18, 2025

Copy link
Member

@niloc132 niloc132 left a comment

Choose a reason for hiding this comment

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

This looks right, but why stop here - we've got a few other emulated annotation types that can be removed too:
javax.annotation.Generated
javax.annotation.processing.Generated

org.junit.runner.RunWith
org.junit.runners.SuiteClasses

Do not remove javax.validation.Pattern, as it has inner types like Flag that can't be emulated any other way (though also might not technically be needed for emulation, but might possible be used downstream).

@@ -1,25 +0,0 @@
/*
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is not an annotation, but

  1. there is no use-case for throwing this from browser code
  2. both methods declared by this class were missing from emulation

Probably better to remove than add the missing methods.

Copy link
Member

Choose a reason for hiding this comment

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

That does seem like a weird one to be emulated - looks like it could have been a part of a push to emulate anything that can be emulated way back: 21eef3b

That would make it at least possible to handle such exceptions in gwt-rpc clients.

However in this case, since the Method can't be made into a field, without a custom field serializer, this can't work.

Normally I'd be inclined to say we shouldn't take away existing emulation that someone might be using... but I think this one is pretty sketchy to begin with.

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.

Support attributes introduced in Java 9 for @Deprecated annotation
2 participants