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 5c1a036de2
commit e505160716
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()}
* 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 !");