From 0746b23fc4ef1bd88207a1c5df15cd70927c781d Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 27 Sep 2018 21:22:24 +0000 Subject: [PATCH] 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 --- src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 !"); -- 2.39.5