Favor local, composed annotations in the TCF
Prior to this commit, AnnotationAttributes retrieved from MetaAnnotationUtils's AnnotationDescriptor could contain attributes from the wrong annotation if an inherited annotation shadowed a locally declared composed annotation. This commit addresses this issue by invoking the new getAnnotationAttributes() method in AnnotatedElementUtils that provides a flag to control whether superclasses should be searched -- which coincidentally processes local annotations before searching the class hierarchy. Issue: SPR-12749, SPR-11598
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -286,8 +286,8 @@ public abstract class MetaAnnotationUtils {
|
||||
this.declaringClass = declaringClass;
|
||||
this.composedAnnotation = composedAnnotation;
|
||||
this.annotation = annotation;
|
||||
this.annotationAttributes = AnnotatedElementUtils.getAnnotationAttributes(
|
||||
rootDeclaringClass, annotation.annotationType().getName());
|
||||
this.annotationAttributes = AnnotatedElementUtils.getAnnotationAttributes(rootDeclaringClass,
|
||||
annotation.annotationType().getName(), true, true, false, false);
|
||||
}
|
||||
|
||||
public Class<?> getRootDeclaringClass() {
|
||||
|
||||
Reference in New Issue
Block a user