since
if (!isMappable(source, metaAnnotation)) {
continue;
}
is called before and 'source' ,'metaAnnotation' did not changed.
The code should be deleted.
Comment From: yilianhuaixiao
@sbrannen Yes, I think you are right
Comment From: sbrannen
@yilianhuaixiao with your latest commit that fixes the issue, please introduce a test that fails before the fix and passes after the fix.
Comment From: yilianhuaixiao
@sbrannen I added the testcase which can be passed after changing.
Comment From: sbrannen
@yilianhuaixiao, thanks again for the PR and the test case!
It turns out that AnnotationTypeMappings.forAnnotationType(Class<? extends Annotation>, AnnotationFilter)
is not invoked outside of the AnnotationTypeMappings
class itself.
It is only invoked from AnnotationTypeMappings.forAnnotationType(Class<? extends Annotation>)
, with AnnotationFilter.PLAIN
as the supplied annotation filter, which filters out annotations from the java.lang
and org.springframework.lang
packages.
Since none of the annotations from the java.lang
and org.springframework.lang
packages is repeatable, the filtering of repeatable annotations is unnecessary.
In light of that, I am changing this from a "bug" to a "task" issue in order to remove the method from the package-private API and to remove the filtering of repeatable annotations altogether.
Comment From: sbrannen
It turns out that
AnnotationTypeMappings.forAnnotationType(Class<? extends Annotation>, AnnotationFilter)
is not invoked outside of theAnnotationTypeMappings
class itself.
Actually, I made a mistake while analyzing this in my IDE. An AnnotationFilter
can be supplied to AnnotationTypeMappings
via the from
factory methods in TypeMappedAnnotations
via the from
factory methods in MergedAnnotations
which are part of the public API.
Thus, we will merge this PR as a bug fix.
Comment From: sbrannen
This has been merged into 5.2.x
and master
.
Thanks