diff --git a/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedMergedAnnotationInvocationHandler.java b/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedMergedAnnotationInvocationHandler.java index 69f34eb28b7..0e977696c65 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedMergedAnnotationInvocationHandler.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedMergedAnnotationInvocationHandler.java @@ -170,7 +170,8 @@ final class SynthesizedMergedAnnotationInvocationHandler i Class type = value.getClass(); if (type.isArray()) { StringBuilder builder = new StringBuilder("{"); - for (int i = 0; i < Array.getLength(value); i++) { + int arrayLength = Array.getLength(value); + for (int i = 0; i < arrayLength; i++) { if (i > 0) { builder.append(", "); }