Skip to content

Commit 6b90504

Browse files
committed
Polishing
See gh-31962
1 parent 88a7ca0 commit 6b90504

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,11 @@ private String resolveCorsAnnotationValue(String value) {
433433
private static class AnnotationDescriptor<A extends Annotation> {
434434

435435
private final A annotation;
436-
private final Annotation source;
436+
private final MergedAnnotation<?> root;
437437

438438
AnnotationDescriptor(MergedAnnotation<A> mergedAnnotation) {
439439
this.annotation = mergedAnnotation.synthesize();
440-
this.source = (mergedAnnotation.getDistance() > 0 ?
441-
mergedAnnotation.getRoot().synthesize() : this.annotation);
440+
this.root = mergedAnnotation.getRoot();
442441
}
443442

444443
@Override
@@ -453,7 +452,7 @@ public int hashCode() {
453452

454453
@Override
455454
public String toString() {
456-
return this.source.toString();
455+
return this.root.synthesize().toString();
457456
}
458457

459458
}

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,11 @@ private String resolveCorsAnnotationValue(String value) {
612612
private static class AnnotationDescriptor<A extends Annotation> {
613613

614614
private final A annotation;
615-
private final Annotation source;
615+
private final MergedAnnotation<?> root;
616616

617617
AnnotationDescriptor(MergedAnnotation<A> mergedAnnotation) {
618618
this.annotation = mergedAnnotation.synthesize();
619-
this.source = (mergedAnnotation.getDistance() > 0 ?
620-
mergedAnnotation.getRoot().synthesize() : this.annotation);
619+
this.root = mergedAnnotation.getRoot();
621620
}
622621

623622
@Override
@@ -632,7 +631,7 @@ public int hashCode() {
632631

633632
@Override
634633
public String toString() {
635-
return this.source.toString();
634+
return this.root.synthesize().toString();
636635
}
637636

638637
}

0 commit comments

Comments
 (0)