Fix some FindBugs warnings
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 26 Sep 2011 14:59:59 +0000 (14:59 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 26 Sep 2011 14:59:59 +0000 (14:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1175896 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/Embedded.java
java/org/apache/catalina/valves/StuckThreadDetectionValve.java
test/org/apache/tomcat/util/threads/TestLimitLatch.java

index 9fb781f..f221a18 100644 (file)
@@ -160,7 +160,7 @@ public class Embedded  extends StandardService {
     /**
      * Custom mappings of login methods to authenticators
      */
-    protected HashMap<String,Authenticator> authenticators;
+    protected volatile HashMap<String,Authenticator> authenticators;
 
 
     /**
index 911da42..b0c64ea 100644 (file)
@@ -177,7 +177,7 @@ public class StuckThreadDetectionValve extends ValveBase {
         // Keeping a reference to the thread object here does not prevent
         // GC'ing, as the reference is removed from the Map in the finally clause
 
-        Long key = new Long(Thread.currentThread().getId());
+        Long key = Long.valueOf(Thread.currentThread().getId());
         StringBuffer requestUrl = request.getRequestURL();
         if(request.getQueryString()!=null) {
             requestUrl.append("?");
@@ -240,7 +240,7 @@ public class StuckThreadDetectionValve extends ValveBase {
         return result;
     }
 
-    private class MonitoredThread {
+    private static class MonitoredThread {
 
         /**
          * Reference to the thread to get a stack trace from background task
@@ -288,7 +288,7 @@ public class StuckThreadDetectionValve extends ValveBase {
         }
     }
 
-    private class CompletedStuckThread {
+    private static class CompletedStuckThread {
 
         private String threadName;
         private long totalActiveTime;
index 391b4a9..e9638e7 100644 (file)
@@ -92,7 +92,7 @@ public class TestLimitLatch {
         assertFalse("No threads should be waiting", latch.hasQueuedThreads());
     }
 
-    private class TestThread extends Thread {
+    private static class TestThread extends Thread {
         
         private int holdTime;
         private LimitLatch latch;