提交 af2c3882 编写于 作者: Z zl

去掉LongestMatchColumnWidthStyleStrategy缓存的static修饰符

上级 827153fd
...@@ -24,7 +24,7 @@ public class LongestMatchColumnWidthStyleStrategy extends AbstractColumnWidthSty ...@@ -24,7 +24,7 @@ public class LongestMatchColumnWidthStyleStrategy extends AbstractColumnWidthSty
private static final int MAX_COLUMN_WIDTH = 255; private static final int MAX_COLUMN_WIDTH = 255;
private static final Map<Integer, Map<Integer, Integer>> CACHE = new HashMap<Integer, Map<Integer, Integer>>(8); private final Map<Integer, Map<Integer, Integer>> cache = new HashMap<Integer, Map<Integer, Integer>>(8);
@Override @Override
protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<CellData> cellDataList, Cell cell, Head head, protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<CellData> cellDataList, Cell cell, Head head,
...@@ -33,10 +33,10 @@ public class LongestMatchColumnWidthStyleStrategy extends AbstractColumnWidthSty ...@@ -33,10 +33,10 @@ public class LongestMatchColumnWidthStyleStrategy extends AbstractColumnWidthSty
if (!needSetWidth) { if (!needSetWidth) {
return; return;
} }
Map<Integer, Integer> maxColumnWidthMap = CACHE.get(writeSheetHolder.getSheetNo()); Map<Integer, Integer> maxColumnWidthMap = cache.get(writeSheetHolder.getSheetNo());
if (maxColumnWidthMap == null) { if (maxColumnWidthMap == null) {
maxColumnWidthMap = new HashMap<Integer, Integer>(16); maxColumnWidthMap = new HashMap<Integer, Integer>(16);
CACHE.put(writeSheetHolder.getSheetNo(), maxColumnWidthMap); cache.put(writeSheetHolder.getSheetNo(), maxColumnWidthMap);
} }
Integer columnWidth = dataLength(cellDataList, cell, isHead); Integer columnWidth = dataLength(cellDataList, cell, isHead);
if (columnWidth < 0) { if (columnWidth < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册