From df96ef1a29a1368931588a39b55d05f61b90cda0 Mon Sep 17 00:00:00 2001 From: Looly Date: Sat, 29 Feb 2020 12:37:15 +0800 Subject: [PATCH] fix code --- hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java b/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java index 80e857b15..bfc192060 100644 --- a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java +++ b/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java @@ -117,10 +117,7 @@ public class ExcelBase> implements Closeable { */ @SuppressWarnings("unchecked") public T setSheet(String sheetName) { - this.sheet = this.workbook.getSheet(sheetName); - if (null == this.sheet) { - this.sheet = this.workbook.createSheet(sheetName); - } + WorkbookUtil.getOrCreateSheet(this.workbook, sheetName); return (T) this; }