Repository: tomee
Updated Branches:
  refs/heads/master 9b7b46570 -> 67e162c57


PMD


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

Branch: refs/heads/master
Commit: 67e162c5710e2f3fd919402092a81c2013ebd661
Parents: 9b7b465
Author: AndyGee <[email protected]>
Authored: Fri Mar 3 21:31:13 2017 +0100
Committer: AndyGee <[email protected]>
Committed: Fri Mar 3 21:31:13 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/openejb/util/Pool.java | 24 ++++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/67e162c5/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java 
b/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java
index 877598b..8e790df 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Pool.java
@@ -178,8 +178,8 @@ public class Pool<T> {
 
     private Executor createExecutor() {
         final ThreadPoolExecutor threadPoolExecutor = new 
ThreadPoolExecutor(3, 10,
-            60L, TimeUnit.SECONDS,
-            new LinkedBlockingQueue<Runnable>(2), new 
DaemonThreadFactory("org.apache.openejb.util.Pool", hashCode()));
+                60L, SECONDS,
+                new LinkedBlockingQueue<Runnable>(2), new 
DaemonThreadFactory("org.apache.openejb.util.Pool", hashCode()));
 
         threadPoolExecutor.setRejectedExecutionHandler(new 
RejectedExecutionHandler() {
             @Override
@@ -187,12 +187,12 @@ public class Pool<T> {
 
                 if (null == r || null == tpe || tpe.isShutdown() || 
tpe.isTerminated() || tpe.isTerminating()) {
                     return;
-    }
+                }
 
                 try {
-                    if (!tpe.getQueue().offer(r, 20, TimeUnit.SECONDS)) {
+                    if (!tpe.getQueue().offer(r, 20, SECONDS)) {
                         
org.apache.openejb.util.Logger.getInstance(LogCategory.OPENEJB, 
"org.apache.openejb.util.resources")
-                            .warning("Default pool executor failed to run 
asynchronous process: " + r);
+                                .warning("Default pool executor failed to run 
asynchronous process: " + r);
                     }
                 } catch (final InterruptedException e) {
                     //Ignore
@@ -523,7 +523,7 @@ public class Pool<T> {
     }
 
     private static long now() {
-        return TimeUnit.MILLISECONDS.convert(System.nanoTime(), 
TimeUnit.NANOSECONDS);
+        return MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS);
     }
 
     public final class Entry {
@@ -597,11 +597,11 @@ public class Pool<T> {
         public String toString() {
             final long now = now();
             return "Entry{" +
-                "min=" + (hard.get() != null) +
-                ", age=" + (now - created) +
-                ", idle=" + (now - used) +
-                ", bean=" + soft.get() +
-                '}';
+                    "min=" + (hard.get() != null) +
+                    ", age=" + (now - created) +
+                    ", idle=" + (now - used) +
+                    ", bean=" + soft.get() +
+                    '}';
         }
 
         private class Discarded implements Runnable {
@@ -1114,7 +1114,7 @@ public class Pool<T> {
         private Duration maxAge = new Duration(0, MILLISECONDS);
         private double maxAgeOffset = -1;
         private Duration idleTimeout = new Duration(0, MILLISECONDS);
-        private Duration interval = new Duration(5 * 60, TimeUnit.SECONDS);
+        private Duration interval = new Duration(5 * 60, SECONDS);
         private Supplier<T> supplier;
         private Executor executor;
         private ScheduledExecutorService scheduledExecutorService;

Reply via email to