tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [13/20] tomee git commit: use ThreadLocalRandom
Date Thu, 27 Dec 2018 10:01:29 GMT
use ThreadLocalRandom


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/6450b2b4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/6450b2b4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/6450b2b4

Branch: refs/heads/master
Commit: 6450b2b4b68c0bc06a7e32ebcc80573aa71be69a
Parents: 40dc320
Author: Hayri Cicek <hayri@kodnito.com>
Authored: Mon Dec 10 13:32:27 2018 +0100
Committer: Hayri Cicek <hayri@kodnito.com>
Committed: Mon Dec 10 13:32:27 2018 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/openejb/loader/FileUtils.java      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/6450b2b4/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index 747f7c8..f6f15cd 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -20,12 +20,11 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Hashtable;
+import java.util.concurrent.ThreadLocalRandom;
 
 @SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
 public class FileUtils {
 
-    private static final java.util.Random RANDOM = new java.util.Random();
-
     private File home;
 
     private FileUtils(final String homeDir, final String defaultDir) {
@@ -165,7 +164,7 @@ public class FileUtils {
     public static File createTempDirectory(final String pathPrefix) throws IOException {
         for (int maxAttempts = 100; maxAttempts > 0; --maxAttempts) {
 
-            final String path = pathPrefix + RANDOM.nextLong();
+            final String path = pathPrefix + ThreadLocalRandom.current().nextLong();
             final File tmpDir = new File(path);
 
             if (!tmpDir.exists() && tmpDir.mkdirs()) {


Mime
View raw message