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

Annotations with target TYPE_USE are missing from JavaField instances #1382

Open
ivan-p92 opened this issue Nov 20, 2024 · 0 comments
Open

Comments

@ivan-p92
Copy link

Hi,

While working on some ArchUnit checks (I find the tool really useful so far!), I found that annotations with a target of @Target(TYPE_USE) are ignored (for example with @Nullable from Jspecify).

To reproduce, I created my own annotation:

@Target({TYPE_USE})
@Retention(RUNTIME)
public @interface Foo {}

Inspecting an ArchUnit JavaField resulting from importing a class with a field annotated with this annotation, no JavaAnnotations are present.

When adding or using FIELD as target, the JavaAnnotation is present on the JavaField instance.

@Target({TYPE_USE, FIELD})
@Retention(RUNTIME)
public @interface Foo {}

It would be great if these annotations were imported!

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

No branches or pull requests

1 participant