More FindBugs warnings
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Mar 2011 13:56:35 +0000 (13:56 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Mar 2011 13:56:35 +0000 (13:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1081785 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/mbeans/MBeanUtils.java
java/org/apache/jasper/compiler/TagFileProcessor.java
res/findbugs/filter-false-positives.xml

index 85f271b..aa0f7aa 100644 (file)
@@ -1652,7 +1652,7 @@ public class MBeanUtils {
             c = c.getParent();
         }
         
-        if (c instanceof Engine) {
+        if (c != null) {
             domain = c.getName();
         }
         
index 9da3978..bc459b0 100644 (file)
@@ -428,7 +428,8 @@ class TagFileProcessor {
             HashMap<String, NameEntry> table = (type == VAR_NAME_FROM) ? nameFromTable : nameTable;
             NameEntry nameEntry = table.get(name);
             if (nameEntry != null) {
-                if (type != TAG_DYNAMIC || nameEntry.getType() != TAG_DYNAMIC) {
+                if (!TAG_DYNAMIC.equals(type) ||
+                        !TAG_DYNAMIC.equals(nameEntry.getType())) {
                     int line = nameEntry.getNode().getStart().getLineNumber();
                     err.jspError(n, "jsp.error.tagfile.nameNotUnique", type,
                             nameEntry.getType(), Integer.toString(line));
index 649137c..d931d7f 100644 (file)
     <Bug code="Nm" />
   </Match>
   <Match>
-    <!-- Field by field copy is fine for clone in thos case -->
+    <!-- Field by field copy is fine for clone in this case -->
     <Class name="org.apache.tomcat.util.bcel.classfile.StackMapType"/>
     <Bug code="CN" />
   </Match>
   <Match>
+    <!-- Fall-through expected -->
+    <Class name="org.apache.tomcat.util.bcel.classfile.Utility"/>
+    <Bug code="SF" />
+  </Match>
+  <Match>
     <!-- Returning null here is fine -->
     <Class name="org.apache.tomcat.util.buf.MessageBytes"/>
     <Method name="toString"/>
   <Match>
     <!-- Test really is for the same object rather than equality -->
     <Class name="org.apache.tomcat.util.digester.Digester"/>
-    <Method name="updateBodyText"/>
+    <Or>
+      <Method name="updateBodyText"/>
+      <Method name="updateAttributes"/>
+    </Or>
     <Bug code="ES" />
   </Match>
   <Match>
     <Bug code="ML" />
   </Match>
   <Match>
+    <Class name="org.apache.tomcat.util.net.SecureNioChannel"/>
+    <Method name="rehandshake"/>
+    <Bug code="DE" />
+  </Match>
+  <Match>
     <!-- Sync is there to protect referenced object not field -->
     <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor"/>
     <Method name="run"/>