Skip to content

Commit d7b45b7

Browse files
committed
Improve diagnostics for convention-based annotation attribute overrides
The warning message logged for an annotation that still uses convention-based overrides now includes a concrete suggestion for how the problem may potentially be fixed. WARN - Support for convention-based annotation attribute overrides is deprecated and will be removed in Spring Framework 6.1. Please annotate the 'locations' attribute in @org.springframework.core.annotation.MergedAnnotationsTests$ConventionBasedComposedContextConfiguration with an appropriate @AliasFor declaration -- for example, @AliasFor(annotation = org.springframework.core.annotation.MergedAnnotationsTests$ContextConfiguration.class). See gh-28760
1 parent 5978737 commit d7b45b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ private void addConventionMappings() {
296296
Support for convention-based annotation attribute overrides is \
297297
deprecated and will be removed in Spring Framework 6.1. Please \
298298
annotate the '%s' attribute in @%s with an appropriate @AliasFor \
299-
declaration."""
300-
.formatted(name, rootAnnotationTypeName));
299+
declaration -- for example, @AliasFor(annotation = %s.class)."""
300+
.formatted(name, rootAnnotationTypeName, this.annotationType.getName()));
301301
}
302302
mappings[i] = mapped;
303303
MirrorSet mirrors = getMirrorSets().getAssigned(i);

0 commit comments

Comments
 (0)