Skip to content

Commit ad088f2

Browse files
committed
Polishing
1 parent 5bca18f commit ad088f2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -173,9 +173,8 @@ private <A extends Annotation> MergedAnnotation<A> find(Object requiredType,
173173
if (!isMappingForType(mapping, requiredType)) {
174174
continue;
175175
}
176-
MergedAnnotation<A> candidate = (mappingIndex == 0
177-
? (MergedAnnotation<A>) root
178-
: TypeMappedAnnotation.createIfPossible(mapping, root, IntrospectionFailureLogger.INFO));
176+
MergedAnnotation<A> candidate = (mappingIndex == 0 ? (MergedAnnotation<A>) root :
177+
TypeMappedAnnotation.createIfPossible(mapping, root, IntrospectionFailureLogger.INFO));
179178
if (candidate != null && (predicate == null || predicate.test(candidate))) {
180179
if (selector.isBestCandidate(candidate)) {
181180
return candidate;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,7 @@ private <T> Class<T> getAdaptType(Method attribute, Class<T> type) {
596596

597597
private int getAttributeIndex(String attributeName, boolean required) {
598598
Assert.hasText(attributeName, "Attribute name must not be null");
599-
int attributeIndex = (isFiltered(attributeName) ? -1 :
600-
this.mapping.getAttributes().indexOf(attributeName));
599+
int attributeIndex = (isFiltered(attributeName) ? -1 : this.mapping.getAttributes().indexOf(attributeName));
601600
if (attributeIndex == -1 && required) {
602601
throw new NoSuchElementException("No attribute named '" + attributeName +
603602
"' present in merged annotation " + getType().getName());
@@ -648,6 +647,7 @@ static <A extends Annotation> MergedAnnotation<A> of(
648647
@Nullable
649648
static <A extends Annotation> TypeMappedAnnotation<A> createIfPossible(
650649
AnnotationTypeMapping mapping, MergedAnnotation<?> annotation, IntrospectionFailureLogger logger) {
650+
651651
if (annotation instanceof TypeMappedAnnotation) {
652652
TypeMappedAnnotation<?> typeMappedAnnotation = (TypeMappedAnnotation<?>) annotation;
653653
return createIfPossible(mapping, typeMappedAnnotation.source,

0 commit comments

Comments
 (0)