You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After changes introduced in #22586, AnnotationsScanner.getDeclaredAnnotation(source, annotationType) method can't find org.springframework.lang.Nullable anymore because it gets filtered out by this filter:
static final AnnotationFilter PLAIN = packages("java.lang",
"org.springframework.lang");
from org.springframework.core.annotation.AnnotationFilter
Is that intentional? If so, what should be used instead?
Jus to clarify, we use AnnotatedElementUtils.findMergedAnnotation, but internally it relies on AnnotationsScanner.getDeclaredAnnotation
The text was updated successfully, but these errors were encountered:
We don't consider the lang annotations as searchable there. Since such annotations are usually declared locally and never use attribute aliases, why do you need to use a merged annotation search to begin with? Why not simply look it up through regular JDK getAnnotation calls? Are you possibly not repeating the nullability declarations on interface implementations and subclasses?
I'm in the process of restoring some basic detection of lang annotations so that AnnotatedElementUtils.findMergedAnnotation and co can be used for simple direct annotation lookups as well (again). We had that before, mostly as an optimization for locally declared annotations, and should be able to restore that... even if the new MergedAnnotation API does not consider such annotations as searchable within its algorithm.
Uh oh!
There was an error while loading. Please reload this page.
Affects: 5.2.0.BUILD-SNAPSHOT
After changes introduced in #22586,
AnnotationsScanner.getDeclaredAnnotation(source, annotationType)
method can't findorg.springframework.lang.Nullable
anymore because it gets filtered out by this filter:from
org.springframework.core.annotation.AnnotationFilter
Is that intentional? If so, what should be used instead?
Jus to clarify, we use
AnnotatedElementUtils.findMergedAnnotation
, but internally it relies onAnnotationsScanner.getDeclaredAnnotation
The text was updated successfully, but these errors were encountered: