Fix FindBugs warnings
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 16 Jan 2011 21:06:31 +0000 (21:06 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 16 Jan 2011 21:06:31 +0000 (21:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1059671 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/AprEndpoint.java
res/findbugs/filter-false-positives.xml

index 610a93a..dcb912e 100644 (file)
@@ -1435,7 +1435,7 @@ public class AprEndpoint extends AbstractEndpoint {
             if (rv == Status.APR_SUCCESS) {
                 sendfileCount--;
             }
-            sendfileData.remove(new Long(data.socket));
+            sendfileData.remove(Long.valueOf(data.socket));
         }
 
         /**
@@ -1488,7 +1488,7 @@ public class AprEndpoint extends AbstractEndpoint {
                                     SendfileData data = addS.get(i);
                                     int rv = Poll.add(sendfilePollset, data.socket, Poll.APR_POLLOUT);
                                     if (rv == Status.APR_SUCCESS) {
-                                        sendfileData.put(new Long(data.socket), data);
+                                        sendfileData.put(Long.valueOf(data.socket), data);
                                         successCount++;
                                     } else {
                                         log.warn(sm.getString("endpoint.sendfile.addfail", "" + rv, Error.strerror(rv)));
@@ -1511,7 +1511,7 @@ public class AprEndpoint extends AbstractEndpoint {
                         for (int n = 0; n < rv; n++) {
                             // Get the sendfile state
                             SendfileData state =
-                                sendfileData.get(new Long(desc[n*2+1]));
+                                sendfileData.get(Long.valueOf(desc[n*2+1]));
                             // Problem events
                             if (((desc[n*2] & Poll.APR_POLLHUP) == Poll.APR_POLLHUP)
                                     || ((desc[n*2] & Poll.APR_POLLERR) == Poll.APR_POLLERR)) {
@@ -1575,7 +1575,7 @@ public class AprEndpoint extends AbstractEndpoint {
                         if (rv > 0) {
                             for (int n = 0; n < rv; n++) {
                                 // Get the sendfile state
-                                SendfileData state = sendfileData.get(new Long(desc[n]));
+                                SendfileData state = sendfileData.get(Long.valueOf(desc[n]));
                                 // Close socket and clear pool
                                 remove(state);
                                 // Destroy file descriptor pool, which should close the file
index b69278a..1ab467c 100644 (file)
     <Bug code="ES" />
   </Match>
   <Match>
+    <!-- addCount is modified in other threads -->
+    <Class name="org.apache.tomcat.util.net.AprEndpoint$Poller"/>
+    <Method name="run"/>
+    <Bug code="NN" />
+  </Match>
+  <Match>
+    <!-- addCount is modified in other threads -->
+    <Class name="org.apache.tomcat.util.net.AprEndpoint$Sendfile"/>
+    <Method name="run"/>
+    <Bug code="NN" />
+  </Match>
+  <Match>
+    <!-- Sync is there to protect referenced object not field -->
+    <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketEventProcessor"/>
+    <Method name="run"/>
+    <Bug code="ML" />
+  </Match>
+  <Match>
+    <!-- Sync is there to protect referenced object not field -->
+    <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor"/>
+    <Method name="run"/>
+    <Bug code="ML" />
+  </Match>
+  <Match>
     <!-- Yes the simple name is the same as the super class. Accept it. -->
     <Class name="org.apache.tomcat.util.threads.ThreadPoolExecutor" />
     <Bug code="Nm" />