]> source.dussan.org Git - poi.git/commitdiff
remove unnecessary close
authorPJ Fanning <fanningpj@apache.org>
Fri, 3 Jan 2020 11:24:12 +0000 (11:24 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 3 Jan 2020 11:24:12 +0000 (11:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1872283 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java

index c329025d1488e082e029fd33eba8fa6c0162ef9d..d329d44a3ff0aeb116a2b719c3183cf1e78110a1 100644 (file)
@@ -767,7 +767,6 @@ public class POIXMLDocumentPart {
         if (coreRel != null) {
             PackagePart pp = pkg.getPart(coreRel);
             if (pp == null) {
-                closeQuietly(pp);
                 throw new POIXMLException("OOXML file structure broken/invalid - core document '" + coreRel.getTargetURI() + "' not found.");
             }
             return pp;
@@ -781,19 +780,4 @@ public class POIXMLDocumentPart {
 
         throw new POIXMLException("OOXML file structure broken/invalid - no core document found!");
     }
-
-    private static void closeQuietly(final PackagePart closeable) {
-        // no need to log a NullPointerException here
-        if(closeable == null) {
-            return;
-        }
-
-        try {
-            closeable.close();
-        } catch ( Exception exc ) {
-            logger.log( POILogger.ERROR, "Unable to close resource: " + exc,
-                    exc );
-        }
-    }
-
 }