|
27 | 27 | import java.util.LinkedHashSet;
|
28 | 28 | import java.util.List;
|
29 | 29 | import java.util.Map;
|
30 |
| -import java.util.Objects; |
31 | 30 | import java.util.Set;
|
32 | 31 | import java.util.function.BiFunction;
|
33 | 32 |
|
@@ -179,30 +178,25 @@ private Method resolveAliasTarget(Method attribute, AliasFor aliasFor, boolean c
|
179 | 178 | }
|
180 | 179 | if (isAliasPair(target) && checkAliasPair) {
|
181 | 180 | AliasFor targetAliasFor = target.getAnnotation(AliasFor.class);
|
182 |
| - if (targetAliasFor == null) { |
183 |
| - throw new AnnotationConfigurationException(String.format( |
184 |
| - "%s must be declared as an @AliasFor '%s'.", |
185 |
| - StringUtils.capitalize(AttributeMethods.describe(target)), |
186 |
| - attribute.getName())); |
187 |
| - } |
188 |
| - Method mirror = resolveAliasTarget(target, targetAliasFor, false); |
189 |
| - if (!mirror.equals(attribute)) { |
190 |
| - throw new AnnotationConfigurationException(String.format( |
191 |
| - "%s must be declared as an @AliasFor '%s', not '%s'.", |
192 |
| - StringUtils.capitalize(AttributeMethods.describe(target)), |
193 |
| - attribute.getName(), mirror.getName())); |
| 181 | + if (targetAliasFor != null) { |
| 182 | + Method mirror = resolveAliasTarget(target, targetAliasFor, false); |
| 183 | + if (!mirror.equals(attribute)) { |
| 184 | + throw new AnnotationConfigurationException(String.format( |
| 185 | + "%s must be declared as an @AliasFor '%s', not '%s'.", |
| 186 | + StringUtils.capitalize(AttributeMethods.describe(target)), |
| 187 | + attribute.getName(), mirror.getName())); |
| 188 | + } |
194 | 189 | }
|
195 | 190 | }
|
196 | 191 | return target;
|
197 | 192 | }
|
198 | 193 |
|
199 | 194 | private boolean isAliasPair(Method target) {
|
200 |
| - return target.getDeclaringClass().equals(this.annotationType); |
| 195 | + return (this.annotationType == target.getDeclaringClass()); |
201 | 196 | }
|
202 | 197 |
|
203 | 198 | private boolean isCompatibleReturnType(Class<?> attributeType, Class<?> targetType) {
|
204 |
| - return Objects.equals(attributeType, targetType) || |
205 |
| - Objects.equals(attributeType, targetType.getComponentType()); |
| 199 | + return (attributeType == targetType || attributeType == targetType.getComponentType()); |
206 | 200 | }
|
207 | 201 |
|
208 | 202 | private void processAliases() {
|
|
0 commit comments