From 8d1e6c21bb01de1720953da0bfae01276b672eee Mon Sep 17 00:00:00 2001 From: BigXin0109 <1064730540@qq.com> Date: Fri, 26 Aug 2022 23:42:18 +0800 Subject: [PATCH] fix: Reflection missing fields (#590) --- .../src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java index 56b58ed2..db5c343d 100644 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java @@ -94,9 +94,7 @@ public class ReflectUtil { } else { int length = allFields.length; allFields = Arrays.copyOf(allFields, length + declaredFields.length); - for (int i = 1; i < declaredFields.length; i++) { - allFields[length + i] = declaredFields[i - 1]; - } + System.arraycopy(declaredFields, 0, allFields, length, declaredFields.length); } searchType = withSuperClassFields ? searchType.getSuperclass() : null; }