diff --git a/src/main/java/com/alibaba/excel/util/ClassUtils.java b/src/main/java/com/alibaba/excel/util/ClassUtils.java index 64bc29d7..20b30e34 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 {