Author: markt
Date: Sun Jan 16 21:06:31 2011
New Revision: 1059671
URL: http://svn.apache.org/viewvc?rev=1059671&view=rev
Log:
Fix FindBugs warnings
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
tomcat/trunk/res/findbugs/filter-false-positives.xml
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1059671&r1=1059670&r2=1059671&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Sun Jan 16
21:06:31 2011
@@ -1435,7 +1435,7 @@ public class AprEndpoint extends Abstrac
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 Abstrac
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 Abstrac
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 Abstrac
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
Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1059671&r1=1059670&r2=1059671&view=diff
==============================================================================
--- tomcat/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/trunk/res/findbugs/filter-false-positives.xml Sun Jan 16 21:06:31
2011
@@ -99,6 +99,30 @@
<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" />
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]