From e58a6835bcd80802385b1239a041ae62c56309e7 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Thu, 29 Aug 2019 19:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E6=B5=81?= =?UTF-8?q?=E9=9C=80=E8=A6=81gc=E6=89=8D=E8=83=BD=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20#511?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/analysis/ExcelAnalyserImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java index 256fb517..d21b8db0 100644 --- a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java +++ b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java @@ -117,30 +117,30 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (analysisContext.readWorkbookHolder().getAutoCloseStream() - && readWorkbookHolder.getInputStream() != null) { - readWorkbookHolder.getInputStream().close(); + if (readWorkbookHolder.getOpcPackage() != null) { + readWorkbookHolder.getOpcPackage().close(); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (readWorkbookHolder.getTempFile() != null) { - FileUtils.delete(readWorkbookHolder.getTempFile()); + if (readWorkbookHolder.getPoifsFileSystem() != null) { + readWorkbookHolder.getPoifsFileSystem().close(); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (readWorkbookHolder.getOpcPackage() != null) { - readWorkbookHolder.getOpcPackage().close(); + if (analysisContext.readWorkbookHolder().getAutoCloseStream() + && readWorkbookHolder.getInputStream() != null) { + readWorkbookHolder.getInputStream().close(); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (readWorkbookHolder.getPoifsFileSystem() != null) { - readWorkbookHolder.getPoifsFileSystem().close(); + if (readWorkbookHolder.getTempFile() != null) { + FileUtils.delete(readWorkbookHolder.getTempFile()); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e);