From: markt Date: Mon, 26 Sep 2011 14:59:59 +0000 (+0000) Subject: Fix some FindBugs warnings X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8d1455a80c67fb2b05d1d7dfb7786503e618f982;p=tomcat7.0 Fix some FindBugs warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1175896 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/Embedded.java b/java/org/apache/catalina/startup/Embedded.java index 9fb781ffa..f221a183a 100644 --- a/java/org/apache/catalina/startup/Embedded.java +++ b/java/org/apache/catalina/startup/Embedded.java @@ -160,7 +160,7 @@ public class Embedded extends StandardService { /** * Custom mappings of login methods to authenticators */ - protected HashMap authenticators; + protected volatile HashMap authenticators; /** diff --git a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java index 911da4287..b0c64ea35 100644 --- a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java +++ b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java @@ -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; diff --git a/test/org/apache/tomcat/util/threads/TestLimitLatch.java b/test/org/apache/tomcat/util/threads/TestLimitLatch.java index 391b4a9c7..e9638e7aa 100644 --- a/test/org/apache/tomcat/util/threads/TestLimitLatch.java +++ b/test/org/apache/tomcat/util/threads/TestLimitLatch.java @@ -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;