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
This commit is contained in:
Sam Brannen 2022-07-09 17:15:13 +02:00
parent 597873746c
commit d7b45b7c8e
1 changed files with 2 additions and 2 deletions

View File

@ -296,8 +296,8 @@ final class AnnotationTypeMapping {
Support for convention-based annotation attribute overrides is \
deprecated and will be removed in Spring Framework 6.1. Please \
annotate the '%s' attribute in @%s with an appropriate @AliasFor \
declaration."""
.formatted(name, rootAnnotationTypeName));
declaration -- for example, @AliasFor(annotation = %s.class)."""
.formatted(name, rootAnnotationTypeName, this.annotationType.getName()));
}
mappings[i] = mapped;
MirrorSet mirrors = getMirrorSets().getAssigned(i);