From f4f65e82eb3448352a5698539fb8917610c3c695 Mon Sep 17 00:00:00 2001 From: liuxu <928525166@qq.com> Date: Thu, 2 Jan 2020 10:47:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9issue=20#1046(=E5=BD=93?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E5=B1=9E=E6=80=A7=E6=B2=A1=E6=9C=89=E6=8C=89?= =?UTF-8?q?=E7=85=A7ExcelProperty=E7=9A=84=E5=B1=9E=E6=80=A7index=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E6=8E=92=E5=BA=8F=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E5=86=99=E6=95=B0=E6=8D=AE=E5=87=BA=E7=8E=B0=E9=94=99=E4=B9=B1?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/excel/util/ClassUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/alibaba/excel/util/ClassUtils.java b/src/main/java/com/alibaba/excel/util/ClassUtils.java index 64bc29d..20b30e3 100644 --- a/src/main/java/com/alibaba/excel/util/ClassUtils.java +++ b/src/main/java/com/alibaba/excel/util/ClassUtils.java @@ -109,11 +109,12 @@ public class ClassUtils { + "' and '" + field.getName() + "' must be inconsistent"); } customFiledMap.put(excelProperty.index(), field); - allFieldList.add(field); } + List allWriteFieldList = new ArrayList(customFiledMap.values()); + allWriteFieldList.addAll(allFieldList); FIELD_CACHE.put(clazz, - new SoftReference(new FieldCache(defaultFieldList, customFiledMap, allFieldList, ignoreMap))); + new SoftReference(new FieldCache(defaultFieldList, customFiledMap, allWriteFieldList, ignoreMap))); } private static class FieldCache {