增加SafeConcurrentHashMap

This commit is contained in:
Looly
2022-09-15 09:50:54 +08:00
parent 920fe44e50
commit 06fec1045c
31 changed files with 168 additions and 105 deletions

View File

@@ -8,6 +8,7 @@ import cn.hutool.core.io.IORuntimeException;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.map.SafeConcurrentHashMap;
import cn.hutool.core.map.TableMap;
import cn.hutool.core.map.multi.RowKeyTable;
import cn.hutool.core.map.multi.Table;
@@ -44,7 +45,6 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
/**
@@ -938,7 +938,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
*/
public ExcelWriter writeHeadRow(Iterable<?> rowData) {
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
this.headLocationCache = new ConcurrentHashMap<>();
this.headLocationCache = new SafeConcurrentHashMap<>();
final Row row = this.sheet.createRow(this.currentRow.getAndIncrement());
int i = 0;
Cell cell;