You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/03/16 00:40:44 UTC
svn commit: r1301271 - in /tomcat/tc7.0.x/trunk:
java/org/apache/catalina/session/ManagerBase.java
res/findbugs/filter-false-positives.xml
Author: markt
Date: Thu Mar 15 23:40:44 2012
New Revision: 1301271
URL: http://svn.apache.org/viewvc?rev=1301271&view=rev
Log:
Exclude warning with comment
Add some finals
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java
tomcat/tc7.0.x/trunk/res/findbugs/filter-false-positives.xml
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=1301271&r1=1301270&r2=1301271&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java Thu Mar 15 23:40:44 2012
@@ -145,16 +145,16 @@ public abstract class ManagerBase extend
protected static final int TIMING_STATS_CACHE_SIZE = 100;
- protected Deque<SessionTiming> sessionCreationTiming =
+ protected final Deque<SessionTiming> sessionCreationTiming =
new LinkedList<SessionTiming>();
- protected Deque<SessionTiming> sessionExpirationTiming =
+ protected final Deque<SessionTiming> sessionExpirationTiming =
new LinkedList<SessionTiming>();
/**
* Number of sessions that have expired.
*/
- protected AtomicLong expiredSessions = new AtomicLong(0);
+ protected final AtomicLong expiredSessions = new AtomicLong(0);
/**
@@ -211,7 +211,8 @@ public abstract class ManagerBase extend
/**
* The property change support for this component.
*/
- protected PropertyChangeSupport support = new PropertyChangeSupport(this);
+ protected final PropertyChangeSupport support =
+ new PropertyChangeSupport(this);
// ------------------------------------------------------------- Properties
@@ -796,6 +797,9 @@ public abstract class ManagerBase extend
do {
if (result != null) {
+ // Not thread-safe but if one of multiple increments is lost
+ // that is not a big deal since the fact that there was any
+ // duplicate is a much bigger issue.
duplicates++;
}
@@ -1308,8 +1312,8 @@ public abstract class ManagerBase extend
// ----------------------------------------------------------- Inner classes
protected static final class SessionTiming {
- private long timestamp;
- private int duration;
+ private final long timestamp;
+ private final int duration;
public SessionTiming(long timestamp, int duration) {
this.timestamp = timestamp;
Modified: tomcat/tc7.0.x/trunk/res/findbugs/filter-false-positives.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/res/findbugs/filter-false-positives.xml?rev=1301271&r1=1301270&r2=1301271&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/res/findbugs/filter-false-positives.xml (original)
+++ tomcat/tc7.0.x/trunk/res/findbugs/filter-false-positives.xml Thu Mar 15 23:40:44 2012
@@ -89,6 +89,12 @@
<Bug code="IS" />
</Match>
<Match>
+ <!-- We can live with the threading issue. See code comment for details. -->
+ <Class name="org.apache.catalina.session.ManagerBase" />
+ <Method name="generateSessionId" />
+ <Bug code="VO" />
+ </Match>
+ <Match>
<!-- Use of null is deliberate -->
<Class name="org.apache.catalina.ssi.ExpressionParseTree" />
<Method name="pushOpp" />
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org