From: PJ Fanning Date: Thu, 27 Sep 2018 21:22:24 +0000 (+0000) Subject: make OPCPackage#close() unsynchronized and add javadoc note saying method is not... X-Git-Tag: REL_4_0_1~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0746b23fc4ef1bd88207a1c5df15cd70927c781d;p=poi.git make OPCPackage#close() unsynchronized and add javadoc note saying method is not thread-safe git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842171 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java index 949ec69520..9625a86ff9 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java @@ -415,11 +415,13 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { * If your package is open read only, then you should call {@link #revert()} * when finished with the package. * + * This method is not thread-safe. + * * @throws IOException * If an IO exception occur during the saving process. */ @Override - public synchronized void close() throws IOException { + public void close() throws IOException { if (this.packageAccess == PackageAccess.READ) { logger.log(POILogger.WARN, "The close() method is intended to SAVE a package. This package is open in READ ONLY mode, use the revert() method instead !");