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 2020/10/22 19:54:41 UTC

[tomcat] branch 7.0.x updated (6902e36 -> 8d9d469)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from 6902e36  Remove unnecessary annotation
     new eb4beb6  Simplify code
     new 8d9d469  Fix remaining false positives

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 res/findbugs/filter-false-positives.xml            | 104 +++++++++++++++++++++
 .../tomcat/websocket/TesterFirehoseServer.java     |   6 +-
 2 files changed, 106 insertions(+), 4 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Simplify code

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit eb4beb68bf3b120b9d7fcee64e38588cb6db60f9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 22 20:44:44 2020 +0100

    Simplify code
---
 test/org/apache/tomcat/websocket/TesterFirehoseServer.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/tomcat/websocket/TesterFirehoseServer.java b/test/org/apache/tomcat/websocket/TesterFirehoseServer.java
index 2aa3aef..90e1c44 100644
--- a/test/org/apache/tomcat/websocket/TesterFirehoseServer.java
+++ b/test/org/apache/tomcat/websocket/TesterFirehoseServer.java
@@ -227,12 +227,10 @@ public class TesterFirehoseServer {
 
             // Ignore the latch result as the message count test below will tell us
             // if the right number of messages arrived
-            handler.getLatch().await(TesterFirehoseServer.WAIT_TIME_MILLIS,
-                    TimeUnit.MILLISECONDS);
+            Assert.assertTrue(handler.getLatch().await(TesterFirehoseServer.WAIT_TIME_MILLIS,
+                    TimeUnit.MILLISECONDS));
 
             Queue<String> messages = handler.getMessages();
-            Assert.assertEquals(
-                    TesterFirehoseServer.MESSAGE_COUNT, messages.size());
             for (String message : messages) {
                 Assert.assertEquals(TesterFirehoseServer.MESSAGE, message);
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Fix remaining false positives

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 8d9d469977d937042068785833e13546cbab6ba7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 22 20:54:14 2020 +0100

    Fix remaining false positives
---
 res/findbugs/filter-false-positives.xml | 104 ++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)

diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml
index 21ed1b0..b25df40 100644
--- a/res/findbugs/filter-false-positives.xml
+++ b/res/findbugs/filter-false-positives.xml
@@ -137,6 +137,12 @@
     <Bug code="RCN"/>
   </Match>
   <Match>
+    <!-- Calling sleep while holding a lock is deliberate -->
+    <Class name="org.apache.catalina.core.StandardContext" />
+    <Method name="stopInternal" />
+    <Bug pattern="SWL_SLEEP_WITH_LOCK_HELD" />
+  </Match>
+  <Match>
     <!-- Have to trigger GC for leak detection to work. Clearly documented -->
     <Class name="org.apache.catalina.core.StandardHost" />
     <Method name="findReloadedContextMemoryLeaks" />
@@ -192,6 +198,17 @@
     <Bug code="DE" />
   </Match>
   <Match>
+    <!-- Design choice to reduce need for syncs -->
+    <Class name="org.apache.catalina.ha.tcp.ReplicationValve" />
+    <Or>
+      <Field name="nrOfCrossContextSendRequests" />
+      <Field name="nrOfFilterRequests" />
+      <Field name="nrOfRequests" />
+      <Field name="nrOfSendRequests" />
+    </Or>
+    <Pattern code="VO_VOLATILE_INCREMENT" />
+  </Match>
+  <Match>
     <!-- Field is only modified during Servlet load -->
     <Class name="org.apache.catalina.manager.host.HostManagerServlet" />
     <Bug code="MSF" />
@@ -342,6 +359,12 @@
     <Bug code="NS"/>
   </Match>
   <Match>
+    <!-- lock is in clone so this is safe -->
+    <Class name="org.apache.catalina.tribes.membership.Membership" />
+    <Method name="clone" />
+    <Bug pattern="ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD" />
+  </Match>
+  <Match>
     <!-- Intentional in case thread is waiting -->
     <Class name="org.apache.catalina.tribes.transport.RxTaskPool"/>
     <Method name="returnWorker"/>
@@ -501,11 +524,37 @@
     <Bug code="Nm" />
   </Match>
   <Match>
+    <!-- Utility classes used to import/export l10n strings -->
+    <!-- This code does not need to be robust -->
+    <Class name="org.apache.tomcat.buildutil.translate.Import"/>
+  </Match>
+  <Match>
     <!-- Class has to implement clone since its superclass does but fakes it -->
     <Class name="org.apache.naming.resources.ResourceAttributes" />
     <Bug code="CN" />
   </Match>
   <Match>
+    <!-- instanceof is appropriate here -->
+    <Or>
+      <Class name="org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement"/>
+      <Class name="org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement"/>
+    </Or>
+    <Method name="equals"/>
+    <Bug pattern="EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC"/>
+  </Match>
+  <Match>
+    <!-- Naked notify is by design (doesn't matter which thread is unblocked -->
+    <Or>
+      <Class name="org.apache.tomcat.dbcp.pool.impl.GenericKeyedObjectPool"/>
+      <Class name="org.apache.tomcat.dbcp.pool.impl.GenericObjectPool"/>
+    </Or>
+    <Or>
+      <Method name="allocate"/>
+      <Method name="close"/>
+    </Or>
+    <Bug pattern="NN_NAKED_NOTIFY"/>
+  </Match>
+  <Match>
     <!-- Return value is ignored but a null result will trigger an exception -->
     <Class name="org.apache.tomcat.jdbc.pool.ConnectionPool$ConnectionFuture" />
     <Method name="get" />
@@ -642,6 +691,12 @@
     <Bug code="SF" />
   </Match>
   <Match>
+    <!-- Returns null by design -->
+    <Class name="org.apache.tomcat.util.http.parser.EntityTag" />
+     <Method name="compareEntityTag"/>
+    <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
+  </Match>
+  <Match>
     <!-- Hiding of field in superclass is deliberate -->
     <Class name="org.apache.tomcat.util.modeler.NotificationInfo"/>
     <Field name="info" />
@@ -679,6 +734,15 @@
     <Bug code="ML" />
   </Match>
   <Match>
+    <!-- Modifications to SocketLists are always protected by syncs -->
+    <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketList"/>
+    <Or>
+      <Method name="add"/>
+      <Method name="remove"/>
+    </Or>
+    <Bug pattern="VO_VOLATILE_INCREMENT"/>
+  </Match>
+  <Match>
     <!-- Sync is there to protect referenced object not field -->
     <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor"/>
     <Method name="run"/>
@@ -740,6 +804,12 @@
     <Bug code="UG" />
   </Match>
   <Match>
+    <!-- Deliberate use of run() for the purposes of the test -->
+    <Class name="org.apache.catalina.core.TestAsyncContextStateChanges$AsyncServlet"/>
+    <Method name="doGet"/>
+    <Bug pattern="RU_INVOKE_RUN"/>
+  </Match>
+  <Match>
     <Or>
       <Class name="org.apache.catalina.startup.TestListener$SCL" />
       <Class name="org.apache.catalina.startup.TestListener$SCL3" />
@@ -841,6 +911,12 @@
     <Bug code="DE" />
   </Match>
   <Match>
+    <!-- Concrete Map type not affected -->
+    <Class name="org.apache.catalina.util.TestParameterMap" />
+    <Method name="testEntrySetImmutabilityAfterLocked" />
+    <Bug pattern="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS" />
+  </Match>
+  <Match>
     <!-- Deliberate hack for the purposes of the test -->
     <Class name="org.apache.catalina.valves.TestStuckThreadDetectionValve$StickingServlet"/>
     <Field name="wasInterrupted"/>
@@ -855,6 +931,31 @@
     <Bug pattern="STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE" />
   </Match>
   <Match>
+    <!-- Exceptions are deliberately ignored -->
+    <Class name="org.apache.tomcat.dbcp.dbcp.AbstractConnectionPoolTest$TestThread"/>
+    <Method name="run"/>
+    <Bug pattern="DE_MIGHT_IGNORE"/>
+  </Match>
+  <Match>
+    <!-- Sleep with lock is deliberate -->
+    <Class name="org.apache.tomcat.dbcp.dbcp.TestBasicDataSource"/>
+    <Method name="testCreateDataSourceCleanupEvictor"/>
+    <Bug pattern="SWL_SLEEP_WITH_LOCK_HELD"/>
+  </Match>
+  <Match>
+    <!-- nulls are intentional in the tests -->
+    <Or>
+      <Class name="org.apache.tomcat.dbcp.dbcp.TesterConnection"/>
+      <Class name="org.apache.tomcat.dbcp.dbcp.TesterPreparedStatement"/>
+      <Class name="org.apache.tomcat.dbcp.dbcp.TesterStatement"/>
+    </Or>
+    <Or>
+      <Method name="executeQuery"/>
+      <Method name="prepareStatement"/>
+    </Or>
+    <Bug pattern="NP_NONNULL_RETURN_VIOLATION"/>
+  </Match>
+  <Match>
     <!-- Use of statics is unavoidable in all cases -->
     <!-- Better to use it consistently rather than only where necessary -->
     <Class name="org.apache.tomcat.jdbc.pool.interceptor.TestInterceptor" />
@@ -913,6 +1014,9 @@
       <Method name="testBasicPrefix" />
       <Method name="testQuote2" />
       <Method name="testDuplicate01" />
+      <Method name="testSpecIssue194a" />
+      <Method name="testSpecIssue194b" />
+      <Method name="testSpecIssue194c" />
     </Or>
     <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org