-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Review how DefaultAnnotationManager processes annotations #3335
Comments
From what I recall, we currently do an eager loading of all classes in the artifact. As one of the main goals is not to introduce any more dependencies in the core module, I didn't look for any other way to solve it (one way would be using Jandex). They will include the Classfile API in JDK 21 as a private API but in the future, they plan to release it, so we would still only depend on the Java class library. |
@Thihup Feel free to keep an eye on those developments and hopefully we can then make the default implementation adopt this API once it is available for public use :) |
…rocesses annotations
While the API is not public, I used reflection to try it out to see if it would work - and it does! The test case mentioned here is now supported by running the application with |
Would it be something we can create as a separate module or do you think that would be overkill? |
@mnriem I think having a separate implementation using the Classfile API would be reasonable. However, it makes its usage more complicated for example running Piranha through the Maven plugin. |
We can still ship it as part of the regular distribution, but this separates it from a code perspective and is an opt-in so we keep the default implementation clean? |
Do you mean changing the code in the distributions from context.add(AnnotationScanExtension.class); // Annotation scanning to something like if (System.getProperty("cloud.piranha.extension.annotationscan.experimental.classfile") != null) {
context.add(AnnotationScanClassFileExtension.class); // Annotation scanning using the new Classfile API
} else {
context.add(AnnotationScanExtension.class); // Annotation scanning
} |
They will change the Classfile API a little bit before the release of JDK 21, so I'll keep track of the changes and after it has been stabilized, I'll provide a PR. They plan to include the Classfile API as a preview API in JDK 22. https://bugs.openjdk.org/browse/JDK-8280389 |
…rocesses annotations
For background, see eclipse-ee4j/jaxb-ri#1703
The text was updated successfully, but these errors were encountered: