Author: fanningpj
Date: Tue Mar 13 15:12:00 2018
New Revision: 1826655

URL: http://svn.apache.org/viewvc?rev=1826655&view=rev
Log:
[bug-62176] synchronize temp dir creation

Modified:
    poi/trunk/gradle/wrapper/gradle-wrapper.jar
    poi/trunk/src/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java

Modified: poi/trunk/gradle/wrapper/gradle-wrapper.jar
URL: 
http://svn.apache.org/viewvc/poi/trunk/gradle/wrapper/gradle-wrapper.jar?rev=1826655&r1=1826654&r2=1826655&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
poi/trunk/src/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java?rev=1826655&r1=1826654&r2=1826655&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java 
(original)
+++ poi/trunk/src/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java 
Tue Mar 13 15:12:00 2018
@@ -85,11 +85,12 @@ public class DefaultTempFileCreationStra
     /**
      * Attempt to create a directory, including any necessary parent 
directories.
      * Does nothing if directory already exists.
+     * The method is synchronized to ensure that multiple threads don't try to 
create the directory at the same time.
      *
      * @param directory  the directory to create
      * @throws IOException if unable to create temporary directory or it is 
not a directory
      */
-    private void createTempDirectory(File directory) throws IOException {
+    private synchronized void createTempDirectory(File directory) throws 
IOException {
         // create directory if it doesn't exist
         final boolean dirExists = (directory.exists() || directory.mkdirs());
         
@@ -138,4 +139,4 @@ public class DefaultTempFileCreationStra
         // All done
         return newDirectory;
     }
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to