Skip to content

Commit

Permalink
Merge pull request #1047 from liuxuzxx/master
Browse files Browse the repository at this point in the history
修改issue #1046(当类的属性没有按照ExcelProperty的属性index顺序排序的时候,写数据出现错乱)
  • Loading branch information
zhuangjiaju authored Apr 22, 2020
2 parents da7b787 + f4f65e8 commit 1440ef0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/alibaba/excel/util/ClassUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ private static void declaredFields(Class clazz, Boolean convertAllFiled) {
+ "' and '" + field.getName() + "' must be inconsistent");
}
customFiledMap.put(excelProperty.index(), field);
allFieldList.add(field);
}

List<Field> allWriteFieldList = new ArrayList<Field>(customFiledMap.values());
allWriteFieldList.addAll(allFieldList);
FIELD_CACHE.put(clazz,
new SoftReference<FieldCache>(new FieldCache(defaultFieldList, customFiledMap, allFieldList, ignoreMap)));
new SoftReference<FieldCache>(new FieldCache(defaultFieldList, customFiledMap, allWriteFieldList, ignoreMap)));
}

private static class FieldCache {
Expand Down

0 comments on commit 1440ef0

Please sign in to comment.