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
This commit is contained in:
PJ Fanning 2018-09-27 21:22:24 +00:00
parent 44e86832f2
commit 0746b23fc4
1 changed files with 3 additions and 1 deletions

View File

@ -415,11 +415,13 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* If your package is open read only, then you should call {@link #revert()} * If your package is open read only, then you should call {@link #revert()}
* when finished with the package. * when finished with the package.
* *
* This method is not thread-safe.
*
* @throws IOException * @throws IOException
* If an IO exception occur during the saving process. * If an IO exception occur during the saving process.
*/ */
@Override @Override
public synchronized void close() throws IOException { public void close() throws IOException {
if (this.packageAccess == PackageAccess.READ) { if (this.packageAccess == PackageAccess.READ) {
logger.log(POILogger.WARN, 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 !"); "The close() method is intended to SAVE a package. This package is open in READ ONLY mode, use the revert() method instead !");