From 398a4226607be734c7a2b3f2265e1514af6770fd Mon Sep 17 00:00:00 2001 From: Looly Date: Thu, 9 May 2024 09:22:39 +0800 Subject: [PATCH] fix 3576@Github --- .../annotation/elements/CombinationAnnotatedElement.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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();