Class AnnotationProxy
java.lang.Object
io.github.ascopes.protobufmavenplugin.utils.AnnotationProxy
Proxies annotations in a classloader-safe way in the event we are dealing
with two classloaders holding the same classes.
This allows retrieving annotations on an AnnotatedElement
safely even when the wrong classloader is used by Plexus.
Ideally, this should never be needed, but for reasons we cannot consistently reproduce, certain components get shared between Mojo executions, even when scoping per Mojo instance.
See GH-974 for such an example.
- Since:
- 5.1.3
- Author:
- Ashley Scopes
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
Optional<? extends A> findAnnotation(Class<A> annotationCls, AnnotatedElement element)
-
Method Details
-
findAnnotation
public static <A extends Annotation> Optional<? extends A> findAnnotation(Class<A> annotationCls, AnnotatedElement element)
-