Skip to content

Commit 9f7cbe1

Browse files
committed
Polishing
1 parent a68f5b1 commit 9f7cbe1

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,19 +289,15 @@ private void addConventionMappings() {
289289
int mapped = rootAttributes.indexOf(name);
290290
if (!MergedAnnotation.VALUE.equals(name) && mapped != -1 && !isExplicitAttributeOverride(name)) {
291291
String rootAnnotationTypeName = this.root.annotationType.getName();
292-
// We want to avoid duplicate log warnings as much as possible, without
293-
// fully synchronizing on the cache.
294292
String cacheKey = rootAnnotationTypeName + "." + name;
295-
if (!conventionBasedOverrideCheckCache.contains(cacheKey)) {
296-
conventionBasedOverrideCheckCache.add(cacheKey);
297-
if (logger.isWarnEnabled()) {
298-
logger.warn("""
299-
Support for convention-based annotation attribute overrides is \
300-
deprecated and will be removed in Spring Framework 6.1. Please \
301-
annotate the '%s' attribute in @%s with an appropriate @AliasFor \
302-
declaration."""
303-
.formatted(name, rootAnnotationTypeName));
304-
}
293+
// We want to avoid duplicate log warnings as much as possible, without full synchronization.
294+
if (conventionBasedOverrideCheckCache.add(cacheKey) && logger.isWarnEnabled()) {
295+
logger.warn("""
296+
Support for convention-based annotation attribute overrides is \
297+
deprecated and will be removed in Spring Framework 6.1. Please \
298+
annotate the '%s' attribute in @%s with an appropriate @AliasFor \
299+
declaration."""
300+
.formatted(name, rootAnnotationTypeName));
305301
}
306302
mappings[i] = mapped;
307303
MirrorSet mirrors = getMirrorSets().getAssigned(i);

0 commit comments

Comments
 (0)