From 2caaa81afafebe073bc2f629e1f21e510b98bf98 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 2 Sep 2015 15:37:16 +0200 Subject: [PATCH] Polishing --- .../core/annotation/AnnotationUtils.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java index ed6982ca73..228f9047f2 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java @@ -454,7 +454,7 @@ public abstract class AnnotationUtils { * or if it should be looked up via @{@link java.lang.annotation.Repeatable} * when running on Java 8 or higher * @param declaredMode {@code true} if only declared annotations (i.e., - * directly or indirectly present) should be considered. + * directly or indirectly present) should be considered * @return the annotations found or an empty set; never {@code null} * @since 4.2 * @see org.springframework.core.BridgeMethodResolver#findBridgedMethod @@ -1277,10 +1277,8 @@ public abstract class AnnotationUtils { DefaultAnnotationAttributeExtractor attributeExtractor = new DefaultAnnotationAttributeExtractor(annotation, annotatedElement); InvocationHandler handler = new SynthesizedAnnotationInvocationHandler(attributeExtractor); - A synthesizedAnnotation = (A) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), + return (A) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), new Class[] {(Class) annotationType, SynthesizedAnnotation.class}, handler); - - return synthesizedAnnotation; } /** @@ -1325,10 +1323,8 @@ public abstract class AnnotationUtils { MapAnnotationAttributeExtractor attributeExtractor = new MapAnnotationAttributeExtractor(attributes, annotationType, annotatedElement); InvocationHandler handler = new SynthesizedAnnotationInvocationHandler(attributeExtractor); - A synthesizedAnnotation = (A) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), + return (A) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), new Class[] {annotationType, SynthesizedAnnotation.class}, handler); - - return synthesizedAnnotation; } /**