diff --git a/hutool-core/src/main/java/org/dromara/hutool/core/annotation/elements/CombinationAnnotatedElement.java b/hutool-core/src/main/java/org/dromara/hutool/core/annotation/elements/CombinationAnnotatedElement.java index c2fbd1b72..9737e9bd7 100644 --- a/hutool-core/src/main/java/org/dromara/hutool/core/annotation/elements/CombinationAnnotatedElement.java +++ b/hutool-core/src/main/java/org/dromara/hutool/core/annotation/elements/CombinationAnnotatedElement.java @@ -13,6 +13,7 @@ package org.dromara.hutool.core.annotation.elements; import org.dromara.hutool.core.annotation.AnnotationUtil; +import org.dromara.hutool.core.array.ArrayUtil; import org.dromara.hutool.core.collection.set.SetUtil; import org.dromara.hutool.core.map.TableMap; @@ -144,6 +145,9 @@ public class CombinationAnnotatedElement implements AnnotatedElement, Serializab * @param annotations Class, Method, Field等 */ private void parseDeclared(final Annotation[] annotations) { + if(ArrayUtil.isEmpty(annotations)){ + return; + } Class annotationType; // 直接注解 for (final Annotation annotation : annotations) { @@ -166,6 +170,10 @@ public class CombinationAnnotatedElement implements AnnotatedElement, Serializab * @param annotations Class, Method, Field等 */ private void parse(final Annotation[] annotations) { + if(ArrayUtil.isEmpty(annotations)){ + return; + } + Class annotationType; for (final Annotation annotation : annotations) { annotationType = annotation.annotationType();