You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/04/10 10:13:30 UTC

svn commit: r1090749 - in /commons/proper/discovery/trunk: findbugs-exclude-filter.xml pom.xml

Author: simonetripodi
Date: Sun Apr 10 08:13:30 2011
New Revision: 1090749

URL: http://svn.apache.org/viewvc?rev=1090749&view=rev
Log:
added the findbugs plugin, configuration kindly borrowed from [Lang]

Added:
    commons/proper/discovery/trunk/findbugs-exclude-filter.xml   (with props)
Modified:
    commons/proper/discovery/trunk/pom.xml

Added: commons/proper/discovery/trunk/findbugs-exclude-filter.xml
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/findbugs-exclude-filter.xml?rev=1090749&view=auto
==============================================================================
--- commons/proper/discovery/trunk/findbugs-exclude-filter.xml (added)
+++ commons/proper/discovery/trunk/findbugs-exclude-filter.xml Sun Apr 10 08:13:30 2011
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<!--
+  This file contains some false positive bugs detected by findbugs. Their
+  false positive nature has been analyzed individually and they have been
+  put here to instruct findbugs it must ignore them.
+-->
+<FindBugsFilter>
+
+  <!-- Reason: Optimization to use == -->
+  <Match>
+    <Class name="org.apache.commons.lang3.BooleanUtils" />
+    <Method name="toBoolean" />
+    <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
+  </Match>
+
+  <!-- Reason: Optimization to use == -->
+  <Match>
+    <Class name="org.apache.commons.lang3.StringUtils" />
+    <Method name="indexOfDifference"/>
+    <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
+  </Match>
+
+  <!-- Reason: Very much intended to do a fall through on the switch -->
+  <Match>
+    <Class name="org.apache.commons.lang3.math.NumberUtils" />
+    <Method name="createNumber"/>
+    <Bug pattern="SF_SWITCH_FALLTHROUGH" />
+  </Match>
+
+  <!-- Reason: Very much intended to do a fall through on the switch -->
+  <Match>
+    <Class name="org.apache.commons.lang3.time.DateUtils" />
+    <Method name="getFragment"/>
+    <Bug pattern="SF_SWITCH_FALLTHROUGH" />
+  </Match>
+
+  <!-- Reason: hashCode is lazily loaded in Range classes -->
+  <!-- TODO: Work out why regex didn't work here -->
+  <Match>
+    <Class name="org.apache.commons.lang3.math.DoubleRange" />
+    <Field name="hashCode" />
+    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
+  </Match>
+  <Match>
+    <Class name="org.apache.commons.lang3.math.FloatRange" />
+    <Field name="hashCode" />
+    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
+  </Match>
+  <Match>
+    <Class name="org.apache.commons.lang3.math.IntRange" />
+    <Field name="hashCode" />
+    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
+  </Match>
+  <Match>
+    <Class name="org.apache.commons.lang3.math.LongRange" />
+    <Field name="hashCode" />
+    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
+  </Match>
+  <Match>
+    <Class name="org.apache.commons.lang3.math.NumberRange" />
+    <Field name="hashCode" />
+    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
+  </Match>
+
+  <!-- Reason: toProperString is lazily loaded -->
+  <Match>
+    <Class name="org.apache.commons.lang3.math.Fraction" />
+    <Field name="toProperString" />
+    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
+  </Match>
+
+  <!-- Reason: It does call super.clone(), but via a subsequent method -->
+  <Match>
+    <Class name="org.apache.commons.lang3.text.StrTokenizer" />
+    <Method name="clone"/>
+    <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
+  </Match>
+
+  <!-- Reason: Testing shows that new Integer(...) etc is quicker than Integer.valueOf -->
+  <Match>
+    <Bug pattern="DM_NUMBER_CTOR" />
+  </Match>
+
+</FindBugsFilter>

Propchange: commons/proper/discovery/trunk/findbugs-exclude-filter.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/discovery/trunk/findbugs-exclude-filter.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: commons/proper/discovery/trunk/findbugs-exclude-filter.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: commons/proper/discovery/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/pom.xml?rev=1090749&r1=1090748&r2=1090749&view=diff
==============================================================================
--- commons/proper/discovery/trunk/pom.xml (original)
+++ commons/proper/discovery/trunk/pom.xml Sun Apr 10 08:13:30 2011
@@ -191,6 +191,17 @@
             <enableRulesSummary>false</enableRulesSummary>
           </configuration>
         </plugin>
+        <!-- Requires setting 'export MAVEN_OPTS="-Xmx512m" ' -->
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>findbugs-maven-plugin</artifactId>
+          <version>2.3.1</version>
+          <configuration>
+            <threshold>Normal</threshold>
+            <effort>Default</effort>
+            <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile>
+           </configuration>
+        </plugin>
       </plugins>
     </reporting>