Skip to content

Commit 179c63a

Browse files
committed
Introduce EMPTY_ANNOTATION_ARRAY in ParameterResolutionDelegate
1 parent 7e671ab commit 179c63a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/annotation/ParameterResolutionDelegate.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@
4545
*/
4646
public final class ParameterResolutionDelegate {
4747

48+
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
49+
4850
private static final AnnotatedElement EMPTY_ANNOTATED_ELEMENT = new AnnotatedElement() {
4951
@Override
5052
public <T extends Annotation> @Nullable T getAnnotation(Class<T> annotationClass) {
5153
return null;
5254
}
5355
@Override
5456
public Annotation[] getAnnotations() {
55-
return new Annotation[0];
57+
return EMPTY_ANNOTATION_ARRAY;
5658
}
5759
@Override
5860
public Annotation[] getDeclaredAnnotations() {
59-
return new Annotation[0];
61+
return EMPTY_ANNOTATION_ARRAY;
6062
}
6163
};
6264

0 commit comments

Comments
 (0)