Thread: [Fb-contrib-commit] SF.net SVN: fb-contrib:[1767] trunk/fb-contrib (Page 5)
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2014-03-18 05:52:27
|
Revision: 1767
http://sourceforge.net/p/fb-contrib/code/1767
Author: dbrosius
Date: 2014-03-18 05:52:22 +0000 (Tue, 18 Mar 2014)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/plugin.xml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/CD_Sample.java
trunk/fb-contrib/samples/MUC_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
Removed Paths:
-------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/MapEntry.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/.classpath 2014-03-18 05:52:22 UTC (rev 1767)
@@ -12,11 +12,11 @@
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
- <classpathentry kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
- <classpathentry kind="lib" path="lib/findbugs-2.0.3.jar"/>
- <classpathentry kind="lib" path="lib/guava-15.0.jar"/>
+ <classpathentry kind="lib" path="lib/findbugs-2.0.3.jar" sourcepath="/home/dave/.m2/repository/com/google/code/findbugs/findbugs/2.0.3/findbugs-2.0.3-sources.jar"/>
<classpathentry kind="lib" path="lib/annotations-2.0.3.jar"/>
- <classpathentry kind="lib" path="lib/commons-lang3-3.2.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
+ <classpathentry kind="lib" path="lib/guava-16.0.1.jar" sourcepath="lib/guava-16.0.1-sources.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang3-3.3.jar"/>
+ <classpathentry kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/build.xml 2014-03-18 05:52:22 UTC (rev 1767)
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="5.0.3" />
+ <property name="fb-contrib.version" value="5.2.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/etc/findbugs.xml 2014-03-18 05:52:22 UTC (rev 1767)
@@ -11,11 +11,16 @@
<Earlier class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" />
<LaterCategory name="reporting" spanplugins="true" />
</SplitPass>
+ <SplitPass>
+ <Earlier class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" />
+ <LaterCategory name="reporting" spanplugins="true" />
+ </SplitPass>
+
</OrderingConstraints>
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -25,13 +30,11 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments" speed="fast" reports="SMA_STUTTERED_METHOD_ARGUMENTS" hidden="true" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" />
-
<Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -177,7 +180,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING" />
<Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" />
@@ -248,19 +251,27 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument" speed="fast" reports="ICA_INVALID_CONSTANT_ARRAY" />
- <!-- COMMENT OUT FOR POINT RELEASE
- <Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections" speed="fast" reports="PSC_PRESIZE_COLLECTIONS" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds" speed="fast" reports="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS,AIOB_ARRAY_STORE_TO_NULL_REFERENCE" />
-
<Detector class="com.mebigfatguy.fbcontrib.detect.CollectionNamingConfusion" speed="fast" reports="CNC_COLLECTION_NAMING_CONFUSION" />
<Detector class="com.mebigfatguy.fbcontrib.detect.PoorMansEnum" speed="fast" reports="PME_POOR_MANS_ENUM" />
<Detector class="com.mebigfatguy.fbcontrib.detect.UnusedParameter" speed="fast" reports="UP_UNUSED_PARAMETER" />
- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.CircularDependencies" speed="moderate" reports="CD_CIRCULAR_DEPENDENCY"/>
+
+ <Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" speed="fast" reports="" hidden="true" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ModifyingUnmodifiableCollection" speed="fast" reports="MUC_MODIFYING_UNMODIFIABLE_COLLECTION"/>
+
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections" speed="fast" reports="PSC_PRESIZE_COLLECTIONS" />
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds" speed="fast" reports="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS,AIOB_ARRAY_STORE_TO_NULL_REFERENCE" />
+
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -396,6 +407,7 @@
<BugPattern abbrev="LO" type="LO_INVALID_FORMATTING_ANCHOR" category="CORRECTNESS" />
<BugPattern abbrev="LO" type="LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS" category="CORRECTNESS" />
<BugPattern abbrev="LO" type="LO_EXCEPTION_WITH_LOGGER_PARMS" category="CORRECTNESS" />
+ <BugPattern abbrev="LO" type="LO_APPENDED_STRING_IN_FORMAT_STRING" category="PERFORMANCE" />
<BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" category="CORRECTNESS" />
<BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" category="PERFORMANCE" />
<BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" />
@@ -410,11 +422,11 @@
<BugPattern abbrev="OC" type="OC_OVERZEALOUS_CASTING" category="CORRECTNESS" />
<BugPattern abbrev="PDP" type="PDP_POORLY_DEFINED_PARAMETER" category="CORRECTNESS" />
<BugPattern abbrev="NSE" type="NSE_NON_SYMMETRIC_EQUALS" category="CORRECTNESS" />
- <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT" category="CORRECTNESS" experimental="true" />
- <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT" category="CORRECTNESS" />
+ <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" category="CORRECTNESS" />
<BugPattern abbrev="NFF" type="NFF_NON_FUNCTIONAL_FIELD" category="CORRECTNESS" />
- <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_FIELD_GUARD" category="CORRECTNESS" experimental="true" />
- <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_FIELD_GUARD" category="CORRECTNESS" />
+ <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD" category="CORRECTNESS" />
<BugPattern abbrev="MDM" type="MDM_RUNTIME_EXIT_OR_HALT" category="CORRECTNESS" />
<BugPattern abbrev="MDM" type="MDM_RUNFINALIZATION" category="CORRECTNESS" />
<BugPattern abbrev="MDM" type="MDM_INETADDRESS_GETLOCALHOST" category="CORRECTNESS" />
@@ -437,10 +449,10 @@
<BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_LOCAL" category="CORRECTNESS" />
<BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_FIELD" category="CORRECTNESS" />
<BugPattern abbrev="UVA" type="UVA_USE_VAR_ARGS" category="STYLE" />
- <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" experimental="true" />
- <BugPattern abbrev="SEC" type="SEC_SIDE_EFFECT_CONSTRUCTOR" category="STYLE" experimental="true" />
- <BugPattern abbrev="SGSU" type="SGSU_SUSPICIOUS_GETTER_SETTER_USE" category="CORRECTNESS" experimental="true" />
- <BugPattern abbrev="LGO" type="LGO_LINGERING_GRAPHICS_OBJECT" category="PERFORMANCE" experimental="true" />
+ <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" />
+ <BugPattern abbrev="SEC" type="SEC_SIDE_EFFECT_CONSTRUCTOR" category="STYLE" />
+ <BugPattern abbrev="SGSU" type="SGSU_SUSPICIOUS_GETTER_SETTER_USE" category="CORRECTNESS" />
+ <BugPattern abbrev="LGO" type="LGO_LINGERING_GRAPHICS_OBJECT" category="PERFORMANCE" />
<BugPattern abbrev="STB" type="STB_STACKED_TRY_BLOCKS" category="STYLE" experimental="true" />
<BugPattern abbrev="CEBE" type="CEBE_COMMONS_EQUALS_BUILDER_ISEQUALS" category="CORRECTNESS" />
<BugPattern abbrev="CHTH" type="CHTH_COMMONS_HASHCODE_BUILDER_TOHASHCODE" category="CORRECTNESS" />
@@ -454,10 +466,12 @@
<BugPattern abbrev="PSC" type="PSC_PRESIZE_COLLECTIONS" category="PERFORMANCE" />
<BugPattern abbrev="UMTP" type="UMTP_UNBOUND_METHOD_TEMPLATE_PARAMETER" category="CORRECTNESS" />
<BugPattern abbrev="NPMC" type="NPMC_NON_PRODUCTIVE_METHOD_CALL" category="CORRECTNESS" />
- <BugPattern abbrev="AIOB" type="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS" category="CORRECTNESS" />
- <BugPattern abbrev="AIOB" type="AIOB_ARRAY_STORE_TO_NULL_REFERENCE" category="CORRECTNESS" />
- <BugPattern abbrev="ICA" type="ICA_INVALID_CONSTANT_ARGUMENT" category="CORRECTNESS" />
- <BugPattern abbrev="CNC" type="CNC_COLLECTION_NAMING_CONFUSION" category="STYLE" />
- <BugPattern abbrev="PME" type="PME_POOR_MANS_ENUM" category="STYLE" />
- <BugPattern abbrev="UP" type="UP_UNUSED_PARAMETER" category="STYLE" />
+ <BugPattern abbrev="AIOB" type="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="AIOB" type="AIOB_ARRAY_STORE_TO_NULL_REFERENCE" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="ICA" type="ICA_INVALID_CONSTANT_ARGUMENT" category="CORRECTNESS" />
+ <BugPattern abbrev="CNC" type="CNC_COLLECTION_NAMING_CONFUSION" category="STYLE" experimental="true" />
+ <BugPattern abbrev="PME" type="PME_POOR_MANS_ENUM" category="STYLE" experimental="true" />
+ <BugPattern abbrev="UP" type="UP_UNUSED_PARAMETER" category="STYLE" experimental="true" />
+ <BugPattern abbrev="CD" type="CD_CIRCULAR_DEPENDENCY" category="CORRECTNESS" />
+ <BugPattern abbrev="MUC" type="MUC_MODIFYING_UNMODIFIABLE_COLLECTION" category="CORRECTNESS" experimental="true" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/etc/messages.xml 2014-03-18 05:52:22 UTC (rev 1767)
@@ -20,6 +20,14 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections">
+ <Details>
+ <![CDATA[
+ <p>Collects method calls that may return immutable collections</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering">
<Details>
@@ -1381,6 +1389,25 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.CircularDependencies">
+ <Details>
+ <![CDATA[
+ <p>This detector looks circular dependencies among classes. </p>
+ <p>It is a moderately fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ModifyingUnmodifiableCollection">
+ <Details>
+ <![CDATA[
+ <p>This detector looks for code that attempts to modify a collection that is or may be
+ defined as immutable. Doing so will cause exceptions at runtime.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -3102,6 +3129,19 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="LO_APPENDED_STRING_IN_FORMAT_STRING">
+ <ShortDescription>Method passes a concatenated string to Slf4j's format string</ShortDescription>
+ <LongDescription>Method {1} passes a concatenated string to Slf4j's format string</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method uses an slf4j logger to log a string, where the first (format) string is created using concatenation.
+ You should use {} markers to inject dynamic content into the string, so that String building is delayed until the
+ actual log string is needed. If the log level is high enough that this log statement isn't used, then the appends
+ will never be executed.
+ ]]>
+ </Details>
+ </BugPattern>'
<BugPattern type="IICU_INCORRECT_INTERNAL_CLASS_USE">
<ShortDescription>Class relies on internal API classes</ShortDescription>
@@ -3878,6 +3918,32 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="CD_CIRCULAR_DEPENDENCY">
+ <ShortDescription>Test for circular dependencies among classes</ShortDescription>
+ <LongDescription>Class {0} has a circular dependency with other classes</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>
+ This class has a circular dependency with other classes. This makes building these classes
+ difficult, as each is dependent on the other to build correctly. Consider using interfaces
+ to break the hard dependency.
+ </p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="MUC_MODIFYING_UNMODIFIABLE_COLLECTION">
+ <ShortDescription>This method attempts to modify collection that appears to possibly be immutable</ShortDescription>
+ <LongDescription>This method {1} attempts to modify collection that appears to possibly be immutable</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method attempts to modify a collection that it got from a source that could potentially have created an
+ immutable collection, thru Arrays.asList, Collections.unmodifiableXXX, or one of guava's methods. Doing so will cause
+ an exception, as these collections are not mutable.
+ ]]>
+ </Details>
+ </BugPattern>
<!-- BugCode -->
@@ -3996,4 +4062,6 @@
<BugCode abbrev="CNC">Collection Naming Confusion</BugCode>
<BugCode abbrev="PME">Poor Mans Enum</BugCode>
<BugCode abbrev="UP">Unused Parameter</BugCode>
+ <BugCode abbrev="CD">Circular Dependencies</BugCode>
+ <BugCode abbrev="MUC">Modifying Unmodifiable Collection</BugCode>
</MessageCollection>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/htdocs/index.shtml 2014-03-18 05:52:22 UTC (rev 1767)
@@ -68,14 +68,14 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 5.0.3 available for download
- <a href="http://sourceforge.net/projects/fb-contrib/files/Current/fb-contrib-5.0.3.jar/download">here</a>.</p>
+ <p style="font-weight: bold;">The latest version of fb-contrib is 5.2.0 available for download
+ <a href="http://sourceforge.net/projects/fb-contrib/files/Current/fb-contrib-5.2.0.jar/download">here</a>.</p>
</div>
<hr/>
- <img id="git_image" src="flip2.gif" onClick="toggleBlock('git', 'git_image');" align="top"/>
+ <img id="git_image" src="flip1.gif" onClick="toggleBlock('git', 'git_image');" align="top"/>
Detectors added in git<br/>
- <div id="git" style="display:block;">
+ <div id="git" style="display:none;">
<ul>
<li><b>[STB] Stacked Try Blocks</b><br/>
Looks for two or more try catch blocks that are consecutive and catch the
@@ -88,16 +88,23 @@
to be big enough. This just causes unneeded reallocations putting strain
on the garbage collector.
</li>
- <li><b>[AIOB] Array Index Out of Bounds</b><br/>
- Looks for questionable load/stores to array elements.<ul>
- <li>
- Looks for accesses to array elements using literal values that are known to be outside the bounds of the array.
- This mistake will cause an ArrayIndexOutOfBoundsException to occur at runtime.</li>
- <li>
- Looks for stores to array elements where the array itself appears to have not been allocated.
- </li>
- </ul>
- </li>
+ <li><b>[AIOB] Array Index Out of Bounds</b><br/>
+ Looks for questionable load/stores to array elements.<ul>
+ <li>
+ Looks for accesses to array elements using literal values that are known to be outside the bounds of the array.
+ This mistake will cause an ArrayIndexOutOfBoundsException to occur at runtime.</li>
+ <li>
+ Looks for stores to array elements where the array itself appears to have not been allocated.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <hr/>
+ <img id="v5_2_0_image" src="flip2.gif" onClick="toggleBlock('v5_2_0', 'v5_2_0_image');" align="top"/>
+ Detectors added in v5.2.0<br/>
+ <div id="git" style="display:block;">
+ <ul>
<li><b>[CNC] Collection Naming Confusion</b><br/>
Looks for fields and local variables that have Map, Set, List in their names
but the variable is a collection of a different basic type.
@@ -110,6 +117,14 @@
Looks for private or static methods that have parameters that aren't used. These parameters
can be removed.
</li>
+ <li><b>[CD] Circular Dependencies</b><br/>
+ Looks for class dependencies that where two or more classes rely on each other, either directly or indirectly.
+ This often signifies an improper data model. Consider using interfaces to break this closed loop.
+ </li>
+ <li><b>[MUC] Modifying Unmodifiable Collection</b><br/>
+ Looks for code that attempts to modify a collection that is or may be
+ defined as immutable. or instance, being returned from Arrays.asList(). Doing so will cause exceptions at runtime.
+ </li>
</ul>
</div>
<hr/>
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/htdocs/repository.html 2014-03-18 05:52:22 UTC (rev 1767)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>5.0.3</td></tr>
+ <tr><td><b>Version:</b></td><td>5.2.0</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/plugin.xml
===================================================================
--- trunk/fb-contrib/plugin.xml 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/plugin.xml 2014-03-18 05:52:22 UTC (rev 1767)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
-<plugin>
+<plugin id="fb-contrib" name="fb-contrib" version="5.2.0">
<extension point="edu.umd.cs.findbugs.plugin.eclipse.findbugsPlugins">
<findbugsPlugin fbPluginId="com.mebigfatguy.fbcontrib" libraryPath="."></findbugsPlugin>
</extension>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/pom.xml 2014-03-18 05:52:22 UTC (rev 1767)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>5.0.3</version>
+ <version>5.2.0</version>
<parent>
<groupId>org.sonatype.oss</groupId>
Added: trunk/fb-contrib/samples/CD_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CD_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/CD_Sample.java 2014-03-18 05:52:22 UTC (rev 1767)
@@ -0,0 +1,24 @@
+
+public class CD_Sample {
+ Child c = new Child();;
+
+ public void cdTest() {
+ c.childTest();
+ }
+}
+
+class Child {
+ SubChild sc = new SubChild();
+
+ public void childTest() {
+ sc.subChildTest();
+ }
+}
+
+class SubChild {
+ CD_Sample cds = new CD_Sample();
+
+ public void subChildTest() {
+ cds.toString();
+ }
+}
Property changes on: trunk/fb-contrib/samples/CD_Sample.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/fb-contrib/samples/LO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/LO_Sample.java 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/samples/LO_Sample.java 2014-03-18 05:52:22 UTC (rev 1767)
@@ -41,6 +41,14 @@
public void testInvalidSLF4jParm() {
l3.error("This is a problem {0}", "hello");
}
+
+ public void testLogAppending(String s) {
+ try {
+ l3.info("Got an error with: " + s);
+ } catch (Exception e) {
+ l3.warn("Go a bad error with: " + s, e);
+ }
+ }
public void testWrongNumberOfParms() {
l3.error("This is a problem {}", "hello", "hello");
Added: trunk/fb-contrib/samples/MUC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/MUC_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/MUC_Sample.java 2014-03-18 05:52:22 UTC (rev 1767)
@@ -0,0 +1,45 @@
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import java.util.Collections;
+
+
+public class MUC_Sample {
+
+ public void testMUC() {
+ List<String> l = getImmutableList();
+
+ l.add("Uhoh");
+ }
+
+ public void testPossiblyMUC() {
+ Set<String> s = getPossiblyImmutableSet(Math.random() > 0.5);
+
+ s.add("Yowsers");
+ }
+
+ public void testMUCChained() {
+ List<String> l = getImmutableListChained();
+
+ l.add("Uhoh");
+ }
+
+ public List<String> getImmutableList() {
+ return Arrays.asList("foo");
+ }
+
+ public Set<String> getPossiblyImmutableSet(boolean b) {
+ if (b)
+ return Collections.unmodifiableSet(new HashSet<String>());
+
+ return new HashSet<String>();
+ }
+
+ public List<String> getImmutableListChained() {
+ return getImmutableList();
+ }
+
+
+}
Property changes on: trunk/fb-contrib/samples/MUC_Sample.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/fb-contrib/samples/samples.fbp
===================================================================
--- trunk/fb-contrib/samples/samples.fbp 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/samples/samples.fbp 2014-03-18 05:52:22 UTC (rev 1767)
@@ -1,16 +1,15 @@
<Project projectName="sample">
- <Jar>./././././.</Jar>
- <AuxClasspathEntry>././../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/commons-collections-3.2.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/junit-4.11.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/log4j-1.2.17-sources.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/log4j-1.2.17.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/slf4j-api-1.7.5.jar</AuxClasspathEntry>
- <AuxClasspathEntry>./../lib/guava-15.0.jar</AuxClasspathEntry>
- <AuxClasspathEntry>../lib/commons-lang3-3.2.jar</AuxClasspathEntry>
- <AuxClasspathEntry>../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
- <SrcDir>./././././.</SrcDir>
+ <Jar>././.</Jar>
+ <AuxClasspathEntry>./../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/commons-collections-3.2.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/guava-16.0.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/junit-4.11.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/log4j-1.2.17.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>../lib/commons-lang3-3.3.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>../lib/slf4j-api-1.7.6.jar</AuxClasspathEntry>
+ <SrcDir>././.</SrcDir>
<SuppressionFilter>
<LastVersion value="-1" relOp="NEQ"/>
</SuppressionFilter>
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java 2014-02-17 21:28:00 UTC (rev 1766)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java 2014-03-18 05:52:22 UTC (rev 1767)
@@ -1,6 +1,6 @@
/*
* fb-contrib - Auxiliary detectors for Java programs
- * Copyright (C) 2005-2013 Dave Brosius
+ * C...
[truncated message content] |
|
From: <dbr...@us...> - 2014-04-13 01:38:48
|
Revision: 1771
http://sourceforge.net/p/fb-contrib/code/1771
Author: dbrosius
Date: 2014-04-13 01:38:42 +0000 (Sun, 13 Apr 2014)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/LSC_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
Removed Paths:
-------------
trunk/fb-contrib/lib/
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/build.xml 2014-04-13 01:38:42 UTC (rev 1771)
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="5.2.0" />
+ <property name="fb-contrib.version" value="5.3.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -73,11 +73,6 @@
<pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" />
<pathelement location="${lib.dir}/guava-${guava.version}.jar" />
</path>
- <mkdir dir="${classes.dir}/com" />
- <mkdir dir="${classes.dir}/com/mebigfatguy" />
- <mkdir dir="${classes.dir}/com/mebigfatguy/fbcontrib" />
- <mkdir dir="${classes.dir}/com/mebigfatguy/fbcontrib/detect" />
- <echo message="*.class" file="${classes.dir}/com/mebigfatguy/fbcontrib/detect/.cvsignore" />
</target>
<target name="validate_xml" depends="-init" description="validates the xml files">
@@ -95,7 +90,7 @@
</target>
<target name="compile_samples" depends="-init" description="compiles sample problem files">
- <javac srcdir="${samples.dir}" destdir="${samples.dir}" source="1.5" target="1.5" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
+ <javac srcdir="${samples.dir}" destdir="${samples.dir}" source="1.7" target="1.7" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
<classpath refid="fb-contrib.classpath" />
<classpath refid="fb-contrib.samples.classpath" />
</javac>
@@ -135,6 +130,7 @@
<attribute name="Require-Bundle" value="edu.umd.cs.findbugs.plugin.eclipse" />
<attribute name="Bundle-ActivationPolicy" value="lazy" />
<attribute name="Export-Package" value="com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug" />
+ <attribute name="Import-Package" value="edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bceledu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic" />
</manifest>
</jar>
</target>
@@ -150,8 +146,9 @@
<include name="**/*.xml" />
<include name="**/*.xsd" />
<include name="**/*.license" />
- <include name="**/*.txt" />
- <include name="lib/*.jar" />
+ <include name="**/*.txt" />
+ <include name="**/*.md" />
+ <include name="**/*.xls" />
</fileset>
</zip>
</target>
@@ -159,7 +156,7 @@
<target name="javadoc" depends="-init" description="build the javadoc for the project">
<javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api">
<doctitle><![CDATA[<h1>fb-contrib javadoc</h1>]]></doctitle>
- <bottom><![CDATA[<i>Copyright © 2005-2012 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
+ <bottom><![CDATA[<i>Copyright © 2005-2014 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/etc/findbugs.xml 2014-04-13 01:38:42 UTC (rev 1771)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -34,7 +34,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -265,12 +265,12 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ModifyingUnmodifiableCollection" speed="fast" reports="MUC_MODIFYING_UNMODIFIABLE_COLLECTION"/>
- <!-- COMMENT OUT FOR POINT RELEASE
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections" speed="fast" reports="PSC_PRESIZE_COLLECTIONS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds" speed="fast" reports="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS,AIOB_ARRAY_STORE_TO_NULL_REFERENCE" />
- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/etc/messages.xml 2014-04-13 01:38:42 UTC (rev 1771)
@@ -1545,9 +1545,19 @@
<LongDescription>Method {1} makes literal string comparisons passing the literal as an argument</LongDescription>
<Details>
<![CDATA[
- <p>This method calls the equals or compareTo methods on a String variable passing in a String literal.
- A NullPointerException may occur if the string variable is null. If instead the method was called on
- the string literal, and the variable was passed as an argument, this exception could never happen.</p>
+ <p>This line is in the form of <br/>
+ <code>String str = ...<br/>
+ str.equals("someOtherString");<br/>
+ //or</br>
+ str.compareTo("someOtherString");</code></p>
+ <p>A <code>NullPointerException</code> may occur if the String variable <code>str</code> is <code>null</code>. If instead the code was restructured to<br/>
+ <code>String str = ...<br/>
+ "someOtherString".equals(str);<br/>
+ //or</br>
+ "someOtherString".compareTo(str);</code><br/>
+ that is, call <code>equals()</code> or <code>compareTo()</code> on the string literal, passing the
+ variable as an argument, this exception could never happen as both <code>equals()</code> and
+ <code>compareTo()</code> check for <code>null</code>.</p>
]]>
</Details>
</BugPattern>
@@ -3888,8 +3898,8 @@
<Details>
<![CDATA[
<p>This class defines a field or local collection variable with a name that contains a different type
- of collection in its name. This is confusing to the reader, and likely caused by a previous refactor of
- type, without changing the name.</p>
+ of collection in its name. An example woutd be a Set<User> called userList. This is confusing to the reader,
+ and likely caused by a previous refactor of type, without changing the name.</p>
]]>
</Details>
</BugPattern>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/htdocs/index.shtml 2014-04-13 01:38:42 UTC (rev 1771)
@@ -123,7 +123,7 @@
</li>
<li><b>[MUC] Modifying Unmodifiable Collection</b><br/>
Looks for code that attempts to modify a collection that is or may be
- defined as immutable. or instance, being returned from Arrays.asList(). Doing so will cause exceptions at runtime.
+ defined as immutable. for instance, being returned from Arrays.asList(). Doing so will cause exceptions at runtime.
</li>
</ul>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/pom.xml 2014-04-13 01:38:42 UTC (rev 1771)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>5.2.0</version>
+ <version>5.3.0</version>
<parent>
<groupId>org.sonatype.oss</groupId>
@@ -56,6 +56,9 @@
<contributor>
<name>Philipp Wiesemann</name>
</contributor>
+ <contributor>
+ <name>Kevin Lubick</name>
+ </contributor>
</contributors>
<licenses>
Modified: trunk/fb-contrib/samples/LSC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/LSC_Sample.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/samples/LSC_Sample.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -1,22 +1,173 @@
+
public class LSC_Sample {
+ public static final String CONSTANT_VAL_STRING = "GoodBye";
+ private static final String CONSTANT_VAL_STRING2 = "GoodBye2";
+
+ enum Planets {
+ EARTH,MARS,VENUS, JUPITER;
+ }
+
public boolean test1(String s) {
+ //tag
return s.equals("Hello");
}
public boolean test2(String s) {
+ //no tag
return "Hello".equals(s);
}
public boolean test3(String s1, String s2) {
+ //no tag
return s1.equals(s2);
}
public int test4(String s) {
+ //tag
return s.compareTo("Hello");
}
public int test5(String s) {
+ //no tag
return "Hello".compareTo(s);
}
+
+ public int test6(String s) {
+ //tag
+ return s.compareTo(CONSTANT_VAL_STRING);
+ }
+
+ public int test7(String s) {
+ //no tag
+ return CONSTANT_VAL_STRING.compareTo(s);
+ }
+
+ public int test8(String s) {
+ //tag
+ return s.compareTo(CONSTANT_VAL_STRING2);
+ }
+
+ public int test9(String s) {
+ //no tag
+ return CONSTANT_VAL_STRING2.compareTo(s);
+ }
+
+ public static int test10(String s) {
+ switch (s) {
+ case "Hello":
+ return 1;
+ case CONSTANT_VAL_STRING:
+ return 2;
+
+ }
+
+ switch (s) { //two in a row to check the correct switch offsets
+ case "Hello2":
+ return 1;
+ case CONSTANT_VAL_STRING+"2":
+ return 2;
+ default:
+ return 3;
+ }
+ }
+
+
+ public static int test11(String s, String s2) {
+ //no tag
+ switch (s) {
+ case "Switch1":
+ return 1;
+ case "switch2":
+ return 2;
+ case "switch3":
+ //tag
+ if (s2.equalsIgnoreCase("Foo6")) {
+ return 5;
+ }
+ }
+
+ //tag
+ if (s.equals("Foo7")) {
+ return 3;
+ }
+ System.out.println(s);
+ return 4;
+
+ }
+
+ public static int test12(int n, String s2) {
+ switch (n) { //this is probably a table lookup
+ case 1:
+ return 1;
+ case 2:
+ return 2;
+ case 3:
+ case 4:
+ //tag
+ if (s2.equalsIgnoreCase("Foo6")) {
+ return 5;
+ }
+ }
+
+ //tag
+ if (s2.equals("Foo7")) {
+ return 3;
+ }
+ System.out.println(s2);
+ return 4;
+
+ }
+
+ public static int test13(Planets p, String s2) {
+ switch (p) {
+ case EARTH:
+ return 1;
+ case MARS:
+ return 2;
+ case JUPITER:
+ //tag
+ if (s2.equalsIgnoreCase("Foo6")) {
+ return 5;
+ }
+ default:
+ break;
+ }
+
+ //tag
+ if (s2.equals("Foo7")) {
+ return 3;
+ }
+ System.out.println(s2);
+ return 4;
+
+ }
+
+ /*
+ * Tried really hard to get a false negative, by manipulating this switch to look like a
+ * string switch. Couldn't make it happen.
+ */
+ public static int test14(String s2) {
+ switch (s2.hashCode()) {
+ case 1:
+ return 1;
+ case 2:
+ return 2;
+ case 3:
+ case 99: //forces this to also be a lookup table, like the strings
+ //tag
+ if (s2.equalsIgnoreCase("Foo6")) {
+ return 5;
+ }
+ }
+
+ //tag
+ if (s2.equals("Foo7")) {
+ return 3;
+ }
+ System.out.println(s2);
+ return 4;
+
+ }
+
}
\ No newline at end of file
Modified: trunk/fb-contrib/samples/OCP_Sample.java
===================================================================
--- trunk/fb-contrib/samples/OCP_Sample.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/samples/OCP_Sample.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -6,6 +6,8 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
+import java.sql.Date;
+import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@@ -98,3 +100,12 @@
public void usesOCP(LinkedList<String> ll) {
}
}
+
+class fpOverride {
+ public static final Comparator<Date> COMPARATOR = new Comparator<Date>() {
+
+ public int compare(Date o1, Date o2) {
+ return o1.getYear() - o2.getYear();
+ }
+ };
+}
\ No newline at end of file
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -69,7 +69,7 @@
/**
* constructs a CMRIC detector given the reporter to report bugs on
*
- * @param bugReporter
+ * @param reporter
* the sync of bug reports
*/
public CollectMethodsReturningImmutableCollections(BugReporter reporter) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -19,6 +19,9 @@
package com.mebigfatguy.fbcontrib.detect;
import java.util.BitSet;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
import org.apache.bcel.Constants;
import org.apache.bcel.classfile.Code;
@@ -43,6 +46,7 @@
private OpcodeStack stack;
private BitSet initializedRegs;
private BitSet modifyRegs;
+ private Map<Integer, Integer> nullStoreToLocation;
/**
* constructs an AIOB detector given the reporter to report bugs on
@@ -58,10 +62,13 @@
stack = new OpcodeStack();
initializedRegs = new BitSet();
modifyRegs = new BitSet();
+ nullStoreToLocation = new HashMap<Integer, Integer>();
super.visitClassContext(classContext);
} finally {
stack = null;
initializedRegs = null;
+ modifyRegs = null;
+ nullStoreToLocation = null;
}
}
@@ -77,10 +84,15 @@
initializedRegs.set(arg);
arg += ("J".equals(argSig) || "D".equals(argSig)) ? 2 : 1;
}
+ nullStoreToLocation.clear();
super.visitCode(obj);
- initializedRegs.clear();
- modifyRegs.clear();
+ for (Integer pc : nullStoreToLocation.values()) {
+ bugReporter.reportBug(new BugInstance(this, "AIOB_ARRAY_STORE_TO_NULL_REFERENCE", HIGH_PRIORITY)
+ .addClass(this)
+ .addMethod(this)
+ .addSourceLine(this, pc.intValue()));
+ }
}
public void sawOpcode(int seen) {
@@ -189,10 +201,7 @@
int reg = arrayItem.getRegisterNumber();
if ((reg >= 0) && !initializedRegs.get(reg)) {
- bugReporter.reportBug(new BugInstance(this, "AIOB_ARRAY_STORE_TO_NULL_REFERENCE", HIGH_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
+ nullStoreToLocation.put(Integer.valueOf(reg), getPC());
}
}
}
@@ -237,8 +246,33 @@
initializedRegs.set(getRegisterOperand());
}
break;
+
+ case IFEQ:
+ case IFNE:
+ case IFLT:
+ case IFGE:
+ case IFGT:
+ case IFLE:
+ case IF_ICMPEQ:
+ case IF_ICMPNE:
+ case IF_ICMPLT:
+ case IF_ICMPGE:
+ case IF_ICMPGT:
+ case IF_ICMPLE:
+ case IF_ACMPEQ:
+ case IF_ACMPNE:
+ case GOTO:
+ case GOTO_W:
+ int branchTarget = getBranchTarget();
+ Iterator<Map.Entry<Integer, Integer>> it = nullStoreToLocation.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<Integer, Integer> entry = it.next();
+ int pc = entry.getValue().intValue();
+ if ((branchTarget < pc) && (initializedRegs.get(entry.getKey().intValue())))
+ it.remove();
+ }
}
-
+
} finally {
stack.sawOpcode(this, seen);
if (sizeSet) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -55,21 +55,21 @@
stack.precomputation(this);
switch (seen) {
- case INVOKESTATIC: {
- String className = getClassConstantOperand();
- if (className.startsWith("edu/emory/mathcs/backport/")) {
- reportBug();
+ case INVOKESTATIC: {
+ String className = getClassConstantOperand();
+ if (className.startsWith("edu/emory/mathcs/backport/")) {
+ reportBug();
+ }
}
- }
break;
- case INVOKESPECIAL: {
- String className = getClassConstantOperand();
- String methodName = getNameConstantOperand();
- if (className.startsWith("edu/emory/mathcs/backport/")
- && methodName.equals("<init>")) {
- reportBug();
+
+ case INVOKESPECIAL: {
+ String className = getClassConstantOperand();
+ String methodName = getNameConstantOperand();
+ if (className.startsWith("edu/emory/mathcs/backport/") && "<init>".equals(methodName)) {
+ reportBug();
+ }
}
- }
break;
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -26,6 +26,8 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.CodeException;
@@ -52,6 +54,7 @@
public class BloatedAssignmentScope extends BytecodeScanningDetector {
private static final Set<String> dangerousAssignmentClassSources = new HashSet<String>(7);
private static final Set<String> dangerousAssignmentMethodSources = new HashSet<String>(4);
+ private static final Set<Pattern> dangerousAssignmentMethodPatterns = new HashSet<Pattern>(1);
static {
dangerousAssignmentClassSources.add("java/io/BufferedInputStream");
@@ -61,12 +64,17 @@
dangerousAssignmentClassSources.add("java/io/BufferedReader");
dangerousAssignmentClassSources.add("java/io/FileReader");
dangerousAssignmentClassSources.add("java/io/Reader");
+ dangerousAssignmentClassSources.add("javax/nio/channels/Channel");
+ dangerousAssignmentClassSources.add("io/netty/channel/Channel");
+
dangerousAssignmentMethodSources.add("java/lang/System.currentTimeMillis()J");
dangerousAssignmentMethodSources.add("java/lang/System.nanoTime()J");
dangerousAssignmentMethodSources.add("java/util/Calendar.get(I)I");
dangerousAssignmentMethodSources.add("java/util/GregorianCalendar.get(I)I");
dangerousAssignmentMethodSources.add("java/util/Iterator.next()Ljava/lang/Object;");
dangerousAssignmentMethodSources.add("java/util/regex/Matcher.start()I");
+
+ dangerousAssignmentMethodPatterns.add(Pattern.compile(".*serial.*", Pattern.CASE_INSENSITIVE));
}
BugReporter bugReporter;
@@ -932,7 +940,19 @@
}
String key = clsName + "." + getNameConstantOperand() + getSigConstantOperand();
- return dangerousAssignmentMethodSources.contains(key);
+ if (dangerousAssignmentMethodSources.contains(key)) {
+ return true;
+ }
+
+ for (Pattern p : dangerousAssignmentMethodPatterns) {
+ Matcher m = p.matcher(key);
+ if (m.matches()) {
+ return true;
+ }
+ }
+
+
+ return false;
}
static class UserObject {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -68,10 +68,10 @@
/**
- * constructs a BED detector given the reporter to report bugs on
+ * overrides the visitor to create the opcode stack
*
- * @param bugReporter
- * the sync of bug reports
+ * @param classContext the context object of the currently parsed class
+ *
*/
@Override
public void visitClassContext(ClassContext classContext) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -95,7 +95,7 @@
public void visitCode(Code obj) {
try {
Method m = getMethod();
- if (m.isPublic() && !m.isSynthetic() && m.getName().equals("clone") && (m.getArgumentTypes().length == 0)) {
+ if (m.isPublic() && !m.isSynthetic() && "clone".equals(m.getName()) && (m.getArgumentTypes().length == 0)) {
String returnClsName = m.getReturnType().getSignature();
returnClsName = returnClsName.substring(1, returnClsName.length() - 1).replaceAll("/", ".");
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -192,7 +192,7 @@
if (loop != null) {
int pc = getPC();
if (loop.hasPC(pc)) {
- boolean breakFollows = breakFollows(loop, !Type.getReturnType(signature).getSignature().equals("V"));
+ boolean breakFollows = breakFollows(loop, !"V".equals(Type.getReturnType(signature).getSignature()));
if (!breakFollows) {
bugReporter.reportBug(new BugInstance(this, "DWI_DELETING_WHILE_ITERATING", NORMAL_PRIORITY)
@@ -218,7 +218,7 @@
if (loop != null) {
int pc = getPC();
if (loop.hasPC(pc)) {
- boolean breakFollows = breakFollows(loop, !Type.getReturnType(signature).getSignature().equals("V"));
+ boolean breakFollows = breakFollows(loop, !"V".equals(Type.getReturnType(signature).getSignature()));
if (!breakFollows) {
bugReporter.reportBug(new BugInstance(this, "DWI_MODIFYING_WHILE_ITERATING", NORMAL_PRIORITY)
.addClass(this)
@@ -497,12 +497,12 @@
static class GroupPair {
private Set<Comparable<?>> groupMembers;
- private String collectionClass;
+ private String colClass;
public GroupPair(Comparable<?> member, String cls) {
groupMembers = new HashSet<Comparable<?>>();
groupMembers.add(member);
- collectionClass = cls;
+ colClass = cls;
}
public void addMember(Comparable<?> member) {
@@ -518,12 +518,12 @@
}
public boolean isStandardCollection() {
- return (collectionClass == null) || !collectionClass.contains("/concurrent/");
+ return (colClass == null) || !colClass.contains("/concurrent/");
}
@Override
public String toString() {
- return groupMembers + ((collectionClass == null) ? "" : collectionClass);
+ return groupMembers + ((colClass == null) ? "" : colClass);
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -99,7 +99,7 @@
firstLocalReg = isStatic ? 0 : 1;
for (Type p : parms) {
String parmSig = p.getSignature();
- firstLocalReg += (parmSig.equals("J") || parmSig.equals("D")) ? 2 : 1;
+ firstLocalReg += ("J".equals(parmSig) || "D".equals(parmSig)) ? 2 : 1;
}
sourceLines = getSourceLines(obj);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java 2014-03-18 05:59:32 UTC (rev 1770)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java 2014-04-13 01:38:42 UTC (rev 1771)
@@ -19,6 +19,8 @@
package com.mebigfatguy.fbcontrib.detect;
import java.util.BitSet;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.bcel.Constants;
import org.apache.bcel.classfile.Code;
@@ -34,15 +36,30 @@
* looks for methods that compare strings against literal strings, where the literal string
* is passed as the parameter. If the .equals or .compareTo is called on the literal itself, passing
* the variable as the parameter, you avoid the possibility of a NullPointerException.
+ *
+ * Updated for 1.7 to not throw false positives for string-based switch statements (which are susceptible to
+ * NPEs). String-based switch generate String.equals(Constant) bytecodes, and thus, must be accounted for
*/
public class LiteralStringComparison extends BytecodeScanningDetector
{
+ //offsets to detect for a string switch
+ private static final int HASH_CODE_PC_OFFSET = 3;
+ private static final int DUP_PC_OFFSET = 5;
+ private static final int STRING_SWITCH_OFFSET = 3;
+
+
private BugReporter bugReporter;
private OpcodeStack stack;
-
+
+ private Set<Integer> stringBasedSwitchFalsePositives;
+
+ int lastDupSeen;
+ int lastStringHashCodeSeen;
+
+
/**
- * constructs a LSC detector given the reporter to report bugs on
- * @param bugReporter ...
[truncated message content] |
|
From: <dbr...@us...> - 2014-05-24 04:08:33
|
Revision: 1772
http://sourceforge.net/p/fb-contrib/code/1772
Author: dbrosius
Date: 2014-05-24 04:08:28 +0000 (Sat, 24 May 2014)
Log Message:
-----------
prepared for version 5.2.1 release
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.properties
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/LSYC_Sample.java
trunk/fb-contrib/samples/ROOM_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/CTU_Sample.java
trunk/fb-contrib/samples/HES_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/.classpath 2014-05-24 04:08:28 UTC (rev 1772)
@@ -15,8 +15,8 @@
<classpathentry kind="lib" path="lib/findbugs-2.0.3.jar" sourcepath="/home/dave/.m2/repository/com/google/code/findbugs/findbugs/2.0.3/findbugs-2.0.3-sources.jar"/>
<classpathentry kind="lib" path="lib/annotations-2.0.3.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
- <classpathentry kind="lib" path="lib/guava-16.0.1.jar" sourcepath="lib/guava-16.0.1-sources.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
+ <classpathentry kind="lib" path="lib/guava-17.0.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Modified: trunk/fb-contrib/build.properties
===================================================================
--- trunk/fb-contrib/build.properties 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/build.properties 2014-05-24 04:08:28 UTC (rev 1772)
@@ -9,3 +9,5 @@
output.. = classes/
proxy.server =
+
+findbugs.dir=/home/dave/dev/findbugs/findbugs
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/build.xml 2014-05-24 04:08:28 UTC (rev 1772)
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="5.3.0" />
+ <property name="fb-contrib.version" value="5.2.1" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -38,7 +38,7 @@
<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank">
<mkdir dir="${lib.dir}" />
- <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true">
+ <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true" separateClassifierTypes="true">
<server url="http://repo1.maven.org/maven2" />
<generateVersions propertyFileName="${basedir}/version.properties" />
</yank:yank>
@@ -91,7 +91,8 @@
<target name="compile_samples" depends="-init" description="compiles sample problem files">
<javac srcdir="${samples.dir}" destdir="${samples.dir}" source="1.7" target="1.7" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
- <classpath refid="fb-contrib.classpath" />
+ <compilerarg value="-XDignore.symbol.file"/>
+ <classpath refid="fb-contrib.classpath" />
<classpath refid="fb-contrib.samples.classpath" />
</javac>
<delete file="${samples.dir}/SJVU_Sample.class" />
@@ -164,8 +165,7 @@
</target>
<target name="install" depends="build" description="installs the plugin into FindBugs">
- <property environment="env" />
- <copy todir="${env.FINDBUGS_HOME}/plugin">
+ <copy todir="${findbugs.dir}/plugin">
<fileset dir="${basedir}">
<include name="fb-contrib-${fb-contrib.version}.jar" />
</fileset>
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/etc/bugrank.txt 2014-05-24 04:08:28 UTC (rev 1772)
@@ -126,4 +126,7 @@
0 BugPattern NSE_NON_SYMMETRIC_EQUALS
0 BugPattern CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT
0 BugPattern NFF_NON_FUNCTIONAL_FIELD
-0 BugPattern CEBE_COMMONS_EQUAL_BUILDER_TOEQUALS
\ No newline at end of file
+0 BugPattern CEBE_COMMONS_EQUAL_BUILDER_TOEQUALS
+-2 BugPattern HE_LOCAL_EXECUTOR_SERVICE
+-4 BugPattern HE_EXECUTOR_NEVER_SHUTDOWN
+-2 BugPattern HE_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN
\ No newline at end of file
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/etc/findbugs.xml 2014-05-24 04:08:28 UTC (rev 1772)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -34,7 +34,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
-<!-- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -264,14 +264,21 @@
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" speed="fast" reports="" hidden="true" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ModifyingUnmodifiableCollection" speed="fast" reports="MUC_MODIFYING_UNMODIFIABLE_COLLECTION"/>
+
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE
<Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections" speed="fast" reports="PSC_PRESIZE_COLLECTIONS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds" speed="fast" reports="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS,AIOB_ARRAY_STORE_TO_NULL_REFERENCE" />
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.Unjitable" speed="fast" reports="UJM_UNJITABLE_METHOD" />
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.HangingExecutors" speed="fast" reports="HES_EXECUTOR_NEVER_SHUTDOWN,HES_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN,HES_LOCAL_EXECUTOR_SERVICE"/>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ConflictingTimeUnits" speed="fast" reports="CTU_CONFLICTING_TIME_UNITS" />
+
+ COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -474,4 +481,9 @@
<BugPattern abbrev="UP" type="UP_UNUSED_PARAMETER" category="STYLE" experimental="true" />
<BugPattern abbrev="CD" type="CD_CIRCULAR_DEPENDENCY" category="CORRECTNESS" />
<BugPattern abbrev="MUC" type="MUC_MODIFYING_UNMODIFIABLE_COLLECTION" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="UJM" type="UJM_UNJITABLE_METHOD" category="PERFORMANCE" experimental="true" />
+ <BugPattern abbrev="HES" type="HES_EXECUTOR_NEVER_SHUTDOWN" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="HES" type="HES_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="HES" type="HES_LOCAL_EXECUTOR_SERVICE" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="CTU" type="CTU_CONFLICTING_TIME_UNITS" category="CORRECTNESS" experimental="true" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/etc/messages.xml 2014-05-24 04:08:28 UTC (rev 1772)
@@ -178,6 +178,12 @@
<p>Looks for methods that correctly do not write to a parameter. To help document this, and to perhaps
help the JVM optimize the invocation of this method, you should consider defining these parameters
as final.</p>
+
+ <p>Performance gains are debatable as "the final keyword does not appear in the class file for
+ local variables and parameters, thus it cannot impact the runtime performance. It's only use
+ is to clarify the coders intent that the variable not be changed (which many consider dubious
+ reason for its usage), and dealing with anonymous inner classes." - http://stackoverflow.com/a/266981/1447621</p>
+
<p>It is a slow detector</p>
]]>
</Details>
@@ -1384,7 +1390,7 @@
<Details>
<![CDATA[
<p>Looks for private or static methods that have parameters that aren't used. These parameters
- can be removed.</p>
+ can be removed, assuming the method isn't used through reflection.</p>
<p>It is fast detector</p>
]]>
</Details>
@@ -1409,6 +1415,38 @@
</Details>
</Detector>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.HangingExecutors">
+ <Details>
+ <![CDATA[
+ <p>Single detector for hanging ExecutorServices, that is, ExecutorServices that never get a call to shutdown, which
+ can potentially cause the JVM to not exit.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.Unjitable">
+ <Details>
+ <![CDATA[
+ <p>This detector looks for methods that are longer than 8000 bytes. Methods this
+ long are automatically disqualified by the jit for compilation and will always be
+ emulated. Consider breaking this method up to avoid this, if performance is important.</p>
+ <p>It is a fast detector.</p>
+ ]]>
+ </Details>
+ </Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ConflictingTimeUnits">
+ <Details>
+ <![CDATA[
+ <p>looks for methods that perform arithmetic operations on values representing time
+ where the time unit is incompatible, ie adding a millisecond value to a nanosecond value.
+ </p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
</Detector>
@@ -1592,22 +1630,43 @@
<LongDescription>Class {0} defines two or more one for one associated lists or arrays</LongDescription>
<Details>
<![CDATA[
- <p>This class appears to maintain two or more lists or arrays who's contains is related one-for-one
- through the index of the list or array. Consider creating a separate class to hold all the related
+ <p>This class appears to maintain two or more lists or arrays whose contents are related in a parallel way. That is,
+ you have something like:<br/>
+ <code>
+ List<String> words = new ArrayList<String>();<br/>
+ List<Integer> wordCounts = new ArrayList<String>();<br/>
+ </code>
+ where the elements of the list at index 0 are related, the elements at index 1 are related and so on. </p>
+ <p>
+ Consider creating a separate class to hold all the related
pieces of information, and adding instances of this class to just one list or array, or if just two values, use
- a Map to associate one value with the other.</p>
+ a Map to associate one value with the other like:<br/>
+ <code>
+ private class WordAndCount{public String word; public int count}
+ List<WordAndCount> wordsAndCounts = new ArrayList<WordAndCount>();<br/>
+ <br/>
+ //or, for just two elements<br/>
+ Map<String,Integer> wordCounts = new HashMap<String,Integer>();<br/>
+ </code>
+
+ </p>
]]>
</Details>
</BugPattern>
<BugPattern type="FP_FINAL_PARAMETERS">
<ShortDescription>Method does not define a parameter as final, but could</ShortDescription>
- <LongDescription>Method {1} does not define a parameter as final, but could</LongDescription>
+ <LongDescription>Method {1} does not define one or more parameters as final, but could</LongDescription>
<Details>
<![CDATA[
- <p>This method correctly does not write to a parameter. To help document this, and to perhaps
+ <p>This method does not write to a parameter. To help document this, and to perhaps
help the JVM optimize the invocation of this method, you should consider defining these parameters
as final.</p>
+
+ <p>Performance gains are debatable as "the final keyword does not appear in the class file for
+ local variables and parameters, thus it cannot impact the runtime performance. It's only use
+ is to clarify the coders intent that the variable not be changed (which many consider dubious
+ reason for its usage), and dealing with anonymous inner classes." - http://stackoverflow.com/a/266981/1447621 </p>
]]>
</Details>
</BugPattern>
@@ -2041,13 +2100,33 @@
</BugPattern>
<BugPattern type="PMB_POSSIBLE_MEMORY_BLOAT">
- <ShortDescription>Class defines static field that appears to allow memory bloat</ShortDescription>
- <LongDescription>Class {0} defines static field that appears to allow memory bloat</LongDescription>
+ <ShortDescription>Potential memory bloat in static field</ShortDescription>
+ <LongDescription>Class {0} defines static field "{2}" which appears to allow memory bloat</LongDescription>
<Details>
<![CDATA[
- <p>This class defines static fields that are collections or StringBuffers that do not
- appear to have any way to clear or reduce their size. This is a potential cause of
- memory bloat.</p>
+ <p>This class defines static fields that are <code>Collection</code>s, <code>StringBuffer</code>s, or <code>StringBuilder</code>s
+ that do not appear to have any way to clear or reduce their size. That is, a collection is defined
+ and has method calls like <br/>
+ {<code>add()</code>, <code>append()</code>, <code>offer()</code>, <code>put()</code>, ...} <br/>
+ with no method calls to removal methods like<br/>
+ {<code>clear()</code>, <code>delete()</code>, <code>pop()</code>, <code>remove()</code>, ...}<br/>
+ This means that the collection in question can only ever increase in size, which is
+ a potential cause of memory bloat.</p>
+
+ <p>
+ If this collection is a list, set or otherwise of static things (e.g. a List<String> for month names), consider
+ adding all of the elements in a static initializer, which can only be called once:<br/>
+ <code>
+ private static List<String> monthNames = new ArrayList<String>();<br/>
+ static {<br/>
+ monthNames.add("January");<br/>
+ monthNames.add("February");<br/>
+ monthNames.add("March");<br/>
+ ...<br/>
+ }
+ </code>
+ </p>
+
]]>
</Details>
</BugPattern>
@@ -3954,7 +4033,110 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="HES_EXECUTOR_NEVER_SHUTDOWN">
+ <ShortDescription>ExecutorService field doesn't ever get shutdown</ShortDescription>
+ <LongDescription>ExecutorService {2} is instantiated, but never shutdown, potentially preventing the entire JVM from shutting down</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>Most <code>ExecutorService</code> objects must be explicitly shutdown,
+ otherwise, their internal threads can prolong the running of the JVM, even when everything
+ else has stopped.</p>
+
+ <p>FindBugs has detected that there are no calls to either the <code>shutdown()</code> or <code>shutdownNow()</code>
+ method, and thus, the <code>ExecutorService</code> is not guaranteed to ever terminate. This is especially
+ problematic for <code>Executors.newFixedThreadPool()</code> and most of the other convenience methods in
+ the <code>Executors</code> class.</p>
+
+ <p>Even though there are some exceptions to this, particularly when a custom <code>ThreadFactory</code> is
+ provided, or for <code>ThreadPoolExecutor</code>s with <code>allowsCoreThreadTimeOut()</code> set to true,
+ it is good practice to explictly shutdown the <code>ExecutorService</code> when its utility is done.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="HES_LOCAL_EXECUTOR_SERVICE">
+ <ShortDescription>Suspicious Local Executor Service</ShortDescription>
+ <LongDescription>ExecutorService is created as a local variable, which is unusual</LongDescription>
+ <Details>
+ <![CDATA[
+ <p><code>ExecutorService</code>s are typically instantiated as fields so that many tasks can be executed on a controlled number of <code>Thread</code>s across many method calls. Therefore, it is unusual for <code>ExecutorService</code>s to be a local variable, where tasks will be added only one time, in the enclosing method. </p>
+
+ <p>Furthermore, when a local <code>ExecutorService</code> reaches the end of scope and goes up for garbage collection, the internal <code>Thread</code>s are not necessarily terminated and can prevent the JVM from ever shutting down.</p>
+
+ <p>Consider making this local variable a field and create a method that will explicitly shutdown the <code>ExecutorService</code></p>
+ ]]>
+ </Details>
+ </BugPattern>
+<BugPattern type="HES_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN">
+ <ShortDescription>An ExecutorService isn't shutdown before the reference to it is lost</ShortDescription>
+ <LongDescription>ExecutorService {2} is replaced with another ExecutorService without being shutdown, potentially preventing the entire JVM from shutting down</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>Most <code>ExecutorService</code> objects must be explicitly shutdown, otherwise, their internal threads can prevent the JVM from ever shutting down, even when everything else has stopped.</p>
+
+ <p>FindBugs has detected that something like the following is happening:<br/>
+ <code>
+ ExecutorService executor = ... //e.g. Executors.newCachedThreadPool();<br/>
+ ...<br/>
+ public void reset() {<br/>
+ this.executor = Executors.newCachedThreadPool(); <br/>
+ this.executor.execute(new SampleExecutable()); <br/>
+ }<br/>
+ </code>
+ For normal objects, losing the last reference to them like this would trigger the object to be cleaned up
+ in garbage collection. For <code>ExecutorService</code>s, this isn't enough to terminate the internal threads in the
+ thread pool, and the <code>ExecutorService</code> isn't guaranteed to shutdown, causing the JVM to never stop. <br/>
+ To fix this, simply add a call to <code>shutdown()</code> like this:<br/>
+ <code>
+ ExecutorService executor = ... //e.g. Executors.newCachedThreadPool();<br/>
+ ...<br/>
+ public void reset() {<br/>
+ <b> this.executor.shutDown();</b> <br/>
+ this.executor = Executors.newCachedThreadPool(); <br/>
+ this.executor.execute(new SampleExecutable()); <br/>
+ }
+ </code>
+ </p>
+
+ <p>Even though there are some exceptions to this, particularly when a custom <code>ThreadFactory</code> is
+ provided, or for <code>ThreadPoolExecutor</code>s with <code>allowsCoreThreadTimeOut()</code> set to true,
+ it is good practice to explictly shutdown the <code>ExecutorService</code> at the end of execution, or
+ when it is being replaced.</p>
+
+ <p><b>Note:</b> <code>ExecutorService</code>s are generally created once in a program's lifecycle. If you find yourself
+ replacing the <code>ExecutorService</code>, perhaps you may consider restructuring your code to use calls like
+ <code>awaitTermination()</code> or <code>Future</code>s/<code>Callable</code>s to avoid recreating the <code>ExecutorService</code>.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="UJM_UNJITABLE_METHOD">
+ <ShortDescription>This method is too long to be compiled by the JIT</ShortDescription>
+ <LongDescription>This method {1} is too long to be compiled by the JIT</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method is longer than 8000 bytes. By default the JIT will not attempt to compile this method no matter
+ how hot it is, and so this method will always be interpreted. If performance is important, you should consider
+ breaking this method up in smaller chunks. (And probably a good idea for readability too!).
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="CTU_CONFLICTING_TIME_UNITS">
+ <ShortDescription>This method performs arithmetic operations on time values with different units</ShortDescription>
+ <LongDescription>This method performs arithmetic operations on time values with different units</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method takes two values that appear to be representing time, and performs arithmetic operations on this
+ two values directly, even though it appears that the two values are representing different time units, such as
+ adding a millisecond value to a nanosecond value. You should convert the two values to the same time unit before
+ performing this calculation in order for it to be meaningful.
+ ]]>
+ </Details>
+ </BugPattern>
+
<!-- BugCode -->
<BugCode abbrev="ISB">Inefficient String Buffering</BugCode>
@@ -4074,4 +4256,7 @@
<BugCode abbrev="UP">Unused Parameter</BugCode>
<BugCode abbrev="CD">Circular Dependencies</BugCode>
<BugCode abbrev="MUC">Modifying Unmodifiable Collection</BugCode>
+ <BugCode abbrev="UJM">Unjitable method</BugCode>
+ <BugCode abbrev="HES">Hanging ExecutorService</BugCode>
+ <BugCode abbrev="CTU">Conflicting Time Units</BugCode>
</MessageCollection>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/htdocs/index.shtml 2014-05-24 04:08:28 UTC (rev 1772)
@@ -89,7 +89,8 @@
on the garbage collector.
</li>
<li><b>[AIOB] Array Index Out of Bounds</b><br/>
- Looks for questionable load/stores to array elements.<ul>
+ Looks for questionable load/stores to array elements.
+ <ul>
<li>
Looks for accesses to array elements using literal values that are known to be outside the bounds of the array.
This mistake will cause an ArrayIndexOutOfBoundsException to occur at runtime.</li>
@@ -98,6 +99,17 @@
</li>
</ul>
</li>
+ <li><b>[UJM] Unjitable Methods</b><br/>
+ Looks for methods that are too big that the JIT will not compile them no matter how often they are run
+ </li>
+ <li><b>[HE] Hangable Executors</b><br/>
+ Looks for executors that are never shutdown, which will not allow the application to terminate<br/>
+ <span style="color: #0000FF;">--contributed by Kevin Lubick - THANKS!</span>
+ </li>
+ <li><b>[CTU] Conflicting Time Units</b><br/>
+ Looks for methods that perform arithmetic operations on values representing time
+ where the time unit is incompatible, ie adding a millisecond value to a nanosecond value.
+ </li>
</ul>
</div>
<hr/>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2014-04-13 01:38:42 UTC (rev 1771)
+++ trunk/fb-contrib/pom.xml 2014-05-24 04:08:28 UTC (rev 1772)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>5.3.0</version>
+ <version>5.2.1</version>
<parent>
<groupId>org.sonatype.oss</groupId>
Added: trunk/fb-contrib/samples/CTU_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CTU_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/CTU_Sample.java 2014-05-24 04:08:28 UTC (rev 1772)
@@ -0,0 +1,26 @@
+import java.util.concurrent.TimeUnit;
+
+
+public class CTU_Sample {
+
+ public long simpleMillisAndNanos() {
+ long millis = System.currentTimeMillis();
+ long nanos = System.nanoTime();
+
+ return millis + nanos;
+ }
+
+ public long badUseOfConvert() {
+ long secs = TimeUnit.SECONDS.convert(1000, TimeUnit.MILLISECONDS);
+ long millis = System.currentTimeMillis();
+
+ return secs + millis;
+ }
+
+ public long fpHandConversions() {
+ long millis = System.currentTimeMillis();
+ long secs = TimeUnit.SECONDS.convert(1, TimeUnit.HOURS);
+
+ return millis * 1000 + secs;
+ }
+}
Property changes on: trunk/fb-contrib/samples/CTU_Sample.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/fb-contrib/samples/HES_Sample.java
===================================================================
--- trunk/fb-contrib/samples/HES_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/HES_Sample.java 2014-05-24 04:08:28 UTC (rev 1772)
@@ -0,0 +1,370 @@
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+//Expected bug count: 12
+//5 HE_EXECUTOR_NEVER_SHUTDOWN
+//4 HE_LOCAL_EXECUTOR_SERVICE
+//3 HE_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN
+public class HES_Sample {
+
+
+ public static void main(String[] args) {
+ LocalExecutorProblem p = new LocalExecutorProblem();
+ p.task();
+
+ System.out.println("Should end");
+ }
+}
+
+class SampleExecutable implements Runnable {
+ @Override
+ public void run() {
+ System.out.println("Hello");
+ }
+
+ //Dummy method with throws to simulate something potentially throwing exception
+ public static void methodThrows() throws Exception{
+ if (Math.random()<.5)
+ throw new Exception("There was a problem with the RNG");
+ }
+
+}
+
+class SingleThreadExecutorProblem {
+ //tag
+ private ExecutorService executor;
+
+ public SingleThreadExecutorProblem() {
+ this.executor = Executors.newSingleThreadExecutor();
+ }
+
+ public void test() {
+ executor.execute(new SampleExecutable());
+ executor.execute(new SampleExecutable());
+ }
+
+}
+
+class SingleThreadExecutorGood {
+ //no tag
+ private ExecutorService executor;
+
+ public SingleThreadExecutorGood() {
+ this.executor = Executors.newSingleThreadExecutor();
+ }
+ public void test() {
+ executor.execute(new SampleExecutable());
+ executor.execute(new SampleExecutable());
+ }
+ public void shutDown() {
+ executor.shutdown();
+ }
+}
+class SingleThreadExecutorGood1 {
+ //no tag
+ private ExecutorService executor;
+
+ public SingleThreadExecutorGood1() {
+ this.executor = Executors.newSingleThreadExecutor();
+ }
+ public void test() {
+ executor.execute(new SampleExecutable());
+ executor.execute(new SampleExecutable());
+ }
+ public void shutDown() {
+ executor.shutdownNow();
+ }
+}
+class SingleThreadExecutorGood2 {
+ //no tag
+ private ExecutorService executor;
+
+ public SingleThreadExecutorGood2() {
+ this.executor = Executors.newSingleThreadExecutor();
+ }
+ public void test() {
+ executor.execute(new SampleExecutable());
+ executor.execute(new SampleExecutable());
+ }
+ public void shutDown() {
+ try {
+ executor.awaitTermination(30, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ executor.shutdown();
+ }
+}
+
+class SingleThreadExecutorTryProblem {
+ //this won't get tagged as of version 2.2 If given more thought, this could be implemented
+ private ExecutorService executor;
+
+ public SingleThreadExecutorTryProblem() {
+ this.executor = Executors.newSingleThreadExecutor();
+ }
+ public void test() {
+ executor.execute(new SampleExecutable());
+ executor.execute(new SampleExecutable());
+ }
+ public void shutDown() {
+ try {
+ executor.awaitTermination(30, TimeUnit.SECONDS);
+ executor.shutdown(); //this doesn't count as shutdown, so it should be tagged.
+ //probably with a different bug
+ } catch (InterruptedException e) {
+ e.printSta...
[truncated message content] |
|
From: <dbr...@us...> - 2014-07-26 03:41:11
|
Revision: 1774
http://sourceforge.net/p/fb-contrib/code/1774
Author: dbrosius
Date: 2014-07-26 03:40:55 +0000 (Sat, 26 Jul 2014)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/plugin.xml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/ABC_Sample.java
trunk/fb-contrib/samples/COM_Sample.java
trunk/fb-contrib/samples/CU_Sample.java
trunk/fb-contrib/samples/HES_Sample.java
trunk/fb-contrib/samples/ISB_Sample.java
trunk/fb-contrib/samples/JVR_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/LSYC_Sample.java
trunk/fb-contrib/samples/MDM_Sample.java
trunk/fb-contrib/samples/NPMC_Sample.java
trunk/fb-contrib/samples/NSE_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/PCAIL_Sample.java
trunk/fb-contrib/samples/PMB_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/SCA_Sample.java
trunk/fb-contrib/samples/SCII_Sample.java
trunk/fb-contrib/samples/SCRV_Sample.java
trunk/fb-contrib/samples/SC_Sample.java
trunk/fb-contrib/samples/SMA_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StutteredMethodArguments.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/HCP_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2014-05-24 04:13:22 UTC (rev 1773)
+++ trunk/fb-contrib/.classpath 2014-07-26 03:40:55 UTC (rev 1774)
@@ -5,18 +5,21 @@
<classpathentry excluding="lib/" kind="src" path="samples"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
- <classpathentry kind="lib" path="lib/asm-tree-3.3.1.jar"/>
<classpathentry kind="lib" path="lib/backport-util-concurrent-3.1.jar"/>
- <classpathentry kind="lib" path="lib/bcel-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
- <classpathentry kind="lib" path="lib/findbugs-2.0.3.jar" sourcepath="/home/dave/.m2/repository/com/google/code/findbugs/findbugs/2.0.3/findbugs-2.0.3-sources.jar"/>
- <classpathentry kind="lib" path="lib/annotations-2.0.3.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.jar"/>
- <classpathentry kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
+ <classpathentry kind="lib" path="lib/slf4j-api-1.7.7.jar"/>
<classpathentry kind="lib" path="lib/guava-17.0.jar"/>
+ <classpathentry kind="lib" path="lib/httpclient-cache-4.3.4.jar"/>
+ <classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
+ <classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/>
+ <classpathentry kind="lib" path="lib/annotations-3.0.0.jar"/>
+ <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar"/>
+ <classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar"/>
+ <classpathentry kind="lib" path="lib/findbugs-3.0.0.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2014-05-24 04:13:22 UTC (rev 1773)
+++ trunk/fb-contrib/build.xml 2014-07-26 03:40:55 UTC (rev 1774)
@@ -13,12 +13,12 @@
<property name="samples.dir" value="${basedir}/samples" />
<property name="javadoc.dir" value="${basedir}/javadoc" />
<property name="htdocs.dir" value="${basedir}/htdocs" />
- <property name="javac.source" value="1.5" />
- <property name="javac.target" value="1.5" />
+ <property name="javac.source" value="1.6" />
+ <property name="javac.target" value="1.6" />
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="5.2.1" />
+ <property name="fb-contrib.version" value="6.0.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -36,9 +36,9 @@
<delete dir="${basedir}/plugin" />
</target>
- <target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank">
+ <target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
<mkdir dir="${lib.dir}" />
- <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true" separateClassifierTypes="true">
+ <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true">
<server url="http://repo1.maven.org/maven2" />
<generateVersions propertyFileName="${basedir}/version.properties" />
</yank:yank>
@@ -59,9 +59,9 @@
<mkdir dir="${javadoc.dir}" />
<path id="fb-contrib.classpath">
<pathelement location="${lib.dir}/findbugs-${findbugs.version}.jar" />
- <pathelement location="${lib.dir}/bcel-${bcel.version}.jar" />
+ <pathelement location="${lib.dir}/bcel-findbugs-${bcel-findbugs.version}.jar" />
<pathelement location="${lib.dir}/annotations-${annotations.version}.jar" />
- <pathelement location="${lib.dir}/asm-tree-${asm-tree.version}.jar" />
+ <pathelement location="${lib.dir}/asm-debug-all-${asm-debug-all.version}.jar" />
</path>
<path id="fb-contrib.samples.classpath">
<pathelement location="${lib.dir}/javax.servlet.jsp-api-${javax.servlet.jsp-api.version}.jar" />
@@ -72,6 +72,9 @@
<pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" />
<pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" />
<pathelement location="${lib.dir}/guava-${guava.version}.jar" />
+ <pathelement location="${lib.dir}/httpclient-cache-${httpclient-cache.version}.jar" />
+ <pathelement location="${lib.dir}/httpcore-${httpcore.version}.jar" />
+ <pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" />
</path>
</target>
@@ -165,6 +168,7 @@
</target>
<target name="install" depends="build" description="installs the plugin into FindBugs">
+ <echo message="Findbugs: ${findbugs.dir}/plugin"/>
<copy todir="${findbugs.dir}/plugin">
<fileset dir="${basedir}">
<include name="fb-contrib-${fb-contrib.version}.jar" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2014-05-24 04:13:22 UTC (rev 1773)
+++ trunk/fb-contrib/etc/bugrank.txt 2014-07-26 03:40:55 UTC (rev 1774)
@@ -88,6 +88,7 @@
0 BugPattern SPP_USE_GETPROPERTY
0 BugPattern SPP_SERIALVER_SHOULD_BE_PRIVATE
0 BugPattern SPP_USELESS_CASING
+0 BugPattern SPP_CONVERSION_OF_STRING_LITERAL
0 BugPattern BAS_BLOATED_ASSIGNMENT_SCOPE
0 BugPattern SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTATOR
0 BugPattern DWI_DELETING_WHILE_ITERATING
@@ -129,4 +130,6 @@
0 BugPattern CEBE_COMMONS_EQUAL_BUILDER_TOEQUALS
-2 BugPattern HE_LOCAL_EXECUTOR_SERVICE
-4 BugPattern HE_EXECUTOR_NEVER_SHUTDOWN
--2 BugPattern HE_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN
\ No newline at end of file
+-2 BugPattern HE_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN
+0 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD
+0 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_LOCAL
\ No newline at end of file
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2014-05-24 04:13:22 UTC (rev 1773)
+++ trunk/fb-contrib/etc/findbugs.xml 2014-07-26 03:40:55 UTC (rev 1774)
@@ -149,7 +149,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast"
- reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TERNARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING" />
+ reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TERNARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING,SPP_EQUALS_ON_STRING_BUILDER,SPP_CONVERSION_OF_STRING_LITERAL" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" />
@@ -157,7 +157,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UseSplit" speed="fast" reports="USS_USE_STRING_SPLIT" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousJDKVersionUse" speed="slow" reports="SJVU_SUSPICIOUS_JDK_VERSION_USE" disabled="true" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousJDKVersionUse" speed="slow" reports="SJVU_SUSPICIOUS_JDK_VERSION_USE" />
<Detector class="com.mebigfatguy.fbcontrib.detect.UseAddAll" speed="fast" reports="UAA_USE_ADD_ALL" />
@@ -264,9 +264,7 @@
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" speed="fast" reports="" hidden="true" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ModifyingUnmodifiableCollection" speed="fast" reports="MUC_MODIFYING_UNMODIFIABLE_COLLECTION"/>
-
- <!-- COMMENT OUT FOR POINT RELEASE
<Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections" speed="fast" reports="PSC_PRESIZE_COLLECTIONS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds" speed="fast" reports="AIOB_ARRAY_INDEX_OUT_OF_BOUNDS,AIOB_ARRAY_STORE_TO_NULL_REFERENCE" />
@@ -274,10 +272,13 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.Unjitable" speed="fast" reports="UJM_UNJITABLE_METHOD" />
<Detector class="com.mebigfatguy.fbcontrib.detect.HangingExecutors" speed="fast" reports="HES_EXECUTOR_NEVER_SHUTDOWN,HES_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN,HES_LOCAL_EXECUTOR_SERVICE"/>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.HttpClientProblems" speed="fast" reports="HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD,HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_LOCAL"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflictingTimeUnits" speed="fast" reports="CTU_CONFLICTING_TIME_UNITS" />
- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
@@ -384,6 +385,8 @@
<BugPattern abbrev="SPP" type="SPP_NULL_BEFORE_INSTANCEOF" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_NON_USEFUL_TOSTRING" category="STYLE" />
<BugPattern abbrev="SPP" type="SPP_TOSTRING_ON_STRING" category="CORRECTNESS" />
+ <BugPattern abbrev="SPP" type="SPP_EQUALS_ON_STRING_BUILDER" category="CORRECTNESS" />
+ <BugPattern abbrev="SPP" type="SPP_CONVERSION_OF_STRING_LITERAL" category="CORRECTNESS" experimental="true" />
<BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" category="PERFORMANCE" />
<BugPattern abbrev="SCII" type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" category="STYLE" />
<BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" category="CORRECTNESS" />
@@ -485,5 +488,7 @@
<BugPattern abbrev="HES" type="HES_EXECUTOR_NEVER_SHUTDOWN" category="CORRECTNESS" experimental="true" />
<BugPattern abbrev="HES" type="HES_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN" category="CORRECTNESS" experimental="true" />
<BugPattern abbrev="HES" type="HES_LOCAL_EXECUTOR_SERVICE" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="HCP" type="HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_LOCAL" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="HCP" type="HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD" category="CORRECTNESS" experimental="true"/>
<BugPattern abbrev="CTU" type="CTU_CONFLICTING_TIME_UNITS" category="CORRECTNESS" experimental="true" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2014-05-24 04:13:22 UTC (rev 1773)
+++ trunk/fb-contrib/etc/messages.xml 2014-07-26 03:40:55 UTC (rev 1774)
@@ -214,7 +214,7 @@
<Details>
<![CDATA[
<p>Looks for methods that use floating point indexes for loops. Since floating point
- math is inprecise, rounding errors will occur each time through the loop causing
+ math is imprecise, rounding errors will occur each time through the loop causing
hard to find problems. It is usually better to use integer indexing, and calculating
the correct floating point value from the index.</p>
<p>It is a fast detector</p>
@@ -226,7 +226,7 @@
<Details>
<![CDATA[
<p>Looks for method calls to collection classes where the method is not defined by the Collections
- interface, and an equivalent method exists in the interface. Examples include:<br>
+ interface, and an equivalent method exists in the interface. Examples include:<br/>
<table border="1">
<tr><th>Old Method</th><th>New Method</th></tr>
<tr><td>Hashtable.contains</td><td>Map.containsValue</td></tr>
@@ -624,7 +624,7 @@
<![CDATA[
<p>Looks for code that builds an array of values from a collection, by manually looping
over the elements of the collection, and adding them to the array. It is simpler and
- cleaner to use mycollection.toArray(new type[mycollection.size()].</p>
+ cleaner to use mycollection.toArray(new type[mycollection.size()]).</p>
<p>It is a fast detector</p>
]]>
</Details>
@@ -1204,7 +1204,7 @@
<![CDATA[
<p>This detector looks for creation of java.awt.Graphics object that do not have the
.dispose() method called on them when finished. These objects will be cleaned up by
- the Garbage collector, bug given the likelyhood that large numbers of these objects can
+ the Garbage collector, bug given the likelihood that large numbers of these objects can
be created in a short period of time, it is better to dispose them as soon as possible.</p>
<p>It is a fast detector</p>
]]>
@@ -1418,18 +1418,28 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.HangingExecutors">
<Details>
<![CDATA[
- <p>Single detector for hanging ExecutorServices, that is, ExecutorServices that never get a call to shutdown, which
+ <p>Three detectors for hanging ExecutorServices, that is, ExecutorServices that never get a call to shutdown, which
can potentially cause the JVM to not exit.</p>
<p>It is a fast detector</p>
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.HttpClientProblems">
+ <Details>
+ <![CDATA[
+ <p>The HttpRequests from the apache.httpComponents have some little-known quirks about them.
+ This is a set of detectors that helps guard against resource starvation.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.Unjitable">
<Details>
<![CDATA[
<p>This detector looks for methods that are longer than 8000 bytes. Methods this
- long are automatically disqualified by the jit for compilation and will always be
+ long are automatically disqualified by the JIT for compilation and will always be
emulated. Consider breaking this method up to avoid this, if performance is important.</p>
<p>It is a fast detector.</p>
]]>
@@ -1458,9 +1468,40 @@
<LongDescription>Method {1} passes simple concatenating string in StringBuffer or StringBuilder append</LongDescription>
<Details>
<![CDATA[
- <p>This method uses StringBuffer or StringBuilder's append method to concatenate strings. However, it passes the result
+ <p>This method uses <code>StringBuffer</code> or <code>StringBuilder</code>'s append method to concatenate strings. However, it passes the result
of doing a simple String concatenation to one of these append calls, thus removing any performance gains
- of using the StringBuffer or StringBuilder class.</p>
+ of using the <code>StringBuffer</code> or <code>StringBuilder</code> class.</p>
+
+ <p>
+ Java will implicitly use StringBuilders, which can make this hard to detect or fix. For example, <br/>
+ <code>
+ StringBuilder sb = new StringBuilder();<br/>
+ for (Map.Entry<Integer, String> e : map.entrySet()) {<br/>
+ sb.append(e.getKey() + e.getValue()); //bug detected here<br/>
+ }<br/>
+ </code><br/>
+
+ gets automatically turned into something like: <br/>
+ <code>
+ StringBuilder sb = new StringBuilder();<br/>
+ for (Map.Entry<Integer, String> e : map.entrySet()) {<br/>
+ StringBuilder tempBuilder = new StringBuilder();<br/>
+ tempBuilder.append(e.getKey());<br/>
+ tempBuilder.append(e.getValue());<br/>
+ sb.append(tempBuilder.toString()); //this isn't too efficient<br/>
+ }<br/>
+ </code><br/>
+
+ which involves a temporary <code>StringBuilder</code>, which is completely unneccessary. To prevent this from happening, simply do:<br/>
+
+ <code>
+ StringBuilder sb = new StringBuilder();<br/>
+ for (Map.Entry<Integer, String> e : map.entrySet()) {<br/>
+ sb.append(e.getKey()); <br/>
+ sb.append(e.getValue());<br/>
+ }<br/>
+ </code>
+ </p>
]]>
</Details>
</BugPattern>
@@ -1483,9 +1524,31 @@
<LongDescription>Method {1} concatenates the result of a toString() call</LongDescription>
<Details>
<![CDATA[
- <p>This method concatenates the output of a toString() call into a StringBuffer/Builder.
+ <p>This method concatenates the output of a <code>toString()</code> call into a <code>StringBuffer</code> or <code>StringBuilder</code>.
It is simpler just to pass the object you want to append to the append call, as that form
- does not suffer the potential for NullPointerExceptions, and is easier to read.</p>
+ does not suffer the potential for <code>NullPointerException</code>s, and is easier to read.</p>
+
+ <p>
+ Keep in mind that Java compiles simple <code>String</code> Concatenation to use <code>StringBuilder</code>s, so you may see this bug even when you don't use <code>StringBuilder</code>s explicitly.
+ </p>
+
+ <p>
+ Instead of: <br/>
+ <code>
+ StringBuilder builder = ... <br/>
+ builder.append(someObj.toString());<br/>
+ ... <br/>
+ System.out.println("Problem with the object :" + someObj.toString());<br/>
+ </code>
+ just do: <br/>
+ <code>
+ StringBuilder builder = ... <br/>
+ builder.append(someObj);<br/>
+ ... <br/>
+ System.out.println("Problem with the object :" + someObj);<br/>
+ </code>
+ to avoid the possibility of <code>NullPointerException</code>s when someObj is <code>null</code>.
+ </p>
]]>
</Details>
</BugPattern>
@@ -1504,7 +1567,7 @@
<BugPattern type="CC_CYCLOMATIC_COMPLEXITY">
<ShortDescription>Method is excessively complex</ShortDescription>
- <LongDescription>Method {1} is excessively complex</LongDescription>
+ <LongDescription>Method {1} is excessively complex, with a cyclomatic complexity of {3}</LongDescription>
<Details>
<![CDATA[
<p>This method has a high cyclomatic complexity figure, which calculates the number of branch
@@ -1586,12 +1649,12 @@
<p>This line is in the form of <br/>
<code>String str = ...<br/>
str.equals("someOtherString");<br/>
- //or</br>
+ //or<br/>
str.compareTo("someOtherString");</code></p>
<p>A <code>NullPointerException</code> may occur if the String variable <code>str</code> is <code>null</code>. If instead the code was restructured to<br/>
<code>String str = ...<br/>
"someOtherString".equals(str);<br/>
- //or</br>
+ //or<br/>
"someOtherString".compareTo(str);</code><br/>
that is, call <code>equals()</code> or <code>compareTo()</code> on the string literal, passing the
variable as an argument, this exception could never happen as both <code>equals()</code> and
@@ -1785,8 +1848,24 @@
<LongDescription>Method {1} passes parsed string to primitive wrapper constructor</LongDescription>
<Details>
<![CDATA[
- <p>This method passes a primitive value retrieved from a BoxedPrimitive.parseBoxedPrimitive("1") call to
- the same class's constructor. It is simpler to just pass the string to the BoxedPrimitives constructor.</p>
+ <p>This method passes a primitive value retrieved from a <code>BoxedPrimitive.parseBoxedPrimitive("1")</code> call to
+ the same class's constructor. It is simpler to just pass the string to the BoxedPrimitives constructor or, better yet, use the static valueOf.</p>
+ <p>Instead of something like:<br/>
+ <code>
+ Boolean bo = new Boolean(Boolean.parseBoolean("true")); <br/>
+ Float f = new Float(Float.parseFloat("1.234"));<br/>
+ </code>
+ Simply do: <br/>
+ <code>
+ Boolean bo = new Boolean("true"); <br/>
+ Float f = new Float("1.234");<br/>
+ </code>
+ or, to be more memory efficient: <br/>
+ <code>
+ Boolean bo = Boolean.valueOf("true"); <br/>
+ Float f = Float.valueOf("1.234");<br/>
+ </code>
+ </p>
]]>
</Details>
</BugPattern>
@@ -1810,8 +1889,27 @@
<![CDATA[
<p>This method passes a String to a wrapped primitive object's valueOf method, which in turn calls
the boxedValue() method to convert to a primitive. When it is desired to convert from a String
- to a primitive value, it is simpler to use the BoxedPrimitive.parseBoxedPrimitive(myString)
+ to a primitive value, it is simpler to use the BoxedPrimitive.parseBoxedPrimitive(String)
method. </p>
+
+ <p>Instead of something like:<br/>
+ <code>
+ public int someMethod(String data) {<br/>
+ long l = Long.valueOf(data).longValue(); <br/>
+ float f = Float.valueOf(data).floatValue(); <br/>
+ return Integer.valueOf(data); // There is an implicit .intValue() call<br/>
+ }<br/>
+ </code>
+ Simply do: <br/>
+ <code>
+ public int someMethod(String data) {<br/>
+ long l = Long.parseLong(data); <br/>
+ float f = Float.parseFloat(data); <br/>
+ return Integer.parseInt(data); <br/>
+ }<br/>
+ </code>
+ </p>
+
]]>
</Details>
</BugPattern>
@@ -1823,8 +1921,19 @@
<![CDATA[
<p>This method passes a String to a wrapped primitive object's parse method, which in turn calls
the valueOf() method to convert to a boxed primitive. When it is desired to convert from a String
- to a boxed primitive object, it is simpler to use the BoxedPrimitive.valueOf(myString)
- method.</p>
+ to a boxed primitive object, it is simpler to use the BoxedPrimitive.va...
[truncated message content] |
|
From: <dbr...@us...> - 2015-05-06 00:34:38
|
Revision: 1776
http://sourceforge.net/p/fb-contrib/code/1776
Author: dbrosius
Date: 2015-05-06 00:34:33 +0000 (Wed, 06 May 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.properties
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugdescriptions.xsl
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/findbugsplugin.xsd
trunk/fb-contrib/etc/messagecollection.xsd
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/plugin.xml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/AIOB_Sample.java
trunk/fb-contrib/samples/BED_Sample.java
trunk/fb-contrib/samples/CNC_Sample.java
trunk/fb-contrib/samples/EXS_Sample.java
trunk/fb-contrib/samples/FCBL_Sample.java
trunk/fb-contrib/samples/ICA_Sample.java
trunk/fb-contrib/samples/MDM_Sample.java
trunk/fb-contrib/samples/MRC_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/PMB_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/SUA_Sample.java
trunk/fb-contrib/samples/UCPM_Sample.java
trunk/fb-contrib/samples/UVA_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StutteredMethodArguments.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TailRecursion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/CBC_Sample.java
trunk/fb-contrib/samples/CIS_Sample.java
trunk/fb-contrib/samples/CRF_Sample.java
trunk/fb-contrib/samples/CSI_Sample.java
trunk/fb-contrib/samples/OPM_Sample.java
trunk/fb-contrib/samples/SLS_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/StatisticsKey.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/package.html
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassImpersonatingString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/PublicAPI.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/user.properties.example
Property Changed:
----------------
trunk/fb-contrib/samples/ABC_Sample.java
trunk/fb-contrib/samples/ACEM_Sample.java
trunk/fb-contrib/samples/AFBR_Sample.java
trunk/fb-contrib/samples/AOM_Sample.java
trunk/fb-contrib/samples/AWCBR_Sample.java
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/BSB_Sample.java
trunk/fb-contrib/samples/CAO_Sample.java
trunk/fb-contrib/samples/CBX_Sample.java
trunk/fb-contrib/samples/CE_Sample.java
trunk/fb-contrib/samples/CLI_Sample.java
trunk/fb-contrib/samples/COM_Sample.java
trunk/fb-contrib/samples/DDC_Sample.java
trunk/fb-contrib/samples/DLC_Sample.java
trunk/fb-contrib/samples/DRE_Sample.java
trunk/fb-contrib/samples/DWI_Sample.java
trunk/fb-contrib/samples/FCBL_Sample.java
trunk/fb-contrib/samples/FPL_Sample.java
trunk/fb-contrib/samples/FP_Sample.java
trunk/fb-contrib/samples/ISB_Sample.java
trunk/fb-contrib/samples/ITC_Sample.java
trunk/fb-contrib/samples/LEST_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/package.html
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2014-07-26 03:46:13 UTC (rev 1775)
+++ trunk/fb-contrib/.classpath 2015-05-06 00:34:33 UTC (rev 1776)
@@ -4,11 +4,9 @@
<classpathentry kind="src" path="src"/>
<classpathentry excluding="lib/" kind="src" path="samples"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
<classpathentry kind="lib" path="lib/backport-util-concurrent-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
- <classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.jar"/>
@@ -19,7 +17,14 @@
<classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/>
<classpathentry kind="lib" path="lib/annotations-3.0.0.jar"/>
<classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar"/>
- <classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar"/>
- <classpathentry kind="lib" path="lib/findbugs-3.0.0.jar"/>
+ <classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar" sourcepath="lib/sources/bcel-findbugs-6.0-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="http://commons.apache.org/proper/commons-bcel/apidocs/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="lib/commons-codec-1.6.jar"/>
+ <classpathentry kind="lib" path="lib/findbugs-3.0.1.jar" sourcepath="lib/sources/findbugs-3.0.1-sources.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
+ <classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Modified: trunk/fb-contrib/build.properties
===================================================================
--- trunk/fb-contrib/build.properties 2014-07-26 03:46:13 UTC (rev 1775)
+++ trunk/fb-contrib/build.properties 2015-05-06 00:34:33 UTC (rev 1776)
@@ -9,5 +9,3 @@
output.. = classes/
proxy.server =
-
-findbugs.dir=/home/dave/dev/findbugs/findbugs
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2014-07-26 03:46:13 UTC (rev 1775)
+++ trunk/fb-contrib/build.xml 2015-05-06 00:34:33 UTC (rev 1776)
@@ -1,6 +1,6 @@
<!-- fb-contrib Ant build script. Dave Brosius -->
-<project name="fb-contrib" default="info">
+<project name="fb-contrib" default="default">
<property file="user.properties" />
<property file="build.properties" />
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.0.0" />
+ <property name="fb-contrib.version" value="6.0.1" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -36,9 +36,16 @@
<delete dir="${basedir}/plugin" />
</target>
+ <target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib">
+ <mkdir dir="${user.home}/.ant/lib" />
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/>
+ <get src="https://bitbucket.org/klubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.2.0/vcsversion-0.2.0.jar" dest="${user.home}/.ant/lib"/>
+ </target>
+
<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
<mkdir dir="${lib.dir}" />
- <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true">
+ <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true" separateClassifierTypes="true">
<server url="http://repo1.maven.org/maven2" />
<generateVersions propertyFileName="${basedir}/version.properties" />
</yank:yank>
@@ -47,13 +54,27 @@
<target name="info">
<echo message="fb-contrib - a findbugs plugin"/>
<echo message=""/>
- <echo message=" this project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
- <echo message=" download yank.jar and place in ant/lib directory"/>
+ <echo message=" This project requires three jars to build fb-contrib: yank, bug-rank-check-style and vcsversion" />
+ <echo message=""/>
+ <echo message=" This project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
+ <echo message=" download yank.jar and place in ~/.ant/lib directory"/>
<echo message=" http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.mebigfatguy.yank%22"/>
- <antcall target="install"/>
+
+ <echo message="===="/>
+ <echo message=" Additionally, this project uses bug-rank-check-style to validate etc/bugrank.txt"/>
+ <echo message=" bug-rank-check-style-1.0.0.jar can be downloaded at https://bitbucket.org/klubick/bugrankcheckstyle/downloads"/>
+ <echo message=" and put in ~/.ant/lib alongside yank"/>
+ <echo message="===="/>
+ <echo message=" Finally, this project uses vcsversion to inject the git version information into the manifest file"/>
+ <echo message=" and can be downloaded and placed in ~/.ant/lib as well"/>
+ <echo message=" http://search.maven.org/#search%7Cga%7C1%7Cvcsversion"/>
+ <echo message="===="/>
+ <echo message=" This task can be automated by running ant infra_jars"/>
</target>
+
+ <target name="default" depends="info, install"/>
- <target name="-init" depends="yank" description="prepares repository for a build">
+ <target name="-init" depends="yank">
<mkdir dir="${lib.dir}" />
<mkdir dir="${classes.dir}" />
<mkdir dir="${javadoc.dir}" />
@@ -75,15 +96,18 @@
<pathelement location="${lib.dir}/httpclient-cache-${httpclient-cache.version}.jar" />
<pathelement location="${lib.dir}/httpcore-${httpcore.version}.jar" />
<pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" />
+ <pathelement location="${lib.dir}/commons-codec-${commons-codec.version}.jar" />
</path>
</target>
<target name="validate_xml" depends="-init" description="validates the xml files">
+ <taskdef name="bug-rank-check-style" classname="text.style.check.BugRankCheckStyleTask"/>
<xmlvalidate lenient="false" failonerror="yes">
<attribute name="http://apache.org/xml/features/validation/schema" value="true" />
<attribute name="http://xml.org/sax/features/namespaces" value="true" />
<fileset dir="${etc.dir}" includes="*.xml" />
</xmlvalidate>
+ <bug-rank-check-style findbugsxml="etc/findbugs.xml" failOnMissingDetector="false" />
</target>
<target name="compile" depends="-init" description="compiles java files">
@@ -106,7 +130,8 @@
</javac>
</target>
- <target name="jar" depends="compile" description="produces the fb-contrib jar file">
+ <target name="jar" depends="compile" xmlns:vcs="antlib:com.mebigfatguy.vcsversion" description="produces the fb-contrib jar file">
+ <vcs:vcsversion vcs="git" revisionProperty="_rev_" dateProperty="_date_" branchProperty="_branch_"/>
<jar destfile="${basedir}/fb-contrib-${fb-contrib.version}.jar">
<fileset dir="etc">
<include name="findbugs.xml" />
@@ -124,6 +149,7 @@
<manifest>
<attribute name="fb-contrib-version" value="${fb-contrib.version}" />
<attribute name="Main-Class" value="com.mebigfatguy.fbcontrib.FBContrib" />
+ <attribute name="git-revision" value="${_branch_} ${_rev_} ${_date_}" />
<attribute name="Eclipse-RegisterBuddy" value="edu.umd.cs.findbugs.plugin.eclipse" />
<attribute name="Bundle-ManifestVersion" value="2" />
<attribute name="Bundle-Name" value="fb-contrib plugin" />
@@ -134,7 +160,7 @@
<attribute name="Require-Bundle" value="edu.umd.cs.findbugs.plugin.eclipse" />
<attribute name="Bundle-ActivationPolicy" value="lazy" />
<attribute name="Export-Package" value="com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug" />
- <attribute name="Import-Package" value="edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bceledu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic" />
+ <attribute name="Import-Package" value="edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bcel, edu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic" />
</manifest>
</jar>
</target>
@@ -160,7 +186,7 @@
<target name="javadoc" depends="-init" description="build the javadoc for the project">
<javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api">
<doctitle><![CDATA[<h1>fb-contrib javadoc</h1>]]></doctitle>
- <bottom><![CDATA[<i>Copyright © 2005-2014 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
+ <bottom><![CDATA[<i>Copyright © 2005-2015 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
Modified: trunk/fb-contrib/etc/bugdescriptions.xsl
===================================================================
--- trunk/fb-contrib/etc/bugdescriptions.xsl 2014-07-26 03:46:13 UTC (rev 1775)
+++ trunk/fb-contrib/etc/bugdescriptions.xsl 2015-05-06 00:34:33 UTC (rev 1776)
@@ -40,6 +40,11 @@
<xsl:for-each select="//BugPattern[starts-with(@type,$abbrev)]">
<xsl:sort select="."/>
<li>
+ <a>
+ <xsl:attribute name="name">
+ <xsl:value-of select="@type"/>
+ </xsl:attribute>
+ </a>
<div class="bugcode">
<xsl:value-of select="@type"/>
</div>
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2014-07-26 03:46:13 UTC (rev 1775)
+++ trunk/fb-contrib/etc/bugrank.txt 2015-05-06 00:34:33 UTC (rev 1776)
@@ -1,135 +1,223 @@
-0 BugPattern ISB_INEFFICIENT_STRING_BUFFERING
-0 BugPattern ISB_EMPTY_STRING_APPENDING
-0 BugPattern SCI_SYNCHRONIZED_COLLECTION_ITERATORS
-0 BugPattern CC_CYCLOMATIC_COMPLEXITY
-0 BugPattern OCP_OVERLY_CONCRETE_PARAMETER
-0 BugPattern LII_LIST_INDEXED_ITERATING
-0 BugPattern UCC_UNRELATED_COLLECTION_CONTENTS
-0 BugPattern DRE_DECLARED_RUNTIME_EXCEPTION
-0 BugPattern CE_CLASS_ENVY
-0 BugPattern LSC_LITERAL_STRING_COMPARISON
-0 BugPattern PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS
-0 BugPattern DLC_DUBIOUS_LIST_COLLECTION
-0 BugPattern PL_PARALLEL_LISTS
-0 BugPattern FP_FINAL_PARAMETERS
-0 BugPattern ACEM_ABSTRACT_CLASS_EMPTY_METHODS
-0 BugPattern MAC_MANUAL_ARRAY_COPY
-0 BugPattern FPL_FLOATING_POINT_LOOPS
-0 BugPattern NCMU_NON_COLLECTION_METHOD_USE
-0 BugPattern CAO_CONFUSING_AUTOBOXED_OVERLOADING
-0 BugPattern AFBR_ABNORMAL_FINALLY_BLOCK_RETURN
-0 BugPattern SMII_STATIC_METHOD_INSTANCE_INVOCATION
-0 BugPattern STS_SPURIOUS_THREAD_STATES
-0 BugPattern NAB_NEEDLESS_AUTOBOXING_CTOR
-0 BugPattern NAB_NEEDLESS_BOXING_STRING_CTOR
-0 BugPattern NAB_NEEDLESS_AUTOBOXING_VALUEOF
-0 BugPattern NAB_NEEDLESS_BOXING_PARSE
-0 BugPattern NAB_NEEDLESS_BOXING_VALUEOF
-0 BugPattern NAB_NEEDLESS_BOX_TO_UNBOX
-0 BugPattern NAB_NEEDLESS_BOX_TO_CAST
-0 BugPattern NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION
-0 BugPattern USBR_UNNECESSARY_STORE_BEFORE_RETURN
-0 BugPattern COM_COPIED_OVERRIDDEN_METHOD
-0 BugPattern ABC_ARRAY_BASED_COLLECTIONS
-0 BugPattern ODN_ORPHANED_DOM_NODE
-0 BugPattern AOM_ABSTRACT_OVERRIDDEN_METHOD
-0 BugPattern CBX_CUSTOM_BUILT_XML
-0 BugPattern BSB_BLOATED_SYNCHRONIZED_BLOCK
-0 BugPattern CLI_CONSTANT_LIST_INDEX
-0 BugPattern SCR_SLOPPY_CLASS_REFLECTION
-0 BugPattern AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE
-0 BugPattern SG_SLUGGISH_GUI
-0 BugPattern NIR_NEEDLESS_INSTANCE_RETRIEVAL
-0 BugPattern DDC_DOUBLE_DATE_COMPARISON
-0 BugPattern SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT
-0 BugPattern JVR_JDBC_VENDOR_RELIANCE
-0 BugPattern PMB_POSSIBLE_MEMORY_BLOAT
-0 BugPattern LSYC_LOCAL_SYNCHRONIZED_COLLECTION
-0 BugPattern FCBL_FIELD_COULD_BE_LOCAL
-0 BugPattern NOS_NON_OWNED_SYNCHRONIZATION
-0 BugPattern NRTL_NON_RECYCLEABLE_TAG_LIB
-0 BugPattern S508C_NULL_LAYOUT
-0 BugPattern S508C_NO_SETLABELFOR
-0 BugPattern S508C_NO_SETSIZE
-0 BugPattern S508C_NON_ACCESSIBLE_JCOMPONENT
-0 BugPattern S508C_SET_COMP_COLOR
-0 BugPattern UEC_USE_ENUM_COLLECTIONS
-0 BugPattern SIL_SQL_IN_LOOP
-0 BugPattern NMCS_NEEDLESS_MEMBER_COLLECTION_SYNCHRONIZATION
-0 BugPattern ITC_INHERITANCE_TYPE_CHECKING
-0 BugPattern SACM_STATIC_ARRAY_CREATED_IN_METHOD
-0 BugPattern PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS
-0 BugPattern UTA_USE_TO_ARRAY
-0 BugPattern LEST_LOST_EXCEPTION_STACK_TRACE
-0 BugPattern UCPM_USE_CHARACTER_PARAMETERIZED_METHOD
-0 BugPattern TR_TAIL_RECURSION
-0 BugPattern URV_UNRELATED_RETURN_VALUES
-0 BugPattern URV_CHANGE_RETURN_TYPE
-0 BugPattern URV_INHERITED_METHOD_WITH_RELATED_TYPES
-0 BugPattern PIS_POSSIBLE_INCOMPLETE_SERIALIZATION
-0 BugPattern SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES
-0 BugPattern SPP_NEGATIVE_BITSET_ITEM
-0 BugPattern SPP_INTERN_ON_CONSTANT
-0 BugPattern SPP_NO_CHAR_SB_CTOR
-0 BugPattern SPP_USE_MATH_CONSTANT
-0 BugPattern SPP_STUTTERED_ASSIGNMENT
-0 BugPattern SPP_USE_ISNAN
-0 BugPattern SPP_USE_BIGDECIMAL_STRING_CTOR
-0 BugPattern SPP_STRINGBUFFER_WITH_EMPTY_STRING
-0 BugPattern SPP_EQUALS_ON_ENUM
-0 BugPattern SPP_INVALID_BOOLEAN_NULL_CHECK
-0 BugPattern SPP_USE_CHARAT
-0 BugPattern SPP_USELESS_TERNARY
-0 BugPattern SPP_SUSPECT_STRING_TEST
-0 BugPattern SPP_USE_STRINGBUILDER_LENGTH
-0 BugPattern SPP_INVALID_CALENDAR_COMPARE
-0 BugPattern SPP_USE_CONTAINSKEY
-0 BugPattern SPP_USE_ISEMPTY
-0 BugPattern SPP_USE_GETPROPERTY
-0 BugPattern SPP_SERIALVER_SHOULD_BE_PRIVATE
-0 BugPattern SPP_USELESS_CASING
-0 BugPattern SPP_CONVERSION_OF_STRING_LITERAL
-0 BugPattern BAS_BLOATED_ASSIGNMENT_SCOPE
-0 BugPattern SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTATOR
-0 BugPattern DWI_DELETING_WHILE_ITERATING
-0 BugPattern DWI_MODIFYING_WHILE_ITERATING
-0 BugPattern USS_USE_STRING_SPLIT
-0 BugPattern SJVU_SUSPICIOUS_JDK_VERSION_USE
-0 BugPattern UAA_USE_ADD_ALL
-0 BugPattern MRC_METHOD_RETURNS_C...
[truncated message content] |
|
From: <dbr...@us...> - 2015-05-26 03:14:31
|
Revision: 1778
http://sourceforge.net/p/fb-contrib/code/1778
Author: dbrosius
Date: 2015-05-26 03:14:28 +0000 (Tue, 26 May 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/NAB_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/build.xml 2015-05-26 03:14:28 UTC (rev 1778)
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.0.1" />
+ <property name="fb-contrib.version" value="6.1.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-05-26 03:14:28 UTC (rev 1778)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -34,7 +34,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -277,7 +277,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflictingTimeUnits" speed="fast" reports="CTU_CONFLICTING_TIME_UNITS" />
- <!-- COMMENT OUT FOR POINT RELEASE
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.detect.CharsetIssues" speed="fast" reports="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET,CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING,CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET_NAME" />
@@ -291,7 +291,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles" speed="fast" reports="CRF_CONFLATING_RESOURCES_AND_FILES" />
- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/etc/messages.xml 2015-05-26 03:14:28 UTC (rev 1778)
@@ -40,6 +40,10 @@
sb.append(a + b);
return sb.toString();
</pre>
+ You should use the .append method to append values
+ <pre>
+ sb.append(a).append(b);
+ </pre>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -2863,8 +2867,8 @@
</BugPattern>
<BugPattern type="SPP_STRINGBUFFER_WITH_EMPTY_STRING">
- <ShortDescription>Method passes empty string to StringBuffer of StringBuilder constructor</ShortDescription>
- <LongDescription>Method {1} passes empty string to StringBuffer of StringBuilder constructor</LongDescription>
+ <ShortDescription>Method passes an empty string to StringBuffer of StringBuilder constructor</ShortDescription>
+ <LongDescription>Method {1} passes an empty string to StringBuffer of StringBuilder constructor</LongDescription>
<Details>
<![CDATA[
<p>This method calls the StringBuffer or StringBuilder constructor passing in a constant empty string ("").
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/htdocs/index.shtml 2015-05-26 03:14:28 UTC (rev 1778)
@@ -68,9 +68,12 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.0.0 available for download
- <a href="http://sourceforge.net/projects/fb-contrib/files/Current/fb-contrib-6.0.0.jar/download">here</a>.</p>
- <p style="font-weight: bold;">This version requires FindBugs 3.0 or better</p>
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.0.1 available for download
+ <a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
+ <p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
+ <p style="font-weight: bold;">Please note that active development for this project is now done on
+ github. If this site seems behind, please <a href="http://github.com/mebigfatguy/fb-contrib">check there</a>.
+ I will try to keep this site up to date, but I'd appreciate a poke if you see something missing.</p>
</div>
<hr/>
@@ -98,6 +101,15 @@
Looks for string fields that appear to be built with parsing or calling
toString() on another object, or from objects that are fields.
</li>
+ <li><b>[SLS] Suspicious Loop Search</b><br/>
+ Looks for loops where an equality check is made and a variable is set because of it.
+ It would seem once the item is found, the loop can be terminated, but is not.
+ </li>
+ <li><b>[CRF] Conflating Resources and Files</b><br/>
+ Looks for code that uses the File api on URI/URLs where the reference is not a file based one.
+ In the case of classpath URIs, this may work if the classpath is resolving to a folder, but will
+ fall for jar files.
+ </li>
</ul>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/pom.xml 2015-05-26 03:14:28 UTC (rev 1778)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.0.1</version>
+ <version>6.1.0</version>
<parent>
<groupId>org.sonatype.oss</groupId>
Modified: trunk/fb-contrib/samples/BAS_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BAS_Sample.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/samples/BAS_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -165,6 +165,21 @@
return null;
}
+
+ public void testFPNestedIfs(Map<String, String> x, int i, boolean b) {
+
+ String s = x.get("hello");
+
+ if (i == 0) {
+ if (b) {
+ System.out.println(s);
+ }
+ } else if (i == 1) {
+ System.out.println(s);
+ } else if (i == 2) {
+ System.out.println(s);
+ }
+ }
static class Holder {
int member;
Modified: trunk/fb-contrib/samples/LO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/LO_Sample.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/samples/LO_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -20,6 +20,8 @@
private static Logger l4 = Logger.getLogger(ActionEvent.class.getName());
//no tag
private static Logger l5 = Logger.getLogger(LO_Sample.class.getName());
+ //no tag
+ private static Logger l6 = Logger.getLogger("my.nasty.logger.LOGGER");
//no tag
private Logger someLocalLogger;
Modified: trunk/fb-contrib/samples/NAB_Sample.java
===================================================================
--- trunk/fb-contrib/samples/NAB_Sample.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/samples/NAB_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -128,4 +128,9 @@
public Boolean testBooleanReturns() {
return true;
}
+
+ public Integer testfpTernary(Integer i, int[] data) {
+ Integer j = (i == null) ? data.length : i;
+ return j;
+ }
}
Modified: trunk/fb-contrib/samples/PRMC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/PRMC_Sample.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/samples/PRMC_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -1,4 +1,5 @@
import java.nio.ByteBuffer;
+import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
@@ -41,6 +42,11 @@
Factory.getInstance().fo();
Factory.getInstance().fum();
}
+
+ public void repeatedEmptyArrays() {
+ System.out.println(Arrays.asList(new Integer[0]));
+ System.out.println(Arrays.asList(new Integer[0]));
+ }
static class Factory {
private static Factory f = new Factory();
@@ -106,6 +112,11 @@
SAMPLE2 = new PRMC_Sample();
SAMPLE2.setValue(5);
}
+
+ public void fpAsListLiterals() {
+ System.out.println(Arrays.asList("foo"));
+ System.out.println(Arrays.asList("bar"));
+ }
public void setValue(int i) {
}
Modified: trunk/fb-contrib/samples/WOC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/WOC_Sample.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/samples/WOC_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -1,5 +1,6 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -18,6 +19,11 @@
private final List<String> fpList = new ArrayList<String>();
private List<String> fp1 = new ArrayList<String>();
private List<String> fp2 = new ArrayList<String>();
+ private List<String> fp3;
+
+ public WOC_Sample(List<String> x) {
+ fp3 = x;
+ }
public void testWOCSimple() {
//tag WOC_WRITE_ONLY_COLLECTION_LOCAL
@@ -141,6 +147,13 @@
}
l.add("Hello there");
}
+
+ public void fpClone(List<Data> l) {
+ HashSet<String> s = new HashSet<>();
+ for (Data d : l) {
+ d.ss = (Set<String>) s.clone();
+ }
+ }
public static class FpContains {
private List<String> fpSetList;
@@ -161,4 +174,12 @@
}
}
}
+
+ public void fpAddToCtorParm(String x) {
+ fp3.add(x);
+ }
+
+ private class Data {
+ Set<String> ss;
+ }
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -102,9 +102,10 @@
}
/**
- * implements the Detector with a nop
+ * implements the Detector with a noop
*/
@Override
public void report() {
+ //not used, part of the Detector interface
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -139,7 +139,7 @@
case BIPUSH:
case SIPUSH:
- size = getIntConstant();
+ size = Integer.valueOf(getIntConstant());
sizeSet = true;
break;
@@ -212,7 +212,7 @@
int reg = arrayItem.getRegisterNumber();
if ((reg >= 0) && !initializedRegs.get(reg)) {
- nullStoreToLocation.put(Integer.valueOf(reg), getPC());
+ nullStoreToLocation.put(Integer.valueOf(reg), Integer.valueOf(getPC()));
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -298,8 +298,6 @@
rootScopeBlock.addChild(sb);
} else {
sb.pushUpLoadStores();
- sb.setStart(pc);
- sb.setFinish(target);
}
} else {
sb = new ScopeBlock(pc, target);
@@ -370,7 +368,7 @@
rootScopeBlock.addChild(sb);
} else if (seen == MONITOREXIT) {
if (monitorSyncPCs.size() > 0) {
- ScopeBlock sb = findSynchronizedScopeBlock(rootScopeBlock, monitorSyncPCs.get(0));
+ ScopeBlock sb = findSynchronizedScopeBlock(rootScopeBlock, monitorSyncPCs.get(0).intValue());
if (sb != null)
sb.setFinish(pc);
monitorSyncPCs.remove(monitorSyncPCs.size() - 1);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -249,5 +249,6 @@
*/
@Override
public void report() {
+ // not used, supplied to support the Detector interface
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -81,6 +81,7 @@
*/
@Override
public void report() {
+ // not used, required by the Detector interface
}
/**
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -80,6 +80,7 @@
exceptionClasses.add(Repository.lookupClass("java/util/concurrent/CopyOnWriteArrayList"));
exceptionClasses.add(Repository.lookupClass("java/util/concurrent/CopyOnWriteArraySet"));
} catch (ClassNotFoundException cnfe) {
+ //don't have a bugReporter yet, so do nothing
}
collectionMethods = new HashSet<String>(3);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -46,6 +46,7 @@
setCls = Repository.lookupClass("java/util/Set");
mapCls = Repository.lookupClass("java/util/Map");
} catch (ClassNotFoundException cnfe) {
+ // np bugReporter yet, so ignore
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -370,6 +370,7 @@
if (loggingClassName != null) {
//first look at the constant passed in
loggingClassName = loggingClassName.replace('.', '/');
+ loggingPriority = LOW_PRIORITY;
} else if (userValue instanceof String){
//try the user value, which may have been set by a call to Foo.class.getName()
loggingClassName = (String) userValue;
@@ -383,6 +384,7 @@
if (loggingClassName != null) {
loggingClassName = loggingClassName.replace('.', '/');
}
+ loggingPriority = LOW_PRIORITY;
}
}
} else if ("org/apache/commons/logging/LogFactory".equals(callingClsName) && "getLog".equals(mthName)) {
@@ -400,6 +402,7 @@
if (loggingClassName != null) {
loggingClassName = loggingClassName.replace('.', '/');
}
+ loggingPriority = LOW_PRIORITY;
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -121,7 +121,7 @@
if (stack.getStackDepth() > 0) {
OpcodeStack.Item item = stack.getStackItem(0);
- int register = item.getRegisterNumber();
+ Integer register = Integer.valueOf(item.getRegisterNumber());
if (registerConstants.containsKey(register) && (registerConstants.get(register) == null)) {
methodSuspect = false;
return;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -360,6 +360,10 @@
item.setUserValue(null);
}
+ protected OpcodeStack getStack() {
+ return stack;
+ }
+
/**
* Checks to see if any of the locals or fields that we are tracking are passed into
* another method. If they are, we clear out our tracking of them, because we can't
@@ -378,6 +382,13 @@
}
}
+
+ /**
+ * informs the missing method detector that a field should no longer be considered special
+ */
+ protected void clearSpecialField(String name) {
+ fieldSpecialObjects.remove(name);
+ }
protected abstract BugInstance makeFieldBugInstance();
protected abstract BugInstance makeLocalBugInstance();
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -18,6 +18,7 @@
*/
package com.mebigfatguy.fbcontrib.detect;
+import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
@@ -29,15 +30,16 @@
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
-import edu.umd.cs.findbugs.BytecodeScanningDetector;
+import edu.umd.cs.findbugs.ba.ClassContext;
+import edu.umd.cs.findbugs.bcel.OpcodeStackDetector;
/**
* Looks for methods that pass a primitive wrapper class object, to the
* same classes Constructor.
*/
-public class NeedlessAutoboxing extends BytecodeScanningDetector
+public class NeedlessAutoboxing extends OpcodeStackDetector
{
- enum State {SEEN_NOTHING, SEEN_VALUE, SEEN_VALUEOFSTRING, SEEN_PARSE, SEEN_CTOR, SEEN_VALUEOFPRIMITIVE, SEEN_GOTO, SEEN_ICONST, SEEN_GETSTATIC}
+ enum State {SEEN_NOTHING, SEEN_VALUE, SEEN_VALUEOFSTRING, SEEN_PARSE, SEEN_CTOR, SEEN_VALUEOFPRIMITIVE, SEEN_ICONST, SEEN_GETSTATIC}
private static final Map<String, String[]> boxClasses = new HashMap<String, String[]>();
static {
@@ -65,6 +67,7 @@
private BugReporter bugReporter;
private State state;
private String boxClass;
+ private BitSet ternaryPCs;
/**
* constructs a NAB detector given the reporter to report bugs on
@@ -73,18 +76,33 @@
public NeedlessAutoboxing(BugReporter bugReporter) {
this.bugReporter = bugReporter;
}
-
+
@Override
+ public void visitClassContext(ClassContext classContext) {
+ try {
+ ternaryPCs = new BitSet();
+ super.visitClassContext(classContext);
+ } finally {
+ ternaryPCs = null;
+ }
+ }
+ @Override
public void visitMethod(Method obj) {
state = State.SEEN_NOTHING;
+ ternaryPCs.clear();
}
@Override
public void sawOpcode(int seen) {
+ if (ternaryPCs.get(getPC())) {
+ ternaryPCs.clear(getPC());
+ state = State.SEEN_NOTHING;
+ return;
+ }
+
switch (state) {
case SEEN_NOTHING:
- case SEEN_GOTO:
if (seen == INVOKEVIRTUAL) {
boxClass = getClassConstantOperand();
String[] boxSigs = boxClasses.get(boxClass);
@@ -135,7 +153,10 @@
state = State.SEEN_GETSTATIC;
}
} else if ((seen == GOTO) || (seen == GOTO_W)) {
- state = State.SEEN_GOTO;
+ if (stack.getStackDepth() > 0) {
+ ternaryPCs.set(getBranchTarget());
+ }
+ state = State.SEEN_NOTHING;
}
break;
@@ -254,6 +275,6 @@
state = State.SEEN_NOTHING;
sawOpcode(seen);
break;
- }
+ }
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -43,6 +43,7 @@
try {
serializableClass = Repository.lookupClass("java/io/Serializable");
} catch (ClassNotFoundException cnfe) {
+ // no bugReporter here, so do nothing
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -254,7 +254,7 @@
}
private static String getDeclaredAccessValue(int declaredAccess) {
- return DECLARED_ACCESS.get(declaredAccess & (Constants.ACC_PRIVATE|Constants.ACC_PROTECTED|Constants.ACC_PUBLIC));
+ return DECLARED_ACCESS.get(Integer.valueOf(declaredAccess & (Constants.ACC_PRIVATE|Constants.ACC_PROTECTED|Constants.ACC_PUBLIC)));
}
private static Object getRequiredAccessValue(MethodInfo mi) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -66,14 +66,10 @@
}
}
}
-
}
} catch (ClassNotFoundException cnfe) {
-
- } finally {
-
+ bugReporter.reportMissingClass(cnfe);
}
-
}
/**
@@ -132,5 +128,6 @@
@Override
public void report() {
+ // Unused, requirement of the Detector interface
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -247,11 +247,14 @@
} else if ((seen == INVOKEVIRTUAL) || (seen == INVOKEINTERFACE) || (seen == INVOKESTATIC)) {
String signature = getSigConstantOperand();
int parmCount = Type.getArgumentTypes(signature).length;
- int neededStackSize = parmCount - ((seen == INVOKESTATIC) ? 1 : 0);
+ int neededStackSize = parmCount - ((seen == INVOKESTATIC) ? 0 : 1);
if (stack.getStackDepth() > neededStackSize) {
Object[] parmConstants = new Object[parmCount];
for (int i = 0; i < parmCount; i++) {
OpcodeStack.Item parm = stack.getStackItem(i);
+ if ((parm.getSignature().charAt(0) == '[') && (!Values.ZERO.equals(parm.getConstant()))) {
+ return;
+ }
parmConstants[i] = parm.getConstant();
if (parmConstants[i] == null) {
return;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -113,7 +113,7 @@
bugReporter.reportBug(new BugInstance(this, BugType.PSC_PRESIZE_COLLECTIONS.name(), NORMAL_PRIORITY)
.addClass(this)
.addMethod(this)
- .addSourceLine(this, pcs.get(0)));
+ .addSourceLine(this, pcs.get(0).intValue()));
}
}
}
@@ -161,7 +161,7 @@
lines = new ArrayList<Integer>();
allocToAddPCs.put(allocNum, lines);
}
- lines.add(getPC());
+ lines.add(Integer.valueOf(getPC()));
}
}
}
@@ -180,7 +180,7 @@
lines = new ArrayList<Integer>();
allocToAddPCs.put(allocNum, lines);
}
- lines.add(getPC());
+ lines.add(Integer.valueOf(getPC()));
}
}
}
@@ -219,7 +219,7 @@
Integer allocLoc = allocLocation.get(entry.getKey());
if ((allocLoc != null) && (allocLoc.intValue() < target)) {
List<Integer> pcs = entry.getValue();
- for (Integer pc : pcs) {
+ for (int pc : pcs) {
if (pc > target) {
int numDownBranches = countDownBranches(target, pc);
if (numDownBranches == 1) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2015-05-06 00:39:22 UTC (rev 1777)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2015-05-26 03:14:28 UTC (rev 1778)
@@ -697,7 +697,7 @@
Integer stackOffset = methodsThatAr...
[truncated message content] |
|
From: <dbr...@us...> - 2015-05-31 15:00:00
|
Revision: 1779
http://sourceforge.net/p/fb-contrib/code/1779
Author: dbrosius
Date: 2015-05-31 14:59:57 +0000 (Sun, 31 May 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/CD_Sample.java
trunk/fb-contrib/samples/JAO_Sample.java
trunk/fb-contrib/samples/OPM_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/build.xml 2015-05-31 14:59:57 UTC (rev 1779)
@@ -18,7 +18,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.1.0" />
+ <property name="fb-contrib.version" value="6.2.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/etc/bugrank.txt 2015-05-31 14:59:57 UTC (rev 1779)
@@ -73,6 +73,7 @@
+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT
+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL
+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE
++2 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT
+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS
+0 BugPattern JVR_JDBC_VENDOR_RELIANCE
+0 BugPattern LEST_LOST_EXCEPTION_STACK_TRACE
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-05-31 14:59:57 UTC (rev 1779)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -34,7 +34,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
-<!-- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -172,7 +172,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics" speed="fast" reports="CFS_CONFUSING_FUNCTION_SEMANTICS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.JUnitAssertionOddities" speed="fast"
- reports="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT,JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED,JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS" />
+ reports="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT,JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED,JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS,JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm" speed="fast" reports="SCA_SUSPICIOUS_CLONE_ALGORITHM" />
@@ -277,21 +277,21 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflictingTimeUnits" speed="fast" reports="CTU_CONFLICTING_TIME_UNITS" />
- <!-- COMMENT OUT FOR POINT RELEASE -->
-
<Detector class="com.mebigfatguy.fbcontrib.detect.CharsetIssues" speed="fast" reports="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET,CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING,CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET_NAME" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ContainsBasedConditional" speed="fast" reports="CBC_CONTAINS_BASED_CONDITIONAL" />
-
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousLoopSearch" speed="fast" reports="SLS_SUSPICIOUS_LOOP_SEARCH" />
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles" speed="fast" reports="CRF_CONFLATING_RESOURCES_AND_FILES" />
+
+ <!-- COMMENT OUT FOR POINT RELEASE
+
<Detector class="com.mebigfatguy.fbcontrib.detect.OverlyPermissiveMethod" speed="fast" reports="OPM_OVERLY_PERMISSIVE_METHOD" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.ClassImpersonatingString" speed="fast" reports="CIS_STRING_PARSING_A_FIELD,CIS_TOSTRING_STORED_IN_FIELD" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ClassImpersonatingString" speed="fast" reports="CIS_STRING_PARSING_A_FIELD,CIS_TOSTRING_STORED_IN_FIELD" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousLoopSearch" speed="fast" reports="SLS_SUSPICIOUS_LOOP_SEARCH" />
-
- <Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles" speed="fast" reports="CRF_CONFLATING_RESOURCES_AND_FILES" />
-
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
@@ -399,8 +399,8 @@
<BugPattern abbrev="SPP" type="SPP_NON_USEFUL_TOSTRING" category="STYLE" />
<BugPattern abbrev="SPP" type="SPP_TOSTRING_ON_STRING" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_EQUALS_ON_STRING_BUILDER" category="CORRECTNESS" />
- <BugPattern abbrev="SPP" type="SPP_CONVERSION_OF_STRING_LITERAL" category="CORRECTNESS" experimental="true" />
- <BugPattern abbrev="SPP" type="SPP_STATIC_FORMAT_STRING" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="SPP" type="SPP_CONVERSION_OF_STRING_LITERAL" category="CORRECTNESS" />
+ <BugPattern abbrev="SPP" type="SPP_STATIC_FORMAT_STRING" category="CORRECTNESS" />
<BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" category="PERFORMANCE" />
<BugPattern abbrev="SCII" type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" category="STYLE" />
<BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" category="CORRECTNESS" />
@@ -422,6 +422,7 @@
<BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" category="CORRECTNESS" />
<BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED" category="CORRECTNESS" />
<BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS" category="CORRECTNESS" />
+ <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT" category="CORRECTNESS" />
<BugPattern abbrev="SCA" type="SCA_SUSPICIOUS_CLONE_ALGORITHM" category="CORRECTNESS" />
<BugPattern abbrev="WEM" type="WEM_WEAK_EXCEPTION_MESSAGING" category="STYLE" />
<BugPattern abbrev="SCSS" type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" category="CORRECTNESS" />
@@ -507,14 +508,14 @@
<BugPattern abbrev="HCP" type="HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_LOCAL" category="CORRECTNESS"/>
<BugPattern abbrev="HCP" type="HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD" category="CORRECTNESS"/>
<BugPattern abbrev="CTU" type="CTU_CONFLICTING_TIME_UNITS" category="CORRECTNESS" />
- <BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET_NAME" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="CBC" type="CBC_CONTAINS_BASED_CONDITIONAL" category="STYLE" experimental="true"/>
+ <BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET" category="CORRECTNESS"/>
+ <BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET_NAME" category="CORRECTNESS"/>
+ <BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING" category="CORRECTNESS"/>
+ <BugPattern abbrev="CBC" type="CBC_CONTAINS_BASED_CONDITIONAL" category="STYLE"/>
<BugPattern abbrev="OPM" type="OPM_OVERLY_PERMISSIVE_METHOD" category="STYLE" experimental="true" />
<BugPattern abbrev="CIS" type="CIS_STRING_PARSING_A_FIELD" category="STYLE" experimental="true" />
<BugPattern abbrev="CIS" type="CIS_TOSTRING_STORED_IN_FIELD" category="STYLE" experimental="true" />
- <BugPattern abbrev="SLS" type="SLS_SUSPICIOUS_LOOP_SEARCH" category="CORRECTNESS" experimental="true" />
- <BugPattern abbrev="CRF" type="CRF_CONFLATING_RESOURCES_AND_FILES" category="CORRECTNESS" experimental="true" />
+ <BugPattern abbrev="SLS" type="SLS_SUSPICIOUS_LOOP_SEARCH" category="CORRECTNESS" />
+ <BugPattern abbrev="CRF" type="CRF_CONFLATING_RESOURCES_AND_FILES" category="CORRECTNESS" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/etc/messages.xml 2015-05-31 14:59:57 UTC (rev 1779)
@@ -3500,6 +3500,19 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT">
+ <ShortDescription>Method appears to have no assertions</ShortDescription>
+ <LongDescription>Method {1} appears to have no assertions</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This JUnit test method has no assertions. While a unit test could still be valid if it relies on whether
+ or not an exception is thrown, it is usually a sign of a weak test if there are no assertions. It is also
+ possible that assertions occur in a called method that is not seen by this detector, but this makes the logic of
+ this test more difficult to reason about.</p>
+ ]]>
+ </Details>
+ </BugPattern>
<BugPattern type="SCA_SUSPICIOUS_CLONE_ALGORITHM">
<ShortDescription>Clone method stores a new value to member field of source object</ShortDescription>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/htdocs/index.shtml 2015-05-31 14:59:57 UTC (rev 1779)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.0.1 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.2.0 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
@@ -77,22 +77,15 @@
</div>
<hr/>
- <img id="git_image" src="flip2.gif" onClick="toggleBlock('git', 'git_image');" align="top"/>
+ <img id="git_image" src="flip1.gif" onClick="toggleBlock('git', 'git_image');" align="top"/>
Detectors added in git<br/>
- <div id="git" style="display:block;">
+ <div id="git" style="display:none;">
<ul>
<li><b>[STB] Stacked Try Blocks</b><br/>
Looks for two or more try catch blocks that are consecutive and catch the
same kind of exception, and throw the same exception always. These blocks can
be coalesced into one.
</li>
- <li><b>[CSI] Charset Issues</b><br/>
- Looks for issues related to manually specified charsets by using string literals.
- </li>
- <li><b>[CBC] Contains based Conditional</b><br/>
- Looks for complex if expressions made up of multiple conditions joined by OR, whereit is much cleaner
- to build a static set of the possible values, and use the contains method on that set.
- </li>
<li><b>[OPM] Overly Permissive Method</b><br/>
Looks for methods that are declared more permissively than the code is using. For instance, declaring
a method public, when it could just be declared private.
@@ -101,7 +94,21 @@
Looks for string fields that appear to be built with parsing or calling
toString() on another object, or from objects that are fields.
</li>
- <li><b>[SLS] Suspicious Loop Search</b><br/>
+ </ul>
+ </div>
+ <hr/>
+ <img id="v6_2_0_image" src="flip2.gif" onClick="toggleBlock('v6_2_0', 'v6_2_0_image');" align="top"/>
+ Detectors added in v6.2.0<br/>
+ <div id="v6_2_0" style="display:block;">
+ <ul>
+ <li><b>[CSI] Charset Issues</b><br/>
+ Looks for issues related to manually specified charsets by using string literals.
+ </li>
+ <li><b>[CBC] Contains based Conditional</b><br/>
+ Looks for complex if expressions made up of multiple conditions joined by OR, whereit is much cleaner
+ to build a static set of the possible values, and use the contains method on that set.
+ </li>
+ <li><b>[SLS] Suspicious Loop Search</b><br/>
Looks for loops where an equality check is made and a variable is set because of it.
It would seem once the item is found, the loop can be terminated, but is not.
</li>
@@ -110,14 +117,13 @@
In the case of classpath URIs, this may work if the classpath is resolving to a folder, but will
fall for jar files.
</li>
- </ul>
- </div>
-
+ </ul>
+ </div>
<hr/>
-
<img id="v6_0_0_image" src="flip1.gif" onClick="toggleBlock('v6_0_0', 'v6_0_0_image');" align="top"/>
Detectors added in v6.0.0<br/>
<div id="v6_0_0" style="display:none;">
+ <ul>
<li><b>[PSC] Presize Collections</b><br/>
Looks for methods that create and populate collections, and while knowing
the end size of those collections, does not pre allocate the collection
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/pom.xml 2015-05-31 14:59:57 UTC (rev 1779)
@@ -8,8 +8,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.1.0</version>
-
+ <version>6.2.0</version>
+
+ <prerequisites>
+ <maven>2.2.1</maven>
+ </prerequisites>
+
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
@@ -20,7 +24,7 @@
<description>An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.</description>
<url>http://fb-contrib.mebigfatguy.com</url>
<inceptionYear>2005</inceptionYear>
-
+
<developers>
<developer>
<id>dbrosius</id>
@@ -62,6 +66,10 @@
<contributor>
<name>Philippe Arteau</name>
</contributor>
+ <contributor>
+ <name>Thrawn</name>
+ <email>she...@ya...</email>
+ </contributor>
</contributors>
<licenses>
@@ -70,13 +78,13 @@
<url>http://www.gnu.org/licenses/lgpl.txt</url>
</license>
</licenses>
-
+
<scm>
- <connection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/trunk/</connection>
- <developerConnection>scm:svn:https://fb-contrib.svn.sourceforge.net/svnroot/fb-contrib/trunk/</developerConnection>
- <url>http://fb-contrib.svn.sourceforge.net/viewvc/fb-contrib/trunk/</url>
+ <connection>scm:git:https://github.com/mebigfatguy/fb-contrib/</connection>
+ <developerConnection>scm:git:https://github.com/mebigfatguy/fb-contrib/</developerConnection>
+ <url>https://github.com/mebigfatguy/fb-contrib/</url>
</scm>
-
+
<mailingLists>
<mailingList>
<name>fb-contrib-commit</name>
@@ -85,7 +93,7 @@
<post>fb-...@li...</post>
<archive>http://sourceforge.net/mailarchive/forum.php?forum_name=fb-contrib-commit</archive>
</mailingList>
-
+
<mailingList>
<name>fb-contrib-discuss</name>
<subscribe>https://lists.sourceforge.net/mailman/listinfo/fb-contrib-discuss</subscribe>
@@ -94,17 +102,18 @@
<archive>http://sourceforge.net/mailarchive/forum.php?forum_name=fb-contrib-discuss</archive>
</mailingList>
</mailingLists>
-
+
<issueManagement>
- <system>SourceForge.net Tracker</system>
- <url>http://sourceforge.net/tracker/?group_id=147536</url>
+ <system>GitHub</system>
+ <url>https://github.com/mebigfatguy/fb-contrib/issues/</url>
</issueManagement>
-
+
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <maven.build.timestamp.format>E MMM d hh:mm:ss yyyy XX</maven.build.timestamp.format>
</properties>
-
+
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
@@ -117,13 +126,13 @@
<artifactId>bcel-findbugs</artifactId>
<version>6.0</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
</dependencies>
<build>
@@ -132,6 +141,7 @@
<resource>
<directory>${basedir}</directory>
<includes>
+ <include>plugin.xml</include>
<include>license.txt</include>
</includes>
</resource>
@@ -149,67 +159,109 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
- <version>2.3</version>
+ <version>2.5</version>
</plugin>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <version>1.3</version>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.1</version>
+ <version>3.1</version>
+ <configuration>
+ <compilerArgument>-Xlint</compilerArgument>
+ </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
- <version>2.5</version>
+ <version>2.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
- <version>2.3</version>
+ <version>2.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.3</version>
+ <version>2.5</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <fb-contrib-version>${project.version}</fb-contrib-version>
+ <Main-Class>com.mebigfatguy.fbcontrib.FBContrib</Main-Class>
+ <git-revision>${scmBranch} ${buildNumber} ${maven.build.timestamp}</git-revision>
+ <Eclipse-RegisterBuddy>edu.umd.cs.findbugs.plugin.eclipse</Eclipse-RegisterBuddy>
+ <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+ <Bundle-Name>fb-contrib plugin</Bundle-Name>
+ <Bundle-SymbolicName>fb-contrib; singleton:=true</Bundle-SymbolicName>
+ <Bundle-Version>${project.version}</Bundle-Version>
+ <Bundle-ClassPath>.</Bundle-ClassPath>
+ <Bundle-Vendor>FB-Contrib Project</Bundle-Vendor>
+ <Require-Bundle>edu.umd.cs.findbugs.plugin.eclipse</Require-Bundle>
+ <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+ <Export-Package>com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug</Export-Package>
+ <Import-Package>edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bcel, edu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic</Import-Package>
+ </manifestEntries>
+ </archive>
+ </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1.2</version>
+ <version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.4.1</version>
+ <version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>2.0.1</version>
+ <version>3.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.1.1</version>
+ <version>2.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
+ <version>2.17</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Modified: trunk/fb-contrib/samples/CD_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CD_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/samples/CD_Sample.java 2015-05-31 14:59:57 UTC (rev 1779)
@@ -22,3 +22,21 @@
cds.toString();
}
}
+
+class Mammooth {
+ private int x;
+
+ static class Builder {
+ private int x;
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public Mammooth build() {
+ Mammooth m = new Mammooth();
+ m.x = x;
+ return m;
+ }
+ }
+}
Modified: trunk/fb-contrib/samples/JAO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/JAO_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/samples/JAO_Sample.java 2015-05-31 14:59:57 UTC (rev 1779)
@@ -1,7 +1,8 @@
+import junit.framework.TestCase;
+
import org.junit.Assert;
+import org.junit.Test;
-import junit.framework.TestCase;
-
public class JAO_Sample extends TestCase {
public void testExactDoubles(double d1, double d2) {
@@ -40,3 +41,18 @@
}
}
+
+class New {
+ @Test
+ public void nada() {
+ }
+
+ @Test
+ public void aha() {
+ check("hello", "world");
+ }
+
+ private void check(String a, String b) {
+ Assert.assertEquals(a, b);
+ }
+}
Modified: trunk/fb-contrib/samples/OPM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/OPM_Sample.java 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/samples/OPM_Sample.java 2015-05-31 14:59:57 UTC (rev 1779)
@@ -1,3 +1,5 @@
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@@ -22,16 +24,27 @@
List<String> l = getFoo(new ArrayList<String>());
}
+ @Override
public List<String> getFoo(List<String> l) {
return l;
}
public void fpUncalledDontReport() {
+ fpHasRTAnnotation();
}
+ @RT
+ public void fpHasRTAnnotation() {
+ }
+
}
abstract class OPMSuper {
public abstract List<String> getFoo(List<String> l);
}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface RT {
+
+}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2015-05-31 14:59:57 UTC (rev 1779)
@@ -298,6 +298,7 @@
rootScopeBlock.addChild(sb);
} else {
sb.pushUpLoadStores();
+ sb.setStart(pc);
}
} else {
sb = new ScopeBlock(pc, target);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2015-05-31 14:59:57 UTC (rev 1779)
@@ -69,6 +69,7 @@
private OpcodeStack stack;
private Set<String> declaredCheckedExceptions;
private boolean classIsFinal;
+ private boolean classIsAnonymous;
public BogusExceptionDeclaration(BugReporter bugReporter) {
this.bugReporter = bugReporter;
@@ -87,7 +88,9 @@
if ((runtimeExceptionClass != null) && (exceptionClass != null)) {
stack = new OpcodeStack();
declaredCheckedExceptions = new HashSet<String>(6);
- classIsFinal = classContext.getJavaClass().isFinal();
+ JavaClass cls = classContext.getJavaClass();
+ classIsFinal = cls.isFinal();
+ classIsAnonymous = cls.isAnonymous();
super.visitClassContext(classContext);
}
} finally {
@@ -107,9 +110,14 @@
declaredCheckedExceptions.clear();
stack.resetForMethodEntry(this);
Method method = getMethod();
+
+ if (method.isSynthetic()) {
+ return;
+ }
+
ExceptionTable et = method.getExceptionTable();
if (et != null) {
- if (classIsFinal || method.isStatic() || method.isPrivate() || method.isFinal() || ((Values.CONSTRUCTOR.equals(method.getName()) && !isAnonymousInnerCtor(method, getThisClass())))) {
+ if (classIsFinal || classIsAnonymous || method.isStatic() || method.isPrivate() || method.isFinal() || ((Values.CONSTRUCTOR.equals(method.getName()) && !isAnonymousInnerCtor(method, getThisClass())))) {
String[] exNames = et.getExceptionNames();
for (String exName : exNames) {
try {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java 2015-05-26 03:14:28 UTC (rev 1778)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java 2015-05-31 14:59:57 UTC (rev 1779)
@@ -78,6 +78,9 @@
if (refClsName.startsWith(clsName) && (clsName.indexOf('$') >= 0))
return;
+
+ if (isStaticChild(clsName, refClsName) || ...
[truncated message content] |
|
From: <dbr...@us...> - 2015-08-16 23:24:00
|
Revision: 1781
http://sourceforge.net/p/fb-contrib/code/1781
Author: dbrosius
Date: 2015-08-16 23:23:57 +0000 (Sun, 16 Aug 2015)
Log Message:
-----------
sync from githuh
Added Paths:
-----------
trunk/fb-contrib/samples/UTAO_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
Removed Paths:
-------------
trunk/fb-contrib/samples/JAO_Sample.java
trunk/fb-contrib/samples/samples.fb
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java
Deleted: trunk/fb-contrib/samples/JAO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/JAO_Sample.java 2015-08-16 23:20:38 UTC (rev 1780)
+++ trunk/fb-contrib/samples/JAO_Sample.java 2015-08-16 23:23:57 UTC (rev 1781)
@@ -1,58 +0,0 @@
-import junit.framework.TestCase;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class JAO_Sample extends TestCase {
-
- public void testExactDoubles(double d1, double d2) {
- Assert.assertEquals(d1, d2);
- }
-
- public void testTrue(boolean b) {
- Assert.assertEquals(true, b);
- }
-
- public void testFalse(boolean b) {
- Assert.assertEquals("Wow this is bad", false, b);
- }
-
- public void testWrongOrder(int i) {
- Assert.assertEquals(i, 10);
- }
-
- public void testAutoBoxNotNull(int i) {
- Assert.assertNotNull(i);
- Assert.assertNotNull(i == 3);
- }
-
- public void testAssertUsed(String s) {
- assert s != null;
- }
-
- public void testUseAssertEquals(String s, String s2) {
- Assert.assertTrue(s.equals(s2));
- Assert.assertTrue(s.length() == s.length());
- }
-
- public void test3ArgNP(float foo, int boo) {
- Assert.assertEquals(1.0f, foo, 0.1);
- Assert.assertEquals(20, boo, 0);
-
- }
-}
-
-class New {
- @Test
- public void nada() {
- }
-
- @Test
- public void aha() {
- check("hello", "world");
- }
-
- private void check(String a, String b) {
- Assert.assertEquals(a, b);
- }
-}
Added: trunk/fb-contrib/samples/UTAO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/UTAO_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/UTAO_Sample.java 2015-08-16 23:23:57 UTC (rev 1781)
@@ -0,0 +1,102 @@
+import org.junit.Assert;
+import org.junit.Test;
+
+import junit.framework.TestCase;
+
+public class UTAO_Sample extends TestCase {
+
+ public void testExactDoubles(double d1, double d2) {
+ Assert.assertEquals(d1, d2);
+ }
+
+ public void testTrue(boolean b) {
+ Assert.assertEquals(true, b);
+ }
+
+ public void testFalse(boolean b) {
+ Assert.assertEquals("Wow this is bad", false, b);
+ }
+
+ public void testWrongOrder(int i) {
+ Assert.assertEquals(i, 10);
+ }
+
+ public void testAutoBoxNotNull(int i) {
+ Assert.assertNotNull(i);
+ Assert.assertNotNull(i == 3);
+ }
+
+ public void testAssertUsed(String s) {
+ assert s != null;
+ }
+
+ public void testUseAssertEquals(String s, String s2) {
+ Assert.assertTrue(s.equals(s2));
+ Assert.assertTrue(s.length() == s.length());
+ }
+
+ public void test3ArgNP(float foo, int boo) {
+ Assert.assertEquals(1.0f, foo, 0.1);
+ Assert.assertEquals(20, boo, 0);
+
+ }
+}
+
+class New {
+ @Test
+ public void nada() {
+ }
+
+ @Test
+ public void aha() {
+ check("hello", "world");
+ }
+
+ private void check(String a, String b) {
+ Assert.assertEquals(a, b);
+ }
+}
+
+class TestNG {
+ @org.testng.annotations.Test
+ public void nada() {
+ }
+
+ @org.testng.annotations.Test
+ public void testTrue(boolean b) {
+ org.testng.Assert.assertEquals(b, true);
+ }
+
+ @org.testng.annotations.Test
+ public void testFalse(boolean b) {
+ org.testng.Assert.assertEquals(b, false, "Wow this is bad");
+ }
+
+ @org.testng.annotations.Test
+ public void testWrongOrder(int i) {
+ org.testng.Assert.assertEquals(10, i);
+ }
+
+ @org.testng.annotations.Test
+ public void testAutoBoxNotNull(int i) {
+ org.testng.Assert.assertNotNull(i);
+ org.testng.Assert.assertNotNull(i == 3);
+ }
+
+ @org.testng.annotations.Test
+ public void testAssertUsed(String s) {
+ assert s != null;
+ }
+
+ @org.testng.annotations.Test
+ public void testUseAssertEquals(String s, String s2) {
+ org.testng.Assert.assertTrue(s.equals(s2));
+ org.testng.Assert.assertTrue(s.length() == s.length());
+ }
+
+ @org.testng.annotations.Test
+ public void test3ArgNP(float foo, int boo) {
+ Assert.assertEquals(foo, 1.0f, 0.1);
+ Assert.assertEquals(boo, 20, 0);
+ }
+}
Property changes on: trunk/fb-contrib/samples/UTAO_Sample.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/fb-contrib/samples/samples.fb
===================================================================
--- trunk/fb-contrib/samples/samples.fb 2015-08-16 23:20:38 UTC (rev 1780)
+++ trunk/fb-contrib/samples/samples.fb 2015-08-16 23:23:57 UTC (rev 1781)
@@ -1,10 +0,0 @@
-[Jar files]
-.
-[Source dirs]
-.
-[Aux classpath entries]
-./lib/jsp-api.jar
-./lib/junit.jar
-./lib/servlet-api.jar
-[Options]
-relative_paths=true
Deleted: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java 2015-08-16 23:20:38 UTC (rev 1780)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JUnitAssertionOddities.java 2015-08-16 23:23:57 UTC (rev 1781)
@@ -1,287 +0,0 @@
-/*
- * fb-contrib - Auxiliary detectors for Java programs
- * Copyright (C) 2005-2015 Dave Brosius
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package com.mebigfatguy.fbcontrib.detect;
-
-import org.apache.bcel.Repository;
-import org.apache.bcel.classfile.AnnotationEntry;
-import org.apache.bcel.classfile.Code;
-import org.apache.bcel.classfile.JavaClass;
-import org.apache.bcel.classfile.Method;
-import org.apache.bcel.generic.Type;
-
-import com.mebigfatguy.fbcontrib.utils.BugType;
-import com.mebigfatguy.fbcontrib.utils.TernaryPatcher;
-
-import edu.umd.cs.findbugs.BugInstance;
-import edu.umd.cs.findbugs.BugReporter;
-import edu.umd.cs.findbugs.BytecodeScanningDetector;
-import edu.umd.cs.findbugs.OpcodeStack;
-import edu.umd.cs.findbugs.OpcodeStack.CustomUserValue;
-import edu.umd.cs.findbugs.ba.ClassContext;
-
-/** looks for odd uses of the Assert class of the JUnit framework */
-@CustomUserValue
-public class JUnitAssertionOddities extends BytecodeScanningDetector
-{
- private enum State {SAW_NOTHING, SAW_IF_ICMPNE, SAW_ICONST_1, SAW_GOTO, SAW_ICONST_0, SAW_EQUALS};
-
- private static final String TESTCASE_CLASS = "junit.framework.TestCase";
- private static final String TEST_CLASS = "org.junit.Test";
- private static final String TEST_ANNOTATION_SIGNATURE = "Lorg/junit/Test;";
- private static final String OLD_ASSERT_CLASS = "junit/framework/Assert";
- private static final String NEW_ASSERT_CLASS = "org/junit/Assert";
-
- private BugReporter bugReporter;
- private JavaClass testCaseClass;
- private JavaClass testAnnotationClass;
- private JavaClass cls;
- private OpcodeStack stack;
- private boolean isTestCaseDerived;
- private boolean isAnnotationCapable;
- private String clsName;
- private boolean sawAssert;
- private State state;
-
- /**
- * constructs a JOA detector given the reporter to report bugs on
- * @param bugReporter the sync of bug reports
- */
- public JUnitAssertionOddities(BugReporter bugReporter) {
- this.bugReporter = bugReporter;
-
- try {
- testCaseClass = Repository.lookupClass(TESTCASE_CLASS);
- } catch (ClassNotFoundException cnfe) {
- testCaseClass = null;
- }
- try {
- testAnnotationClass = Repository.lookupClass(TEST_CLASS);
- } catch (ClassNotFoundException cnfe) {
- testAnnotationClass = null;
- }
- }
-
- /**
- * override the visitor to see if this class could be a test class
- *
- * @param classContext the context object of the currently parsed class
- */
- @Override
- public void visitClassContext(ClassContext classContext) {
- try {
- cls = classContext.getJavaClass();
- clsName = cls.getClassName().replace('.', '/');
- isTestCaseDerived = ((testCaseClass != null) && cls.instanceOf(testCaseClass));
- isAnnotationCapable = (cls.getMajor() >= 5) && (testAnnotationClass != null);
- if (isTestCaseDerived || isAnnotationCapable) {
- stack = new OpcodeStack();
- super.visitClassContext(classContext);
- }
- } catch (ClassNotFoundException cnfe) {
- bugReporter.reportMissingClass(cnfe);
- } finally {
- stack = null;
- }
- }
-
- @Override
- public void visitCode(Code obj) {
- Method m = getMethod();
- boolean isTestMethod = isTestCaseDerived && m.getName().startsWith("test");
-
- if (!isTestMethod && isAnnotationCapable) {
- AnnotationEntry[] annotations = m.getAnnotationEntries();
- if (annotations != null) {
- for (AnnotationEntry annotation : annotations) {
- if (annotation.isRuntimeVisible() && TEST_ANNOTATION_SIGNATURE.equals(annotation.getAnnotationType())) {
- isTestMethod = true;
- break;
- }
- }
- }
- }
-
- if (isTestMethod) {
- stack.resetForMethodEntry(this);
- state = State.SAW_NOTHING;
- sawAssert = false;
- super.visitCode(obj);
-
-// if (!sawAssert) {
-// bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT.name(), LOW_PRIORITY)
-// .addClass(this)
-// .addMethod(this));
-// }
- }
- }
-
- @Override
- public void sawOpcode(int seen) {
- String userValue = null;
-
- try {
- stack.precomputation(this);
-
- if (seen == INVOKESTATIC) {
- String clsName = getClassConstantOperand();
- if (OLD_ASSERT_CLASS.equals(clsName) || NEW_ASSERT_CLASS.equals(clsName)) {
- sawAssert = true;
- String methodName = getNameConstantOperand();
- if ("assertEquals".equals(methodName)) {
- String signature = getSigConstantOperand();
- Type[] argTypes = Type.getArgumentTypes(signature);
- if ((argTypes.length == 2) || (argTypes.length ==3)) {
-
- if (stack.getStackDepth() >= 2) {
- OpcodeStack.Item item1 = stack.getStackItem(1);
- Object cons1 = item1.getConstant();
- if ((cons1 != null) && (argTypes[argTypes.length-1].equals(Type.BOOLEAN)) && (argTypes[argTypes.length-2].equals(Type.BOOLEAN))) {
- bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT.name(), NORMAL_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
- return;
- }
- OpcodeStack.Item item0 = stack.getStackItem(0);
- if ((item0.getConstant() != null) && (item1.getConstant() == null) && ((argTypes.length == 2) || !isFloatingPtPrimitive(item0.getSignature()))) {
- bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT.name(), NORMAL_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
- return;
- }
- if (argTypes[argTypes.length-1].equals(Type.OBJECT) && argTypes[argTypes.length-2].equals(Type.OBJECT)) {
- if ("Ljava/lang/Double;".equals(item0.getSignature()) && "Ljava/lang/Double;".equals(item1.getSignature())) {
- bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE.name(), NORMAL_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
- return;
- }
- }
- }
- }
- } else if ("assertNotNull".equals(methodName)) {
- if (stack.getStackDepth() > 0) {
- if ("valueOf".equals(stack.getStackItem(0).getUserValue())) {
- bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL.name(), NORMAL_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
- }
- }
- } else if ("assertTrue".equals(methodName)) {
- if ((state == State.SAW_ICONST_0) || (state == State.SAW_EQUALS)) {
- bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS.name(), NORMAL_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
- }
- }
- } else {
- String methodName = getNameConstantOperand();
- String sig = getSigConstantOperand();
- if (clsName.startsWith("java/lang/")
- && "valueOf".equals(methodName)
- && (sig.indexOf(")Ljava/lang/") >= 0)) {
- userValue = "valueOf";
- }
- }
- } else if (seen == ATHROW) {
- if (stack.getStackDepth() > 0) {
- OpcodeStack.Item item = stack.getStackItem(0);
- String throwClass = item.getSignature();
- if ("Ljava/lang/AssertionError;".equals(throwClass)) {
- bugReporter.reportBug(new BugInstance(this, BugType.JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED.name(), NORMAL_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
- sawAssert = true;
- }
- }
- }
-
- switch (state) {
- case SAW_NOTHING:
- case SAW_EQUALS:
- if (seen == IF_ICMPNE)
- state = State.SAW_IF_ICMPNE;
- else
- state = State.SAW_NOTHING;
- break;
-
- case SAW_IF_ICMPNE:
- if (seen == ICONST_1)
- state = State.SAW_ICONST_1;
- else
- state = State.SAW_NOTHING;
- break;
-
- case SAW_ICONST_1:
- if (seen == GOTO)
- state = State.SAW_GOTO;
- else
- state = State.SAW_NOTHING;
- break;
-
- case SAW_GOTO:
- if (seen == ICONST_0)
- state = State.SAW_ICONST_0;
- else
- state = State.SAW_NOTHING;
- break;
-
- default:
- state = State.SAW_NOTHING;
- break;
- }
-
- if ((seen == INVOKEVIRTUAL) || (seen == INVOKESTATIC) || (seen == INVOKESPECIAL)) {
- String lcName = getNameConstantOperand().toLowerCase();
- if (seen == INVOKEVIRTUAL) {
- String sig = getSigConstantOperand();
- if ("equals".equals(lcName) && "(Ljava/lang/Object;)Z".equals(sig)) {
- state = State.SAW_EQUALS;
- }
- }
-
- //assume that if you call a method in the unit test class, or call a method with assert of verify in them
- //it's possibly doing asserts for you. Yes this is a hack
-
- if (clsName.equals(getClassConstantOperand()) || lcName.contains("assert") || lcName.contains("verify")) {
- sawAssert = true;
- }
- }
-
-
- } finally {
- TernaryPatcher.pre(stack, seen);
- stack.sawOpcode(this, seen);
- TernaryPatcher.post(stack, seen);
- if ((userValue != null) && (stack.getStackDepth() > 0)) {
- OpcodeStack.Item item = stack.getStackItem(0);
- item.setUserValue(userValue);
- }
- }
- }
-
- public boolean isFloatingPtPrimitive(String signature) {
- return "D".equals(signature) || "F".equals(signature);
- }
-}
Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java (rev 0)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java 2015-08-16 23:23:57 UTC (rev 1781)
@@ -0,0 +1,359 @@
+/*
+ * fb-contrib - Auxiliary detectors for Java programs
+ * Copyright (C) 2005-2015 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.fbcontrib.detect;
+
+import org.apache.bcel.Repository;
+import org.apache.bcel.classfile.AnnotationEntry;
+import org.apache.bcel.classfile.Code;
+import org.apache.bcel.classfile.JavaClass;
+import org.apache.bcel.classfile.Method;
+import org.apache.bcel.generic.Type;
+
+import com.mebigfatguy.fbcontrib.utils.BugType;
+import com.mebigfatguy.fbcontrib.utils.TernaryPatcher;
+
+import edu.umd.cs.findbugs.BugInstance;
+import edu.umd.cs.findbugs.BugReporter;
+import edu.umd.cs.findbugs.BytecodeScanningDetector;
+import edu.umd.cs.findbugs.OpcodeStack;
+import edu.umd.cs.findbugs.OpcodeStack.CustomUserValue;
+import edu.umd.cs.findbugs.ba.ClassContext;
+
+/** looks for odd uses of the Assert class of the JUnit and TestNG framework */
+@CustomUserValue
+public class UnitTestAssertionOddities extends BytecodeScanningDetector {
+ private enum State {
+ SAW_NOTHING, SAW_IF_ICMPNE, SAW_ICONST_1, SAW_GOTO, SAW_ICONST_0, SAW_EQUALS
+ };
+
+ private enum TestFrameworkType {
+ UNKNOWN, JUNIT, TESTNG;
+ }
+
+ private static final String TESTCASE_CLASS = "junit.framework.TestCase";
+ private static final String TEST_CLASS = "org.junit.Test";
+ private static final String TEST_ANNOTATION_SIGNATURE = "Lorg/junit/Test;";
+ private static final String OLD_ASSERT_CLASS = "junit/framework/Assert";
+ private static final String NEW_ASSERT_CLASS = "org/junit/Assert";
+
+ private static final String TESTNG_CLASS = "org.testng.annotations.Test";
+ private static final String TESTNG_ANNOTATION_SIGNATURE = "Lorg/testng/annotations/Test;";
+ private static final String NG_ASSERT_CLASS = "org/testng/Assert";
+ private static final String NG_JUNIT_ASSERT_CLASS = "org/testng/AssertJUnit";
+
+ private BugReporter bugReporter;
+ private JavaClass testCaseClass;
+ private JavaClass testAnnotationClass;
+ private JavaClass testNGAnnotationClass;
+ private OpcodeStack stack;
+ private boolean isTestCaseDerived;
+ private boolean isAnnotationCapable;
+ private String clsName;
+ private boolean sawAssert;
+ private State state;
+ private TestFrameworkType frameworkType;
+
+ /**
+ * constructs a JOA detector given the reporter to report bugs on
+ *
+ * @param bugReporter
+ * the sync of bug reports
+ */
+ public UnitTestAssertionOddities(BugReporter bugReporter) {
+ this.bugReporter = bugReporter;
+
+ try {
+ testCaseClass = Repository.lookupClass(TESTCASE_CLASS);
+ } catch (ClassNotFoundException cnfe) {
+ testCaseClass = null;
+ }
+ try {
+ testAnnotationClass = Repository.lookupClass(TEST_CLASS);
+ } catch (ClassNotFoundException cnfe) {
+ testAnnotationClass = null;
+ }
+
+ try {
+ testNGAnnotationClass = Repository.lookupClass(TESTNG_CLASS);
+ } catch (ClassNotFoundException cnfe) {
+ testNGAnnotationClass = null;
+ }
+ }
+
+ /**
+ * override the visitor to see if this class could be a test class
+ *
+ * @param classContext
+ * the context object of the currently parsed class
+ */
+ @Override
+ public void visitClassContext(ClassContext classContext) {
+ try {
+ JavaClass cls = classContext.getJavaClass();
+ clsName = cls.getClassName().replace('.', '/');
+ isTestCaseDerived = (testCaseClass != null) && cls.instanceOf(testCaseClass);
+ isAnnotationCapable = (cls.getMajor() >= 5) && ((testAnnotationClass != null) || (testNGAnnotationClass != null));
+ if (isTestCaseDerived || isAnnotationCapable) {
+ stack = new OpcodeStack();
+ super.visitClassContext(classContext);
+ }
+ } catch (ClassNotFoundException cnfe) {
+ bugReporter.reportMissingClass(cnfe);
+ } finally {
+ stack = null;
+ }
+ }
+
+ @Override
+ public void visitCode(Code obj) {
+ Method m = getMethod();
+ frameworkType = isTestCaseDerived && m.getName().startsWith("test") ? TestFrameworkType.JUNIT : TestFrameworkType.UNKNOWN;
+
+ if ((frameworkType == TestFrameworkType.UNKNOWN) && isAnnotationCapable) {
+ AnnotationEntry[] annotations = m.getAnnotationEntries();
+ if (annotations != null) {
+ for (AnnotationEntry annotation : annotations) {
+ String annotationType = annotation.getAnnotationType();
+ if (annotation.isRuntimeVisible()) {
+ if (TEST_ANNOTATION_SIGNATURE.equals(annotationType)) {
+ frameworkType = TestFrameworkType.JUNIT;
+ break;
+ } else if (TESTNG_ANNOTATION_SIGNATURE.equals(annotationType)) {
+ frameworkType = TestFrameworkType.TESTNG;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (frameworkType != TestFrameworkType.UNKNOWN) {
+ stack.resetForMethodEntry(this);
+ state = State.SAW_NOTHING;
+ sawAssert = false;
+ super.visitCode(obj);
+
+ if (!sawAssert) {
+ bugReporter.reportBug(new BugInstance(this, frameworkType == TestFrameworkType.JUNIT ? BugType.UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT.name()
+ : BugType.UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT.name(), LOW_PRIORITY).addClass(this).addMethod(this));
+ }
+ }
+ }
+
+ @Override
+ public void sawOpcode(int seen) {
+ String userValue = null;
+
+ try {
+ stack.precomputation(this);
+
+ if (seen == INVOKESTATIC) {
+ String clsName = getClassConstantOperand();
+ if (OLD_ASSERT_CLASS.equals(clsName) || NEW_ASSERT_CLASS.equals(clsName) || NG_JUNIT_ASSERT_CLASS.equals(clsName)) {
+ sawAssert = true;
+ String methodName = getNameConstantOperand();
+ if ("assertEquals".equals(methodName)) {
+ String signature = getSigConstantOperand();
+ Type[] argTypes = Type.getArgumentTypes(signature);
+ if ((argTypes.length == 2) || (argTypes.length == 3)) {
+
+ if (stack.getStackDepth() >= 2) {
+ OpcodeStack.Item expectedItem = stack.getStackItem(1);
+ Object cons1 = expectedItem.getConstant();
+ if ((cons1 != null) && argTypes[argTypes.length - 1].equals(Type.BOOLEAN)
+ && argTypes[argTypes.length - 2].equals(Type.BOOLEAN)) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ return;
+ }
+ OpcodeStack.Item item0 = stack.getStackItem(0);
+ if ((item0.getConstant() != null) && (expectedItem.getConstant() == null)
+ && ((argTypes.length == 2) || !isFloatingPtPrimitive(item0.getSignature()))) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ return;
+ }
+ if (argTypes[argTypes.length - 1].equals(Type.OBJECT) && argTypes[argTypes.length - 2].equals(Type.OBJECT)) {
+ if ("Ljava/lang/Double;".equals(item0.getSignature()) && "Ljava/lang/Double;".equals(expectedItem.getSignature())) {
+ bugReporter
+ .reportBug(new BugInstance(this, BugType.UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ return;
+ }
+ }
+ }
+ }
+ } else if ("assertNotNull".equals(methodName)) {
+ if (stack.getStackDepth() > 0) {
+ if ("valueOf".equals(stack.getStackItem(0).getUserValue())) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ }
+ }
+ } else if ("assertTrue".equals(methodName)) {
+ if ((state == State.SAW_ICONST_0) || (state == State.SAW_EQUALS)) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ }
+ }
+ } else if (NG_ASSERT_CLASS.equals(clsName)) {
+ sawAssert = true;
+ String methodName = getNameConstantOperand();
+ if ("assertEquals".equals(methodName)) {
+ String signature = getSigConstantOperand();
+ Type[] argTypes = Type.getArgumentTypes(signature);
+ if ((argTypes.length == 2) || (argTypes.length == 3)) {
+
+ OpcodeStack.Item actualItem, expectedItem;
+ if ((argTypes.length == 2) && (stack.getStackDepth() >= 2)) {
+ expectedItem = stack.getStackItem(0);
+ actualItem = stack.getStackItem(1);
+ } else if ((argTypes.length == 3) && (stack.getStackDepth() >= 3)) {
+ expectedItem = stack.getStackItem(1);
+ actualItem = stack.getStackItem(2);
+ } else {
+ return;
+ }
+
+ Object cons1 = expectedItem.getConstant();
+ if ((cons1 != null) && argTypes[argTypes.length - 1].equals(Type.BOOLEAN) && argTypes[argTypes.length - 2].equals(Type.BOOLEAN)) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ return;
+ }
+ if ((actualItem.getConstant() != null) && (expectedItem.getConstant() == null)
+ && ((argTypes.length == 2) || !isFloatingPtPrimitive(actualItem.getSignature()))) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT.name(), NORMAL_PRIORITY)
+ .addClass(this).addMethod(this).addSourceLine(this));
+ return;
+ }
+ if (argTypes[argTypes.length - 1].equals(Type.OBJECT) && argTypes[argTypes.length - 2].equals(Type.OBJECT)) {
+ if ("Ljava/lang/Double;".equals(actualItem.getSignature()) && "Ljava/lang/Double;".equals(expectedItem.getSignature())) {
+ bugReporter.reportBug(new BugInstance(this, BugType.UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE.name(), NORMAL_PRIORITY)
+ ...
[truncated message content] |
|
From: <dbr...@us...> - 2015-08-16 23:20:43
|
Revision: 1780
http://sourceforge.net/p/fb-contrib/code/1780
Author: dbrosius
Date: 2015-08-16 23:20:38 +0000 (Sun, 16 Aug 2015)
Log Message:
-----------
sync from githuh
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.properties
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/ABC_Sample.java
trunk/fb-contrib/samples/AIOB_Sample.java
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/BED_Sample.java
trunk/fb-contrib/samples/CBC_Sample.java
trunk/fb-contrib/samples/CD_Sample.java
trunk/fb-contrib/samples/CIS_Sample.java
trunk/fb-contrib/samples/CNC_Sample.java
trunk/fb-contrib/samples/COM_Sample.java
trunk/fb-contrib/samples/CRF_Sample.java
trunk/fb-contrib/samples/CSI_Sample.java
trunk/fb-contrib/samples/CTU_Sample.java
trunk/fb-contrib/samples/CU_Sample.java
trunk/fb-contrib/samples/DRE_Sample.java
trunk/fb-contrib/samples/EXS_Sample.java
trunk/fb-contrib/samples/FCBL_Sample.java
trunk/fb-contrib/samples/HCP_Sample.java
trunk/fb-contrib/samples/HES_Sample.java
trunk/fb-contrib/samples/ICA_Sample.java
trunk/fb-contrib/samples/ISB_Sample.java
trunk/fb-contrib/samples/LEST_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/LSC_Sample.java
trunk/fb-contrib/samples/LSYC_Sample.java
trunk/fb-contrib/samples/MDM_Sample.java
trunk/fb-contrib/samples/MRC_Sample.java
trunk/fb-contrib/samples/MUC_Sample.java
trunk/fb-contrib/samples/NAB_Sample.java
trunk/fb-contrib/samples/NMCS_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/OPM_Sample.java
trunk/fb-contrib/samples/PCAIL_Sample.java
trunk/fb-contrib/samples/PMB_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/SCII_Sample.java
trunk/fb-contrib/samples/SCRV_Sample.java
trunk/fb-contrib/samples/SC_Sample.java
trunk/fb-contrib/samples/SG_Sample.java
trunk/fb-contrib/samples/SLS_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/SUA_Sample.java
trunk/fb-contrib/samples/UCPM_Sample.java
trunk/fb-contrib/samples/UMTP_Sample.java
trunk/fb-contrib/samples/UP_Sample.java
trunk/fb-contrib/samples/UVA_Sample.java
trunk/fb-contrib/samples/WEM_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/StatisticsKey.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassImpersonatingString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StutteredMethodArguments.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TailRecursion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/PublicAPI.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/yank.xls
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2015-05-31 14:59:57 UTC (rev 1779)
+++ trunk/fb-contrib/.classpath 2015-08-16 23:20:38 UTC (rev 1780)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry excluding="**/*.*" kind="src" path="etc"/>
<classpathentry kind="src" path="src"/>
- <classpathentry excluding="lib/" kind="src" path="samples"/>
+ <classpathentry excluding="lib/" kind="src" output="target/classes/samples" path="samples"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/backport-util-concurrent-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
@@ -26,5 +26,6 @@
<classpathentry kind="lib" path="lib/findbugs-3.0.1.jar" sourcepath="lib/sources/findbugs-3.0.1-sources.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
- <classpathentry kind="output" path="classes"/>
+ <classpathentry kind="lib" path="lib/testng-6.9.6.jar"/>
+ <classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.properties
===================================================================
--- trunk/fb-contrib/build.properties 2015-05-31 14:59:57 UTC (rev 1779)
+++ trunk/fb-contrib/build.properties 2015-08-16 23:20:38 UTC (rev 1780)
@@ -6,6 +6,6 @@
source.. = src/,\
etc/,\
samples/
-output.. = classes/
+output.. = target/classes/main
proxy.server =
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-05-31 14:59:57 UTC (rev 1779)
+++ trunk/fb-contrib/build.xml 2015-08-16 23:20:38 UTC (rev 1780)
@@ -7,40 +7,33 @@
<property file="version.properties" />
<property name="src.dir" value="${basedir}/src" />
- <property name="classes.dir" value="${basedir}/classes" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="etc.dir" value="${basedir}/etc" />
+ <property name="target.dir" value="${basedir}/target" />
<property name="samples.dir" value="${basedir}/samples" />
- <property name="javadoc.dir" value="${basedir}/javadoc" />
+ <property name="main.classes.dir" value="${target.dir}/classes/main" />
+ <property name="samples.classes.dir" value="${target.dir}/classes/samples" />
+ <property name="javadoc.dir" value="${target.dir}/javadoc" />
<property name="htdocs.dir" value="${basedir}/htdocs" />
<property name="javac.source" value="1.6" />
<property name="javac.target" value="1.6" />
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.2.0" />
+ <property name="fb-contrib.version" value="6.3.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
<target name="clean" description="removes all generated collateral">
- <delete dir="${classes.dir}" />
- <delete dir="${javadoc.dir}" />
+ <delete dir="${target.dir}" />
<delete file="${htdocs.dir}/bugdescriptions.html" />
- <delete file="${basedir}/fb-contrib-${fb-contrib.version}.jar" />
- <delete file="${basedir}/fb-contrib-src-${fb-contrib.version}.zip" />
- <delete>
- <fileset dir="${samples.dir}">
- <include name="**/*.class" />
- </fileset>
- </delete>
- <delete dir="${basedir}/plugin" />
</target>
<target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib">
<mkdir dir="${user.home}/.ant/lib" />
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/>
<get src="https://bitbucket.org/klubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
- <get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.2.0/vcsversion-0.2.0.jar" dest="${user.home}/.ant/lib"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/>
</target>
<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
@@ -76,7 +69,8 @@
<target name="-init" depends="yank">
<mkdir dir="${lib.dir}" />
- <mkdir dir="${classes.dir}" />
+ <mkdir dir="${main.classes.dir}" />
+ <mkdir dir="${samples.classes.dir}" />
<mkdir dir="${javadoc.dir}" />
<path id="fb-contrib.classpath">
<pathelement location="${lib.dir}/findbugs-${findbugs.version}.jar" />
@@ -87,6 +81,7 @@
<path id="fb-contrib.samples.classpath">
<pathelement location="${lib.dir}/javax.servlet.jsp-api-${javax.servlet.jsp-api.version}.jar" />
<pathelement location="${lib.dir}/junit-${junit.version}.jar" />
+ <pathelement location="${lib.dir}/testng-${testng.version}.jar" />
<pathelement location="${lib.dir}/javax.servlet-api-${javax.servlet-api.version}.jar" />
<pathelement location="${lib.dir}/log4j-${log4j.version}.jar" />
<pathelement location="${lib.dir}/commons-lang3-${commons-lang3.version}.jar" />
@@ -111,19 +106,19 @@
</target>
<target name="compile" depends="-init" description="compiles java files">
- <javac srcdir="${src.dir}" destdir="${classes.dir}" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
+ <javac srcdir="${src.dir}" destdir="${main.classes.dir}" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
<classpath refid="fb-contrib.classpath" />
</javac>
</target>
<target name="compile_samples" depends="-init" description="compiles sample problem files">
- <javac srcdir="${samples.dir}" destdir="${samples.dir}" source="1.7" target="1.7" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
+ <javac srcdir="${samples.dir}" destdir="${samples.classes.dir}" source="1.7" target="1.7" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
<compilerarg value="-XDignore.symbol.file"/>
<classpath refid="fb-contrib.classpath" />
<classpath refid="fb-contrib.samples.classpath" />
</javac>
<delete file="${samples.dir}/SJVU_Sample.class" />
- <javac srcdir="${samples.dir}" destdir="${samples.dir}" source="1.4" target="1.4" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
+ <javac srcdir="${samples.dir}" destdir="${samples.classes.dir}" source="1.4" target="1.4" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
<include name="SJVU_Sample.java" />
<classpath refid="fb-contrib.classpath" />
<classpath refid="fb-contrib.samples.classpath" />
@@ -132,14 +127,14 @@
<target name="jar" depends="compile" xmlns:vcs="antlib:com.mebigfatguy.vcsversion" description="produces the fb-contrib jar file">
<vcs:vcsversion vcs="git" revisionProperty="_rev_" dateProperty="_date_" branchProperty="_branch_"/>
- <jar destfile="${basedir}/fb-contrib-${fb-contrib.version}.jar">
+ <jar destfile="${target.dir}/fb-contrib-${fb-contrib.version}.jar">
<fileset dir="etc">
<include name="findbugs.xml" />
<include name="messages*.xml" />
<include name="bugrank.txt" />
<include name="*.license" />
</fileset>
- <fileset dir="${classes.dir}">
+ <fileset dir="${main.classes.dir}">
<include name="**/*.class" />
</fileset>
<fileset dir="${basedir}">
@@ -159,7 +154,7 @@
<attribute name="Bundle-Vendor" value="FB-Contrib Project" />
<attribute name="Require-Bundle" value="edu.umd.cs.findbugs.plugin.eclipse" />
<attribute name="Bundle-ActivationPolicy" value="lazy" />
- <attribute name="Export-Package" value="com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug" />
+ <attribute name="Export-Package" value="com.mebigfatguy.fbcontrib, com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug, com.mebigfatguy.fbcontrib.utils" />
<attribute name="Import-Package" value="edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bcel, edu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic" />
</manifest>
</jar>
@@ -170,7 +165,7 @@
</target>
<target name="srczip" description="builds the source distribution zip file">
- <zip destfile="${basedir}/fb-contrib-src-${fb-contrib.version}.zip">
+ <zip destfile="${target.dir}/fb-contrib-src-${fb-contrib.version}.zip">
<fileset dir="${basedir}">
<include name="**/*.java" />
<include name="**/*.xml" />
@@ -196,7 +191,7 @@
<target name="install" depends="build" description="installs the plugin into FindBugs">
<echo message="Findbugs: ${findbugs.dir}/plugin"/>
<copy todir="${findbugs.dir}/plugin">
- <fileset dir="${basedir}">
+ <fileset dir="${target.dir}">
<include name="fb-contrib-${fb-contrib.version}.jar" />
</fileset>
</copy>
@@ -206,9 +201,9 @@
<target name="sonatype" depends="release" description="prepare an artifact bundle for sonatype">
<mkdir dir="${sonatype.dir}"/>
- <copy todir="${sonatype.dir}" file="${basedir}/fb-contrib-${fb-contrib.version}.jar"/>
- <copy tofile="${sonatype.dir}/fb-contrib-${fb-contrib.version}-sources.jar" file="${basedir}/fb-contrib-src-${fb-contrib.version}.zip"/>
- <jar destfile="${sonatype.dir}/fb-contrib-${fb-contrib.version}-javadoc.jar" basedir="${basedir}" includes="javadoc/**"/>
+ <copy todir="${sonatype.dir}" file="${target.dir}/fb-contrib-${fb-contrib.version}.jar"/>
+ <copy tofile="${sonatype.dir}/fb-contrib-${fb-contrib.version}-sources.jar" file="${target.dir}/fb-contrib-src-${fb-contrib.version}.zip"/>
+ <jar destfile="${sonatype.dir}/fb-contrib-${fb-contrib.version}-javadoc.jar" basedir="${target.dir}" includes="javadoc/**"/>
<copy tofile="${sonatype.dir}/fb-contrib-${fb-contrib.version}.pom" file="${basedir}/pom.xml"/>
<exec executable="gpg">
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2015-05-31 14:59:57 UTC (rev 1779)
+++ trunk/fb-contrib/etc/bugrank.txt 2015-08-16 23:20:38 UTC (rev 1780)
@@ -27,6 +27,7 @@
+0 BugPattern CLI_CONSTANT_LIST_INDEX
+0 BugPattern CNC_COLLECTION_NAMING_CONFUSION
+0 BugPattern COM_COPIED_OVERRIDDEN_METHOD
++0 BugPattern COM_PARENT_DELEGATED_CALL
+0 BugPattern CRF_CONFLATING_RESOURCES_AND_FILES
+0 BugPattern CSBTS_COMMONS_STRING_BUILDER_TOSTRING
+0 BugPattern CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING
@@ -68,13 +69,6 @@
+0 BugPattern ISB_TOSTRING_APPENDING
+0 BugPattern ITC_INHERITANCE_TYPE_CHECKING
+2 BugPattern ITU_INAPPROPRIATE_TOSTRING_USE
-+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT
-+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED
-+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT
-+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL
-+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE
-+2 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT
-+0 BugPattern JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS
+0 BugPattern JVR_JDBC_VENDOR_RELIANCE
+0 BugPattern LEST_LOST_EXCEPTION_STACK_TRACE
+0 BugPattern LGO_LINGERING_GRAPHICS_OBJECT
@@ -217,8 +211,23 @@
+0 BugPattern URV_UNRELATED_RETURN_VALUES
+0 BugPattern USBR_UNNECESSARY_STORE_BEFORE_RETURN
+0 BugPattern USS_USE_STRING_SPLIT
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE
++2 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_ASSERT_USED
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_IMPOSSIBLE_NULL
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE
++2 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_EQUALS
+0 BugPattern UTA_USE_TO_ARRAY
+0 BugPattern UVA_USE_VAR_ARGS
++0 BugPattern WEM_OBSCURING_EXCEPTION
+0 BugPattern WEM_WEAK_EXCEPTION_MESSAGING
+0 BugPattern WOC_WRITE_ONLY_COLLECTION_FIELD
+0 BugPattern WOC_WRITE_ONLY_COLLECTION_LOCAL
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-05-31 14:59:57 UTC (rev 1779)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-08-16 23:20:38 UTC (rev 1780)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -34,7 +34,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -83,7 +83,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryStoreBeforeReturn" speed="fast" reports="USBR_UNNECESSARY_STORE_BEFORE_RETURN" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod" speed="fast" reports="COM_COPIED_OVERRIDDEN_METHOD" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod" speed="fast" reports="COM_COPIED_OVERRIDDEN_METHOD,COM_PARENT_DELEGATED_CALL" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayBasedCollections" speed="fast" reports="ABC_ARRAY_BASED_COLLECTIONS" />
@@ -171,12 +171,12 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics" speed="fast" reports="CFS_CONFUSING_FUNCTION_SEMANTICS" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.JUnitAssertionOddities" speed="fast"
- reports="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT,JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED,JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS,JAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.UnitTestAssertionOddities" speed="fast"
+ reports="UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,UTAO_JUNIT_ASSERTION_ODD...
[truncated message content] |
|
From: <dbr...@us...> - 2015-08-22 22:14:21
|
Revision: 1782
http://sourceforge.net/p/fb-contrib/code/1782
Author: dbrosius
Date: 2015-08-22 22:14:18 +0000 (Sat, 22 Aug 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/samples/DWI_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/.classpath 2015-08-22 22:14:18 UTC (rev 1782)
@@ -11,7 +11,7 @@
<classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.7.jar"/>
- <classpathentry kind="lib" path="lib/guava-17.0.jar"/>
+ <classpathentry kind="lib" path="lib/guava-17.0.jar" sourcepath="lib/sources/guava-17.0-sources.jar"/>
<classpathentry kind="lib" path="lib/httpclient-cache-4.3.4.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/build.xml 2015-08-22 22:14:18 UTC (rev 1782)
@@ -126,7 +126,7 @@
</target>
<target name="jar" depends="compile" xmlns:vcs="antlib:com.mebigfatguy.vcsversion" description="produces the fb-contrib jar file">
- <vcs:vcsversion vcs="git" revisionProperty="_rev_" dateProperty="_date_" branchProperty="_branch_"/>
+ <vcs:vcsversion vcs="git" revisionProperty="_rev_" dateProperty="_date_" branchProperty="_branch_" urlProperty="_url_"/>
<jar destfile="${target.dir}/fb-contrib-${fb-contrib.version}.jar">
<fileset dir="etc">
<include name="findbugs.xml" />
@@ -144,7 +144,10 @@
<manifest>
<attribute name="fb-contrib-version" value="${fb-contrib.version}" />
<attribute name="Main-Class" value="com.mebigfatguy.fbcontrib.FBContrib" />
- <attribute name="git-revision" value="${_branch_} ${_rev_} ${_date_}" />
+ <attribute name="git-url" value="${_url_}" />
+ <attribute name="git-branch" value="${_branch_}" />
+ <attribute name="git-revision" value="${_rev_}" />
+ <attribute name="git-date" value="${_date_}" />
<attribute name="Eclipse-RegisterBuddy" value="edu.umd.cs.findbugs.plugin.eclipse" />
<attribute name="Bundle-ManifestVersion" value="2" />
<attribute name="Bundle-Name" value="fb-contrib plugin" />
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-08-22 22:14:18 UTC (rev 1782)
@@ -286,7 +286,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles" speed="fast" reports="CRF_CONFLATING_RESOURCES_AND_FILES" />
<!-- COMMENT OUT FOR POINT RELEASE -->
-
+
<Detector class="com.mebigfatguy.fbcontrib.detect.OverlyPermissiveMethod" speed="fast" reports="OPM_OVERLY_PERMISSIVE_METHOD" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ClassImpersonatingString" speed="fast" reports="CIS_STRING_PARSING_A_FIELD,CIS_TOSTRING_STORED_IN_FIELD" />
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/htdocs/index.shtml 2015-08-22 22:14:18 UTC (rev 1782)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.2.1 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.2.2 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/htdocs/repository.html 2015-08-22 22:14:18 UTC (rev 1782)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.2.1</td></tr>
+ <tr><td><b>Version:</b></td><td>6.2.2</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/samples/DWI_Sample.java
===================================================================
--- trunk/fb-contrib/samples/DWI_Sample.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/samples/DWI_Sample.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -13,15 +13,17 @@
Iterator<Integer> it = bagOInts.iterator();
while (it.hasNext()) {
Integer i = it.next();
- if ((i.intValue() & 0x01) == 1)
+ if ((i.intValue() & 0x01) == 1) {
bagOInts.remove(i);
+ }
}
}
public void addIf(Set<String> s, Collection<String> c) {
for (String ss : s) {
- if (ss.equals("addem"))
+ if (ss.equals("addem")) {
s.addAll(c);
+ }
}
}
@@ -52,6 +54,26 @@
}
}
+ public void fpRemoveWithReturn(Set<String> ss) {
+ for (String s : ss) {
+ if (s.equals("foo")) {
+ ss.remove("foo");
+ return;
+ }
+ }
+ }
+
+ public boolean fpRemoveWithReturn2(Set<String> ss) {
+ for (String s : ss) {
+ if (s.equals("foo")) {
+ ss.remove("foo");
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public void fpNonCMECollection() {
for (String s : cow) {
if (s.isEmpty()) {
Modified: trunk/fb-contrib/samples/PRMC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/PRMC_Sample.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/samples/PRMC_Sample.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -6,6 +6,8 @@
import java.util.List;
import java.util.Set;
+import com.google.common.collect.Lists;
+
import edu.emory.mathcs.backport.java.util.Collections;
@SuppressWarnings("all")
@@ -30,8 +32,9 @@
@Override
public boolean equals(Object o) {
PRMC_Sample rmc = (PRMC_Sample) o;
- if (data.equals("INF") || rmc.data.equals("INF"))
+ if (data.equals("INF") || rmc.data.equals("INF")) {
return false;
+ }
return data.equals(rmc.data);
}
@@ -113,6 +116,11 @@
SAMPLE2.setValue(5);
}
+ public void fpWithGuava() {
+ List<String> l = Lists.newArrayList();
+ List<String> ll = Lists.newArrayList();
+ }
+
public void fpAsListLiterals() {
System.out.println(Arrays.asList("foo"));
System.out.println(Arrays.asList("bar"));
@@ -124,6 +132,7 @@
class Chain {
public Chain chainedField;
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("--");
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -100,7 +100,7 @@
/**
* constructs a BAS detector given the reporter to report bugs on
- *
+ *
* @param bugReporter
* the sync of bug reports
*/
@@ -111,7 +111,7 @@
/**
* implements the visitor to create and the clear the register to location
* map
- *
+ *
* @param classContext
* the context object of the currently parsed class
*/
@@ -137,7 +137,7 @@
/**
* implements the visitor to reset the register to location map
- *
+ *
* @param obj
* the context object of the currently parsed code block
*/
@@ -186,7 +186,7 @@
/**
* implements the visitor to look for variables assigned below the scope in
* which they are used.
- *
+ *
* @param seen
* the opcode of the currently parsed instruction
*/
@@ -378,8 +378,9 @@
} else if (seen == MONITOREXIT) {
if (monitorSyncPCs.size() > 0) {
ScopeBlock sb = findSynchronizedScopeBlock(rootScopeBlock, monitorSyncPCs.get(0).intValue());
- if (sb != null)
+ if (sb != null) {
sb.setFinish(pc);
+ }
monitorSyncPCs.remove(monitorSyncPCs.size() - 1);
}
}
@@ -402,7 +403,7 @@
/**
* returns either a register number of a field reference of the object that
* a method is being called on, or null, if it can't be determined.
- *
+ *
* @return either an Integer for a register, or a String for the field name,
* or null
*/
@@ -437,7 +438,7 @@
/**
* returns the scope block in which this register was assigned, by
* traversing the scope block tree
- *
+ *
* @param sb
* the scope block to start searching in
* @param pc
@@ -463,12 +464,12 @@
/**
* returns an existing scope block that has the same target as the one
* looked for
- *
+ *
* @param sb
* the scope block to start with
* @param target
* the target to look for
- *
+ *
* @return the scope block found or null
*/
private ScopeBlock findScopeBlockWithTarget(ScopeBlock sb, int start, int target) {
@@ -493,7 +494,7 @@
/**
* finds the scope block that is the active synchronized block
- *
+ *
* @return the scope block
*/
private ScopeBlock findSynchronizedScopeBlock(ScopeBlock sb, int monitorEnterPC) {
@@ -516,19 +517,20 @@
/**
* returns the catch handler for a given try block
- *
+ *
* @param pc
* the current instruction
* @return the pc of the handler for this pc if it's the start of a try
* block, or -1
- *
+ *
*/
private int findCatchHandlerFor(int pc) {
CodeException[] exceptions = getMethod().getCode().getExceptionTable();
if (exceptions != null) {
for (CodeException ex : exceptions) {
- if (ex.getStartPC() == pc)
+ if (ex.getStartPC() == pc) {
return ex.getHandlerPC();
+ }
}
}
@@ -554,7 +556,7 @@
/**
* construts a new scope block
- *
+ *
* @param start
* the beginning of the block
* @param finish
@@ -577,7 +579,7 @@
/**
* returns a string representation of the scope block
- *
+ *
* @returns a string representation
*/
@Override
@@ -587,7 +589,7 @@
/**
* returns the scope blocks parent
- *
+ *
* @return the parent of this scope block
*/
public ScopeBlock getParent() {
@@ -596,7 +598,7 @@
/**
* returns the children of this scope block
- *
+ *
* @return the scope blocks children
*/
public List<ScopeBlock> getChildren() {
@@ -605,7 +607,7 @@
/**
* returns the start of the block
- *
+ *
* @return the start of the block
*/
public int getStart() {
@@ -614,7 +616,7 @@
/**
* returns the end of the block
- *
+ *
* @return the end of the block
*/
public int getFinish() {
@@ -623,7 +625,7 @@
/**
* sets the start pc of the block
- *
+ *
* @param start
* the start pc
*/
@@ -633,7 +635,7 @@
/**
* sets the finish pc of the block
- *
+ *
* @param finish
* the finish pc
*/
@@ -654,7 +656,7 @@
/**
* returns whether this scope block is a loop
- *
+ *
* @returns whether this block is a loop
*/
public boolean isLoop() {
@@ -670,7 +672,7 @@
/**
* returns whether this block was caused from a goto
- *
+ *
* @returns whether this block was caused by a goto
*/
public boolean isGoto() {
@@ -686,7 +688,7 @@
/**
* returns whether this block was caused from a synchronized block
- *
+ *
* @returns whether this block was caused by a synchronized block
*/
public boolean isSync() {
@@ -702,7 +704,7 @@
/**
* returns whether this block was caused from a try block
- *
+ *
* @returns whether this block was caused by a try block
*/
public boolean isTry() {
@@ -718,7 +720,7 @@
/**
* returns whether this block was caused from a case block
- *
+ *
* @returns whether this block was caused by a case block
*/
public boolean isCase() {
@@ -727,7 +729,7 @@
/**
* adds the register as a store in this scope block
- *
+ *
* @param reg
* the register that was stored
* @param pc
@@ -748,7 +750,7 @@
/**
* removes stores to registers that where retrieved from method calls on
* assocObject
- *
+ *
* @param assocObject
* the object that a method call was just performed on
*/
@@ -768,7 +770,7 @@
/**
* adds the register as a load in this scope block
- *
+ *
* @param reg
* the register that was loaded
* @param pc
@@ -785,7 +787,7 @@
/**
* adds a scope block to this subtree by finding the correct place in
* the hierarchy to store it
- *
+ *
* @param newChild
* the scope block to add to the tree
*/
@@ -795,8 +797,9 @@
if (children != null) {
for (ScopeBlock child : children) {
if ((newChild.startLocation > child.startLocation) && (newChild.startLocation < child.finishLocation)) {
- if (newChild.finishLocation > child.finishLocation)
+ if (newChild.finishLocation > child.finishLocation) {
newChild.finishLocation = child.finishLocation;
+ }
child.addChild(newChild);
return;
}
@@ -818,7 +821,7 @@
/**
* removes a child from this node
- *
+ *
* @param child
* the child to remove
*/
@@ -887,10 +890,10 @@
/**
* returns whether this block either loads or stores into the register
* in question
- *
+ *
* @param reg
* the register to look for loads or stores
- *
+ *
* @return whether the block uses the register
*/
public boolean usesReg(Integer reg) {
@@ -945,7 +948,7 @@
return true;
}
- String key = clsName + "." + getNameConstantOperand() + getSigConstantOperand();
+ String key = clsName + '.' + getNameConstantOperand() + getSigConstantOperand();
if (dangerousAssignmentMethodSources.contains(key)) {
return true;
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -1,17 +1,17 @@
/*
* fb-contrib - Auxiliary detectors for Java programs
* Copyright (C) 2005-2015 Dave Brosius
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -91,7 +91,7 @@
/**
* constructs a CTU detector given the reporter to report bugs on
- *
+ *
* @param bugReporter
* the sync of bug reports
*/
@@ -101,7 +101,7 @@
/**
* overrides the visitor to reset the stack
- *
+ *
* @param classContext
* the context object of the currently parsed class
*/
@@ -117,7 +117,7 @@
/**
* overrides the visitor to resets the stack for this method.
- *
+ *
* @param obj
* the context object for the currently parsed code block
*/
@@ -141,7 +141,7 @@
case INVOKEVIRTUAL:
case INVOKEINTERFACE:
case INVOKESTATIC:
- String methodCall = getClassConstantOperand() + "." + getNameConstantOperand() + getSigConstantOperand();
+ String methodCall = getClassConstantOperand() + '.' + getNameConstantOperand() + getSigConstantOperand();
unit = TIME_UNIT_GENERATING_METHODS.get(methodCall);
if (unit == Units.CALLER) {
int offset = Type.getArgumentTypes(getSigConstantOperand()).length;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -98,7 +98,7 @@
String methodName = m.getName();
if ((m.isPublic() || m.isProtected()) && (!m.isAbstract() && !m.isSynthetic()
&& (!Values.CONSTRUCTOR.equals(methodName) && !Values.STATIC_INITIALIZER.equals(methodName)))) {
- String methodInfo = methodName + ":" + m.getSignature();
+ String methodInfo = methodName + ':' + m.getSignature();
superclassCode.put(methodInfo, new CodeInfo(m.getCode(), m.getAccessFlags()));
}
}
@@ -122,7 +122,7 @@
*/
@Override
public void visitMethod(Method obj) {
- curMethodInfo = obj.getName() + ":" + obj.getSignature();
+ curMethodInfo = obj.getName() + ':' + obj.getSignature();
}
/**
@@ -196,9 +196,11 @@
}
} else {
int expectedInstruction = getExpectedReturnInstruction(getMethod().getReturnType());
- if (seen == expectedInstruction) {
+ if ((seen == expectedInstruction) && (getNextPC() == getCode().getCode().length)) {
bugReporter.reportBug(
new BugInstance(this, BugType.COM_PARENT_DELEGATED_CALL.name(), NORMAL_PRIORITY).addClass(this).addMethod(this).addSourceLine(this));
+ } else {
+ ignore = true;
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -68,7 +68,7 @@
/**
* constructs a CBX detector given the reporter to report bugs on
- *
+ *
* @param bugReporter
* the sync of bug reports
*/
@@ -138,7 +138,7 @@
if ("java/lang/StringBuffer".equals(clsName) || "java/lang/StringBuilder".equals(clsName)) {
String methodName = getNameConstantOperand();
String methodSig = getSigConstantOperand();
- if (Values.CONSTRUCTOR.equals(methodName) && ("(Ljava/lang/String;)L" + clsName + ";").equals(methodSig)) {
+ if (Values.CONSTRUCTOR.equals(methodName) && ("(Ljava/lang/String;)L" + clsName + ';').equals(methodSig)) {
if (stack.getStackDepth() > 0) {
OpcodeStack.Item itm = stack.getStackItem(0);
strCon = (String) itm.getConstant();
@@ -150,7 +150,7 @@
if ("java/lang/StringBuffer".equals(clsName) || "java/lang/StringBuilder".equals(clsName)) {
String methodName = getNameConstantOperand();
String methodSig = getSigConstantOperand();
- if ("append".equals(methodName) && ("(Ljava/lang/String;)L" + clsName + ";").equals(methodSig)) {
+ if ("append".equals(methodName) && ("(Ljava/lang/String;)L" + clsName + ';').equals(methodSig)) {
if (stack.getStackDepth() > 0) {
OpcodeStack.Item itm = stack.getStackItem(0);
strCon = (String) itm.getConstant();
@@ -161,17 +161,20 @@
if (strCon != null) {
strCon = strCon.trim();
- if (strCon.length() == 0)
+ if (strCon.length() == 0) {
return;
+ }
for (Map.Entry<Pattern, Boolean> entry : xmlPatterns.entrySet()) {
Matcher m = entry.getKey().matcher(strCon);
if (m.matches()) {
xmlItemCount++;
- if (entry.getValue().booleanValue())
+ if (entry.getValue().booleanValue()) {
xmlConfidentCount++;
- if ((firstPC < 0) && (xmlConfidentCount > 0))
+ }
+ if ((firstPC < 0) && (xmlConfidentCount > 0)) {
firstPC = getPC();
+ }
break;
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -1,17 +1,17 @@
/*
* fb-contrib - Auxiliary detectors for Java programs
* Copyright (C) 2005-2015 Dave Brosius
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -51,20 +51,21 @@
/**
* constructs a CC detector given the reporter to report bugs on
- *
+ *
* @param bugReporter
* the sync of bug reports
*/
public CyclomaticComplexity(final BugReporter bugReporter) {
this.bugReporter = bugReporter;
Integer limit = Integer.getInteger(LIMIT_PROPERTY);
- if (limit != null)
+ if (limit != null) {
reportLimit = limit.intValue();
+ }
}
/**
* overrides the visitor to store the class context
- *
+ *
* @param context
* the context object for the currently parsed class
*/
@@ -88,7 +89,7 @@
/**
* overrides the visitor to navigate the basic block list to count branches
- *
+ *
* @param obj
* the method of the currently parsed method
*/
@@ -96,19 +97,22 @@
public void visitMethod(final Method obj) {
try {
- if ((obj.getAccessFlags() & Constants.ACC_SYNTHETIC) != 0)
+ if ((obj.getAccessFlags() & Constants.ACC_SYNTHETIC) != 0) {
return;
+ }
Code code = obj.getCode();
- if (code == null)
+ if (code == null) {
return;
+ }
// There really is no valid relationship between reportLimit and
// code
// length, but it is good enough. If the method is small, don't
// bother
- if (code.getCode().length < (2 * reportLimit))
+ if (code.getCode().length < (2 * reportLimit)) {
return;
+ }
BitSet exceptionNodeTargets = new BitSet();
@@ -144,7 +148,7 @@
bugReporter.reportBug(bug);
}
} catch (CFGBuilderException cbe) {
- bugReporter.logError("Failure examining basic blocks for method " + classContext.getJavaClass().getClassName() + "." + obj.getName()
+ bugReporter.logError("Failure examining basic blocks for method " + classContext.getJavaClass().getClassName() + '.' + obj.getName()
+ " in Cyclomatic Complexity detector", cbe);
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2015-08-16 23:23:57 UTC (rev 1781)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2015-08-22 22:14:18 UTC (rev 1782)
@@ -111,7 +111,7 @@
/**
* constructs a DWI detector given the reporter to report bugs on
- *
+ *
* @param bugReporter
* the sync of bug reports
*/
@@ -128,8 +128,9 @@
*/
@Override
public void visitClassContext(ClassContext classContext) {
- if ((collectionClass == null) || (iteratorClass == null))
+ if ((collectionClass == null) || (iteratorClass == null)) {
return;
+ }
try {
stack = new OpcodeStack();
@@ -207,9 +208,11 @@
if (loop != null) {
int pc = getPC();
if (loop.hasPC(pc)) {
- boolean breakFollows = breakFollows(loop, !"V".equals(Type.getReturnType(signature).getSignature()));
+ boolean needPop = !"V".equals(Type.getReturnType(signature).getSignature());
+ boolean breakFollows = breakFollows(loop, needPop);
+ boolean returnFollows = breakFollows ? false : returnFollows(loop, needPop);
- if (!breakFollows) {
+ if (!breakFollows && !returnFollows) {
bugReporter.reportBug(new BugInstance(this, BugType.DWI_DELETING_WHILE_ITERATING.name(), N...
[truncated message content] |
|
From: <dbr...@us...> - 2015-11-25 22:44:58
|
Revision: 1784
http://sourceforge.net/p/fb-contrib/code/1784
Author: dbrosius
Date: 2015-11-25 22:44:53 +0000 (Wed, 25 Nov 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-11-25 21:51:59 UTC (rev 1783)
+++ trunk/fb-contrib/build.xml 2015-11-25 22:44:53 UTC (rev 1784)
@@ -20,7 +20,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.3.0" />
+ <property name="fb-contrib.version" value="6.4.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-11-25 21:51:59 UTC (rev 1783)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-11-25 22:44:53 UTC (rev 1784)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -32,7 +32,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
-<!-- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -282,8 +282,6 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousLoopSearch" speed="fast" reports="SLS_SUSPICIOUS_LOOP_SEARCH" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles" speed="fast" reports="CRF_CONFLATING_RESOURCES_AND_FILES" />
-
- <!-- COMMENT OUT FOR POINT RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.detect.OverlyPermissiveMethod" speed="fast" reports="OPM_OVERLY_PERMISSIVE_METHOD" />
@@ -294,6 +292,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" />
<!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
@@ -529,9 +528,9 @@
<BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_USE_STANDARD_CHARSET_NAME" category="CORRECTNESS"/>
<BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING" category="CORRECTNESS"/>
<BugPattern abbrev="CBC" type="CBC_CONTAINS_BASED_CONDITIONAL" category="STYLE"/>
- <BugPattern abbrev="OPM" type="OPM_OVERLY_PERMISSIVE_METHOD" category="STYLE" experimental="true" />
- <BugPattern abbrev="STT" type="STT_STRING_PARSING_A_FIELD" category="STYLE" experimental="true" />
- <BugPattern abbrev="STT" type="STT_TOSTRING_STORED_IN_FIELD" category="STYLE" experimental="true" />
+ <BugPattern abbrev="OPM" type="OPM_OVERLY_PERMISSIVE_METHOD" category="STYLE" />
+ <BugPattern abbrev="STT" type="STT_STRING_PARSING_A_FIELD" category="STYLE" />
+ <BugPattern abbrev="STT" type="STT_TOSTRING_STORED_IN_FIELD" category="STYLE" />
<BugPattern abbrev="SLS" type="SLS_SUSPICIOUS_LOOP_SEARCH" category="CORRECTNESS" />
<BugPattern abbrev="CRF" type="CRF_CONFLATING_RESOURCES_AND_FILES" category="CORRECTNESS" />
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_EQUALS" category="STYLE" />
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2015-11-25 21:51:59 UTC (rev 1783)
+++ trunk/fb-contrib/htdocs/index.shtml 2015-11-25 22:44:53 UTC (rev 1784)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.2.3 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.4.0 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
@@ -86,7 +86,14 @@
same kind of exception, and throw the same exception always. These blocks can
be coalesced into one.
</li>
- <li><b>[OPM] Overly Permissive Method</b><br/>
+ </ul>
+ </div>
+ <hr/>
+ <img id="v6_4_0_image" src="flip2.gif" onClick="toggleBlock('v6_4_0', 'v6_4_0_image');" align="top"/>
+ Detectors added in v6.4.0<br/>
+ <div id="v6_4_0" style="display:block;">
+ <ul>
+ <li><b>[OPM] Overly Permissive Method</b><br/>
Looks for methods that are declared more permissively than the code is using. For instance, declaring
a method public, when it could just be declared private.
</li>
@@ -98,12 +105,15 @@
Looks for classes that are not fully implemented to be a well rounded class. While
the class will likely work fine, it is more difficult to use or understand than necessary.
</li>
- </ul>
- </div>
+ <li><b>[JXI] JAX-RS Issues</b><br/>
+ Looks for problems with the use of the JAX-RS specification.
+ </li>
+ </ul>
+ </div>
<hr/>
<img id="v6_2_0_image" src="flip2.gif" onClick="toggleBlock('v6_2_0', 'v6_2_0_image');" align="top"/>
Detectors added in v6.2.0<br/>
- <div id="v6_2_0" style="display:block;">
+ <div id="v6_2_0" style="display:none;">
<ul>
<li><b>[CSI] Charset Issues</b><br/>
Looks for issues related to manually specified charsets by using string literals.
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2015-11-25 21:51:59 UTC (rev 1783)
+++ trunk/fb-contrib/htdocs/repository.html 2015-11-25 22:44:53 UTC (rev 1784)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.2.3</td></tr>
+ <tr><td><b>Version:</b></td><td>6.4.0</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2015-11-25 21:51:59 UTC (rev 1783)
+++ trunk/fb-contrib/pom.xml 2015-11-25 22:44:53 UTC (rev 1784)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.3.0-SNAPSHOT</version>
+ <version>6.4.0</version>
<prerequisites>
<maven>2.2.1</maven>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2015-11-25 21:52:04
|
Revision: 1783
http://sourceforge.net/p/fb-contrib/code/1783
Author: dbrosius
Date: 2015-11-25 21:51:59 +0000 (Wed, 25 Nov 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/AWCBR_Sample.java
trunk/fb-contrib/samples/LSC_Sample.java
trunk/fb-contrib/samples/LSYC_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/OPM_Sample.java
trunk/fb-contrib/samples/SCRV_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/UTAO_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/PublicAPI.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/IMC_Sample.java
trunk/fb-contrib/samples/JXI_Sample.java
trunk/fb-contrib/samples/STT_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/UnmodifiableSet.java
Removed Paths:
-------------
trunk/fb-contrib/samples/CIS_Sample.java
trunk/fb-contrib/samples/SC_Sample.java
trunk/fb-contrib/samples/SMA_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassImpersonatingString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StutteredMethodArguments.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2015-08-22 22:14:18 UTC (rev 1782)
+++ trunk/fb-contrib/.classpath 2015-11-25 21:51:59 UTC (rev 1783)
@@ -24,8 +24,8 @@
</classpathentry>
<classpathentry kind="lib" path="lib/commons-codec-1.6.jar"/>
<classpathentry kind="lib" path="lib/findbugs-3.0.1.jar" sourcepath="lib/sources/findbugs-3.0.1-sources.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/testng-6.9.6.jar"/>
+ <classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar" sourcepath="lib/sources/jsr311-api-1.1.1-sources.jar"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-08-22 22:14:18 UTC (rev 1782)
+++ trunk/fb-contrib/build.xml 2015-11-25 21:51:59 UTC (rev 1783)
@@ -15,8 +15,8 @@
<property name="samples.classes.dir" value="${target.dir}/classes/samples" />
<property name="javadoc.dir" value="${target.dir}/javadoc" />
<property name="htdocs.dir" value="${basedir}/htdocs" />
- <property name="javac.source" value="1.6" />
- <property name="javac.target" value="1.6" />
+ <property name="javac.source" value="1.7" />
+ <property name="javac.target" value="1.7" />
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
@@ -32,7 +32,7 @@
<target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib">
<mkdir dir="${user.home}/.ant/lib" />
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/>
- <get src="https://bitbucket.org/klubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
+ <get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/>
</target>
@@ -92,6 +92,7 @@
<pathelement location="${lib.dir}/httpcore-${httpcore.version}.jar" />
<pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" />
<pathelement location="${lib.dir}/commons-codec-${commons-codec.version}.jar" />
+ <pathelement location="${lib.dir}/jsr311-api-${jsr311-api.version}.jar" />
</path>
</target>
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2015-08-22 22:14:18 UTC (rev 1782)
+++ trunk/fb-contrib/etc/bugrank.txt 2015-11-25 21:51:59 UTC (rev 1783)
@@ -22,8 +22,6 @@
+2 BugPattern CE_CLASS_ENVY
+0 BugPattern CFS_CONFUSING_FUNCTION_SEMANTICS
+0 BugPattern CHTH_COMMONS_HASHCODE_BUILDER_TOHASHCODE
-+0 BugPattern CIS_STRING_PARSING_A_FIELD
-+0 BugPattern CIS_TOSTRING_STORED_IN_FIELD
+0 BugPattern CLI_CONSTANT_LIST_INDEX
+0 BugPattern CNC_COLLECTION_NAMING_CONFUSION
+0 BugPattern COM_COPIED_OVERRIDDEN_METHOD
@@ -62,6 +60,10 @@
+0 BugPattern IICU_INCORRECT_INTERNAL_CLASS_USE
+0 BugPattern IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING
+0 BugPattern IKNC_INCONSISTENT_HTTP_PARAM_CASING
++2 BugPattern IMC_IMMATURE_CLASS_NO_EQUALS
++2 BugPattern IMC_IMMATURE_CLASS_NO_HASHCODE
++0 BugPattern IMC_IMMATURE_CLASS_NO_PACKAGE
++2 BugPattern IMC_IMMATURE_CLASS_NO_TOSTRING
+0 BugPattern IPU_IMPROPER_PROPERTIES_USE
+0 BugPattern IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY
+0 BugPattern ISB_EMPTY_STRING_APPENDING
@@ -70,6 +72,10 @@
+0 BugPattern ITC_INHERITANCE_TYPE_CHECKING
+2 BugPattern ITU_INAPPROPRIATE_TOSTRING_USE
+0 BugPattern JVR_JDBC_VENDOR_RELIANCE
++0 BugPattern JXI_GET_ENDPOINT_CONSUMES_CONTENT
++0 BugPattern JXI_INVALID_CONTEXT_PARAMETER_TYPE
++0 BugPattern JXI_PARM_PARAM_NOT_FOUND_IN_PATH
++0 BugPattern JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT
+0 BugPattern LEST_LOST_EXCEPTION_STACK_TRACE
+0 BugPattern LGO_LINGERING_GRAPHICS_OBJECT
+2 BugPattern LII_LIST_INDEXED_ITERATING
@@ -147,9 +153,9 @@
+0 BugPattern SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTATOR
+0 BugPattern SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR
+0 BugPattern SCI_SYNCHRONIZED_COLLECTION_ITERATORS
++0 BugPattern SCRV_SUSPICIOUS_COMPARATOR_RETURN_VALUES
+0 BugPattern SCR_SLOPPY_CLASS_REFLECTION
+0 BugPattern SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT
-+0 BugPattern SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES
+0 BugPattern SEC_SIDE_EFFECT_CONSTRUCTOR
+0 BugPattern SGSU_SUSPICIOUS_GETTER_SETTER_USE
+0 BugPattern SG_SLUGGISH_GUI
@@ -194,6 +200,8 @@
+0 BugPattern SPP_USE_STRINGBUILDER_LENGTH
+0 BugPattern STB_STACKED_TRY_BLOCKS
+2 BugPattern STS_SPURIOUS_THREAD_STATES
++0 BugPattern STT_STRING_PARSING_A_FIELD
++0 BugPattern STT_TOSTRING_STORED_IN_FIELD
+0 BugPattern SUA_SUSPICIOUS_UNINITIALIZED_ARRAY
+0 BugPattern SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT
+0 BugPattern TBP_TRISTATE_BOOLEAN_PATTERN
@@ -218,6 +226,10 @@
+0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE
+2 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT
+0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL
++0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL
++1 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_USING_DEPRECATED
+0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT
+0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_ASSERT_USED
+0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT
@@ -225,6 +237,9 @@
+0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE
+2 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT
+0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_EQUALS
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL
++0 BugPattern UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NULL
+0 BugPattern UTA_USE_TO_ARRAY
+0 BugPattern UVA_USE_VAR_ARGS
+0 BugPattern WEM_OBSCURING_EXCEPTION
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-08-22 22:14:18 UTC (rev 1782)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-11-25 21:51:59 UTC (rev 1783)
@@ -28,8 +28,6 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedSynchronizedBlock" speed="fast" reports="BSB_BLOATED_SYNCHRONIZED_BLOCK" hidden="true" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments" speed="fast" reports="SMA_STUTTERED_METHOD_ARGUMENTS" hidden="true" />
-
<Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
@@ -50,7 +48,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedCollectionContents" speed="fast" reports="UCC_UNRELATED_COLLECTION_CONTENTS" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.DeclaredRuntimeException" speed="fast" reports="DRE_DECLARED_RUNTIME_EXCEPTION" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.RuntimeExceptionDeclared" speed="fast" reports="DRE_DECLARED_RUNTIME_EXCEPTION" />
<Detector class="com.mebigfatguy.fbcontrib.detect.LiteralStringComparison" speed="fast" reports="LSC_LITERAL_STRING_COMPARISON" />
@@ -146,10 +144,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.PossibleIncompleteSerialization" speed="fast" reports="PIS_POSSIBLE_INCOMPLETE_SERIALIZATION" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SCRV_SUSPICIOUS_COMPARATOR_RETURN_VALUES" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast"
- reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TERNARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING,SPP_EQUALS_ON_STRING_BUILDER,SPP_CONVERSION_OF_STRING_LITERAL,SPP_STATIC_FORMAT_STRING" />
+ reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TERNARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_SERIALVER_SHOULD_BE_PRIVATE,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING,SPP_EQUALS_ON_STRING_BUILDER,SPP_CONVERSION_OF_STRING_LITERAL,SPP_STATIC_FORMAT_STRING" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" />
@@ -172,7 +170,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics" speed="fast" reports="CFS_CONFUSING_FUNCTION_SEMANTICS" />
<Detector class="com.mebigfatguy.fbcontrib.detect.UnitTestAssertionOddities" speed="fast"
- reports="UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT,UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,UTAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED,UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS,UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT,UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT,UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE,UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT,UTAO_TESTNG_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,UTAO_TESTNG_ASSERTION_ODDITIES_ASSERT_USED,UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_EQUALS,UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT," />
+ reports="UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT,UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,UTAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED,UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL,UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL,UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS,UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS,UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT,UTAO_JUNIT_ASSERTION_ODDITIES_USING_DEPRECATED,UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT,UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE,UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT,UTAO_TESTNG_ASSERTION_ODDITIES_IMPOSSIBLE_NULL,UTAO_TESTNG_ASSERTION_ODDITIES_ASSERT_USED,UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NULL,UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL,UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_EQUALS,UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS,UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT," />
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm" speed="fast" reports="SCA_SUSPICIOUS_CLONE_ALGORITHM" />
@@ -289,8 +287,12 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.OverlyPermissiveMethod" speed="fast" reports="OPM_OVERLY_PERMISSIVE_METHOD" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.ClassImpersonatingString" speed="fast" reports="CIS_STRING_PARSING_A_FIELD,CIS_TOSTRING_STORED_IN_FIELD" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes" speed="fast" reports="STT_STRING_PARSING_A_FIELD,STT_TOSTRING_STORED_IN_FIELD" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING" />
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" />
+
<!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
@@ -369,7 +371,7 @@
<BugPattern abbrev="URV" type="URV_CHANGE_RETURN_TYPE" category="STYLE" />
<BugPattern abbrev="URV" type="URV_INHERITED_METHOD_WITH_RELATED_TYPES" category="STYLE" />
<BugPattern abbrev="PIS" type="PIS_POSSIBLE_INCOMPLETE_SERIALIZATION" category="CORRECTNESS" />
- <BugPattern abbrev="SCRV" type="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" category="CORRECTNESS" />
+ <BugPattern abbrev="SCRV" type="SCRV_SUSPICIOUS_COMPARATOR_RETURN_VALUES" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_NEGATIVE_BITSET_ITEM" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_INTERN_ON_CONSTANT" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_NO_CHAR_SB_CTOR" category="CORRECTNESS" />
@@ -422,14 +424,21 @@
<BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT" category="STYLE" />
<BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_USING_DEPRECATED" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT" category="STYLE" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE" category="STYLE" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT" category="STYLE" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_ASSERT_USED" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NULL" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_EQUALS" category="CORRECTNESS" />
+ <BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS" category="CORRECTNESS" />
<BugPattern abbrev="UTAO" type="UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT" category="CORRECTNESS" />
<BugPattern abbrev="SCA" type="SCA_SUSPICIOUS_CLONE_ALGORITHM" category="CORRECTNESS" />
<BugPattern abbrev="WEM" type="WEM_WEAK_EXCEPTION_MESSAGING" category="STYLE" />
@@ -449,7 +458,6 @@
<BugPattern abbrev="BED" type="BED_HIERARCHICAL_EXCEPTION_DECLARATION" category="CORRECTNESS" />
<BugPattern abbrev="UNNC" type="UNNC_UNNECESSARY_NEW_NULL_CHECK" category="CORRECTNESS" />
<BugPattern abbrev="DTEP" type="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" category="STYLE" />
- <BugPattern abbrev="SMA" type="SMA_STUTTERED_METHOD_ARGUMENTS" category="STYLE" />
<BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" category="STYLE" />
<BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" />
<BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" />
@@ -522,9 +530,17 @@
<BugPattern abbrev="CSI" type="CSI_CHAR_SET_ISSUES_UNKNOWN_ENCODING" category="CORRECTNESS"/>
<BugPattern abbrev="CBC" type="CBC_CONTAINS_BASED_CONDITIONAL" category="STYLE"/>
<BugPattern abbrev="OPM" type="OPM_OVERLY_PERMISSIVE_METHOD" category="STYLE" experimental="true" />
- <BugPattern abbrev="CIS" type="CIS_STRING_PARSING_A_FIELD" category="STYLE" experimental="true" />
- <BugPattern abbrev="CIS" type="CIS_TOSTRING_STORED_IN_FIELD" category="STYLE" experimental="true" />
+ <BugPattern abbrev="STT" type="STT_STRING_PARSING_A_FIELD" category="STYLE" experimental="true" />
+ <BugPattern abbrev="STT" type="STT_TOSTRING_STORED_IN_FIELD" category="STYLE" experimental="true" />
<BugPattern abbrev="SLS" type="SLS_SUSPICIOUS_LOOP_SEARCH" category="CORRECTNESS" />
<BugPattern abbrev="CRF" type="CRF_CONFLATING_RESOURCES_AND_FILES" category="CORRECTNESS" />
+ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_EQUALS" category="STYLE" />
+ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_HASHCODE" category="STYLE" />
+ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_PACKAGE" category="STYLE" />
+ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_TOSTRING" category="STYLE" />
+ <BugPattern abbrev="JXI" type="JXI_GET_ENDPOINT_CONSUMES_CONTENT" category="CORRECTNESS" />
+ <BugPattern abbrev="JXI" type="JXI_INVALID_CONTEXT_PARAMETER_TYPE" category="CORRECTNESS" />
+ <BugPattern abbrev="JXI" type="JXI_PARM_PARAM_NOT_FOUND_IN_PATH" category="CORRECTNESS" />
+ <BugPattern abbrev="JXI" type="JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" category="CORRECTNESS" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-08-22 22:14:18 UTC (rev 1782)
+++ trunk/fb-contrib/etc/messages.xml 2015-11-25 21:51:59 UTC (rev 1783)
@@ -107,7 +107,7 @@
</Details>
</Detector>
- <Detector class="com.mebigfatguy.fbcontrib.detect.DeclaredRuntimeException">
+ <Detector class="com.mebigfatguy.fbcontrib.detect.RuntimeExceptionDeclared">
<Details>
<![CDATA[
<p>Looks for methods that declare RuntimeExceptions in their throws clause. While doing
@@ -182,15 +182,8 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.FinalParameters">
<Details>
<![CDATA[
- <p>Looks for methods that correctly do not write to a parameter. To help document this, and to perhaps
- help the JVM optimize the invocation of this method, you should consider defining these parameters
- as final.</p>
-
- <p>Performance gains are debatable as "the final keyword does not appear in the class file for
- local variables and parameters, thus it cannot impact the runtime performance. It's only use
- is to clarify the coders intent that the variable not be changed (which many consider dubious
- reason for its usage), and dealing with anonymous inner classes." - http://stackoverflow.com/a/266981/1447621</p>
-
+ <p>Looks for methods that correctly do not write to a parameter. To help document this you should consider
+ defining these parameters as final.</p>
<p>It is a slow detector.</p>
]]>
</Details>
@@ -978,17 +971,6 @@
</Details>
</Detector>
- <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments">
- <Details> experimental="true"
- <![CDATA[
- <p>Looks for method calls that pass the same value for two separate parameters, where
- those arguments are not constants. Often this is a cut/paste mistake, but if not, it is
- confusing why you would pass the same value for two arguments.</p>
- <p>It is a fast detector.</p>
- ]]>
- </Details>
- </Detector>
-
<Detector class="com.mebigfatguy.fbcontrib.detect.TristateBooleanPattern">
<Details>
<![CDATA[
@@ -1508,7 +1490,7 @@
</Details>
</Detector>
- <Detector class="com.mebigfatguy.fbcontrib.detect.ClassImpersonatingString">
+ <Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes">
<Details>
<![CDATA[
<p>Looks for classes that store fields that are Strings that impersonate instances of classes, or collections that are
@@ -1546,6 +1528,28 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass">
+ <Details>
+ <![CDATA[
+ <p>Looks for classes that are not fully complete from a usability point of view. Making them more difficult to use
+ than should be. Things such as
+ <UL>
+ <LI>Missing toString() method</LI>
+ </UL>
+ </p>
+ <p>It is a moderately fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues">
+ <Details>
+ <![CDATA[
+ <p>Looks for problems with the use of the JAX-RS specification.</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -2783,14 +2787,14 @@
</Details>
</BugPattern>
- <BugPattern type="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES">
+ <BugPattern type="SCRV_SUSPICIOUS_COMPARATOR_RETURN_VALUES">
<ShortDescription>Comparator method doesn't seem to return all ordering values</ShortDescription>
<LongDescription>Comparator method {1} doesn't seem to return all ordering values</LongDescription>
<Details>
<![CDATA[
<p>This compareTo or compare method returns constant values for to represent less than,
- equals and greater than. However it does not return each type. Given that comparators
- are transitive, this seems incorrect.</p>
+ equals and greater than. However it does not return each type, or it unconditionally returns a non zero value.
+ Given that comparators are transitive, this seems incorrect.</p>
]]>
</Details>
</BugPattern>
@@ -3500,18 +3504,52 @@
</Details>
</BugPattern>
+ <BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL">
+ <ShortDescription>Junit test method passes null Assert.assertEquals</ShortDescription>
+ <LongDescription>Junit test method {1} passes null to Assert.assertEquals</LongDescription>
+ <Details>
+ <![CDATA...
[truncated message content] |
|
From: <dbr...@us...> - 2015-12-12 17:34:00
|
Revision: 1786
http://sourceforge.net/p/fb-contrib/code/1786
Author: dbrosius
Date: 2015-12-12 17:33:56 +0000 (Sat, 12 Dec 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/ISB_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-11-25 22:58:52 UTC (rev 1785)
+++ trunk/fb-contrib/build.xml 2015-12-12 17:33:56 UTC (rev 1786)
@@ -2,6 +2,14 @@
<project name="fb-contrib" default="default">
+ <presetdef name="javac">
+ <javac encoding="UTF-8" />
+ </presetdef>
+
+ <presetdef name="javadoc">
+ <javadoc encoding="UTF-8" />
+ </presetdef>
+
<property file="user.properties" />
<property file="build.properties" />
<property file="version.properties" />
@@ -20,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.4.0" />
+ <property name="fb-contrib.version" value="6.5.0-SNAPSHOT" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-11-25 22:58:52 UTC (rev 1785)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-12-12 17:33:56 UTC (rev 1786)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -32,7 +32,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-11-25 22:58:52 UTC (rev 1785)
+++ trunk/fb-contrib/etc/messages.xml 2015-12-12 17:33:56 UTC (rev 1786)
@@ -52,7 +52,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SyncCollectionIterators">
<Details>
<![CDATA[
- <p>Looks for use of iterators on synchronized collections built from the java.util.Collections class</p>
+ <p>Looks for use of iterators on synchronized collections built from the java.util.Collections class.</p>
<p>As the collection in question was built through Collections.synchronizedXXX, an assumption
is made that this collection must be multithreaded safe. However, iterator access is used,
which is explicitly unsafe. When iterators are to be used, synchronization should be done manually.</p>
@@ -322,7 +322,7 @@
Since primitive wrapper classes are immutable this is needless garbage being created. Just
use the original reference.
</p>
- <p>It also looks for calls to BoxedClass.valueOf(x) where X is already a Boxed class</p>
+ <p>It also looks for calls to BoxedClass.valueOf(x) where X is already a BoxedClass</p>
<p>It also looks for calls to BoxedClass.valueOf(myString).boxedValue(), when instead it is
simpler to use BoxedClass.parseBoxed(myString)</p>
<p>It is a fast detector.</p>
@@ -696,7 +696,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues">
<Details>
<![CDATA[
- <p>Looks for class that implement Comparator or Comparable, and whose compare or compareTo
+ <p>Looks for classes that implement Comparator or Comparable, and whose compare or compareTo
methods return constant values only, but that don't represent the three possible choice
(a negative number, 0, and a positive number).</p>
<p>It is a fast detector.</p>
@@ -847,11 +847,11 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UnitTestAssertionOddities">
<Details>
<![CDATA[
- <p>Looks for junit or testng test case methods that use assertions with odd parameters.
+ <p>Looks for JUnit or TestNG test case methods that use assertions with odd parameters.
Including in this is:
<ul>
- <li>Passing a constant as the second (actual) parameter in a junit test</li>
- <li>not using the three parameter version of asserts for doubles</li>
+ <li>Passing a constant as the second (actual) parameter in a JUnit test</li>
+ <li>Not using the three parameter version of asserts for doubles</li>
<li>Passing true or false as the first parameter instead of using assertTrue, or assertFalse</li>
<li>Using the assert keyword</li>
</ul>
@@ -911,7 +911,7 @@
should not be counted on.</p>
Packages that shouldn't be used are:
<ul>
- <li>com.sun.xxx</li>
+ <li>sun.xxx</li>
<li>org.apache.xerces.xxx</li>
<li>org.apache.xalan.xxx</li>
</ul>
@@ -1496,7 +1496,7 @@
<p>Looks for classes that store fields that are Strings that impersonate instances of classes, or collections that are
fields that hold Strings that impersonate a class. Examples of String impersonating are storing:
<ul>
- <li>the result of a toString call</li>
+ <li>The result of a toString call</li>
<li>Strings build from parsing or building strings from other objects, such as "1,2,3,4" or "Project:3"</li>
</ul>
By using Strings you are throwing away type-safety, and making it difficult to reason about what the values of variables
@@ -1513,7 +1513,7 @@
<p>Looks for methods that assign a value to a variable in an if equals conditional in a loop, but does not break after doing so.
Since equality would seem to be a one time event, continuing with the loop seems pointless, and a break statement in the if statement
seems like it should be added.</p>
- <p>It is a fast detector</p>
+ <p>It is a fast detector.</p>
]]>
</Details>
</Detector>
@@ -1521,10 +1521,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles">
<Details>
<![CDATA[
- <p>Looks for methods that use the File api on resources retrieved from URLs where the URL in question isn't from a file protocol.
- In the case of classpath resources, this will work if the code is executed from directories, but fail using jars.
- If using resources, then use URL.openStream() method instead of File apis.</p>
- <p>It is a fast detector</p>
+ <p>Looks for methods that use the File API on resources retrieved from URLs where the URL in question isn't from a file protocol.
+ In the case of classpath resources, this will work if the code is executed from directories, but fail using JARs.
+ If using resources, then use URL.openStream() method instead of File APIs.</p>
+ <p>It is a fast detector.</p>
]]>
</Details>
</Detector>
@@ -1533,12 +1533,12 @@
<Details>
<![CDATA[
<p>Looks for classes that are not fully complete from a usability point of view. Making them more difficult to use
- than should be. Things such as
- <UL>
- <LI>Missing toString() method</LI>
- </UL>
+ than it should be. Things such as
+ <ul>
+ <li>Missing toString() method</li>
+ </ul>
</p>
- <p>It is a moderately fast detector</p>
+ <p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
@@ -1737,7 +1737,7 @@
<![CDATA[
<p>This method declares a RuntimeException derived class in its throws clause.
This may indicate a misunderstanding as to how unchecked exceptions are handled.
- If is felt that a RuntimeException is so prevalent that it should be declared, it
+ If it is felt that a RuntimeException is so prevalent that it should be declared, it
is probably a better idea to prevent the occurrence in code.</p>
]]>
</Details>
@@ -2195,11 +2195,11 @@
</BugPattern>
<BugPattern type="COM_PARENT_DELEGATED_CALL">
- <ShortDescription>Method merely delegates to it's superclass's version</ShortDescription>
- <LongDescription>Method {1} merely delegates to it's superclass's version</LongDescription>
+ <ShortDescription>Method merely delegates to its superclass's version</ShortDescription>
+ <LongDescription>Method {1} merely delegates to its superclass's version</LongDescription>
<Details>
<![CDATA[
- <p>This method is implemented to just delegate it's implementation by calling
+ <p>This method is implemented to just delegate its implementation by calling
the superclass method with the same signature. This method can just be removed.</p>
]]>
</Details>
@@ -3123,7 +3123,7 @@
<LongDescription>Method {1} uses iterator().next() on a List to get the first item</LongDescription>
<Details>
<![CDATA[
- <p>This Method calls myList.iterator().next() on a List to get the first item. It is more performant
+ <p>This method calls myList.iterator().next() on a List to get the first item. It is more performant
to just use myList.get(0).</p>
]]>
</Details>
@@ -3247,8 +3247,8 @@
</BugPattern>
<BugPattern type="BAS_BLOATED_ASSIGNMENT_SCOPE">
- <ShortDescription>Method assigns a variable in a larger scope then is needed</ShortDescription>
- <LongDescription>Method {1} assigns a variable in a larger scope then is needed</LongDescription>
+ <ShortDescription>Method assigns a variable in a larger scope than is needed</ShortDescription>
+ <LongDescription>Method {1} assigns a variable in a larger scope than is needed</LongDescription>
<Details>
<![CDATA[
<p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em></p>
@@ -3447,8 +3447,8 @@
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT">
- <ShortDescription>Junit test method passes constant to second (actual) assertion parameter</ShortDescription>
- <LongDescription>Junit test method {1} passes constant to second (actual) assertion parameter</LongDescription>
+ <ShortDescription>JUnit test method passes constant to second (actual) assertion parameter</ShortDescription>
+ <LongDescription>JUnit test method {1} passes constant to second (actual) assertion parameter</LongDescription>
<Details>
<![CDATA[
<p>This method calls assert passing a constant value as the second of the two values. The assert
@@ -3459,8 +3459,8 @@
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE">
- <ShortDescription>Junit test method asserts that two doubles are exactly equal</ShortDescription>
- <LongDescription>Junit test method {1} asserts that two doubles are exactly equal</LongDescription>
+ <ShortDescription>JUnit test method asserts that two doubles are exactly equal</ShortDescription>
+ <LongDescription>JUnit test method {1} asserts that two doubles are exactly equal</LongDescription>
<Details>
<![CDATA[
<p>This method calls assert with two doubles or Doubles. Due to the imprecision of doubles, you
@@ -3470,8 +3470,8 @@
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT">
- <ShortDescription>Junit test method asserts that a value is true or false</ShortDescription>
- <LongDescription>Junit test method {1} asserts that a value is true or false</LongDescription>
+ <ShortDescription>JUnit test method asserts that a value is true or false</ShortDescription>
+ <LongDescription>JUnit test method {1} asserts that a value is true or false</LongDescription>
<Details>
<![CDATA[
<p>This method asserts that a value is equal to true or false. It is simpler to just
@@ -3481,8 +3481,8 @@
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL">
- <ShortDescription>Junit test method asserts that an auto-boxed value is not null</ShortDescription>
- <LongDescription>Junit test method {1} asserts that an auto-boxed value is not null</LongDescription>
+ <ShortDescription>JUnit test method asserts that an autoboxed value is not null</ShortDescription>
+ <LongDescription>JUnit test method {1} asserts that an autoboxed value is not null</LongDescription>
<Details>
<![CDATA[
<p>This method asserts that a primitive value that was autoboxed into a boxed primitive was not
@@ -3493,66 +3493,66 @@
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED">
- <ShortDescription>Junit test method uses Java asserts rather than a junit assertion</ShortDescription>
- <LongDescription>Junit test method {1} uses Java asserts rather than a junit assertion</LongDescription>
+ <ShortDescription>JUnit test method uses Java asserts rather than a JUnit assertion</ShortDescription>
+ <LongDescription>JUnit test method {1} uses Java asserts rather than a JUnit assertion</LongDescription>
<Details>
<![CDATA[
<p>This method uses a Java assert to assure that a certain state is in effect. As this is
- a junit test it makes more sense to either check this condition with a junit assert, or allow
+ a JUnit test it makes more sense to either check this condition with a JUnit assert, or allow
a following exception to occur.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL">
- <ShortDescription>Junit test method passes null Assert.assertEquals</ShortDescription>
- <LongDescription>Junit test method {1} passes null to Assert.assertEquals</LongDescription>
+ <ShortDescription>JUnit test method passes null Assert.assertEquals</ShortDescription>
+ <LongDescription>JUnit test method {1} passes null to Assert.assertEquals</LongDescription>
<Details>
<![CDATA[
<p>This method compares an object's equality to null. It is better to use the Assert.assertNull
- method so that the junit failure method is more meaningful of the intended test.</p>
+ method so that the JUnit failure method is more meaningful of the intended test.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL">
- <ShortDescription>Junit test method passes null Assert.assertNotEquals</ShortDescription>
- <LongDescription>Junit test method {1} passes null to Assert.assertNotEquals</LongDescription>
+ <ShortDescription>JUnit test method passes null Assert.assertNotEquals</ShortDescription>
+ <LongDescription>JUnit test method {1} passes null to Assert.assertNotEquals</LongDescription>
<Details>
<![CDATA[
<p>This method compares an object's inequality to null. It is better to use the Assert.assertNotNull
- method so that the junit failure method is more meaningful of the intended test.</p>
+ method so that the JUnit failure method is more meaningful of the intended test.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS">
- <ShortDescription>Junit test method passes boolean expression to Assert.assertFalse / Assert.assertTrue</ShortDescription>
- <LongDescription>Junit test method {1} passes boolean expression to Assert.assertFalse / Assert.assertTrue</LongDescription>
+ <ShortDescription>JUnit test method passes boolean expression to Assert.assertFalse / Assert.assertTrue</ShortDescription>
+ <LongDescription>JUnit test method {1} passes boolean expression to Assert.assertFalse / Assert.assertTrue</LongDescription>
<Details>
<![CDATA[
<p>This method evaluates a boolean expression and passes that to Assert.assertFalse / Assert.assertTrue.
It is better to pass the two values that are being equated to the Assert.assertEquals method so that the
- junit failure method is more meaningful of the intended test.</p>
+ JUnit failure method is more meaningful of the intended test.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_EQUALS">
- <ShortDescription>Junit test method passes boolean expression to Assert.assertFalse / Assert.assertTrue</ShortDescription>
- <LongDescription>Junit test method {1} passes boolean expression to Assert.assertFalse / Assert.assertTrue</LongDescription>
+ <ShortDescription>JUnit test method passes boolean expression to Assert.assertFalse / Assert.assertTrue</ShortDescription>
+ <LongDescription>JUnit test method {1} passes boolean expression to Assert.assertFalse / Assert.assertTrue</LongDescription>
<Details>
<![CDATA[
<p>This method evaluates a boolean expression and passes that to Assert.assertFalse / Assert.assertTrue.
It is better to pass the two values that are being equated to the Assert.assertNotEquals method so that the
- junit failure method is more meaningful of the intended test.</p>
+ JUnit failure method is more meaningful of the intended test.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT">
- <ShortDescription>Junit test method appears to have no assertions</ShortDescription>
- <LongDescription>Junit test method {1} appears to have no assertions</LongDescription>
+ <ShortDescription>JUnit test method appears to have no assertions</ShortDescription>
+ <LongDescription>JUnit test method {1} appears to have no assertions</LongDescription>
<Details>
<![CDATA[
<p>This JUnit test method has no assertions. While a unit test could still be valid if it relies on whether
@@ -3569,7 +3569,7 @@
<Details>
<![CDATA[
<p>This JUnit 4 test is still using classes from the junit.framework.* package. You should switch them
- over to the corresponding org.junit.* set of classes, instead</p>
+ over to the corresponding org.junit.* set of classes, instead.</p>
]]>
</Details>
</BugPattern>
@@ -3609,8 +3609,8 @@
</BugPattern>
<BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_IMPOSSIBLE_NULL">
- <ShortDescription>TestNG test method asserts that an auto-boxed value is not null</ShortDescription>
- <LongDescription>TestNG test method {1} asserts that an auto-boxed value is not null</LongDescription>
+ <ShortDescription>TestNG test method asserts that an autoboxed value is not null</ShortDescription>
+ <LongDescription>TestNG test method {1} asserts that an autoboxed value is not null</LongDescription>
<Details>
<![CDATA[
<p>This method asserts that a primitive value that was autoboxed into a boxed primitive was not
@@ -3621,12 +3621,12 @@
</BugPattern>
<BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_ASSERT_USED">
- <ShortDescription>TestNG test method uses Java asserts rather than a testng assertion</ShortDescription>
- <LongDescription>TestNG test method {1} uses Java asserts rather than a testng assertion</LongDescription>
+ <ShortDescription>TestNG test method uses Java asserts rather than a TestNG assertion</ShortDescription>
+ <LongDescription>TestNG test method {1} uses Java asserts rather than a TestNG assertion</LongDescription>
<Details>
<![CDATA[
<p>This method uses a Java assert to assure that a certain state is in effect. As this is
- a testng test it makes more sense to either check this condition with a testng assert, or allow
+ a TestNG test it makes more sense to either check this condition with a TestNG assert, or allow
a following exception to occur.</p>
]]>
</Details>
@@ -3724,7 +3724,7 @@
<p>This method catches an exception and generates a new exception of type java.lang.Exception, passing the
original exception as the new Exception's cause. If the original Exception was actually an java.lang.Error, this
is dubious as you should not be handling errors. If the original exception is a more specific exception, there is no
- reason to wrap it in an exception of the java.lang.Exception class, and just obfuscates the type of error that is occuring.
+ reason to wrap it in an exception of the java.lang.Exception class, and just obfuscates the type of error that is occurring.
</p>
]]>
</Details>
@@ -3852,7 +3852,7 @@
to change or removal. You should not be using these classes.</p>
Packages that shouldn't be used are:
<ul>
- <li>com.sun.xxx</li>
+ <li>sun.xxx</li>
<li>org.apache.xerces.xxx</li>
<li>org.apache.xalan.xxx</li>
</ul>
@@ -3872,9 +3872,9 @@
type functionality, which seems dubious when done on a collection</p>
<p>Finally, as a collection is often modified, problems will occur if the collection is
contained in a set, because the hashCode, equals or compareTo values will change while the
- collection is in the set</p>
+ collection is in the set.</p>
<p>If you wish to maintain a collection of collections, it is probably better to use a List
- as the outer collection</p>
+ as the outer collection.</p>
]]>
</Details>
</BugPattern>
@@ -4172,7 +4172,7 @@
<LongDescription>Method {1} calls deprecated SecureRandom method {2}</LongDescription>
<Details>
<![CDATA[
- <p>The <code>In JDK 1.5 or less, SecureRandom()</code> constructors and <code>SecureRandom.getSeed()</code> method are recommended against using. Call <code>SecureRandom.getInstance()</code> and <code>SecureRandom.getInstance().generateSeed()</code> instead.</p>
+ <p>In JDK 1.5 or less, the <code>SecureRandom()</code> constructors and <code>SecureRandom.getSeed()</code> method are recommended against using. Call <code>SecureRandom.getInstance()</code> and <code>SecureRandom.getInstance().generateSeed()</code> instead.</p>
]]>
</Details>
</BugPattern>
@@ -4246,7 +4246,7 @@
<p>As per the Java specifications, "UTF-8", "US-ASCII", "UTF-16" and "ISO-8859-1" will all be valid <a href = "http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html#standard">encoding charsets</a>. If you aren't sure, try "UTF-8".</p>
- <p><b>New in Java 1.7</b>, You can specify an encoding from <code>StandardCharsets</code>, like <code>StandardCharsets.UTF_8</code>. These are generally preferrable because you don't have to deal with <code>UnsupportedEncodingException</code>.</p>
+ <p><b>New in Java 1.7</b>, you can specify an encoding from <code>StandardCharsets</code>, like <code>StandardCharsets.UTF_8</code>. These are generally preferrable because you don't have to deal with <code>UnsupportedEncodingException</code>.</p>
]]>
</Details>
</BugPattern>
@@ -4450,7 +4450,7 @@
<LongDescription>Method {1} compares class name instead of comparing the class</LongDescription>
<Details>
<![CDATA[
- <p>In a JVM, Two classes are the same class (and consequently the same type) if
+ <p>In a JVM, two classes are the same class (and consequently the same type) if
they are loaded by the same class loader, and they have the same fully
qualified name [JVMSpec 1999].
@@ -4484,8 +4484,8 @@
</BugPattern>
<BugPattern type="CU_CLONE_USABILITY_MISMATCHED_RETURN">
- <ShortDescription>Clone method declares it returns a type different then the owning class</ShortDescription>
- <LongDescription>Clone method {1} declares it returns a type different then the owning class</LongDescription>
+ <ShortDescription>Clone method declares it returns a type different than the owning class</ShortDescription>
+ <LongDescription>Clone method {1} declares it returns a type different than the owning class</LongDescription>
<Details>
<![CDATA[
<p>This class implements the Cloneable interface but defines its clone method to return a type
@@ -4531,7 +4531,7 @@
and thus needlessly causes intermediate reallocations of the collection.</p>
<p>You can use the constructor that takes an initial size and that will be much better, but
due to the loadFactor of Maps and Sets, even this will not be a correct estimate.</p>
- <p>If you are using guava, use its methods that allocate maps and sets with a predetermined size,
+ <p>If you are using Guava, use its methods that allocate maps and sets with a predetermined size,
to get the best chance for no reallocations, such as:
<ul>
<li>Sets.newHashSetWithExpectedSize(int)</li>
@@ -4655,7 +4655,7 @@
<Details>
<![CDATA[
<p>This method attempts to modify a collection that it got from a source that could potentially have created an
- immutable collection, thru Arrays.asList, Collections.unmodifiableXXX, or one of guava's methods. Doing so will cause
+ immutable collection, through Arrays.asList, Collections.unmodifiableXXX, or one of Guava's methods. Doing so will cause
an exception, as these collections are not mutable.</p>
]]>
</Details>
@@ -4979,13 +4979,13 @@
</BugPattern>
<BugPattern type="CRF_CONFLATING_RESOURCES_AND_FILES">
- <ShortDescription>This method accesses URL resources using the File api</ShortDescription>
- <LongDescription>This method {1} accesses URL resources using the File api]</LongDescription>
+ <ShortDescription>This method accesses URL resources using the File API</ShortDescription>
+ <LongDescription>This method {1} accesses URL resources using the File API</LongDescription>
<Details>
<![CDATA[
- <p>This method fetches a resource from a URL, and uses the File api to manipulate it. If this resource is a
- classpath resource, it will work if the resource is a file in a directory. If however the file is inside a jar file
- this will fail. Use the URL.openStream api instead to access the data of the classpath resource.
+ <p>This method fetches a resource from a URL, and uses the File API to manipulate it. If this resource is a
+ classpath resource, it will work if the resource is a file in a directory. If however the file is inside a JAR file
+ this will fail. Use the URL.openStream API instead to access the data of the classpath resource.
</p>
]]>
</Details>
@@ -4996,7 +4996,7 @@
<LongDescription>Class {0} does not implement an equals method</LongDescription>
<Details>
<![CDATA[
- <p>This class which has instance fields has no equals(Object o) method, It is possible that this
+ <p>This class which has instance fields has no equals(Object o) method. It is possible that this
class is never used in a context where this is required, it is often assumed, however, from clients
of this class that it is, so it is good to add such methods when you create them.
</p>
@@ -5009,7 +5009,7 @@
<LongDescription>Class {0} does not implement a hashCode method</LongDescription>
<Details>
<![CDATA[
- <p>This class which has instance fields has no hashCode() method, It is possible that this
+ <p>This class which has instance fields has no hashCode() method. It is possible that this
class is never used in a context where this is required, it is often assumed, however, from clients
of this class that it is, so it is good to add such methods when you create them.
</p>
@@ -5050,7 +5050,7 @@
<Details>
<![CDATA[
<p>This JAX-RS endpoint is annotated to be used as @GET requests, but also documents that it
- consumes JSON or XML data. Since a get request pulls parameters from the url, and not
+ consumes JSON or XML data. Since a GET request pulls parameters from the URL, and not
the body of request, this pattern is problematic. If you wish to consume JSON or XML data,
this request should be annotated with @POST.
]]>
@@ -5075,7 +5075,7 @@
<li>javax.servlet.HttpServletRequest</li>
...
[truncated message content] |
|
From: <dbr...@us...> - 2015-12-29 21:37:12
|
Revision: 1787
http://sourceforge.net/p/fb-contrib/code/1787
Author: dbrosius
Date: 2015-12-29 21:37:08 +0000 (Tue, 29 Dec 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/samples/ACEM_Sample.java
trunk/fb-contrib/samples/MDM_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/UMTP_Sample.java
trunk/fb-contrib/samples/UTAO_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/JPAI_Sample.java
trunk/fb-contrib/samples/SEO_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/QMethod.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/.classpath 2015-12-29 21:37:08 UTC (rev 1787)
@@ -27,5 +27,7 @@
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/testng-6.9.6.jar"/>
<classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar" sourcepath="lib/sources/jsr311-api-1.1.1-sources.jar"/>
+ <classpathentry kind="lib" path="lib/spring-tx-4.2.3.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/build.xml 2015-12-29 21:37:08 UTC (rev 1787)
@@ -101,6 +101,8 @@
<pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" />
<pathelement location="${lib.dir}/commons-codec-${commons-codec.version}.jar" />
<pathelement location="${lib.dir}/jsr311-api-${jsr311-api.version}.jar" />
+ <pathelement location="${lib.dir}/spring-tx-${spring-tx.version}.jar" />
+ <pathelement location="${lib.dir}/javax.persistence-${javax.persistence.version}.jar" />
</path>
</target>
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/etc/bugrank.txt 2015-12-29 21:37:08 UTC (rev 1787)
@@ -71,6 +71,13 @@
+0 BugPattern ISB_TOSTRING_APPENDING
+0 BugPattern ITC_INHERITANCE_TYPE_CHECKING
+2 BugPattern ITU_INAPPROPRIATE_TOSTRING_USE
++1 BugPattern JPAI_HC_EQUALS_ON_MANAGED_ENTITY
++1 BugPattern JPAI_IGNORED_MERGE_RESULT
++1 BugPattern JPAI_INEFFICIENT_EAGER_FETCH
++0 BugPattern JPAI_NON_PROXIED_TRANSACTION_CALL
++0 BugPattern JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING
++0 BugPattern JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD
++0 BugPattern JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING
+0 BugPattern JVR_JDBC_VENDOR_RELIANCE
+0 BugPattern JXI_GET_ENDPOINT_CONSUMES_CONTENT
+0 BugPattern JXI_INVALID_CONTEXT_PARAMETER_TYPE
@@ -157,6 +164,7 @@
+0 BugPattern SCR_SLOPPY_CLASS_REFLECTION
+0 BugPattern SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT
+0 BugPattern SEC_SIDE_EFFECT_CONSTRUCTOR
++0 BugPattern SEO_SUBOPTIMAL_EXPRESSION_ORDER
+0 BugPattern SGSU_SUSPICIOUS_GETTER_SETTER_USE
+0 BugPattern SG_SLUGGISH_GUI
+0 BugPattern SIL_SQL_IN_LOOP
@@ -179,6 +187,7 @@
+0 BugPattern SPP_NON_USEFUL_TOSTRING
+0 BugPattern SPP_NO_CHAR_SB_CTOR
+0 BugPattern SPP_NULL_BEFORE_INSTANCEOF
++0 BugPattern SPP_NULL_CHECK_ON_OPTIONAL
+0 BugPattern SPP_SERIALVER_SHOULD_BE_PRIVATE
+0 BugPattern SPP_STATIC_FORMAT_STRING
+0 BugPattern SPP_STRINGBUFFER_WITH_EMPTY_STRING
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-12-29 21:37:08 UTC (rev 1787)
@@ -147,7 +147,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SCRV_SUSPICIOUS_COMPARATOR_RETURN_VALUES" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast"
- reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TERNARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_SERIALVER_SHOULD_BE_PRIVATE,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING,SPP_EQUALS_ON_STRING_BUILDER,SPP_CONVERSION_OF_STRING_LITERAL,SPP_STATIC_FORMAT_STRING" />
+ reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TERNARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_SERIALVER_SHOULD_BE_PRIVATE,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING,SPP_TEMPORARY_TRIM,SPP_STRINGBUILDER_IS_MUTABLE,SPP_USE_GET0,SPP_DOUBLE_APPENDED_LITERALS,SPP_NULL_BEFORE_INSTANCEOF,SPP_NON_USEFUL_TOSTRING,SPP_TOSTRING_ON_STRING,SPP_EQUALS_ON_STRING_BUILDER,SPP_CONVERSION_OF_STRING_LITERAL,SPP_STATIC_FORMAT_STRING,SPP_NULL_CHECK_ON_OPTIONAL" />
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" />
@@ -292,6 +292,11 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" />
<!-- COMMENT OUT FOR POINT RELEASE -->
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.JPAIssues" speed="fast" reports="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD,JPAI_HC_EQUALS_ON_MANAGED_ENTITY,JPAI_NON_PROXIED_TRANSACTION_CALL,JPAI_INEFFICIENT_EAGER_FETCH,JPAI_IGNORED_MERGE_RESULT,JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING,JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING"/>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.SuboptimalExpressionOrder" speed="fast" reports="SEO_SUBOPTIMAL_EXPRESSION_ORDER"/>
+
<!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
@@ -403,6 +408,7 @@
<BugPattern abbrev="SPP" type="SPP_EQUALS_ON_STRING_BUILDER" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_CONVERSION_OF_STRING_LITERAL" category="CORRECTNESS" />
<BugPattern abbrev="SPP" type="SPP_STATIC_FORMAT_STRING" category="CORRECTNESS" />
+ <BugPattern abbrev="SPP" type="SPP_NULL_CHECK_ON_OPTIONAL" category="CORRECTNESS" />
<BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" category="PERFORMANCE" />
<BugPattern abbrev="SCII" type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" category="STYLE" />
<BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" category="CORRECTNESS" />
@@ -541,5 +547,13 @@
<BugPattern abbrev="JXI" type="JXI_INVALID_CONTEXT_PARAMETER_TYPE" category="CORRECTNESS" />
<BugPattern abbrev="JXI" type="JXI_PARM_PARAM_NOT_FOUND_IN_PATH" category="CORRECTNESS" />
<BugPattern abbrev="JXI" type="JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" category="CORRECTNESS" />
+ <BugPattern abbrev="JPAI" type="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_HC_EQUALS_ON_MANAGED_ENTITY" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_NON_PROXIED_TRANSACTION_CALL" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_INEFFICIENT_EAGER_FETCH" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_IGNORED_MERGE_RESULT" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="SEO" type="SEO_SUBOPTIMAL_EXPRESSION_ORDER" category="PERFORMANCE" experimental="true"/>
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/etc/messages.xml 2015-12-29 21:37:08 UTC (rev 1787)
@@ -1547,9 +1547,32 @@
<Details>
<![CDATA[
<p>Looks for problems with the use of the JAX-RS specification.</p>
+ <p>It is a fast detector</p>
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.JPAIssues">
+ <Details>
+ <![CDATA[
+ <p>Looks for problems with the use of the JPA specification, including spring's
+ support of JPA</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.SuboptimalExpressionOrder">
+ <Details>
+ <![CDATA[
+ <p>Looks for conditional expressions that are a combination of simple local variable (in)equalities
+ and tests on the results of method calls where the method calls are done first. By placing the simple
+ conditions first you may elminate costly calls in certain cases. This assumes that the method calls
+ do not have side effects that should happen always.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -3245,6 +3268,20 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="SPP_NULL_CHECK_ON_OPTIONAL">
+ <ShortDescription>Method checks an Optional reference for null or non nullness</ShortDescription>
+ <LongDescription>Method {1} checks an Optional reference for null or non nullness</LongDescription>
+ <Details>
+ <![CDATA[
+ This method uses an Optional variable, and checks the reference value for whether it is null or not null.
+ Since the point of the Optional class is to avoid 'the null reference problem', having code that needs to
+ check the reference itself is self defeating, and therefore makes the use of the Optional variable useless.
+ You should never use a variable of type Optional that has a value of null, and so there should be no need to
+ check for it.
+ ]]>
+ </Details>
+ </BugPattern>
<BugPattern type="BAS_BLOATED_ASSIGNMENT_SCOPE">
<ShortDescription>Method assigns a variable in a larger scope than is needed</ShortDescription>
@@ -5103,6 +5140,112 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD">
+ <ShortDescription>Method has a Spring @Transactional annotation on it, but is non-public</ShortDescription>
+ <LongDescription>Method {1} has a Spring @Transactional annotation on it, but is non-public</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method specifies a Spring @Transactional annotation but the method is defined as being non public.
+ Spring only creates transactional boundaries on methods that are public, and so this annotation not doing
+ anything for this method. Make the method public, or place the annotation on a more appropriate method.
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="JPAI_HC_EQUALS_ON_MANAGED_ENTITY">
+ <ShortDescription>JPA Entity with Generated @Id defined with hashCode/equals</ShortDescription>
+ <LongDescription>JPA Entity {0} with Generated @Id defined with hashCode/equals</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This class is defined to be a JPA Entity, and has an @Id field that is generated by the JPA provider.
+ Since you do not control when that Id is created directly, it is risky to implement hashCode/equals for this
+ class, and especially for use with Collections, as the data behind the algorithms will not be immutable, and
+ thus cause problems when those fields change, and the object is in the collection. It is usually safer
+ to not define hashCode and equals for entity objects, but treat them as objects for IdentityHashSet/Maps instead.
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="JPAI_NON_PROXIED_TRANSACTION_CALL">
+ <ShortDescription>Method annotated with @Transactional is called from a non Spring proxy</ShortDescription>
+ <LongDescription>Method {1} annotated with @Transactional is called from a non Spring proxy</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method call is to a method that has a @Transactional annotation on it. However since this call is from the
+ same class, it is not going through any Spring proxy, and thus the transactional quality of this method is completely
+ lost. @Transactional method must always be called through a Spring bean that is autowired.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="JPAI_INEFFICIENT_EAGER_FETCH">
+ <ShortDescription>OneToMany join specifies 1+n EAGER join</ShortDescription>
+ <LongDescription>OneToMany join specifies 1+n EAGER join</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This JPA entity specifies a @OneToMany join with a fetch type of EAGER. By Default EAGER joins perform
+ select operations on each element returned from the original query in sequence, thus producing 1 + n queries.
+ If you are going to use EAGER joins, it is wise to specify a Join type by using @Fetch annotations in
+ Hibernate or @JoinFetch/@BatchFetch annotations (or hints) in EclipseLink, for example. Even so, These
+ annotations may only apply in limited cases, such as in the use of find.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="JPAI_IGNORED_MERGE_RESULT">
+ <ShortDescription>Method ignores the return value of EntityManager.merge</ShortDescription>
+ <LongDescription>Method {1} ignores the return value of EntityManager.merge</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method calls EntityManager.merge, and throws away the resultant value. This result is the
+ managed entity version of the potentially unmanaged object that was passed to merge. You should use
+ the returned managed entity for any further use.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING">
+ <ShortDescription>Method does not specify how to handle transaction when exception is thrown</ShortDescription>
+ <LongDescription>Method {1} does not specify how to handle transaction when exception is thrown</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method declares that it throws one or more non-runtime exceptions. It also is annotated with a
+ @Transactional annotation but fails to describe whether to rollback the transaction or not based on this
+ thrown exception. use 'rollbackFor' or 'noRollbackFor' attributes of the Transactional annotation to
+ document this.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING">
+ <ShortDescription>Method declares handling a transactional exception that won't be thrown</ShortDescription>
+ <LongDescription>Method {1} declares handling a transactional exception that won't be thrown</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method declares that it either rolls back or does not rollback a transaction based on an
+ expected transaction being thrown. However this exception can not be thrown from this method, and so the
+ annotation is useless.</p>
+ ]]>
+ </Details>
+ </BugPattern>
+
+ <BugPattern type="SEO_SUBOPTIMAL_EXPRESSION_ORDER">
+ <ShortDescription>Method orders expressions in a conditional in a sub optimal way</ShortDescription>
+ <LongDescription>Method {1} orders expressions in a conditional in a sub optimal way</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method builds a conditional for an if or while statement where the expressions contain both simple
+ local variable comparisons, as well as comparisons on method calls. The expression orders these so that the method calls
+ come before the simple local variable call comparisons. This causes method calls to be executed in conditions when they
+ do not need to be, and thus potentially causes a lot of code to be executed for nothing. By ordering the expressions so that
+ the simple conditions contains local variable conditions are first, you eliminate this waste. This assumes that the method
+ calls do not have side effects. If the method do have side effects, it is probably a better idea to pull these calls out of
+ the condition and execute them first, assigning a value to a local variable. In this way you give a hint that the call may have
+ side effects.</p>
+ ]]>
+ </Details>
+ </BugPattern>
<!-- BugCode -->
@@ -5234,4 +5377,6 @@
<BugCode abbrev="CRF">Conflating Resources And Files</BugCode>
<BugCode abbrev="IMC">Immature Class</BugCode>
<BugCode abbrev="JXI">JAX-RS Issues</BugCode>
+ <BugCode abbrev="JPAI">JPA Issues</BugCode>
+ <BugCode abbrev="SEO">Suboptimal Expression Order</BugCode>
</MessageCollection>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/htdocs/index.shtml 2015-12-29 21:37:08 UTC (rev 1787)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.4.0 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.4.1 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
@@ -86,6 +86,17 @@
same kind of exception, and throw the same exception always. These blocks can
be coalesced into one.
</li>
+ <li><b>[JPAI] JPA Issues</b><br/>
+ Looks for various issues around the use of the Java Persistence API (JPA), including
+ with use with spring-tx.
+ </li>
+ <li><b>[SEO] Suboptimal Expression Order</b><br/>
+ Looks for conditional expressions where both simple local variable (in)equalities are used
+ along with method calls, where the method calls are done first. By placing the simple local
+ checks first, you eliminate potentially costly calls in some cases. This assumes that the methods
+ called won't have side-effects that are desired. At present it only looks for simple sequences
+ of 'and' based conditions.
+ </li>
</ul>
</div>
<hr/>
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/htdocs/repository.html 2015-12-29 21:37:08 UTC (rev 1787)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.4.0</td></tr>
+ <tr><td><b>Version:</b></td><td>6.4.1</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/samples/ACEM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/ACEM_Sample.java 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/samples/ACEM_Sample.java 2015-12-29 21:37:08 UTC (rev 1787)
@@ -1,9 +1,19 @@
-public abstract class ACEM_Sample {
+public abstract class ACEM_Sample implements Foo {
public void test() {
}
public int test1() {
throw new UnsupportedOperationException("Not implemented");
}
+
+ @Override
+ public void doFPFoo() {
+ }
+
+
+}
+
+interface Foo {
+ void doFPFoo();
}
\ No newline at end of file
Added: trunk/fb-contrib/samples/JPAI_Sample.java
===================================================================
--- trunk/fb-contrib/samples/JPAI_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/JPAI_Sample.java 2015-12-29 21:37:08 UTC (rev 1787)
@@ -0,0 +1,145 @@
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityManager;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+import org.springframework.transaction.annotation.Transactional;
+
+public class JPAI_Sample {
+
+ EntityManager em;
+
+ @Transactional
+ private void writeData() {
+ }
+
+ @Transactional
+ public void writeGoodData() {
+ }
+
+ private void badWrite() {
+ writeGoodData();
+ }
+
+ public void ignoreMergeResult(MyEntity e, SubEntity s) {
+
+ em.merge(e);
+ em.merge(s);
+
+ List<SubEntity> ss = new ArrayList<SubEntity>();
+ ss.add(s);
+ e.setSubEntities(ss);
+
+ em.flush();
+ }
+
+ @Transactional
+ public void noRollbacks(MyEntity e) throws IOException {
+
+ }
+
+ @Transactional(rollbackFor = { SQLException.class, CloneNotSupportedException.class }, noRollbackFor = IOException.class)
+ public void noDeclaredRollbackExceptions() {
+ }
+
+ @Transactional(rollbackFor = SQLException.class, noRollbackFor = IOException.class)
+ public void fpDefinedRollBack(MyEntity e) throws SQLException, FileNotFoundException {
+ }
+
+ @Transactional(readOnly = true)
+ public void fpReadOnlyExceptions(MyEntity e) throws IOException {
+ }
+
+ @Entity
+ @Table(name = "MY_ENTITY")
+ public static class MyEntity {
+
+ private Integer id;
+ private List<SubEntity> subEntities;
+
+ @Id
+ @SequenceGenerator(name = "MY_ENTITY_SEQ", sequenceName = "MY_ENTITY_SEQ", allocationSize = 100)
+ @GeneratedValue(generator = "MY_ENTITY_SEQ")
+ @Column(name = "ID", nullable = false, unique = true)
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "myEntity", targetEntity = MyEntity.class)
+ public List<SubEntity> getSubEntities() {
+ return subEntities;
+ }
+
+ public void setSubEntities(List<SubEntity> subEntities) {
+ this.subEntities = subEntities;
+ }
+
+ @Override
+ public int hashCode() {
+ return id.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof MyEntity)) {
+ return false;
+ }
+
+ MyEntity that = (MyEntity) o;
+ if (id == null) {
+ return that.id == null;
+ }
+
+ return id.equals(that.id);
+ }
+ }
+
+ @Entity
+ @Table(name = "SUB_ENTITY")
+ public static class SubEntity {
+
+ public Integer subId;
+ public MyEntity myEntity;
+
+ @Id
+ @SequenceGenerator(name = "SUB_ENTITY_SEQ", sequenceName = "SUB_ENTITY_SEQ", allocationSize = 100)
+ @GeneratedValue(generator = "SUB_ENTITY_SEQ")
+ @Column(name = "SUB_ID", nullable = false, unique = true)
+ public Integer getSubId() {
+ return subId;
+ }
+
+ public void setSubId(Integer subId) {
+ this.subId = subId;
+ }
+
+ @JoinColumn(name = "ID", referencedColumnName = "ID", nullable = false)
+ @ManyToOne(fetch = FetchType.EAGER, targetEntity = MyEntity.class)
+ public MyEntity getMyEntity() {
+ return myEntity;
+ }
+
+ public void setMyEntity(MyEntity myEntity) {
+ this.myEntity = myEntity;
+ }
+
+ }
+}
Property changes on: trunk/fb-contrib/samples/JPAI_Sample.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/fb-contrib/samples/MDM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/MDM_Sample.java 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/samples/MDM_Sample.java 2015-12-29 21:37:08 UTC (rev 1787)
@@ -12,6 +12,9 @@
import javax.net.ssl.SSLServerSocketFactory;
public class MDM_Sample implements Runnable {
+ private ReentrantLock myLock;
+
+
public MDM_Sample() throws Exception {
boolean b;
@@ -103,4 +106,8 @@
private static void touch(Object o) {
}
+
+ private void fpAssertReentrantLock() {
+ assert myLock.isHeldByCurrentThread();
+ }
}
Modified: trunk/fb-contrib/samples/OCP_Sample.java
===================================================================
--- trunk/fb-contrib/samples/OCP_Sample.java 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/samples/OCP_Sample.java 2015-12-29 21:37:08 UTC (rev 1787)
@@ -165,6 +165,7 @@
}
class fpOverride {
+ @SuppressWarnings("deprecation")
public static final Comparator<Date> COMPARATOR = new Comparator<Date>() {
@Override // no tag, override
Modified: trunk/fb-contrib/samples/PRMC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/PRMC_Sample.java 2015-12-12 17:33:56 UTC (rev 1786)
+++ trunk/fb-contrib/samples/PRMC_Sample.java 2015-12-29 21:37:08 UTC (rev 1787)
@@ -15,6 +15,8 @@
private static PRMC_Sample SAMPLE1;
private static PRMC_Sample SAMPLE2;
String data;
+ String[] array1;
+ String[] array2;
public boolean test1(Calendar c) {
Date d = c.getTime();
@@ -149,4 +151,13 @@
return sb.toString();
}
}
-}
+
+ class SFIssue71 {
+ protected String[] inc = new String[0];
+ protected String[] dec = new String[0];
+
+ public voi...
[truncated message content] |
|
From: <dbr...@us...> - 2015-12-30 20:32:19
|
Revision: 1788
http://sourceforge.net/p/fb-contrib/code/1788
Author: dbrosius
Date: 2015-12-30 20:32:17 +0000 (Wed, 30 Dec 2015)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/build.xml 2015-12-30 20:32:17 UTC (rev 1788)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.5.0-SNAPSHOT" />
+ <property name="fb-contrib.version" value="6.4.2" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/etc/findbugs.xml 2015-12-30 20:32:17 UTC (rev 1788)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -32,7 +32,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
-<!-- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -291,13 +291,13 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" />
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE
<Detector class="com.mebigfatguy.fbcontrib.detect.JPAIssues" speed="fast" reports="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD,JPAI_HC_EQUALS_ON_MANAGED_ENTITY,JPAI_NON_PROXIED_TRANSACTION_CALL,JPAI_INEFFICIENT_EAGER_FETCH,JPAI_IGNORED_MERGE_RESULT,JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING,JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuboptimalExpressionOrder" speed="fast" reports="SEO_SUBOPTIMAL_EXPRESSION_ORDER"/>
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/etc/messages.xml 2015-12-30 20:32:17 UTC (rev 1788)
@@ -3859,8 +3859,9 @@
<LongDescription>Method {1} creates exception with logger parameter markers in message</LongDescription>
<Details>
<![CDATA[
- <p>This method creates a standard exception passing a message string which contains an SLF4J style
- parameter marker '{}'. This marker will not be translated as it is not processed by the Exception class.
+ <p>This method passes a standard exception as a logger parameter, and expects this exception to be substituted in
+ an SLF4J style parameter marker '{}'. This marker will not be translated as SLF4J doesn't process the Exception class
+ for markers.
</p>
]]>
</Details>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/htdocs/index.shtml 2015-12-30 20:32:17 UTC (rev 1788)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.4.1 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.4.2 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/htdocs/repository.html 2015-12-30 20:32:17 UTC (rev 1788)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.4.1</td></tr>
+ <tr><td><b>Version:</b></td><td>6.4.2</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/pom.xml 2015-12-30 20:32:17 UTC (rev 1788)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.5.0-SNAPSHOT</version>
+ <version>6.4.2</version>
<prerequisites>
<maven>2.2.1</maven>
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2015-12-29 21:37:08 UTC (rev 1787)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2015-12-30 20:32:17 UTC (rev 1788)
@@ -253,6 +253,11 @@
}
}
+ /**
+ * looks for a variety of logging issues with log statements
+ *
+ * @throws ClassNotFoundException if the exception class, or a parent class can't be found
+ */
private void checkForProblemsWithLoggerMethods() throws ClassNotFoundException {
String callingClsName = getClassConstantOperand();
if (callingClsName.endsWith("Log") || (callingClsName.endsWith("Logger"))) {
@@ -316,6 +321,10 @@
}
}
+ /**
+ * looks for slf4j calls where an exception is passed as a logger parameter, expecting to be substituted for a {}
+ * marker. As slf4j just passes the exception down to the message generation itself, the {} marker will go unpopulated.
+ */
private void checkForLoggerParam() {
if (Values.CONSTRUCTOR.equals(getNameConstantOperand())) {
String cls = getClassConstantOperand();
@@ -339,6 +348,11 @@
}
}
+ /**
+ * looks for instantiation of a logger with what looks like a class name that isn't the same
+ * as the class in which it exists. There are some cases where a 'classname-like' string is
+ * presented purposely different than this class, and an attempt is made to ignore those.
+ */
private void lookForSuspectClasses() {
String callingClsName = getClassConstantOperand();
String mthName = getNameConstantOperand();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2016-01-25 22:40:05
|
Revision: 1789
http://sourceforge.net/p/fb-contrib/code/1789
Author: dbrosius
Date: 2016-01-25 22:39:59 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/license.txt
trunk/fb-contrib/plugin.xml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/BED_Sample.java
trunk/fb-contrib/samples/IMC_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/UCPM_Sample.java
trunk/fb-contrib/samples/UTAO_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/StatisticsKey.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TailRecursion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/PublicAPI.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/QMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/UnmodifiableSet.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/IOI_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IOIssues.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2015-12-30 20:32:17 UTC (rev 1788)
+++ trunk/fb-contrib/.classpath 2016-01-25 22:39:59 UTC (rev 1789)
@@ -16,7 +16,7 @@
<classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/>
<classpathentry kind="lib" path="lib/annotations-3.0.0.jar"/>
- <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar"/>
+ <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar" sourcepath="/home/dave/.m2/repository/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2-sources.jar"/>
<classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar" sourcepath="lib/sources/bcel-findbugs-6.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="http://commons.apache.org/proper/commons-bcel/apidocs/"/>
@@ -29,5 +29,7 @@
<classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar" sourcepath="lib/sources/jsr311-api-1.1.1-sources.jar"/>
<classpathentry kind="lib" path="lib/spring-tx-4.2.3.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-io-1.3.2.jar" sourcepath="lib/sources/commons-io-1.3.2-sources.jar"/>
+ <classpathentry kind="lib" path="lib/mockito-all-2.0.2-beta.jar"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2015-12-30 20:32:17 UTC (rev 1788)
+++ trunk/fb-contrib/build.xml 2016-01-25 22:39:59 UTC (rev 1789)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.4.2" />
+ <property name="fb-contrib.version" value="6.6.0" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -42,6 +42,7 @@
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/>
<get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.2.0/fb-delta-0.2.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/>
</target>
<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
@@ -55,7 +56,8 @@
<target name="info">
<echo message="fb-contrib - a findbugs plugin"/>
<echo message=""/>
- <echo message=" This project requires three jars to build fb-contrib: yank, bug-rank-check-style and vcsversion" />
+ <echo message=" This project requires three jars to build fb-contrib: yank, bug-rank-check-style, vcsversion and" />
+ <echo message=" and optionally fb-delta, to generate delta's of bug reports"/>
<echo message=""/>
<echo message=" This project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
<echo message=" download yank.jar and place in ~/.ant/lib directory"/>
@@ -70,6 +72,12 @@
<echo message=" and can be downloaded and placed in ~/.ant/lib as well"/>
<echo message=" http://search.maven.org/#search%7Cga%7C1%7Cvcsversion"/>
<echo message="===="/>
+ <echo message=" If you want to generate delta reports between two sample.xml runs, this project also uses fb-delta to do"/>
+ <echo message=" delta-ing between two samples.xml files, to report what has been 'fixed' and what is 'new'"/>
+ <echo message=" and can be downloaded and placed in ~/.ant/lib as well"/>
+ <echo message=" http://search.maven.org/#search%7Cga%7C1%7Cfb-delta"/>
+ <echo message="===="/>
+
<echo message=" This task can be automated by running ant infra_jars"/>
</target>
@@ -93,9 +101,10 @@
<pathelement location="${lib.dir}/javax.servlet-api-${javax.servlet-api.version}.jar" />
<pathelement location="${lib.dir}/log4j-${log4j.version}.jar" />
<pathelement location="${lib.dir}/commons-lang3-${commons-lang3.version}.jar" />
- <pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" />
- <pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" />
- <pathelement location="${lib.dir}/guava-${guava.version}.jar" />
+ <pathelement location="${lib.dir}/commons-io-${commons-io.version}.jar" />
+ <pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" />
+ <pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" />
+ <pathelement location="${lib.dir}/guava-${guava.version}.jar" />
<pathelement location="${lib.dir}/httpclient-cache-${httpclient-cache.version}.jar" />
<pathelement location="${lib.dir}/httpcore-${httpcore.version}.jar" />
<pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" />
@@ -103,6 +112,7 @@
<pathelement location="${lib.dir}/jsr311-api-${jsr311-api.version}.jar" />
<pathelement location="${lib.dir}/spring-tx-${spring-tx.version}.jar" />
<pathelement location="${lib.dir}/javax.persistence-${javax.persistence.version}.jar" />
+ <pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" />
</path>
</target>
@@ -111,7 +121,7 @@
<xmlvalidate lenient="false" failonerror="yes">
<attribute name="http://apache.org/xml/features/validation/schema" value="true" />
<attribute name="http://xml.org/sax/features/namespaces" value="true" />
- <fileset dir="${etc.dir}" includes="*.xml" />
+ <fileset dir="${etc.dir}" includes="*.xml" excludes="findbugs-exclude.xml"/>
</xmlvalidate>
<bug-rank-check-style findbugsxml="etc/findbugs.xml" failOnMissingDetector="false" />
</target>
@@ -195,7 +205,7 @@
<target name="javadoc" depends="-init" description="build the javadoc for the project">
<javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api">
<doctitle><![CDATA[<h1>fb-contrib javadoc</h1>]]></doctitle>
- <bottom><![CDATA[<i>Copyright © 2005-2015 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
+ <bottom><![CDATA[<i>Copyright © 2005-2016 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
@@ -210,6 +220,21 @@
</fileset>
</copy>
</target>
+
+ <target name="sample_delta" depends="build" xmlns:fbdelta="antlib:com.mebigfatguy.fbdelta" description="compares this runs reported bugs on the sample classes set, against the stored report">
+ <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${lib.dir}/findbugs-ant-${findbugs-ant.version}.jar"/>
+ <findbugs reportlevel="low" home="${findbugs.dir}" auxClassPathRef="fb-contrib.samples.classpath" output="xml:withMessages" jvmargs="-ea -Xmx800m" projectName="Samples" outputFile="${target.dir}/samples.xml">
+ <class location="${samples.classes.dir}" />
+ </findbugs>
+
+ <fbdelta:fbdelta baseReport="${basedir}/samples.xml" updateReport="${target.dir}/samples.xml" outputReport="${target.dir}/samples_delta.xml" changed="delta"/>
+ <antcall target="report"/>
+ </target>
+
+ <target name="report" if="${delta}">
+ <loadfile property="diff" srcFile="${target.dir}/samples_delta.xml"/>
+ <echo>${diff}</echo>
+ </target>
<target name="release" depends="build, srczip, html, javadoc" description="prepares everything for a release" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2015-12-30 20:32:17 UTC (rev 1788)
+++ trunk/fb-contrib/etc/bugrank.txt 2016-01-25 22:39:59 UTC (rev 1789)
@@ -60,10 +60,13 @@
+0 BugPattern IICU_INCORRECT_INTERNAL_CLASS_USE
+0 BugPattern IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING
+0 BugPattern IKNC_INCONSISTENT_HTTP_PARAM_CASING
++1 BugPattern IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES
+2 BugPattern IMC_IMMATURE_CLASS_NO_EQUALS
+2 BugPattern IMC_IMMATURE_CLASS_NO_HASHCODE
+0 BugPattern IMC_IMMATURE_CLASS_NO_PACKAGE
+2 BugPattern IMC_IMMATURE_CLASS_NO_TOSTRING
++0 BugPattern IOI_COPY_WITH_READER
++0 BugPattern IOI_DOUBLE_BUFFER_COPY
+0 BugPattern IPU_IMPROPER_PROPERTIES_USE
+0 BugPattern IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY
+0 BugPattern ISB_EMPTY_STRING_APPENDING
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2015-12-30 20:32:17 UTC (rev 1788)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-01-25 22:39:59 UTC (rev 1789)
@@ -28,8 +28,6 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedSynchronizedBlock" speed="fast" reports="BSB_BLOATED_SYNCHRONIZED_BLOCK" hidden="true" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" />
-
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
COMMENT OUT FOR RELEASE -->
@@ -209,7 +207,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" />
<Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast"
- reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" />
+ reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE,MDM_LOCK_ISLOCKED,MDM_SIGNAL_NOT_SIGNALALL" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods" speed="fast" reports="ROOM_REFLECTION_ON_OBJECT_METHODS" />
@@ -247,7 +245,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.NonProductiveMethodCall" speed="fast" reports="NPMC_NON_PRODUCTIVE_METHOD_CALL" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument" speed="fast" reports="ICA_INVALID_CONSTANT_ARRAY" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument" speed="fast" reports="ICA_INVALID_CONSTANT_ARGUMENT" />
<Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" />
@@ -287,18 +285,21 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes" speed="fast" reports="STT_STRING_PARSING_A_FIELD,STT_TOSTRING_STORED_IN_FIELD" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING,IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES" />
<Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" />
-
- <!-- COMMENT OUT FOR POINT RELEASE
+ <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" />
+
<Detector class="com.mebigfatguy.fbcontrib.detect.JPAIssues" speed="fast" reports="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD,JPAI_HC_EQUALS_ON_MANAGED_ENTITY,JPAI_NON_PROXIED_TRANSACTION_CALL,JPAI_INEFFICIENT_EAGER_FETCH,JPAI_IGNORED_MERGE_RESULT,JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING,JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuboptimalExpressionOrder" speed="fast" reports="SEO_SUBOPTIMAL_EXPRESSION_ORDER"/>
- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues" speed="fast" reports="IOI_DOUBLE_BUFFER_COPY,IOI_COPY_WITH_READER"/>
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -539,6 +540,7 @@
<BugPattern abbrev="STT" type="STT_TOSTRING_STORED_IN_FIELD" category="STYLE" />
<BugPattern abbrev="SLS" type="SLS_SUSPICIOUS_LOOP_SEARCH" category="CORRECTNESS" />
<BugPattern abbrev="CRF" type="CRF_CONFLATING_RESOURCES_AND_FILES" category="CORRECTNESS" />
+ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES" category="STYLE" />
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_EQUALS" category="STYLE" />
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_HASHCODE" category="STYLE" />
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_PACKAGE" category="STYLE" />
@@ -555,5 +557,7 @@
<BugPattern abbrev="JPAI" type="JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/>
<BugPattern abbrev="JPAI" type="JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/>
<BugPattern abbrev="SEO" type="SEO_SUBOPTIMAL_EXPRESSION_ORDER" category="PERFORMANCE" experimental="true"/>
+ <BugPattern abbrev="IOI" type="IOI_DOUBLE_BUFFER_COPY" category="PERFORMANCE" experimental="true"/>
+ <BugPattern abbrev="IOI" type="IOI_COPY_WITH_READER" category="PERFORMANCE" experimental="true"/>
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2015-12-30 20:32:17 UTC (rev 1788)
+++ trunk/fb-contrib/etc/messages.xml 2016-01-25 22:39:59 UTC (rev 1789)
@@ -1573,6 +1573,15 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues">
+ <Details>
+ <![CDATA[
+ <p>Looks for various issues around doing I/O with streams and reader/writers.</p>
+ <p>It is a fast detector</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -5082,6 +5091,19 @@
</Details>
</BugPattern>
+ <BugPattern type="IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES">
+ <ShortDescription>Method uses IDE generated parameter names</ShortDescription>
+ <LongDescription>Method {1} uses IDE generated parameter names</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method appears to have been generated from an interface or super class using an IDE.
+ As such the IDE generated generic names (arg0, arg1, arg2) for parameters for this method,
+ and the author of this method did not change them to be meaningful. For better understandability
+ it is recommended that you name these parameters with regard to their function.
+ ]]>
+ </Details>
+ </BugPattern>
+
<BugPattern type="JXI_GET_ENDPOINT_CONSUMES_CONTENT">
<ShortDescription>JAX-RS Method implements a GET request but consumes input</ShortDescrip...
[truncated message content] |
|
From: <dbr...@us...> - 2016-04-18 22:19:59
|
Revision: 1791
http://sourceforge.net/p/fb-contrib/code/1791
Author: dbrosius
Date: 2016-04-18 22:19:54 +0000 (Mon, 18 Apr 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/mbfg_menu.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/CD_Sample.java
trunk/fb-contrib/samples/IMC_Sample.java
trunk/fb-contrib/samples/UTAO_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IOIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/QMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/UnmodifiableSet.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/.classpath 2016-04-18 22:19:54 UTC (rev 1791)
@@ -31,5 +31,6 @@
<classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-1.3.2.jar" sourcepath="lib/sources/commons-io-1.3.2-sources.jar"/>
<classpathentry kind="lib" path="lib/mockito-all-2.0.2-beta.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/build.xml 2016-04-18 22:19:54 UTC (rev 1791)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.6.0" />
+ <property name="fb-contrib.version" value="6.6.1" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/etc/bugrank.txt 2016-04-18 22:19:54 UTC (rev 1791)
@@ -65,6 +65,7 @@
+2 BugPattern IMC_IMMATURE_CLASS_NO_HASHCODE
+0 BugPattern IMC_IMMATURE_CLASS_NO_PACKAGE
+2 BugPattern IMC_IMMATURE_CLASS_NO_TOSTRING
++0 BugPattern IMC_IMMATURE_CLASS_PRINTSTACKTRACE
+0 BugPattern IOI_COPY_WITH_READER
+0 BugPattern IOI_DOUBLE_BUFFER_COPY
+0 BugPattern IPU_IMPROPER_PROPERTIES_USE
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-04-18 22:19:54 UTC (rev 1791)
@@ -285,7 +285,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes" speed="fast" reports="STT_STRING_PARSING_A_FIELD,STT_TOSTRING_STORED_IN_FIELD" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING,IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING,IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES,IMC_IMMATURE_CLASS_PRINTSTACKTRACE" />
<Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" />
@@ -545,6 +545,7 @@
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_HASHCODE" category="STYLE" />
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_PACKAGE" category="STYLE" />
<BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_TOSTRING" category="STYLE" />
+ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_PRINTSTACKTRACE" category="STYLE" />
<BugPattern abbrev="JXI" type="JXI_GET_ENDPOINT_CONSUMES_CONTENT" category="CORRECTNESS" />
<BugPattern abbrev="JXI" type="JXI_INVALID_CONTEXT_PARAMETER_TYPE" category="CORRECTNESS" />
<BugPattern abbrev="JXI" type="JXI_PARM_PARAM_NOT_FOUND_IN_PATH" category="CORRECTNESS" />
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/etc/messages.xml 2016-04-18 22:19:54 UTC (rev 1791)
@@ -1535,7 +1535,10 @@
<p>Looks for classes that are not fully complete from a usability point of view. Making them more difficult to use
than it should be. Things such as
<ul>
+ <li>Using the default package</li>
+ <li>Missing hashCode/equals</li>
<li>Missing toString() method</li>
+ <li>Using autogenerated parameter names</li>
</ul>
</p>
<p>It is a moderately fast detector.</p>
@@ -5032,7 +5035,7 @@
<![CDATA[
<p>This method fetches a resource from a URL, and uses the File API to manipulate it. If this resource is a
classpath resource, it will work if the resource is a file in a directory. If however the file is inside a JAR file
- this will fail. Use the URL.openStream API instead to access the data of the classpath resource.
+ this will fail. To avoid this confusing inconsistency, use the URL.openStream API instead to access the data of the classpath resource.
</p>
]]>
</Details>
@@ -5083,8 +5086,8 @@
<LongDescription>Class {0} does not implement a toString method</LongDescription>
<Details>
<![CDATA[
- <p>This class which has instance fields has no toString() method, which will make debugging with this
- class more difficult than it could be. Consider adding a method. Using libraries like commons-lang3
+ <p>This class, which has instance fields, has no toString() method which will make debugging with this
+ class more difficult than it could be. Consider adding a toString() method. Using libraries like commons-lang3
ToStringBuilder makes this process easy.
</p>
]]>
@@ -5104,6 +5107,18 @@
</Details>
</BugPattern>
+ <BugPattern type="IMC_IMMATURE_CLASS_PRINTSTACKTRACE">
+ <ShortDescription>Method prints the stack trace to the console</ShortDescription>
+ <LongDescription>Method {1} prints the stack trace to the console</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method prints a stack trace to the console. This is non configurable, and causes an
+ application to look unprofessional. Switch to using loggers so that users can control what
+ is logged and where.
+ ]]>
+ </Details>
+ </BugPattern>
+
<BugPattern type="JXI_GET_ENDPOINT_CONSUMES_CONTENT">
<ShortDescription>JAX-RS Method implements a GET request but consumes input</ShortDescription>
<LongDescription>JAX-RS Method {1} implements a GET request but consumes input</LongDescription>
@@ -5247,7 +5262,7 @@
<Details>
<![CDATA[
<p>This method declares that it either rolls back or does not rollback a transaction based on an
- expected transaction being thrown. However this exception can not be thrown from this method, and so the
+ expected exception being thrown. However this exception, nor any derived exceptions can not be thrown from this method, and so the
annotation is useless.</p>
]]>
</Details>
@@ -5260,9 +5275,9 @@
<![CDATA[
<p>This method builds a conditional expression, for example, in an if or while statement where the expressions contain both simple
local variable comparisons, as well as comparisons on method calls. The expression orders these so that the method calls
- come before the simple local variable call comparisons. This causes method calls to be executed in conditions when they
+ come before the simple local variable comparisons. This causes method calls to be executed in conditions when they
do not need to be, and thus potentially causes a lot of code to be executed for nothing. By ordering the expressions so that
- the simple conditions contains local variable conditions are first, you eliminate this waste. This assumes that the method
+ the simple conditions containing local variable conditions are first, you eliminate this waste. This assumes that the method
calls do not have side effects. If the method do have side effects, it is probably a better idea to pull these calls out of
the condition and execute them first, assigning a value to a local variable. In this way you give a hint that the call may have
side effects.</p>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/htdocs/index.shtml 2016-04-18 22:19:54 UTC (rev 1791)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.6.0 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.6.1 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
Modified: trunk/fb-contrib/htdocs/mbfg_menu.shtml
===================================================================
--- trunk/fb-contrib/htdocs/mbfg_menu.shtml 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/htdocs/mbfg_menu.shtml 2016-04-18 22:19:54 UTC (rev 1791)
@@ -2,8 +2,10 @@
<a id="mbfg_menu" href="#" >Other MeBigFatGuy Projects</a>
<div id="mbfg_projects">
<ul>
+ <li><a href="https://github.com/mebigfatguy/deadmethods">DeadMethods</a></li>
+ <li><a href="https://github.com/mebigfatguy/hashshmash">HashShmash</a></li>
<li><a href="http://beansource.sf.net">Beansource</a></li>
- <li><a href="http://fb-contrib.sf.net">FB-Contrib</a></li>
+ <li><a href="https://github.com/mebigfatguy/fb-contrib">FB-Contrib</a></li>
<li><a href="http://mongobrowser.sf.net">MongoBrowser</a></li>
<li><a href="http://mysfstats.sf.net">MySFStats</a></li>
<li><a href="http://patchanim.sf.net">PatchAnim</a></li>
@@ -12,7 +14,6 @@
<li><a href="http://schemalizer.sf.net">Schemalizer</a></li>
<li><a href="http://tomailer.sf.net">ToMailer</a></li>
<li><a href="http://jd4a.sf.net">JavaDoc for Android</a></li>
- <li><a href="http://damus.sf.net">Damus</a></li>
<li><a href="http://www.heartofgoldfarm.com">Heart of Gold Farm</a></li>
</ul>
</div>
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/htdocs/repository.html 2016-04-18 22:19:54 UTC (rev 1791)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.6.0</td></tr>
+ <tr><td><b>Version:</b></td><td>6.6.1</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/pom.xml 2016-04-18 22:19:54 UTC (rev 1791)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.6.0</version>
+ <version>6.6.1</version>
<prerequisites>
<maven>2.2.1</maven>
@@ -140,10 +140,29 @@
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
+ <dependency><scope>test</scope><groupId>backport-util-concurrent</groupId><artifactId>backport-util-concurrent</artifactId><version>3.1</version></dependency>
+ <dependency><scope>test</scope><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>17.0</version></dependency>
+ <dependency><scope>test</scope><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.6</version></dependency>
+ <dependency><scope>test</scope><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.4</version></dependency>
+ <dependency><scope>test</scope><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.2.1</version></dependency>
+ <dependency><scope>test</scope><groupId>javax.persistence</groupId><artifactId>persistence-api</artifactId><version>1.0.2</version></dependency>
+ <dependency><scope>test</scope><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version></dependency>
+ <dependency><scope>test</scope><groupId>javax.servlet.jsp</groupId><artifactId>javax.servlet.jsp-api</artifactId><version>2.3.1</version></dependency>
+ <dependency><scope>test</scope><groupId>javax.ws.rs</groupId><artifactId>jsr311-api</artifactId><version>1.1.1</version></dependency>
+ <dependency><scope>test</scope><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency>
+ <dependency><scope>test</scope><groupId>log4j</groupId><artifactId>log4j</artifactId><version>1.2.17</version></dependency>
+ <dependency><scope>test</scope><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.3</version></dependency>
+ <dependency><scope>test</scope><groupId>org.apache.httpcomponents</groupId><artifactId>httpclient</artifactId><version>4.3.4</version></dependency>
+ <dependency><scope>test</scope><groupId>org.apache.httpcomponents</groupId><artifactId>httpcore</artifactId><version>4.3.2</version></dependency>
+ <dependency><scope>test</scope><groupId>org.mockito</groupId><artifactId>mockito-all</artifactId><version>1.10.19</version></dependency>
+ <dependency><scope>test</scope><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.7.7</version></dependency>
+ <dependency><scope>test</scope><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId><version>4.2.4.RELEASE</version></dependency>
+ <dependency><scope>test</scope><groupId>org.testng</groupId><artifactId>testng</artifactId><version>6.9.10</version></dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
+ <testSourceDirectory>${basedir}/samples</testSourceDirectory>
<outputDirectory>${basedir}/target/classes/main</outputDirectory>
<resources>
<resource>
@@ -221,6 +240,9 @@
<configuration>
<excludeFilterFile>etc/findbugs-exclude.xml</excludeFilterFile>
<effort>Max</effort>
+ <plugins>
+ <plugin><groupId>com.mebigfatguy.fb-contrib</groupId><artifactId>fb-contrib</artifactId><version>${project.version}</version></plugin>
+ </plugins>
</configuration>
<executions>
<execution>
Modified: trunk/fb-contrib/samples/BAS_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BAS_Sample.java 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/samples/BAS_Sample.java 2016-04-18 22:19:54 UTC (rev 1791)
@@ -123,7 +123,17 @@
System.out.println(h);
}
}
+
+ public void tstFPRefChangeThruMethodChain(Holder h1, Holder h2, boolean b) {
+ String h = h1.toString().trim();
+ h1 = h2;
+
+ if (b) {
+ System.out.println(h);
+ }
+ }
+
public void testFPSrcOverwrite(int src, boolean b) {
int d = src;
src = 0;
Modified: trunk/fb-contrib/samples/CD_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CD_Sample.java 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/samples/CD_Sample.java 2016-04-18 22:19:54 UTC (rev 1791)
@@ -61,3 +61,21 @@
return data;
}
}
+
+class GitHubIssue101 {
+ protected void onCreate(final String savedInstanceState) {
+ final Intent intent = new Intent(ChildWithUsedClassObj.class);
+ startActivity(intent);
+ }
+
+ private void startActivity(Intent i) {
+ }
+}
+
+class ChildWithUsedClassObj extends GitHubIssue101 {
+}
+
+class Intent {
+ Intent(Class c) {
+ }
+}
Modified: trunk/fb-contrib/samples/IMC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/IMC_Sample.java 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/samples/IMC_Sample.java 2016-04-18 22:19:54 UTC (rev 1791)
@@ -1,3 +1,7 @@
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -21,6 +25,14 @@
@SuperSecret
private String dontReportMe;
}
+
+ public void psf(File f) {
+ try (InputStream is = new FileInputStream(f)) {
+ is.read();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
class IMCFPHasAToString {
Modified: trunk/fb-contrib/samples/UTAO_Sample.java
===================================================================
--- trunk/fb-contrib/samples/UTAO_Sample.java 2016-01-25 22:44:19 UTC (rev 1790)
+++ trunk/fb-contrib/samples/UTAO_Sample.java 2016-04-18 22:19:54 UTC (rev 1791)
@@ -1,6 +1,7 @@
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import junit.framework.TestCase;
@@ -103,7 +104,7 @@
}
class TestNG {
- @org.testng.annotations.Test
+ @org.testng.annotations.Test(enabled = false)
public void nada() {
}
@@ -178,7 +179,7 @@
org.testng.Assert.assertEquals(boo, 20, 0);
}
- @org.testng.annotations.Test(expectedExceptions = RuntimeException.class)
+ @org.testng.annotations.Test(expectedExceptions = RuntimeException.class, enabled = false)
public void fpNoAssertsWithNGExpects() {
throw new RuntimeException();
}
@@ -197,9 +198,55 @@
realObject = new Object();
}
- @org.testng.annotations.Test
+ @org.testng.annotations.Test(enabled = false)
public void fpShouldNotEqualMockObject() {
org.testng.Assert.assertNotEquals(realObject, mockObject);
}
}
+
+class GitHubIssue109 {
+ private static final String UUID = "some uuid";
+
+ @Mock
+ private Repo repository;
+ @Mock
+ private Object domainObject;
+
+ @org.testng.annotations.Test
+ public void shouldReturnDomainObjectForUuid() throws Exception {
+ MockitoAnnotations.initMocks(this);
+
+ StrutsAction action = new StrutsAction(repository);
+ Mockito.when(repository.findByUuid(UUID)).thenReturn(domainObject);
+
+ action.setUuid(UUID);
+ org.testng.Assert.assertEquals(action.execute(), Action.SUCCESS);
+ // this assertion triggers the detector
+ Assert.assertEquals(action.getDomainObject(), domainObject);
+ }
+
+ enum Action {
+ SUCCESS, FAILURE
+ };
+
+ class StrutsAction {
+ public StrutsAction(Object repo) {
+ }
+
+ public Object execute() {
+ return null;
+ }
+
+ public Object getDomainObject() {
+ return null;
+ }
+
+ void setUuid(String uuid) {
+ }
+ }
+
+ interface Repo {
+ Object findByUuid(String uuid);
+ }
+}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/c...
[truncated message content] |
|
From: <dbr...@us...> - 2016-07-24 19:20:43
|
Revision: 1793
http://sourceforge.net/p/fb-contrib/code/1793
Author: dbrosius
Date: 2016-07-24 19:20:39 +0000 (Sun, 24 Jul 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.properties
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/FCBL_Sample.java
trunk/fb-contrib/samples/LEST_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/SLS_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IOIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java
Added Paths:
-----------
trunk/fb-contrib/samples/BL_Sample.java
trunk/fb-contrib/samples/DMC_Sample.java
trunk/fb-contrib/samples/FCD_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousMapCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FindCircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/UnmodifiableList.java
Removed Paths:
-------------
trunk/fb-contrib/samples/CD_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2016-04-18 22:22:52 UTC (rev 1792)
+++ trunk/fb-contrib/.classpath 2016-07-24 19:20:39 UTC (rev 1793)
@@ -15,7 +15,7 @@
<classpathentry kind="lib" path="lib/httpclient-cache-4.3.4.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/>
- <classpathentry kind="lib" path="lib/annotations-3.0.0.jar"/>
+ <classpathentry kind="lib" path="lib/annotations-3.0.0.jar" sourcepath="/home/dave/.m2/repository/com/google/code/findbugs/annotations/3.0.0/annotations-3.0.0-sources.jar"/>
<classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar" sourcepath="/home/dave/.m2/repository/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2-sources.jar"/>
<classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar" sourcepath="lib/sources/bcel-findbugs-6.0-sources.jar">
<attributes>
Modified: trunk/fb-contrib/build.properties
===================================================================
--- trunk/fb-contrib/build.properties 2016-04-18 22:22:52 UTC (rev 1792)
+++ trunk/fb-contrib/build.properties 2016-07-24 19:20:39 UTC (rev 1793)
@@ -1,4 +1,4 @@
-jdk14.home=C:/j2sdk1.4.2_13
+
bin.includes = plugin.xml,\
META-INF/,\
.
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-04-18 22:22:52 UTC (rev 1792)
+++ trunk/fb-contrib/build.xml 2016-07-24 19:20:39 UTC (rev 1793)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.6.1" />
+ <property name="fb-contrib.version" value="6.7.0-SNAPSHOT" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -39,10 +39,10 @@
<target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib">
<mkdir dir="${user.home}/.ant/lib" />
- <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.6.1/yank-1.6.1.jar" dest="${user.home}/.ant/lib"/>
<get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/>
- <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.2.0/fb-delta-0.2.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.4.1/fb-delta-0.4.1.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/>
</target>
<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
@@ -179,7 +179,7 @@
<attribute name="Require-Bundle" value="edu.umd.cs.findbugs.plugin.eclipse" />
<attribute name="Bundle-ActivationPolicy" value="lazy" />
<attribute name="Export-Package" value="com.mebigfatguy.fbcontrib, com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug, com.mebigfatguy.fbcontrib.utils" />
- <attribute name="Import-Package" value="edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bcel, edu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic" />
+ <attribute name="Import-Package" value="edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.ba.generic, edu.umd.cs.findbugs.bcel, edu.umd.cs.findbugs.visitclass, edu.umd.cs.findbugs.internalAnnotations, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic" />
</manifest>
</jar>
</target>
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2016-04-18 22:22:52 UTC (rev 1792)
+++ trunk/fb-contrib/etc/bugrank.txt 2016-07-24 19:20:39 UTC (rev 1793)
@@ -8,6 +8,7 @@
+0 BugPattern BAS_BLOATED_ASSIGNMENT_SCOPE
+0 BugPattern BED_BOGUS_EXCEPTION_DECLARATION
+0 BugPattern BED_HIERARCHICAL_EXCEPTION_DECLARATION
++0 BugPattern BL_BURYING_LOGIC
+0 BugPattern BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS
+2 BugPattern BSB_BLOATED_SYNCHRONIZED_BLOCK
+0 BugPattern CAAL_CONFUSING_ARRAY_AS_LIST
@@ -16,7 +17,6 @@
+0 BugPattern CBX_CUSTOM_BUILT_XML
+0 BugPattern CCNE_COMPARE_CLASS_EQUALS_NAME
+2 BugPattern CC_CYCLOMATIC_COMPLEXITY
-+2 BugPattern CD_CIRCULAR_DEPENDENCY
+0 BugPattern CEBE_COMMONS_EQUALS_BUILDER_ISEQUALS
+0 BugPattern CEBE_COMMONS_EQUAL_BUILDER_TOEQUALS
+2 BugPattern CE_CLASS_ENVY
@@ -39,6 +39,7 @@
+0 BugPattern CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT
+0 BugPattern DDC_DOUBLE_DATE_COMPARISON
+0 BugPattern DLC_DUBIOUS_LIST_COLLECTION
++0 BugPattern DMC_DUBIOUS_MAP_COLLECTION
+0 BugPattern DRE_DECLARED_RUNTIME_EXCEPTION
+0 BugPattern DSOC_DUBIOUS_SET_OF_COLLECTIONS
+0 BugPattern DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN
@@ -49,6 +50,7 @@
+0 BugPattern EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS
+0 BugPattern EXS_EXCEPTION_SOFTENING_RETURN_FALSE
+0 BugPattern FCBL_FIELD_COULD_BE_LOCAL
++2 BugPattern FCD_FIND_CIRCULAR_DEPENDENCY
+0 BugPattern FPL_FLOATING_POINT_LOOPS
+6 BugPattern FP_FINAL_PARAMETERS
+0 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD
@@ -94,6 +96,7 @@
+0 BugPattern LO_EXCEPTION_WITH_LOGGER_PARMS
+0 BugPattern LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS
+0 BugPattern LO_INVALID_FORMATTING_ANCHOR
++0 BugPattern LO_INVALID_STRING_FORMAT_NOTATION
+0 BugPattern LO_LOGGER_LOST_EXCEPTION_STACK_TRACE
+0 BugPattern LO_STUTTERED_MESSAGE
+0 BugPattern LO_SUSPECT_LOG_CLASS
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-04-18 22:22:52 UTC (rev 1792)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-07-24 19:20:39 UTC (rev 1793)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -30,7 +30,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -176,7 +176,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING,LO_INVALID_STRING_FORMAT_NOTATION" />
<Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" />
@@ -255,7 +255,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UnusedParameter" speed="fast" reports="UP_UNUSED_PARAMETER" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.CircularDependencies" speed="moderate" reports="CD_CIRCULAR_DEPENDENCY"/>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.FindCircularDependencies" speed="moderate" reports="FCD_FIND_CIRCULAR_DEPENDENCY"/>
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" speed="fast" reports="" hidden="true" />
@@ -298,6 +298,11 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues" speed="fast" reports="IOI_DOUBLE_BUFFER_COPY,IOI_COPY_WITH_READER"/>
<!-- COMMENT OUT FOR POINT RELEASE -->
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousMapCollection" speed="fast" reports="DMC_DUBIOUS_MAP_COLLECTION"/>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.BuryingLogic" speed="fast" reports="BL_BURYING_LOGIC"/>
+
<!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
@@ -458,6 +463,7 @@
<BugPattern abbrev="LO" type="LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS" category="CORRECTNESS" />
<BugPattern abbrev="LO" type="LO_EXCEPTION_WITH_LOGGER_PARMS" category="CORRECTNESS" />
<BugPattern abbrev="LO" type="LO_APPENDED_STRING_IN_FORMAT_STRING" category="PERFORMANCE" />
+ <BugPattern abbrev="LO" type="LO_INVALID_STRING_FORMAT_NOTATION" category="CORRECTNESS" />
<BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" category="CORRECTNESS" />
<BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" category="PERFORMANCE" />
<BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" />
@@ -522,7 +528,7 @@
<BugPattern abbrev="CNC" type="CNC_COLLECTION_NAMING_CONFUSION" category="STYLE" />
<BugPattern abbrev="PME" type="PME_POOR_MANS_ENUM" category="STYLE" />
<BugPattern abbrev="UP" type="UP_UNUSED_PARAMETER" category="STYLE" />
- <BugPattern abbrev="CD" type="CD_CIRCULAR_DEPENDENCY" category="CORRECTNESS" />
+ <BugPattern abbrev="FCD" type="FCD_FIND_CIRCULAR_DEPENDENCY" category="CORRECTNESS" />
<BugPattern abbrev="MUC" type="MUC_MODIFYING_UNMODIFIABLE_COLLECTION" category="CORRECTNESS" />
<BugPattern abbrev="UJM" type="UJM_UNJITABLE_METHOD" category="PERFORMANCE" />
<BugPattern abbrev="HES" type="HES_EXECUTOR_NEVER_SHUTDOWN" category="CORRECTNESS" />
@@ -550,15 +556,17 @@
<BugPattern abbrev="JXI" type="JXI_INVALID_CONTEXT_PARAMETER_TYPE" category="CORRECTNESS" />
<BugPattern abbrev="JXI" type="JXI_PARM_PARAM_NOT_FOUND_IN_PATH" category="CORRECTNESS" />
<BugPattern abbrev="JXI" type="JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" category="CORRECTNESS" />
- <BugPattern abbrev="JPAI" type="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="JPAI" type="JPAI_HC_EQUALS_ON_MANAGED_ENTITY" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="JPAI" type="JPAI_NON_PROXIED_TRANSACTION_CALL" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="JPAI" type="JPAI_INEFFICIENT_EAGER_FETCH" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="JPAI" type="JPAI_IGNORED_MERGE_RESULT" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="JPAI" type="JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="JPAI" type="JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="SEO" type="SEO_SUBOPTIMAL_EXPRESSION_ORDER" category="PERFORMANCE" experimental="true"/>
- <BugPattern abbrev="IOI" type="IOI_DOUBLE_BUFFER_COPY" category="PERFORMANCE" experimental="true"/>
- <BugPattern abbrev="IOI" type="IOI_COPY_WITH_READER" category="PERFORMANCE" experimental="true"/>
+ <BugPattern abbrev="JPAI" type="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD" category="CORRECTNESS"/>
+ <BugPattern abbrev="JPAI" type="JPAI_HC_EQUALS_ON_MANAGED_ENTITY" category="CORRECTNESS"/>
+ <BugPattern abbrev="JPAI" type="JPAI_NON_PROXIED_TRANSACTION_CALL" category="CORRECTNESS"/>
+ <BugPattern abbrev="JPAI" type="JPAI_INEFFICIENT_EAGER_FETCH" category="CORRECTNESS"/>
+ <BugPattern abbrev="JPAI" type="JPAI_IGNORED_MERGE_RESULT" category="CORRECTNESS"/>
+ <BugPattern abbrev="JPAI" type="JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS"/>
+ <BugPattern abbrev="JPAI" type="JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS"/>
+ <BugPattern abbrev="SEO" type="SEO_SUBOPTIMAL_EXPRESSION_ORDER" category="PERFORMANCE"/>
+ <BugPattern abbrev="IOI" type="IOI_DOUBLE_BUFFER_COPY" category="PERFORMANCE"/>
+ <BugPattern abbrev="IOI" type="IOI_COPY_WITH_READER" category="PERFORMANCE"/>
+ <BugPattern abbrev="DMC" type="DMC_DUBIOUS_MAP_COLLECTION" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="BL" type="BL_BURYING_LOGIC" category="STYLE" experimental="true" />
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2016-04-18 22:22:52 UTC (rev 1792)
+++ trunk/fb-contrib/etc/messages.xml 2016-07-24 19:20:39 UTC (rev 1793)
@@ -36,7 +36,7 @@
<![CDATA[
<p>Looks for appending strings inside of calls to StringBuffer or StringBuilder append.</p>
<pre>
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(a + b);
return sb.toString();
</pre>
@@ -115,6 +115,15 @@
If a RuntimeException is declared, it implies that this exception type is expected to happen,
which if true should be handled in code, and not propagated. </p>
<p>It is a fast detector.</p>
+ <p>As an example, every method could be declared like this:
+ <code>
+ public void foo() throws NullPointerException {
+ }
+ </code>
+ But what does that tell you? Is this method very very likely to throw NullPointerExceptions?
+ If it is, why isn't this method handling them so that exceptions aren't thrown. So don't do this.
+ If an NPE is very likely, then check for it, and handle the situation.
+ </p>
]]>
</Details>
</Detector>
@@ -146,7 +155,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.PartiallyConstructedObjectAccess">
<Details>
<![CDATA[
- <p>Looks for constructors of non final classes that make method calls to non final methods.
+ <p>Looks for constructors of non-final classes that make method calls to non-final methods.
As these methods could be overridden, the overridden method will be accessing an object that
is only partially constructed, perhaps causing problems. Making these called methods final is
an easy fix, where possible.</p>
@@ -252,17 +261,17 @@
<p>Looks for methods that have the same signature, except where one uses a
Character parameter, and the other uses an int, long, float, double parameter.
Since autoboxing is available in 1.5 one might assume that
- <pre>
- test('a')
- </pre>
+<pre><code>
+test('a')
+</code></pre>
would map to
- <pre>
- public void test(Character c)
- </pre>
+<pre><code>
+public void test(Character c)
+</code></pre>
but instead maps to one that takes an int, long, float or double, such as
- <pre>
- public void test(int i)
- </pre>
+<pre><code>
+public void test(int i)
+</code></pre>
</p>
<p>It is a fast detector.</p>
]]>
@@ -491,7 +500,7 @@
<Details>
<![CDATA[
<p>Looks for uses of JDBC vendor specific classes and methods making the database
- access code non portable.</p>
+ access code non-portable.</p>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -762,8 +771,10 @@
<Details>
<![CDATA[
<p>Looks for calls to classes and methods that do not exist in the JDK for which this class is
- compiled. This can happen if you specify the -source and -target options of the javac compiler, and
+ compiled. This can happen if you specify the <code>-source</code> and <code>-target</code> options of the javac compiler, and
specify a target that is less than the JDK version of the javac compiler.</p>
+ <p>It relies on the system property <code>-Dfb-contrib.sjvu.jdkhome=/path/to/older/jdk/to/check"</code> to specify
+ what JDK to compare against. If this property is not set, this detector does nothing.</p>
<p>It is a slow detector.</p>
]]>
</Details>
@@ -975,7 +986,7 @@
<Details>
<![CDATA[
<p>Looks for methods that are declared to return a Boolean, but return a null
- value. As this now allows the method to return 3 values, the use of Boolean is
+ value. As this now allows the method to return three values, the use of Boolean is
dubious. It would be better to just define a new enumeration with three values,
and return that.</p>
<p>It is a fast detector.</p>
@@ -1057,14 +1068,14 @@
<p>Finds contravariant array assignments. Since arrays are mutable data structures, their use
must be restricted to covariant or invariant usage.</p>
- <pre>
- class A {}
- class B extends A {}
+<pre><code>
+class A {}
+class B extends A {}
- B[] b = new B[2];
- A[] a = b;
- a[0] = new A(); // results in ArrayStoreException (Runtime)
- </pre>
+B[] b = new B[2];
+A[] a = b;
+a[0] = new A(); // results in ArrayStoreException (Runtime)
+</code></pre>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -1186,9 +1197,9 @@
<![CDATA[
<p>This detector looks for Java bean getter-setter use where the value of a property is set
with the value retrieved from the same bean's correllary getter, like this:</p>
- <pre>
- person.setAge(person.getAge());
- </pre>
+<pre><code>
+ person.setAge(person.getAge());
+</code></pre>
<p>Typically this is a copy paste typo.</p>
<p>It is a fast detector.</p>
]]>
@@ -1199,7 +1210,7 @@
<Details>
<![CDATA[
<p>This detector looks for creation of java.awt.Graphics object that do not have the
- .dispose() method called on them when finished. These objects will be cleaned up by
+ <code>.dispose()</code> method called on them when finished. These objects will be cleaned up by
the Garbage collector, bug given the likelihood that large numbers of these objects can
be created in a short period of time, it is better to dispose them as soon as possible.</p>
<p>It is a fast detector.</p>
@@ -1232,8 +1243,8 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.CommonsHashcodeBuilderToHashcode">
<Details>
<![CDATA[
- <p>This detector looks for uses for Commons-lang HashCodeBuilder where the
- result of hashCode() is returned instead of calling the method toHashCode().</p>
+ <p>This detector looks for uses for Commons-lang <code>HashCodeBuilder</code> where the
+ result of <code>hashCode()</code> is returned instead of calling the method <code>toHashCode()</code>.</p>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -1242,8 +1253,8 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.CommonsStringBuilderToString">
<Details>
<![CDATA[
- <p>This detector looks for uses for Commons-lang ToStringBuilder where the
- result of toString() is returned without an intermediate invocation of toString().</p>
+ <p>This detector looks for uses for Commons-lang <code>ToStringBuilder</code> where the
+ result of <code>toString()</code> is returned without an intermediate invocation of toString().</p>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -1365,7 +1376,7 @@
<p>Looks for fields or local variables that are collections but the names have a different type
of collection in the name. This is confusing, and is probably a left over from a type change, such as
</p>
- <p>List<String> mySet;</p>
+ <p>List<String> mySet;</p>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -1392,7 +1403,7 @@
</Details>
</Detector>
- <Detector class="com.mebigfatguy.fbcontrib.detect.CircularDependencies">
+ <Detector class="com.mebigfatguy.fbcontrib.detect.FindCircularDependencies">
<Details>
<![CDATA[
<p>This detector looks circular dependencies among classes. </p>
@@ -1550,7 +1561,7 @@
<Details>
<![CDATA[
<p>Looks for problems with the use of the JAX-RS specification.</p>
- <p>It is a fast detector</p>
+ <p>It is a fast detector.</p>
]]>
</Details>
</Detector>
@@ -1560,7 +1571,7 @@
<![CDATA[
<p>Looks for problems with the use of the JPA specification, including spring's
support of JPA</p>
- <p>It is a fast detector</p>
+ <p>It is a fast detector.</p>
]]>
</Details>
</Detector>
@@ -1570,9 +1581,9 @@
<![CDATA[
<p>Looks for conditional expressions that are a combination of simple local variable (in)equalities
and tests on the results of method calls where the method calls are done first. By placing the simple
- conditions first you may elminate costly calls in certain cases. This assumes that the method calls
+ conditions first you may eliminate costly calls in certain cases. This assumes that the method calls
do not have side effects that should happen always.</p>
- <p>It is a fast detector</p>
+ <p>It is a fast detector.</p>
]]>
</Details>
</Detector>
@@ -1581,10 +1592,33 @@
<Details>
<![CDATA[
<p>Looks for various issues around doing I/O with streams and reader/writers.</p>
- <p>It is a fast detector</p>
+ <p>It is a fast detector.</p>
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousMapCollection">
+ <Details>
+ <![CDATA[
+ <p>Looks for use of maps that are private fields in a List only way, that is, maps that are created in constructors
+ or static initializers, and are only iterated over. Often this is done because the Map allows for two values, as opposed
+ to a List. The Fix is to just create a List of some object that holds all the values.</p>
+ <p>It is a fast detector.</p>
+ ]]>
+ </Details>
+ </Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.BuryingLogic">
+ <Details>
+ <![CDATA[
+ <p>Looks for methods that needlessly push a large chunk of code to the right through indenting with braces.
+ The code is basically an if/else-then-return structure. The if true test does the bulk of the logic, and the else
+ just returns. It is more readable if the bulk of the logic is move as far to the left in the method as is possible.
+ </p>
+ <p>It is a fast detector.</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -1603,33 +1637,33 @@
<p>
Java will implicitly use StringBuilders, which can make this hard to detect or fix. For example, <br/>
- <code>
- StringBuilder sb = new StringBuilder();<b...
[truncated message content] |
|
From: <dbr...@us...> - 2016-08-17 00:36:41
|
Revision: 1794
http://sourceforge.net/p/fb-contrib/code/1794
Author: dbrosius
Date: 2016-08-17 00:36:37 +0000 (Wed, 17 Aug 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousMapCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FindCircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/QMethod.java
Added Paths:
-----------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/StopOpcodeParsingException.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/build.xml 2016-08-17 00:36:37 UTC (rev 1794)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.7.0-SNAPSHOT" />
+ <property name="fb-contrib.version" value="6.6.2" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -198,12 +198,13 @@
<include name="**/*.txt" />
<include name="**/*.md" />
<include name="**/*.xls" />
+ <include name="**/*.example" />
</fileset>
</zip>
</target>
<target name="javadoc" depends="-init" description="build the javadoc for the project">
- <javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api">
+ <javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api" access="private">
<doctitle><![CDATA[<h1>fb-contrib javadoc</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2005-2016 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-08-17 00:36:37 UTC (rev 1794)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -30,7 +30,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
-<!-- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -297,13 +297,13 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues" speed="fast" reports="IOI_DOUBLE_BUFFER_COPY,IOI_COPY_WITH_READER"/>
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE
<Detector class="com.mebigfatguy.fbcontrib.detect.DubiousMapCollection" speed="fast" reports="DMC_DUBIOUS_MAP_COLLECTION"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.BuryingLogic" speed="fast" reports="BL_BURYING_LOGIC"/>
- <!-- COMMENT OUT FOR POINT RELEASE -->
+ COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/htdocs/index.shtml 2016-08-17 00:36:37 UTC (rev 1794)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.6.1 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.6.2 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/htdocs/repository.html 2016-08-17 00:36:37 UTC (rev 1794)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.6.1</td></tr>
+ <tr><td><b>Version:</b></td><td>6.6.2</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/pom.xml 2016-08-17 00:36:37 UTC (rev 1794)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.7.0-SNAPSHOT</version>
+ <version>6.6.2</version>
<prerequisites>
<maven>2.2.1</maven>
@@ -77,6 +77,9 @@
<contributor>
<name>Richard Fearn</name>
</contributor>
+ <contributor>
+ <name>Mikkel Kjeldsen</name>
+ </contributor>
</contributors>
<licenses>
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2016-08-17 00:36:37 UTC (rev 1794)
@@ -18,6 +18,10 @@
*/
package com.mebigfatguy.fbcontrib.collect;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
import org.apache.bcel.Constants;
@@ -25,12 +29,15 @@
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.Method;
+import org.objectweb.asm.Type;
+import com.mebigfatguy.fbcontrib.utils.QMethod;
import com.mebigfatguy.fbcontrib.utils.UnmodifiableSet;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
import edu.umd.cs.findbugs.NonReportingDetector;
+import edu.umd.cs.findbugs.OpcodeStack;
import edu.umd.cs.findbugs.ba.ClassContext;
public class CollectStatistics extends BytecodeScanningDetector implements NonReportingDetector {
@@ -48,6 +55,9 @@
private int numMethodCalls;
private boolean modifiesState;
private boolean classHasAnnotation;
+ private OpcodeStack stack;
+ private Map<QMethod, Set<CalledMethod>> selfCallTree;
+ private QMethod curMethod;
public CollectStatistics(@SuppressWarnings("unused") BugReporter bugReporter) {
Statistics.getStatistics().clear();
@@ -55,10 +65,21 @@
@Override
public void visitClassContext(ClassContext classContext) {
- JavaClass cls = classContext.getJavaClass();
- AnnotationEntry[] annotations = cls.getAnnotationEntries();
- classHasAnnotation = (annotations != null) && (annotations.length > 0);
- super.visitClassContext(classContext);
+ try {
+ JavaClass cls = classContext.getJavaClass();
+ AnnotationEntry[] annotations = cls.getAnnotationEntries();
+ classHasAnnotation = (annotations != null) && (annotations.length > 0);
+ stack = new OpcodeStack();
+ selfCallTree = new HashMap<>();
+ super.visitClassContext(classContext);
+
+ performModifyStateClosure(classContext.getJavaClass());
+
+ } finally {
+ stack = null;
+ selfCallTree = null;
+ curMethod = null;
+ }
}
@Override
@@ -69,6 +90,8 @@
byte[] code = obj.getCode();
if (code != null) {
+ stack.resetForMethodEntry(this);
+ curMethod = null;
super.visitCode(obj);
String clsName = getClassName();
Method method = getMethod();
@@ -97,25 +120,104 @@
@Override
public void sawOpcode(int seen) {
- switch (seen) {
- case INVOKEVIRTUAL:
- case INVOKEINTERFACE:
- case INVOKESPECIAL:
- case INVOKESTATIC:
- case INVOKEDYNAMIC:
- numMethodCalls++;
- break;
+ try {
+ switch (seen) {
+ case INVOKEVIRTUAL:
+ case INVOKEINTERFACE:
+ case INVOKESPECIAL:
+ case INVOKESTATIC:
+ case INVOKEDYNAMIC:
+ numMethodCalls++;
- case PUTSTATIC:
- case PUTFIELD:
- modifiesState = true;
- break;
+ if (seen != INVOKESTATIC) {
+ int numParms = Type.getArgumentTypes(getSigConstantOperand()).length;
+ if (stack.getStackDepth() > numParms) {
+ OpcodeStack.Item itm = stack.getStackItem(numParms);
+ if (itm.getRegisterNumber() == 0) {
+ Set<CalledMethod> calledMethods;
- default:
- break;
+ if (curMethod == null) {
+ curMethod = new QMethod(getMethodName(), getMethodSig());
+ calledMethods = new HashSet<>();
+ selfCallTree.put(curMethod, calledMethods);
+ } else {
+ calledMethods = selfCallTree.get(curMethod);
+ }
+
+ calledMethods.add(new CalledMethod(new QMethod(getNameConstantOperand(), getSigConstantOperand()), seen == INVOKESPECIAL));
+ }
+ }
+ }
+ break;
+
+ case PUTSTATIC:
+ case PUTFIELD:
+ modifiesState = true;
+ break;
+
+ default:
+ break;
+ }
+ } finally {
+ stack.sawOpcode(this, seen);
}
}
+ private void performModifyStateClosure(JavaClass cls) {
+ boolean foundNewCall = true;
+ Statistics statistics = Statistics.getStatistics();
+
+ String clsName = cls.getClassName();
+ while (foundNewCall && !selfCallTree.isEmpty()) {
+ foundNewCall = false;
+
+ Iterator<Map.Entry<QMethod, Set<CalledMethod>>> callerIt = selfCallTree.entrySet().iterator();
+ while (callerIt.hasNext()) {
+ Map.Entry<QMethod, Set<CalledMethod>> callerEntry = callerIt.next();
+ QMethod caller = callerEntry.getKey();
+
+ MethodInfo callerMi = statistics.getMethodStatistics(clsName, caller.getMethodName(), caller.getSignature());
+ if (callerMi == null) {
+ // odd, shouldn't happen
+ foundNewCall = true;
+ } else if (callerMi.getModifiesState()) {
+ foundNewCall = true;
+ } else {
+
+ for (CalledMethod calledMethod : callerEntry.getValue()) {
+
+ if (calledMethod.isSuper) {
+ callerMi.setModifiesState(true);
+ foundNewCall = true;
+ break;
+ } else {
+ MethodInfo calleeMi = statistics.getMethodStatistics(clsName, calledMethod.callee.getMethodName(),
+ calledMethod.callee.getSignature());
+ if (calleeMi == null) {
+ // a super or sub class probably implements this method so just assume it modifies state
+ callerMi.setModifiesState(true);
+ foundNewCall = true;
+ break;
+ }
+
+ if (calleeMi.getModifiesState()) {
+ callerMi.setModifiesState(true);
+ foundNewCall = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (foundNewCall) {
+ callerIt.remove();
+ }
+ }
+ }
+
+ selfCallTree.clear();
+ }
+
private boolean isAssociationedWithAnnotations(Method m) {
if (classHasAnnotation) {
return true;
@@ -124,4 +226,30 @@
AnnotationEntry[] annotations = m.getAnnotationEntries();
return (annotations != null) && (annotations.length > 0);
}
+
+ static class CalledMethod {
+ private QMethod callee;
+ private boolean isSuper;
+
+ public CalledMethod(QMethod c, boolean s) {
+ callee = c;
+ isSuper = s;
+ }
+
+ @Override
+ public int hashCode() {
+ return callee.hashCode() & (isSuper ? 0 : 1);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof CalledMethod)) {
+ return false;
+ }
+
+ CalledMethod that = (CalledMethod) obj;
+
+ return (isSuper == that.isSuper) && callee.equals(that.callee);
+ }
+ }
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2016-08-17 00:36:37 UTC (rev 1794)
@@ -31,6 +31,7 @@
import com.mebigfatguy.fbcontrib.utils.BugType;
import com.mebigfatguy.fbcontrib.utils.OpcodeUtils;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
+import com.mebigfatguy.fbcontrib.utils.StopOpcodeParsingException;
import com.mebigfatguy.fbcontrib.utils.ToString;
import edu.umd.cs.findbugs.BugInstance;
@@ -73,7 +74,7 @@
try {
int majorVersion = classContext.getJavaClass().getMajor();
if (majorVersion >= MAJOR_1_4) {
- fbInfo = new ArrayList<FinallyBlockInfo>();
+ fbInfo = new ArrayList<>();
super.visitClassContext(classContext);
}
} finally {
@@ -102,7 +103,11 @@
}
if (!fbInfo.isEmpty()) {
- super.visitCode(obj);
+ try {
+ super.visitCode(obj);
+ } catch (StopOpcodeParsingException e) {
+ // no more finally blocks to check
+ }
}
}
@@ -114,9 +119,6 @@
*/
@Override
public void sawOpcode(int seen) {
- if (fbInfo.isEmpty()) {
- return;
- }
FinallyBlockInfo fbi = fbInfo.get(0);
@@ -128,7 +130,7 @@
if (OpcodeUtils.isAStore(seen)) {
fbi.exReg = RegisterUtils.getAStoreReg(this, seen);
} else {
- fbInfo.remove(0);
+ removeEarliestFinallyBlock();
sawOpcode(seen);
return;
}
@@ -140,14 +142,14 @@
} else if (seen == MONITOREXIT) {
fbi.monitorCount--;
if (fbi.monitorCount < 0) {
- fbInfo.remove(0);
+ removeEarliestFinallyBlock();
sawOpcode(seen);
return;
}
}
if ((seen == ATHROW) && (loadedReg == fbi.exReg)) {
- fbInfo.remove(0);
+ removeEarliestFinallyBlock();
sawOpcode(seen);
return;
} else if (OpcodeUtils.isALoad(seen)) {
@@ -159,7 +161,7 @@
if (OpcodeUtils.isReturn(seen) || (seen == ATHROW)) {
bugReporter.reportBug(new BugInstance(this, BugType.AFBR_ABNORMAL_FINALLY_BLOCK_RETURN.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
.addSourceLine(this));
- fbInfo.remove(0);
+ removeEarliestFinallyBlock();
} else if (OpcodeUtils.isInvoke(seen)) {
try {
JavaClass cls = Repository.lookupClass(getClassConstantOperand());
@@ -169,7 +171,7 @@
if ((et != null) && (et.getLength() > 0) && !catchBlockInFinally(fbi)) {
bugReporter.reportBug(new BugInstance(this, BugType.AFBR_ABNORMAL_FINALLY_BLOCK_RETURN.name(), LOW_PRIORITY).addClass(this)
.addMethod(this).addSourceLine(this));
- fbInfo.remove(0);
+ removeEarliestFinallyBlock();
}
}
} catch (ClassNotFoundException cnfe) {
@@ -179,6 +181,16 @@
}
/**
+ * removes the earliest finally block, as we've just concluded checking it, and if it's the last one then throw back to visitCode
+ */
+ private void removeEarliestFinallyBlock() {
+ fbInfo.remove(0);
+ if (fbInfo.isEmpty()) {
+ throw new StopOpcodeParsingException();
+ }
+ }
+
+ /**
* finds the method in specified class by name and signature
*
* @param cls
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2016-08-17 00:36:37 UTC (rev 1794)
@@ -642,6 +642,8 @@
*
* @param sb
* the scope block to start with
+ * @param start
+ * the current pc
* @param target
* the target to look for
*
@@ -697,6 +699,10 @@
/**
* finds the scope block that is the active synchronized block
*
+ * @param sb
+ * the parent scope block to start with
+ * @param monitorEnterPC
+ * the pc where the current synchronized block starts
* @return the scope block
*/
private ScopeBlock findSynchronizedScopeBlock(ScopeBlock sb, int monitorEnterPC) {
@@ -933,6 +939,8 @@
* the register that was stored
* @param pc
* the instruction that did the store
+ * @param assocObject
+ * the the object that is associated with this store, usually the field from which this came
*/
public void addStore(int reg, int pc, UserObject assocObject) {
if (stores == null) {
@@ -1035,7 +1043,7 @@
if (assocs != null) {
for (Map.Entry<UserObject, Integer> entry : assocs.entrySet()) {
UserObject uo = entry.getKey();
- if ((uo.fieldFromReg == fieldFromReg) || ((uo.caller instanceof Integer) && (((Integer) uo.caller) == fieldFromReg))) {
+ if ((uo.fieldFromReg == fieldFromReg) || ((uo.caller instanceof Integer) && (((Integer) uo.caller).intValue() == fieldFromReg))) {
Integer preWrittenFromField = entry.getValue();
if (preWrittenFromField != null) {
if (stores != null) {
@@ -1049,6 +1057,9 @@
/**
* report stores that occur at scopes higher than associated loads that are not involved with loops
+ *
+ * @param parentUsedRegs
+ * the set of registers that where used by the parent scope block
*/
public void findBugs(Set<Integer> parentUsedRegs) {
if (isLoop) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2016-08-17 00:36:37 UTC (rev 1794)
@@ -30,6 +30,7 @@
import com.mebigfatguy.fbcontrib.utils.BugType;
import com.mebigfatguy.fbcontrib.utils.OpcodeUtils;
import com.mebigfatguy.fbcontrib.utils.SignatureUtils;
+import com.mebigfatguy.fbcontrib.utils.StopOpcodeParsingException;
import com.mebigfatguy.fbcontrib.utils.UnmodifiableSet;
import com.mebigfatguy.fbcontrib.utils.Values;
@@ -139,14 +140,18 @@
}
}
if (!declaredCheckedExceptions.isEmpty()) {
- super.visitCode(obj);
- if (!declaredCheckedExceptions.isEmpty()) {
- BugInstance bi = new BugInstance(this, BugType.BED_BOGUS_EXCEPTION_DECLARATION.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
- .addSourceLine(this, 0);
- for (String ex : declaredCheckedExceptions) {
- bi.addString(ex.replaceAll("/", "."));
+ try {
+ super.visitCode(obj);
+ if (!declaredCheckedExceptions.isEmpty()) {
+ BugInstance bi = new BugInstance(this, BugType.BED_BOGUS_EXCEPTION_DECLARATION.name(), NORMAL_PRIORITY).addClass(this)
+ .addMethod(this).addSourceLine(this, 0);
+ for (String ex : declaredCheckedExceptions) {
+ bi.addString(ex.replaceAll("/", "."));
+ }
+ bugReporter.reportBug(bi);
}
- bugReporter.reportBug(bi);
+ } catch (StopOpcodeParsingException e) {
+ // no exceptions left
}
}
}
@@ -213,10 +218,6 @@
*/
@Override
public void sawOpcode(int seen) {
- if (declaredCheckedExceptions.isEmpty()) {
- return;
- }
-
try {
stack.precomputation(this);
@@ -245,14 +246,14 @@
}
if (!found) {
- declaredCheckedExceptions.clear();
+ clearExceptions();
}
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
- declaredCheckedExceptions.clear();
+ clearExceptions();
}
} else if ("wait".equals(getNameConstantOperand())) {
- declaredCheckedExceptions.remove("java.lang.InterruptedException");
+ removeException("java.lang.InterruptedException");
}
} else if (seen == ATHROW) {
if (stack.getStackDepth() > 0) {
@@ -261,7 +262,7 @@
String thrownException = SignatureUtils.stripSignature(exSig);
removeThrownExceptionHierarchy(thrownException);
} else {
- declaredCheckedExceptions.clear();
+ clearExceptions();
}
}
} finally {
@@ -280,9 +281,9 @@
try {
if (Values.DOTTED_JAVA_LANG_EXCEPTION.equals(thrownException)) {
// Exception can be thrown even tho the method isn't declared to throw Exception in the case of templated Exceptions
- declaredCheckedExceptions.clear();
+ clearExceptions();
} else {
- declaredCheckedExceptions.remove(thrownException);
+ removeException(thrownException);
JavaClass exCls = Repository.lookupClass(thrownException);
String clsName;
@@ -292,13 +293,35 @@
break;
}
clsName = exCls.getClassName();
- declaredCheckedExceptions.remove(clsName);
+ removeException(clsName);
} while (!declaredCheckedExceptions.isEmpty() && !Values.DOTTED_JAVA_LANG_EXCEPTION.equals(clsName)
&& !Values.DOTTED_JAVA_LANG_ERROR.equals(clsName));
}
+
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
- declaredCheckedExceptions.clear();
+ clearExceptions();
}
}
+
+ /**
+ * removes the declared checked exception, and if that was the last declared exception, stops opcode parsing by throwing exception
+ *
+ * @param clsName
+ * the name of the exception to remove
+ */
+ private void removeException(String clsName) {
+ declaredCheckedExceptions.remove(clsName);
+ if (declaredCheckedExceptions.isEmpty()) {
+ throw new StopOpcodeParsingException();
+ }
+ }
+
+ /**
+ * clears all declared checked exceptions and throws an exception to stop opcode parsing
+ */
+ private void clearExceptions() {
+ declaredCheckedExceptions.clear();
+ throw new StopOpcodeParsingException();
+ }
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java 2016-07-24 19:20:39 UTC (rev 1793)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java 2016-08-17 00:36:37 UTC (rev 1794)
@@ -29,6 +29,7 @@
import org.apache.bcel.generic.Type;
import com.mebigfatguy.fbcontrib.utils.BugType;
+import com.mebigfatguy.fbcontrib.utils.StopOpcodeParsingException;
import com.mebigfatguy.fbcontrib.utils.ToString;
import edu.umd.cs.findbugs.BugInstance;
@@ -53,7 +54,6 @@
private OpcodeStack stack;
private Deque<IfBlock> ifBlocks;
private IfBlock activeUnconditional;
- private boolean isReported;
private double lowBugRatioLimit;
private double normalBugRatioLimit;
private BitSet catchPCs;
@@ -72,7 +72,7 @@
lowBugRatioLimit = LOW_BUG_RATIO_LIMIT;
}
}
- } catch (Exception e) {
+ ...
[truncated message content] |
|
From: <dbr...@us...> - 2016-09-24 00:35:54
|
Revision: 1796
http://sourceforge.net/p/fb-contrib/code/1796
Author: dbrosius
Date: 2016-09-24 00:35:51 +0000 (Sat, 24 Sep 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/BED_Sample.java
trunk/fb-contrib/samples/BL_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TailRecursion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/FCCD_Sample.java
trunk/fb-contrib/samples/WI_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WiringIssues.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2016-08-17 00:50:35 UTC (rev 1795)
+++ trunk/fb-contrib/.classpath 2016-09-24 00:35:51 UTC (rev 1796)
@@ -27,10 +27,12 @@
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/testng-6.9.6.jar"/>
<classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar" sourcepath="lib/sources/jsr311-api-1.1.1-sources.jar"/>
- <classpathentry kind="lib" path="lib/spring-tx-4.2.3.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-1.3.2.jar" sourcepath="lib/sources/commons-io-1.3.2-sources.jar"/>
<classpathentry kind="lib" path="lib/mockito-all-2.0.2-beta.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
+ <classpathentry kind="lib" path="lib/spring-beans-4.3.2.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/spring-tx-4.3.2.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/spring-context-4.3.2.RELEASE.jar"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-08-17 00:50:35 UTC (rev 1795)
+++ trunk/fb-contrib/build.xml 2016-09-24 00:35:51 UTC (rev 1796)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.6.2" />
+ <property name="fb-contrib.version" value="6.6.3" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -110,6 +110,8 @@
<pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" />
<pathelement location="${lib.dir}/commons-codec-${commons-codec.version}.jar" />
<pathelement location="${lib.dir}/jsr311-api-${jsr311-api.version}.jar" />
+ <pathelement location="${lib.dir}/spring-beans-${spring-beans.version}.jar" />
+ <pathelement location="${lib.dir}/spring-context-${spring-context.version}.jar" />
<pathelement location="${lib.dir}/spring-tx-${spring-tx.version}.jar" />
<pathelement location="${lib.dir}/javax.persistence-${javax.persistence.version}.jar" />
<pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2016-08-17 00:50:35 UTC (rev 1795)
+++ trunk/fb-contrib/etc/bugrank.txt 2016-09-24 00:35:51 UTC (rev 1796)
@@ -50,7 +50,7 @@
+0 BugPattern EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS
+0 BugPattern EXS_EXCEPTION_SOFTENING_RETURN_FALSE
+0 BugPattern FCBL_FIELD_COULD_BE_LOCAL
-+2 BugPattern FCD_FIND_CIRCULAR_DEPENDENCY
++2 BugPattern FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY
+0 BugPattern FPL_FLOATING_POINT_LOOPS
+6 BugPattern FP_FINAL_PARAMETERS
+0 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD
@@ -93,6 +93,7 @@
+0 BugPattern LGO_LINGERING_GRAPHICS_OBJECT
+2 BugPattern LII_LIST_INDEXED_ITERATING
+0 BugPattern LO_APPENDED_STRING_IN_FORMAT_STRING
++0 BugPattern LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING
+0 BugPattern LO_EXCEPTION_WITH_LOGGER_PARMS
+0 BugPattern LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS
+0 BugPattern LO_INVALID_FORMATTING_ANCHOR
@@ -260,5 +261,6 @@
+0 BugPattern UVA_USE_VAR_ARGS
+0 BugPattern WEM_OBSCURING_EXCEPTION
+0 BugPattern WEM_WEAK_EXCEPTION_MESSAGING
++0 BugPattern WI_DUPLICATE_WIRED_TYPES
+0 BugPattern WOC_WRITE_ONLY_COLLECTION_FIELD
+0 BugPattern WOC_WRITE_ONLY_COLLECTION_LOCAL
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-08-17 00:50:35 UTC (rev 1795)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-09-24 00:35:51 UTC (rev 1796)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -30,7 +30,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+ COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -176,7 +176,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING,LO_INVALID_STRING_FORMAT_NOTATION" />
+ <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING,LO_INVALID_STRING_FORMAT_NOTATION,LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING" />
<Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" />
@@ -255,7 +255,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UnusedParameter" speed="fast" reports="UP_UNUSED_PARAMETER" />
- <Detector class="com.mebigfatguy.fbcontrib.detect.FindCircularDependencies" speed="moderate" reports="FCD_FIND_CIRCULAR_DEPENDENCY"/>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.FindClassCircularDependencies" speed="moderate" reports="FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY"/>
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" speed="fast" reports="" hidden="true" />
@@ -303,8 +303,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BuryingLogic" speed="fast" reports="BL_BURYING_LOGIC"/>
- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.WiringIssues" speed="fast" reports="WI_DUPLICATE_WIRED_TYPES"/>
+ COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -464,6 +466,7 @@
<BugPattern abbrev="LO" type="LO_EXCEPTION_WITH_LOGGER_PARMS" category="CORRECTNESS" />
<BugPattern abbrev="LO" type="LO_APPENDED_STRING_IN_FORMAT_STRING" category="PERFORMANCE" />
<BugPattern abbrev="LO" type="LO_INVALID_STRING_FORMAT_NOTATION" category="CORRECTNESS" />
+ <BugPattern abbrev="LO" type="LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING" />
<BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" category="CORRECTNESS" />
<BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" category="PERFORMANCE" />
<BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" />
@@ -528,7 +531,7 @@
<BugPattern abbrev="CNC" type="CNC_COLLECTION_NAMING_CONFUSION" category="STYLE" />
<BugPattern abbrev="PME" type="PME_POOR_MANS_ENUM" category="STYLE" />
<BugPattern abbrev="UP" type="UP_UNUSED_PARAMETER" category="STYLE" />
- <BugPattern abbrev="FCD" type="FCD_FIND_CIRCULAR_DEPENDENCY" category="CORRECTNESS" />
+ <BugPattern abbrev="FCCD" type="FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY" category="CORRECTNESS" />
<BugPattern abbrev="MUC" type="MUC_MODIFYING_UNMODIFIABLE_COLLECTION" category="CORRECTNESS" />
<BugPattern abbrev="UJM" type="UJM_UNJITABLE_METHOD" category="PERFORMANCE" />
<BugPattern abbrev="HES" type="HES_EXECUTOR_NEVER_SHUTDOWN" category="CORRECTNESS" />
@@ -568,5 +571,6 @@
<BugPattern abbrev="IOI" type="IOI_COPY_WITH_READER" category="PERFORMANCE"/>
<BugPattern abbrev="DMC" type="DMC_DUBIOUS_MAP_COLLECTION" category="CORRECTNESS" experimental="true"/>
<BugPattern abbrev="BL" type="BL_BURYING_LOGIC" category="STYLE" experimental="true" />
+ <BugPattern abbrev="WI" type="WI_DUPLICATE_WIRED_TYPES" category="CORRECTNESS" experimental="true"/>
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2016-08-17 00:50:35 UTC (rev 1795)
+++ trunk/fb-contrib/etc/messages.xml 2016-09-24 00:35:51 UTC (rev 1796)
@@ -75,7 +75,7 @@
<Details>
<![CDATA[
<p>Looks for parameters that are defined by classes, but where the method only use methods defined by an
- implemented interface or super class of that class. Relying on concrete classes in public signatures causes cohesion,
+ implemented interface or superclass of that class. Relying on concrete classes in public signatures causes cohesion,
and makes low impact changes more difficult.</p>
<p>It is a slow detector.</p>
]]>
@@ -353,7 +353,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod">
<Details>
<![CDATA[
- <p>Looks for methods that are direct copies of the implementation in the super class.</p>
+ <p>Looks for methods that are direct copies of the implementation in the superclass.</p>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -386,7 +386,7 @@
<Details>
<![CDATA[
<p>Looks for methods that are declared as abstract that override concrete methods in a
- super class. Doing this casts away the implementation of the super class, and breaks
+ superclass. Doing this casts away the implementation of the superclass, and breaks
the contract as set forth by the parent class.</p>
<p>It is a fast detector.</p>
]]>
@@ -831,9 +831,9 @@
<![CDATA[
<p>Looks for methods that catch checked exceptions, and throw unchecked
exceptions in their place. There are several levels of concern. Least
- concerning are methods constrained by interface or super class contracts
+ concerning are methods constrained by interface or superclass contracts
not to throw checked exceptions but appear owned by the same author. Next
- are methods constrained by interface or super class contracts and throw other
+ are methods constrained by interface or superclass contracts and throw other
types of checked exceptions. Most egregious are methods not constrained by any interface
or superclass contract.</p>
<p>It is a moderately fast detector.</p>
@@ -1276,7 +1276,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BackportReusePublicIdentifiers">
<Details>
<![CDATA[
- <p>Detects use of Backport Utils concurrent classes. Updated/Efficient version of these
+ <p>Detects use of Backport Utils concurrent classes. Updated/efficient versions of these
classes are available in versions of the JDK 5.0 and higher, and these
classes should only be used if you are targeting JDK 1.4 and lower.</p>
<p>It is a fast detector.</p>
@@ -1403,7 +1403,7 @@
</Details>
</Detector>
- <Detector class="com.mebigfatguy.fbcontrib.detect.FindCircularDependencies">
+ <Detector class="com.mebigfatguy.fbcontrib.detect.FindClassCircularDependencies">
<Details>
<![CDATA[
<p>This detector looks circular dependencies among classes. </p>
@@ -1619,6 +1619,15 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.WiringIssues">
+ <Details>
+ <![CDATA[
+ <p>Looks for various issues around @Autowired/@Inject fields in DI classes</p>
+ <p>It is a fast detector.</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -1725,7 +1734,7 @@
<Details>
<![CDATA[
<p>This method uses a synchronized collection, built from Collections.synchronizedXXXX, but accesses it
- through an iterator. Since an iterator is by definition, multithreaded unsafe, this is a conflict in
+ through an iterator. Since an iterator is, by definition, multithreaded unsafe, this is a conflict in
concept. When using iterators, you should do the synchronization manually.</p>
]]>
</Details>
@@ -1749,7 +1758,7 @@
<Details>
<![CDATA[
<p>This method uses concrete classes for parameters when only methods defined in an implemented
- interface or super class are used. Consider increasing the abstraction of the interface to
+ interface or superclass are used. Consider increasing the abstraction of the interface to
make low impact changes easier to accomplish in the future.</p>
<p>Take the following example:<br/>
@@ -1871,8 +1880,8 @@
<![CDATA[
<p>This class defines a field based on java.util.List, but uses it to some extent like a Set. Since
lookup type operations are performed using a linear search for Lists, the performance for large
- Lists will be poor. If the list is known to only contain a small number of items, (3,4, etc) then it doesn't matter.
- Otherwise, consider changing this fields implementation to a set-based one. If order of
+ Lists will be poor. If the list is known to only contain a small number of items, (3, 4, etc) then it
+ doesn't matter. Otherwise, consider changing this field's implementation to a set-based one. If order of
iteration is important to maintain insert order, perhaps consider a LinkedHashSet.</p>
]]>
</Details>
@@ -1917,7 +1926,7 @@
as final.</p>
<p>Performance gains are debatable as "the final keyword does not appear in the class file for
- local variables and parameters, thus it cannot impact the runtime performance. It's only use
+ local variables and parameters, thus it cannot impact the runtime performance. Its only use
is to clarify the coders intent that the variable not be changed (which many consider dubious
reason for its usage), and dealing with anonymous inner classes." - http://stackoverflow.com/a/266981/1447621 </p>
]]>
@@ -1987,7 +1996,7 @@
<![CDATA[
<p>This class defines two methods that differ only by a parameter being defined
as Character vs. int, long, float or double. As autoboxing is present, it may be
- assumed that a parameter of 'a' would map to the Character version, but does not.</p>
+ assumed that a parameter of 'a' would map to the Character version, but it does not.</p>
]]>
</Details>
</BugPattern>
@@ -2273,7 +2282,7 @@
<LongDescription>Method {1} is implemented with an exact copy of its superclass's method</LongDescription>
<Details>
<![CDATA[
- <p>This method is implemented using an exact copy of its super class method's
+ <p>This method is implemented using an exact copy of its superclass method's
implementation, which usually means that this method can just be removed.</p>
]]>
</Details>
@@ -2296,7 +2305,7 @@
<Details>
<![CDATA[
<p>This method passes an array as the key to a Map, element in a Set, or item in a List when
- the contains method is used on the List. Since arrays do not, and cannot override the equals
+ the contains method is used on the List. Since arrays do not and cannot override the equals
method, collection inclusion is based on the reference's address, which is probably not desired.
In the case that this is a TreeMap or TreeSet, consider passing a Comparator to the map's
constructor.</p>
@@ -2320,7 +2329,7 @@
<Details>
<![CDATA[
<p>This abstract method is derived from a concrete method implementation. It is highly
- suspect that the super class method's implementation would be cast away.</p>
+ suspect that the superclass method's implementation would be cast away.</p>
]]>
</Details>
</BugPattern>
@@ -2332,7 +2341,7 @@
<![CDATA[
<p>This method generates an XML based string by concatenating together various
XML fragments, and variable values. Doing so makes the code difficult to read, modify
- and validate. It is much more clean to built XML structures in external files that are
+ and validate. It is much more clean to build XML structures in external files that are
read in and transformed into the final product, through modification by Transformer.setParameter.</p>
]]>
</Details>
@@ -2345,7 +2354,7 @@
<![CDATA[
<p>This method implements a synchronized block, but the code found at the beginning
of this block only accesses local variables, and not member variables, or this.
- To be better performance move the code that access local variables only, above the
+ For better performance, move the code that accesses local variables only, above the
synchronized block, and leave the synchronized block only for field accesses, or access
to this object.</p>
]]>
@@ -2383,7 +2392,7 @@
<LongDescription>Method {1} uses 1 element array to simulate call by reference</LongDescription>
<Details>
<![CDATA[
- <p>This method uses a one element array to wrap an object that is to be passed to a method as an argument
+ <p>This method uses a one-element array to wrap an object that is to be passed to a method as an argument
to simulate call by pointer ala C++. It is better to define a proper return class type that holds all
the relevant information retrieved from the called method.</p>
]]>
@@ -2536,7 +2545,7 @@
<LongDescription>Method {1} creates local variable-based synchronized collection</LongDescription>
<Details>
<![CDATA[
- <p>This method creates a synchronized collection and store the reference to it
+ <p>This method creates a synchronized collection and stores the reference to it
in a local variable. As local variables are by definition thread-safe, it seems
questionable that this collection needs to be synchronized.</p>
<p>
@@ -2571,7 +2580,7 @@
<![CDATA[
<p>This method uses a synchronize block where the object that is being synchronized on,
is not owned by this current instance. This means that other instances may use this same
- object for synchronization for its own purposes causing synchronization confusion. It is
+ object for synchronization for their own purposes, causing synchronization confusion. It is
always cleaner and safer to only synchronize on private fields of this class. Note that 'this'
is not owned by the current instance, but is owned by whomever assigns it to a field of its
class. Synchronizing on 'this' is also not a good idea.</p>
@@ -2584,8 +2593,8 @@
<LongDescription>Tag library {0} is not recycleable</LongDescription>
<Details>
<![CDATA[
- <p>This tag library class implements an attribute who's associated backing store field
- is modified at another point in the tag library. In order for a taglibrary to be
+ <p>This tag library class implements an attribute whose associated backing store field
+ is modified at another point in the tag library. In order for a tag library to be
recycleable, only the container is allowed to change this attribute, through the use
of the setXXX method of the taglib. By modifying the value programmatically, the
container will not initialize the attribute correctly on reuse.</p>
@@ -2622,8 +2631,8 @@
<LongDescription>Window {0} sets size manually, and doesn't use pack</LongDescription>
<Details>
<![CDATA[
- <p>This class creates a window, and sizes the window using setSize. It is better
- to handle font size changes to use the pack method.</p>
+ <p>This class creates a window, and sizes the window using setSize. It is better,
+ for handling font size changes, to use the pack method.</p>
]]>
</Details>
</BugPattern>
@@ -2669,7 +2678,7 @@
<LongDescription>Method {1} passes appended string to title/label of component</LongDescription>
<Details>
<![CDATA[
- <p>This method creates a component and passes a string that was build up from a number of
+ <p>This method creates a component and passes a string that was built up from a number of
strings through appending multiple strings together. As foreign languages may order phrases
differently, this will make translations difficult.</p>
]]>
@@ -2707,7 +2716,7 @@
<Details>
<![CDATA[
<p>This class defines a private collection member as synchronized. It appears however
- that this collection isn't only modified in a static initializer, or constructor. As these
+ that this collection is only modified in a static initializer, or constructor. As these
two areas are guaranteed to be thread safe, defining this collection as synchronized is
unnecessary and a potential performance bottleneck.</p>
]]>
@@ -2748,7 +2757,7 @@
parameters, on the same instance without any intervening changes to the objects. If this
method does not make changes to the object, which it appears it doesn't, then making
two calls is just a waste. These method calls could be combined by assigning the
- result into a temporary, and using the temporary the second time.</p>
+ result into a temporary variable, and using the variable the second time.</p>
]]>
</Details>
</BugPattern>
@@ -2761,7 +2770,7 @@
<p>This method manually loops over a collection, pulling each element out and storing
it in an array to build an array from the collection. It is easier, and clearer to use
the built in collections method toArray. Given a collection 'mycollection' of type T, use
- mycollection.toArray(new T[mycollection.size()]);</p>
+ <code>mycollection.toArray(new T[mycollection.size()]);</code></p>
]]>
</Details>
</BugPattern>
@@ -2878,7 +2887,7 @@
<Details>
<![CDATA[
<p>This method implements Serializable but is derived from a
- class that does not. The super class has fields that are not serialized
+ class that does not. The superclass has fields that are not serialized
because this class does not take the responsibility of writing these fields out
either using Serializable's writeObject method, or Externalizable's writeExternal
method. Therefore when this class is read from a stream, the superclass fields
@@ -2894,8 +2903,8 @@
<LongDescription>Comparator method {1} doesn't seem to return all ordering values</LongDescription>
<Details>
<![CDATA[
- <p>This compareTo or compare method returns constant values for to represent less than,
- equals and greater than. However it does not return each type, or it unconditionally returns a non zero value.
+ <p>This compareTo or compare method returns constant values to represent less than,
+ equals, and greater than. However, it does not return each type, or it unconditionally returns a non zero value.
Given that comparators are transitive, this seems incorrect.</p>
]]>
</Details>
@@ -3032,7 +3041,7 @@
<LongDescription>Method {1} fetches character array just to do the equivalent of the charAt method</LongDescription>
<Details>
<![CDATA[
- <p>This method calls the toCharArray method on a String the fetch an array of characters, only
+ <p>This method calls the toCharArray method on a String to fetch an array of characters, only
to retrieve one of those characters by index. It is more performant to just use the charAt method.</p>
]]>
</Details>
@@ -3152,7 +3161,7 @@
<![CDATA[
<p>This class defines a static field 'serialVersionUID' to define the serialization
version for this class. This field is marked as non private. As the serialVersionUID only
- controls the current class, and doesn't effect any derived classes, defining it as non
+ controls the current class, and doesn't affect any derived classes, defining it as non
private is confusing. It is suggested you change this variable to be private.</p>
]]>
</Details>
@@ -3187,8 +3196,8 @@
<LongDescription>Method {1} passes an empty string to equalsIgnoreCase or compareToIgnoreCase</LongDescription>
<Details>
<![CDATA[
- <p>This method passes the empty string "" to equalsIgnoreCase or compareToIgnoreCase, as the empty string
- is not case-sensitive using equals is simpler. It would be even simpler to do a length() == 0 test.</p>
+ <p>This method passes the empty string "" to equalsIgnoreCase or compareToIgnoreCase. As the empty string
+ is not case-sensitive, using equals is simpler. It would be even simpler to do a length() == 0 test.</p>
]]>
</Details>
</BugPattern>
@@ -3214,7 +3223,7 @@
<![CDATA[
<p>This method calls StringBuilder.append and assigns the results to the same StringBuilder like:</p>
<code>sb = sb.append("foo")</code>
- <p>StringBuilder is mutable this is not necessary.
+ <p>StringBuilder is mutable, so this is not necessary.
This is also true of StringBuffer.</p>
]]>
</Details>
@@ -3343,7 +3352,7 @@
<![CDATA[
<p>This method calls String.format passing a static string as the format string that has no replacement markers
(starting with %). Thus no replacement will happen, and the format method is superfluous. If parameters were intended,
- add the appropriate format markers as needed, otherwise, just remove the call to String.format and use the static
+ add the appropriate format markers as needed; otherwise, just remove the call to String.format and use the static
string as is.</p>
]]>
</Details>
@@ -3372,9 +3381,9 @@
<p>This method assigns a value to a variable in an outer scope compared to where the variable is actually used.
Assuming this evaluation does not have side effects, the assignment can be moved into the inner scope (if block)
so that its execution time isn't taken up if the if guard is false. Care should be
- taken however that the right hand side of the assignment does not contain side
- effects that are required to happen, or that changes are not made further down that
- will effect the execution of the assignment when done later on.</p>
+ taken, however, that the right hand side of the assignment does not contain side
+ effects that are required to happen, and that changes are not made further down that
+ will affect the execution of the assignment when done later on.</p>
]]>
</Details>
</BugPattern>
@@ -3400,7 +3409,7 @@
<![CDATA[
<p>This method removes items from a collection using the remove method of the collection, while
at the same time iterating across the collection. Doing this will invalidate the iterator, and further
- use of it, will cause ConcurrentModificationExceptions to be thrown. To avoid this, the remove
+ use of it will cause ConcurrentModificationExceptions to be thrown. To avoid this, the remove
method of the iterator should be used.</p>
]]>
</Details>
@@ -3413,7 +3422,7 @@
<![CDATA[
<p>This method modifies the contents of a collection using the collection API methods, while
at the same time iterating across the collection. Doing this will invalidate the iterator, and further
- use of it, will cause ConcurrentModificationExceptions to be thrown.</p>
+ use of it will cause ConcurrentModificationExceptions to be thrown.</p>
...
[truncated message content] |
|
From: <dbr...@us...> - 2016-10-10 18:28:47
|
Revision: 1800
http://sourceforge.net/p/fb-contrib/code/1800
Author: dbrosius
Date: 2016-10-10 18:28:44 +0000 (Mon, 10 Oct 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/BRPI_Sample.java
trunk/fb-contrib/samples/LEST_Sample.java
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples/CCI_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConcurrentCollectionIssues.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/.classpath 2016-10-10 18:28:44 UTC (rev 1800)
@@ -34,5 +34,6 @@
<classpathentry kind="lib" path="lib/spring-beans-4.3.2.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-tx-4.3.2.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-context-4.3.2.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/threetenbp-1.3.2.jar"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/build.xml 2016-10-10 18:28:44 UTC (rev 1800)
@@ -28,7 +28,7 @@
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
- <property name="fb-contrib.version" value="6.6.3" />
+ <property name="fb-contrib.version" value="6.9.0-SNAPSHOT" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -103,6 +103,7 @@
<pathelement location="${lib.dir}/commons-lang3-${commons-lang3.version}.jar" />
<pathelement location="${lib.dir}/commons-io-${commons-io.version}.jar" />
<pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" />
+ <pathelement location="${lib.dir}/threetenbp-${threetenbp.version}.jar" />
<pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" />
<pathelement location="${lib.dir}/guava-${guava.version}.jar" />
<pathelement location="${lib.dir}/httpclient-cache-${httpclient-cache.version}.jar" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/etc/bugrank.txt 2016-10-10 18:28:44 UTC (rev 1800)
@@ -15,6 +15,7 @@
+0 BugPattern CAO_CONFUSING_AUTOBOXED_OVERLOADING
+0 BugPattern CBC_CONTAINS_BASED_CONDITIONAL
+0 BugPattern CBX_CUSTOM_BUILT_XML
++0 BugPattern CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY
+0 BugPattern CCNE_COMPARE_CLASS_EQUALS_NAME
+2 BugPattern CC_CYCLOMATIC_COMPLEXITY
+0 BugPattern CEBE_COMMONS_EQUALS_BUILDER_ISEQUALS
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-10-10 18:28:44 UTC (rev 1800)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -30,7 +30,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -296,17 +296,18 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuboptimalExpressionOrder" speed="fast" reports="SEO_SUBOPTIMAL_EXPRESSION_ORDER"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues" speed="fast" reports="IOI_DOUBLE_BUFFER_COPY,IOI_COPY_WITH_READER"/>
-
- <!-- COMMENT OUT FOR POINT RELEASE
-
+
<Detector class="com.mebigfatguy.fbcontrib.detect.DubiousMapCollection" speed="fast" reports="DMC_DUBIOUS_MAP_COLLECTION"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.BuryingLogic" speed="fast" reports="BL_BURYING_LOGIC"/>
<Detector class="com.mebigfatguy.fbcontrib.detect.WiringIssues" speed="fast" reports="WI_DUPLICATE_WIRED_TYPES"/>
- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ConcurrentCollectionIssues" speed="fast" reports="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY"/>
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -569,8 +570,8 @@
<BugPattern abbrev="SEO" type="SEO_SUBOPTIMAL_EXPRESSION_ORDER" category="PERFORMANCE"/>
<BugPattern abbrev="IOI" type="IOI_DOUBLE_BUFFER_COPY" category="PERFORMANCE"/>
<BugPattern abbrev="IOI" type="IOI_COPY_WITH_READER" category="PERFORMANCE"/>
- <BugPattern abbrev="DMC" type="DMC_DUBIOUS_MAP_COLLECTION" category="CORRECTNESS" experimental="true"/>
- <BugPattern abbrev="BL" type="BL_BURYING_LOGIC" category="STYLE" experimental="true" />
- <BugPattern abbrev="WI" type="WI_DUPLICATE_WIRED_TYPES" category="CORRECTNESS" experimental="true"/>
-
+ <BugPattern abbrev="DMC" type="DMC_DUBIOUS_MAP_COLLECTION" category="CORRECTNESS"/>
+ <BugPattern abbrev="BL" type="BL_BURYING_LOGIC" category="STYLE"/>
+ <BugPattern abbrev="WI" type="WI_DUPLICATE_WIRED_TYPES" category="CORRECTNESS"/>
+ <BugPattern abbrev="CCI" type="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY" category="CORRECTNESS"/>
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/etc/messages.xml 2016-10-10 18:28:44 UTC (rev 1800)
@@ -1276,9 +1276,9 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BackportReusePublicIdentifiers">
<Details>
<![CDATA[
- <p>Detects use of Backport Utils concurrent classes. Updated/efficient versions of these
- classes are available in versions of the JDK 5.0 and higher, and these
- classes should only be used if you are targeting JDK 1.4 and lower.</p>
+ <p>Detects use of Backport Utils concurrent classes from Emory, or Time classes from ThreeTen. Updated/efficient versions of
+ classes from emory are available in versions of the JDK 5.0 and higher, and in JDK 8.0 and higher for ThreeTen, and these
+ classes should only be used if you are targeting a JDK lower than this.</p>
<p>It is a fast detector.</p>
]]>
</Details>
@@ -1628,6 +1628,15 @@
]]>
</Details>
</Detector>
+
+ <Detector class="com.mebigfatguy.fbcontrib.detect.ConcurrentCollectionIssues">
+ <Details>
+ <![CDATA[
+ <p>Looks for problems with using concurrent collecctions</p>
+ <p>It is a fast detector.</p>
+ ]]>
+ </Details>
+ </Detector>
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
@@ -4704,13 +4713,14 @@
</BugPattern>
<BugPattern type="BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS">
- <ShortDescription>Method uses backport concurrency utils</ShortDescription>
- <LongDescription>Method {1} backport concurrency utils</LongDescription>
+ <ShortDescription>Method uses backported libraries that are now built in</ShortDescription>
+ <LongDescription>Method {1} uses backported libraries that are now built in</LongDescription>
<Details>
<![CDATA[
- <p>This class uses Backport Utils concurrent classes. Updated/Efficient version of these
- classes are available in versions of the JDK 5.0 and higher, and these
- classes should only be used if you are targeting JDK 1.4 and lower.</p>
+ <p>This class uses either Backport Utils concurrent classes from Emory, or Time classes from ThreeTen Backport.
+ Updated/Efficient version of these classes are available in the version of the JDK that this code is compiled against;
+ JDK 1.5 for the concurrent classes, and JDK 1.8 for the time classes, and these
+ classes should only be used if you are targeting a JDK lower than this.</p>
]]>
</Details>
</BugPattern>
@@ -5550,9 +5560,10 @@
<LongDescription>Method {1} buries logic to the right (indented) more than it needs to be</LongDescription>
<Details>
<![CDATA[
- <p>This method has an if statement where if the condition is false, it merely returns. The bulk of the logic
- is found in the if brace code. This unnecessarily obfuscates the logic of the method. It would be more readable
- if you inverted the logic of the if statement, and just returned if true.</p>
+ <p>Looks for relatively large if blocks of code, where you unconditionally return from them, and then follow that with an unconditional
+ return of a small block. This places the bulk of the logic to the right indentation-wise, making it more difficult to read than needed.
+ It would be better to invert the logic of the if block, and immediately return, allowing the bulk of the logic to be move to the left,
+ for easier reading.</p>
]]>
</Details>
</BugPattern>
@@ -5568,6 +5579,22 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY">
+ <ShortDescription>Method gets and sets a value of a ConcurrentHashMap in a racy manner</ShortDescription>
+ <LongDescription>Method {1} gets and sets a value of a ConcurrentHashMap in a racy manner </LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method retrieves the value of a key from a ConcurrentHashMap, where the value is itself a collection. It checks this
+ value for null, and if it is so, creates a new collection and places in the map. This may cause thread race conditions
+ where two threads overwrite each other's values. You should be using
+ <code>
+ ConcurrentHashMap.putIfAbsent(K, V)
+ </code>
+ instead.
+ ]]>
+ </Details>
+ </BugPattern>
<!-- BugCode -->
@@ -5705,4 +5732,5 @@
<BugCode abbrev="DMC">Dubious Map Collection</BugCode>
<BugCode abbrev="BL">Burying Logic</BugCode>
<BugCode abbrev="WI">Wiring issues</BugCode>
+ <BugCode abbrev="CCI">Concurrent Collection Issues</BugCode>
</MessageCollection>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/htdocs/index.shtml 2016-10-10 18:28:44 UTC (rev 1800)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.6.3 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.8.0 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
@@ -81,6 +81,14 @@
Detectors added in git<br/>
<div id="git" style="display:none;">
<ul>
+ <li>--none yet--</li>
+ </ul>
+ </div>
+ <hr/>
+ <img id="git_image" src="flip2.gif" onClick="toggleBlock('v6_8_0', 'v6_8_0_image');" align="top"/>
+ Detectors added in v6.8.0<br/>
+ <div id="v6_8_0" style="display:block;">
+ <ul>
<li><b>[DMC] Dubious Map Collection</b><br/>
Looks for fields that are implementations of java.util.Map, but that are only ever iterated over. This probably means that this
data structure should be a List of some class that holds two values, or at the least Pair. Map was probably choosen as it was the
@@ -95,14 +103,21 @@
<li><b>[WI] Wiring Issues</b><br/>
Looks for various issues around @Autowired/@Inject fields in DI classes
<ul>
- <li>Injecting the same bean twice into the same class hierarchy, even with different field names</li>
+ <li>Injecting the same bean twice into the same class hierarchy, even with different field names</li>
+ </ul>
</li>
+ <li><b>[CCI] Concurrent Collection Issues</b><br/>
+ Looks for various issues around using concurrent collections including
+ <ul>
+ <li>Using get/put with collection values, when you should use putIfAbsent</li>
+ </ul>
+ </li>
</ul>
</div>
<hr/>
- <img id="git_image" src="flip2.gif" onClick="toggleBlock('v6_6_0', 'v6_6_0_image');" align="top"/>
+ <img id="git_image" src="flip1.gif" onClick="toggleBlock('v6_6_0', 'v6_6_0_image');" align="top"/>
Detectors added in v6.6.0<br/>
- <div id="v6_6_0" style="display:block;">
+ <div id="v6_6_0" style="display:none;">
<ul>
<li><b>[STB] Stacked Try Blocks</b><br/>
Looks for two or more try catch blocks that are consecutive and catch the
@@ -148,7 +163,7 @@
</ul>
</div>
<hr/>
- <img id="v6_2_0_image" src="flip2.gif" onClick="toggleBlock('v6_2_0', 'v6_2_0_image');" align="top"/>
+ <img id="v6_2_0_image" src="flip1.gif" onClick="toggleBlock('v6_2_0', 'v6_2_0_image');" align="top"/>
Detectors added in v6.2.0<br/>
<div id="v6_2_0" style="display:none;">
<ul>
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/htdocs/repository.html 2016-10-10 18:28:44 UTC (rev 1800)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.6.3</td></tr>
+ <tr><td><b>Version:</b></td><td>6.8.0</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/pom.xml 2016-10-10 18:28:44 UTC (rev 1800)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.6.3</version>
+ <version>6.9.0-SNAPSHOT</version>
<prerequisites>
<maven>2.2.1</maven>
@@ -173,6 +173,12 @@
<version>4.3.2.RELEASE</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.threeten</groupId>
+ <artifactId>threetenbp</artifactId>
+ <version>1.3.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
Modified: trunk/fb-contrib/samples/BRPI_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BRPI_Sample.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/samples/BRPI_Sample.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -1,3 +1,6 @@
+
+import org.threeten.bp.LocalDate;
+
import edu.emory.mathcs.backport.java.util.Collections;
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
import edu.emory.mathcs.backport.java.util.concurrent.Executors;
@@ -3,8 +6,12 @@
public class BRPI_Sample {
- public static void main(String[] arg) {
+ public void emory() {
Collections.emptySet();
Executors.newCachedThreadPool();
new ConcurrentHashMap();
}
+
+ public void threeten() {
+ LocalDate d = LocalDate.now();
+ }
}
Added: trunk/fb-contrib/samples/CCI_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CCI_Sample.java (rev 0)
+++ trunk/fb-contrib/samples/CCI_Sample.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -0,0 +1,21 @@
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class CCI_Sample {
+
+ private Map<String, Set<String>> map = new ConcurrentHashMap<>();
+
+ public void update(String key, String value) {
+
+ Set<String> values = map.get(key);
+
+ if (values == null) {
+ values = Collections.<String> newSetFromMap(new ConcurrentHashMap<String, Boolean>());
+ map.put(key, values);
+ }
+
+ values.add(value);
+ }
+}
Property changes on: trunk/fb-contrib/samples/CCI_Sample.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/fb-contrib/samples/LEST_Sample.java
===================================================================
--- trunk/fb-contrib/samples/LEST_Sample.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/samples/LEST_Sample.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -149,4 +149,14 @@
private static Exception wrapStatic(Exception e) {
return new Exception(e);
}
+
+ public void testFPSuppressedLest(String s) {
+ try {
+ double d = Double.parseDouble(s);
+ } catch (NumberFormatException e) {
+ RuntimeException r = new RuntimeException();
+ r.addSuppressed(e);
+ throw r;
+ }
+ }
}
Modified: trunk/fb-contrib/samples/samples.fbp
===================================================================
--- trunk/fb-contrib/samples/samples.fbp 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/samples/samples.fbp 2016-10-10 18:28:44 UTC (rev 1800)
@@ -1,23 +1,24 @@
<Project projectName="sample">
- <Jar>././../target/classes/samples</Jar>
- <AuxClasspathEntry>././../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/commons-collections-3.2.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/log4j-1.2.17.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/commons-lang3-3.3.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/slf4j-api-1.7.7.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/guava-17.0.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/httpclient-4.3.4.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/httpclient-cache-4.3.4.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/httpcore-4.3.2.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/commons-codec-1.6.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/commons-io-1.3.2.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/junit-4.12.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/testng-6.9.6.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/jsr311-api-1.1.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>././../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry>
- <AuxClasspathEntry>./../lib/mockito-all-2.0.2-beta.jar</AuxClasspathEntry>
- <AuxClasspathEntry>../lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry>
- <SrcDir>./././.</SrcDir>
+ <Jar>./././../target/classes/samples</Jar>
+ <AuxClasspathEntry>./././../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-collections-3.2.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/log4j-1.2.17.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-lang3-3.3.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/slf4j-api-1.7.7.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/guava-17.0.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/httpclient-4.3.4.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/httpclient-cache-4.3.4.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/httpcore-4.3.2.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-codec-1.6.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-io-1.3.2.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/junit-4.12.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/testng-6.9.6.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/jsr311-api-1.1.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>././../lib/mockito-all-2.0.2-beta.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>../lib/threetenbp-1.3.2.jar</AuxClasspathEntry>
+ <SrcDir>././././.</SrcDir>
</Project>
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -40,6 +40,9 @@
import edu.umd.cs.findbugs.OpcodeStack;
import edu.umd.cs.findbugs.ba.ClassContext;
+/**
+ * a first pass detector to collect various statistics used in second pass detectors.
+ */
public class CollectStatistics extends BytecodeScanningDetector implements NonReportingDetector {
private static final Set<String> COMMON_METHOD_SIGS = UnmodifiableSet.create(
//@formatter:off
@@ -59,10 +62,22 @@
private Map<QMethod, Set<CalledMethod>> selfCallTree;
private QMethod curMethod;
+ /**
+ * constructs a CollectStatistics detector which clears the singleton that holds the statistics for all classes parsed in the first pass.
+ *
+ * @param bugReporter
+ * unused, but required by reflection contract
+ */
public CollectStatistics(@SuppressWarnings("unused") BugReporter bugReporter) {
Statistics.getStatistics().clear();
}
+ /**
+ * implements the visitor to collect statistics on this class
+ *
+ * @param classContext
+ * the currently class
+ */
@Override
public void visitClassContext(ClassContext classContext) {
try {
@@ -227,6 +242,9 @@
return (annotations != null) && (annotations.length > 0);
}
+ /**
+ * represents a method that is called, and whether it is in the super class
+ */
static class CalledMethod {
private QMethod callee;
private boolean isSuper;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -22,6 +22,9 @@
import com.mebigfatguy.fbcontrib.utils.ToString;
+/**
+ * represents statistics including attributes, mutability and sizes of a method
+ */
public class MethodInfo {
public static final int PUBLIC_USE = 1;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -162,7 +162,7 @@
bugReporter.reportBug(new BugInstance(this, BugType.AFBR_ABNORMAL_FINALLY_BLOCK_RETURN.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
.addSourceLine(this));
removeEarliestFinallyBlock();
- } else if (OpcodeUtils.isInvoke(seen)) {
+ } else if (OpcodeUtils.isStandardInvoke(seen)) {
try {
JavaClass cls = Repository.lookupClass(getClassConstantOperand());
Method m = findMethod(cls, getNameConstantOperand(), getSigConstantOperand());
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -27,6 +27,9 @@
import edu.umd.cs.findbugs.OpcodeStack;
import edu.umd.cs.findbugs.ba.ClassContext;
+/**
+ * a base detector class for when you need to precess collections, provides methods for checking collection attributes
+ */
public class AbstractCollectionScanningDetector extends BytecodeScanningDetector {
protected final JavaClass collectionClass;
protected final BugReporter bugReporter;
@@ -52,6 +55,7 @@
* @param classContext
* the context object of the currently parsed class
*/
+ @Override
public void visitClassContext(ClassContext classContext) {
if (collectionClass == null) {
if (ex != null) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java 2016-09-24 00:41:19 UTC (rev 1799)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java 2016-10-10 18:28:44 UTC (rev 1800)
@@ -65,8 +65,8 @@
public void visitClassContext(ClassContext classContext) {
try {
stack = new OpcodeStack();
- mapBugs = new ArrayList<BugInstance>();
- setBugs = new ArrayList<BugInstance>();
+ mapBugs = new ArrayList<>();
+ setBugs = new ArrayList<>();
hasMapComparator = false;
hasSetComparator = false;
super.visitClassContext(classContext);
@@ -147,7 +147,7 @@
found = true;
}
}
- } else if ("java/util/List".equals(className) && "contains".equals(methodName) && "(Ljava/lang/Object;)Z".equals(methodSig)
+ } else if (Values.SLASHED_JAVA_UTIL_LIST.equals(className) && "contains".equals(methodName) && "(Ljava/lang/Object;)Z".equals(methodSig)
&& (stack.getStackDepth() > 0)) {
OpcodeStack.Item itm = stack.getStackItem(0);
String pushedSig = itm.getSignature();
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
===================================================================
--- trunk/fb-contrib/src/co...
[truncated message content] |
|
From: <dbr...@us...> - 2016-11-18 03:30:52
|
Revision: 1803
http://sourceforge.net/p/fb-contrib/code/1803
Author: dbrosius
Date: 2016-11-18 03:30:45 +0000 (Fri, 18 Nov 2016)
Log Message:
-----------
move src to match git layout
Added Paths:
-----------
trunk/fb-contrib/etc/samples.fbp
trunk/fb-contrib/src/main/
trunk/fb-contrib/src/main/java/
trunk/fb-contrib/src/main/java/com/
trunk/fb-contrib/src/samples/
trunk/fb-contrib/src/samples/java/
trunk/fb-contrib/src/samples/java/ABC_Sample.java
trunk/fb-contrib/src/samples/java/ACEM_Sample.java
trunk/fb-contrib/src/samples/java/AFBR_Sample.java
trunk/fb-contrib/src/samples/java/AIOB_Sample.java
trunk/fb-contrib/src/samples/java/AOM_Sample.java
trunk/fb-contrib/src/samples/java/AWCBR_Sample.java
trunk/fb-contrib/src/samples/java/BAS_Sample.java
trunk/fb-contrib/src/samples/java/BED_Sample.java
trunk/fb-contrib/src/samples/java/BL_Sample.java
trunk/fb-contrib/src/samples/java/BRPI_Sample.java
trunk/fb-contrib/src/samples/java/BSB_Sample.java
trunk/fb-contrib/src/samples/java/CAAL_Sample.java
trunk/fb-contrib/src/samples/java/CAO_Sample.java
trunk/fb-contrib/src/samples/java/CBC_Sample.java
trunk/fb-contrib/src/samples/java/CBX_Sample.java
trunk/fb-contrib/src/samples/java/CCI_Sample.java
trunk/fb-contrib/src/samples/java/CCNE_Sample.java
trunk/fb-contrib/src/samples/java/CEBE_EqualsToEqualsSample.java
trunk/fb-contrib/src/samples/java/CE_Sample.java
trunk/fb-contrib/src/samples/java/CFS_Sample.java
trunk/fb-contrib/src/samples/java/CHBH_HashcodeToHashcodeSample.java
trunk/fb-contrib/src/samples/java/CLI_Sample.java
trunk/fb-contrib/src/samples/java/CNC_Sample.java
trunk/fb-contrib/src/samples/java/COM_Sample.java
trunk/fb-contrib/src/samples/java/CRF_Sample.java
trunk/fb-contrib/src/samples/java/CSBTS_StringToStringSample.java
trunk/fb-contrib/src/samples/java/CSI_Sample.java
trunk/fb-contrib/src/samples/java/CTU_Sample.java
trunk/fb-contrib/src/samples/java/CU_Sample.java
trunk/fb-contrib/src/samples/java/CVAA_Sample.java
trunk/fb-contrib/src/samples/java/DDC_Sample.java
trunk/fb-contrib/src/samples/java/DLC_Sample.java
trunk/fb-contrib/src/samples/java/DMC_Sample.java
trunk/fb-contrib/src/samples/java/DRE_Sample.java
trunk/fb-contrib/src/samples/java/DSOC_Sample.java
trunk/fb-contrib/src/samples/java/DTEP_Sample.java
trunk/fb-contrib/src/samples/java/DWI_Sample.java
trunk/fb-contrib/src/samples/java/EXS_Sample.java
trunk/fb-contrib/src/samples/java/FCBL_Sample.java
trunk/fb-contrib/src/samples/java/FCCD_Sample.java
trunk/fb-contrib/src/samples/java/FPL_Sample.java
trunk/fb-contrib/src/samples/java/FP_Sample.java
trunk/fb-contrib/src/samples/java/HCP_Sample.java
trunk/fb-contrib/src/samples/java/HES_Sample.java
trunk/fb-contrib/src/samples/java/ICA_Sample.java
trunk/fb-contrib/src/samples/java/IICU_Sample.java
trunk/fb-contrib/src/samples/java/IKNC_Sample.java
trunk/fb-contrib/src/samples/java/IMC_Sample.java
trunk/fb-contrib/src/samples/java/IOI_Sample.java
trunk/fb-contrib/src/samples/java/IPU_Sample.java
trunk/fb-contrib/src/samples/java/ISB_Sample.java
trunk/fb-contrib/src/samples/java/ITC_Sample.java
trunk/fb-contrib/src/samples/java/ITU_Sample.java
trunk/fb-contrib/src/samples/java/JPAI_Sample.java
trunk/fb-contrib/src/samples/java/JVR_Sample.java
trunk/fb-contrib/src/samples/java/JXI_Sample.java
trunk/fb-contrib/src/samples/java/LEST_Sample.java
trunk/fb-contrib/src/samples/java/LGO_Sample.java
trunk/fb-contrib/src/samples/java/LII_Sample.java
trunk/fb-contrib/src/samples/java/LO_Sample.java
trunk/fb-contrib/src/samples/java/LSC_Sample.java
trunk/fb-contrib/src/samples/java/LSYC_Sample.java
trunk/fb-contrib/src/samples/java/MAC_Sample.java
trunk/fb-contrib/src/samples/java/MDM_Sample.java
trunk/fb-contrib/src/samples/java/MOM_Sample.java
trunk/fb-contrib/src/samples/java/MRC_Sample.java
trunk/fb-contrib/src/samples/java/MTA_Sample.java
trunk/fb-contrib/src/samples/java/MUC_Sample.java
trunk/fb-contrib/src/samples/java/NAB_Sample.java
trunk/fb-contrib/src/samples/java/NCMU_Sample.java
trunk/fb-contrib/src/samples/java/NCS_Sample.java
trunk/fb-contrib/src/samples/java/NFF_Sample.java
trunk/fb-contrib/src/samples/java/NIR_Sample.java
trunk/fb-contrib/src/samples/java/NMCS_Sample.java
trunk/fb-contrib/src/samples/java/NOS_Sample.java
trunk/fb-contrib/src/samples/java/NPMC_Sample.java
trunk/fb-contrib/src/samples/java/NRTL_Sample.java
trunk/fb-contrib/src/samples/java/NSE_Sample.java
trunk/fb-contrib/src/samples/java/OCP_Sample.java
trunk/fb-contrib/src/samples/java/OC_Sample.java
trunk/fb-contrib/src/samples/java/ODN_Sample.java
trunk/fb-contrib/src/samples/java/OPM_Sample.java
trunk/fb-contrib/src/samples/java/PCAIL_Sample.java
trunk/fb-contrib/src/samples/java/PCOA_Sample.java
trunk/fb-contrib/src/samples/java/PDP_Sample.java
trunk/fb-contrib/src/samples/java/PIS_Sample.java
trunk/fb-contrib/src/samples/java/PL_Sample.java
trunk/fb-contrib/src/samples/java/PMB_Sample.java
trunk/fb-contrib/src/samples/java/PME_Sample.java
trunk/fb-contrib/src/samples/java/PRMC_Sample.java
trunk/fb-contrib/src/samples/java/PSC_Sample.java
trunk/fb-contrib/src/samples/java/PUS_Sample.java
trunk/fb-contrib/src/samples/java/ROOM_Sample.java
trunk/fb-contrib/src/samples/java/S508C_Sample.java
trunk/fb-contrib/src/samples/java/SACM_Sample.java
trunk/fb-contrib/src/samples/java/SCA_Sample.java
trunk/fb-contrib/src/samples/java/SCII_Sample.java
trunk/fb-contrib/src/samples/java/SCI_Sample.java
trunk/fb-contrib/src/samples/java/SCRV_Sample.java
trunk/fb-contrib/src/samples/java/SCR_Sample.java
trunk/fb-contrib/src/samples/java/SCSS_Sample.java
trunk/fb-contrib/src/samples/java/SEC_Sample.java
trunk/fb-contrib/src/samples/java/SEO_Sample.java
trunk/fb-contrib/src/samples/java/SGSU_Sample.java
trunk/fb-contrib/src/samples/java/SG_Sample.java
trunk/fb-contrib/src/samples/java/SIL_Sample.java
trunk/fb-contrib/src/samples/java/SJVU_Sample.java
trunk/fb-contrib/src/samples/java/SLS_Sample.java
trunk/fb-contrib/src/samples/java/SMII_Sample.java
trunk/fb-contrib/src/samples/java/SNG_Sample.java
trunk/fb-contrib/src/samples/java/SPP_Sample.java
trunk/fb-contrib/src/samples/java/STB_Sample.java
trunk/fb-contrib/src/samples/java/STS_Sample.java
trunk/fb-contrib/src/samples/java/STT_Sample.java
trunk/fb-contrib/src/samples/java/SUA_Sample.java
trunk/fb-contrib/src/samples/java/SWCO_Sample.java
trunk/fb-contrib/src/samples/java/TBP_Sample.java
trunk/fb-contrib/src/samples/java/TR_Sample.java
trunk/fb-contrib/src/samples/java/UAA_Sample.java
trunk/fb-contrib/src/samples/java/UCC_Sample.java
trunk/fb-contrib/src/samples/java/UCPM_Sample.java
trunk/fb-contrib/src/samples/java/UEC_Sample.java
trunk/fb-contrib/src/samples/java/UMTP_Sample.java
trunk/fb-contrib/src/samples/java/UNNC_Sample.java
trunk/fb-contrib/src/samples/java/UP_Sample.java
trunk/fb-contrib/src/samples/java/URV_Sample.java
trunk/fb-contrib/src/samples/java/USBR_Sample.java
trunk/fb-contrib/src/samples/java/USS_Sample.java
trunk/fb-contrib/src/samples/java/UTAO_Sample.java
trunk/fb-contrib/src/samples/java/UTA_Sample.java
trunk/fb-contrib/src/samples/java/UVA_Sample.java
trunk/fb-contrib/src/samples/java/WEM_Sample.java
trunk/fb-contrib/src/samples/java/WI_Sample.java
trunk/fb-contrib/src/samples/java/WOC_Sample.java
trunk/fb-contrib/src/samples/java/samples-bugs.xml
Removed Paths:
-------------
trunk/fb-contrib/samples/ABC_Sample.java
trunk/fb-contrib/samples/ACEM_Sample.java
trunk/fb-contrib/samples/AFBR_Sample.java
trunk/fb-contrib/samples/AIOB_Sample.java
trunk/fb-contrib/samples/AOM_Sample.java
trunk/fb-contrib/samples/AWCBR_Sample.java
trunk/fb-contrib/samples/BAS_Sample.java
trunk/fb-contrib/samples/BED_Sample.java
trunk/fb-contrib/samples/BL_Sample.java
trunk/fb-contrib/samples/BRPI_Sample.java
trunk/fb-contrib/samples/BSB_Sample.java
trunk/fb-contrib/samples/CAAL_Sample.java
trunk/fb-contrib/samples/CAO_Sample.java
trunk/fb-contrib/samples/CBC_Sample.java
trunk/fb-contrib/samples/CBX_Sample.java
trunk/fb-contrib/samples/CCI_Sample.java
trunk/fb-contrib/samples/CCNE_Sample.java
trunk/fb-contrib/samples/CEBE_EqualsToEqualsSample.java
trunk/fb-contrib/samples/CE_Sample.java
trunk/fb-contrib/samples/CFS_Sample.java
trunk/fb-contrib/samples/CHBH_HashcodeToHashcodeSample.java
trunk/fb-contrib/samples/CLI_Sample.java
trunk/fb-contrib/samples/CNC_Sample.java
trunk/fb-contrib/samples/COM_Sample.java
trunk/fb-contrib/samples/CRF_Sample.java
trunk/fb-contrib/samples/CSBTS_StringToStringSample.java
trunk/fb-contrib/samples/CSI_Sample.java
trunk/fb-contrib/samples/CTU_Sample.java
trunk/fb-contrib/samples/CU_Sample.java
trunk/fb-contrib/samples/CVAA_Sample.java
trunk/fb-contrib/samples/DDC_Sample.java
trunk/fb-contrib/samples/DLC_Sample.java
trunk/fb-contrib/samples/DMC_Sample.java
trunk/fb-contrib/samples/DRE_Sample.java
trunk/fb-contrib/samples/DSOC_Sample.java
trunk/fb-contrib/samples/DTEP_Sample.java
trunk/fb-contrib/samples/DWI_Sample.java
trunk/fb-contrib/samples/EXS_Sample.java
trunk/fb-contrib/samples/FCBL_Sample.java
trunk/fb-contrib/samples/FCCD_Sample.java
trunk/fb-contrib/samples/FPL_Sample.java
trunk/fb-contrib/samples/FP_Sample.java
trunk/fb-contrib/samples/HCP_Sample.java
trunk/fb-contrib/samples/HES_Sample.java
trunk/fb-contrib/samples/ICA_Sample.java
trunk/fb-contrib/samples/IICU_Sample.java
trunk/fb-contrib/samples/IKNC_Sample.java
trunk/fb-contrib/samples/IMC_Sample.java
trunk/fb-contrib/samples/IOI_Sample.java
trunk/fb-contrib/samples/IPU_Sample.java
trunk/fb-contrib/samples/ISB_Sample.java
trunk/fb-contrib/samples/ITC_Sample.java
trunk/fb-contrib/samples/ITU_Sample.java
trunk/fb-contrib/samples/JPAI_Sample.java
trunk/fb-contrib/samples/JVR_Sample.java
trunk/fb-contrib/samples/JXI_Sample.java
trunk/fb-contrib/samples/LEST_Sample.java
trunk/fb-contrib/samples/LGO_Sample.java
trunk/fb-contrib/samples/LII_Sample.java
trunk/fb-contrib/samples/LO_Sample.java
trunk/fb-contrib/samples/LSC_Sample.java
trunk/fb-contrib/samples/LSYC_Sample.java
trunk/fb-contrib/samples/MAC_Sample.java
trunk/fb-contrib/samples/MDM_Sample.java
trunk/fb-contrib/samples/MOM_Sample.java
trunk/fb-contrib/samples/MRC_Sample.java
trunk/fb-contrib/samples/MTA_Sample.java
trunk/fb-contrib/samples/MUC_Sample.java
trunk/fb-contrib/samples/NAB_Sample.java
trunk/fb-contrib/samples/NCMU_Sample.java
trunk/fb-contrib/samples/NCS_Sample.java
trunk/fb-contrib/samples/NFF_Sample.java
trunk/fb-contrib/samples/NIR_Sample.java
trunk/fb-contrib/samples/NMCS_Sample.java
trunk/fb-contrib/samples/NOS_Sample.java
trunk/fb-contrib/samples/NPMC_Sample.java
trunk/fb-contrib/samples/NRTL_Sample.java
trunk/fb-contrib/samples/NSE_Sample.java
trunk/fb-contrib/samples/OCP_Sample.java
trunk/fb-contrib/samples/OC_Sample.java
trunk/fb-contrib/samples/ODN_Sample.java
trunk/fb-contrib/samples/OPM_Sample.java
trunk/fb-contrib/samples/PCAIL_Sample.java
trunk/fb-contrib/samples/PCOA_Sample.java
trunk/fb-contrib/samples/PDP_Sample.java
trunk/fb-contrib/samples/PIS_Sample.java
trunk/fb-contrib/samples/PL_Sample.java
trunk/fb-contrib/samples/PMB_Sample.java
trunk/fb-contrib/samples/PME_Sample.java
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/samples/PSC_Sample.java
trunk/fb-contrib/samples/PUS_Sample.java
trunk/fb-contrib/samples/ROOM_Sample.java
trunk/fb-contrib/samples/S508C_Sample.java
trunk/fb-contrib/samples/SACM_Sample.java
trunk/fb-contrib/samples/SCA_Sample.java
trunk/fb-contrib/samples/SCII_Sample.java
trunk/fb-contrib/samples/SCI_Sample.java
trunk/fb-contrib/samples/SCRV_Sample.java
trunk/fb-contrib/samples/SCR_Sample.java
trunk/fb-contrib/samples/SCSS_Sample.java
trunk/fb-contrib/samples/SEC_Sample.java
trunk/fb-contrib/samples/SEO_Sample.java
trunk/fb-contrib/samples/SGSU_Sample.java
trunk/fb-contrib/samples/SG_Sample.java
trunk/fb-contrib/samples/SIL_Sample.java
trunk/fb-contrib/samples/SJVU_Sample.java
trunk/fb-contrib/samples/SLS_Sample.java
trunk/fb-contrib/samples/SMII_Sample.java
trunk/fb-contrib/samples/SNG_Sample.java
trunk/fb-contrib/samples/SPP_Sample.java
trunk/fb-contrib/samples/STB_Sample.java
trunk/fb-contrib/samples/STS_Sample.java
trunk/fb-contrib/samples/STT_Sample.java
trunk/fb-contrib/samples/SUA_Sample.java
trunk/fb-contrib/samples/SWCO_Sample.java
trunk/fb-contrib/samples/TBP_Sample.java
trunk/fb-contrib/samples/TR_Sample.java
trunk/fb-contrib/samples/UAA_Sample.java
trunk/fb-contrib/samples/UCC_Sample.java
trunk/fb-contrib/samples/UCPM_Sample.java
trunk/fb-contrib/samples/UEC_Sample.java
trunk/fb-contrib/samples/UMTP_Sample.java
trunk/fb-contrib/samples/UNNC_Sample.java
trunk/fb-contrib/samples/UP_Sample.java
trunk/fb-contrib/samples/URV_Sample.java
trunk/fb-contrib/samples/USBR_Sample.java
trunk/fb-contrib/samples/USS_Sample.java
trunk/fb-contrib/samples/UTAO_Sample.java
trunk/fb-contrib/samples/UTA_Sample.java
trunk/fb-contrib/samples/UVA_Sample.java
trunk/fb-contrib/samples/WEM_Sample.java
trunk/fb-contrib/samples/WI_Sample.java
trunk/fb-contrib/samples/WOC_Sample.java
trunk/fb-contrib/samples/samples-bugs.xml
trunk/fb-contrib/samples/samples.fbp
trunk/fb-contrib/src/com/
Property Changed:
----------------
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/package.html
Copied: trunk/fb-contrib/etc/samples.fbp (from rev 1800, trunk/fb-contrib/samples/samples.fbp)
===================================================================
--- trunk/fb-contrib/etc/samples.fbp (rev 0)
+++ trunk/fb-contrib/etc/samples.fbp 2016-11-18 03:30:45 UTC (rev 1803)
@@ -0,0 +1,24 @@
+<Project projectName="sample">
+ <Jar>./././../target/classes/samples</Jar>
+ <AuxClasspathEntry>./././../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-collections-3.2.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/log4j-1.2.17.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-lang3-3.3.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/slf4j-api-1.7.7.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/guava-17.0.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/httpclient-4.3.4.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/httpclient-cache-4.3.4.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/httpcore-4.3.2.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-codec-1.6.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/commons-io-1.3.2.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/junit-4.12.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/testng-6.9.6.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/jsr311-api-1.1.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./././../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>././../lib/mockito-all-2.0.2-beta.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>./../lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>../lib/threetenbp-1.3.2.jar</AuxClasspathEntry>
+ <SrcDir>././././.</SrcDir>
+</Project>
Deleted: trunk/fb-contrib/samples/ABC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/ABC_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/ABC_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,42 +0,0 @@
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-public class ABC_Sample {
- public Map<String[], String> testMaps(String[] key, String value) {
- Map<String[], String> m = new HashMap<String[], String>();
- m.put(key, value);
- return m;
- }
-
- public Set<String[]> testSets(String[] values) {
- Set<String[]> s = new HashSet<String[]>();
- s.add(values);
- return s;
- }
-
- public boolean testLists(List<String[]> l, String[] value) {
- return l.contains(value);
- }
-
- public static class UseComparator {
- private Map<byte[], byte[]> testComp;
-
- public UseComparator() {
- testComp = new TreeMap<byte[], byte[]>(new Comparator<byte[]>() {
- @Override
- public int compare(byte[] b1, byte[] b2) {
- return b1.length - b2.length;
- }
- });
- }
-
- public void testc() {
- testComp.put(new byte[5], new byte[3]);
- }
- }
-}
Deleted: trunk/fb-contrib/samples/ACEM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/ACEM_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/ACEM_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,19 +0,0 @@
-
-public abstract class ACEM_Sample implements Foo {
- public void test() {
- }
-
- public int test1() {
- throw new UnsupportedOperationException("Not implemented");
- }
-
- @Override
- public void doFPFoo() {
- }
-
-
-}
-
-interface Foo {
- void doFPFoo();
-}
\ No newline at end of file
Deleted: trunk/fb-contrib/samples/AFBR_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AFBR_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/AFBR_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,57 +0,0 @@
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-@SuppressWarnings("all")
-public class AFBR_Sample {
- public int test1(boolean b) {
- try {
- int i = 0;
- } finally {
- if (b)
- return 0;
- int j = 0;
- }
- return 2;
- }
-
- public int test2() {
- try {
- return 0;
- } finally {
- throw new NullPointerException();
- }
- }
-
- public int test3() throws Exception {
- try {
- return 0;
- } finally {
- throw new Exception();
- }
- }
-
- public int test4() {
- try {
- throw new Exception();
- } catch (Exception e) {
- return 1;
- } finally {
- return 0;
- }
- }
-
- public int test5() throws IOException {
- InputStream is = null;
- try {
- is = new FileInputStream("test");
- return 1;
- } catch (IOException ioe) {
- System.out.println("error");
- } finally {
- if (is != null)
- is.close();
- }
- return 0;
- }
-}
\ No newline at end of file
Deleted: trunk/fb-contrib/samples/AIOB_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AIOB_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/AIOB_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,66 +0,0 @@
-import java.util.List;
-
-public class AIOB_Sample {
- int[] fa = new int[4];
- int[] fb;
-
- public void testOutOfBounds() {
- int[] a = new int[4];
-
- a[4] = 2;
- fa[4] = 2;
- }
-
- public void testOutOfBoundsGuard() {
- int[] a = new int[4];
-
- if (a.length > 4) {
- a[4] = 2;
- }
- }
-
- public void testUnallocated() {
- int[] b = null;
-
- b[4] = 4;
- fb[4] = 4;
- }
-
- public int[] fpPlusPlusNotRecognized(List<String> l) {
- int size = 0;
-
- for (String s : l) {
- size++;
- }
-
- int[] data = new int[size];
-
- data[0] = 0;
- return data;
- }
-
- public void fpPostAllocate() {
- double[] da = null;
-
- for (int i = 0; i < 10; i++) {
- if ((i & 1) == 1) {
- da[0] = 0.0;
- }
-
- if (da == null)
- da = new double[10];
- }
- }
-
- public void fpPlusEquals(List<String> ss) {
- int size = 0;
-
- for (String s : ss) {
- size += s.length();
- }
-
- int[] a = new int[size];
-
- a[0] = 1;
- }
-}
Deleted: trunk/fb-contrib/samples/AOM_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AOM_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/AOM_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,17 +0,0 @@
-class AOM_Super {
- public void test1() {
- test2();
- System.out.println("test");
- }
-
- private void test2() {
- System.out.println("test");
- }
-}
-
-public abstract class AOM_Sample extends AOM_Super {
- @Override
- public abstract void test1();
-
- public abstract void test2();
-}
Deleted: trunk/fb-contrib/samples/AWCBR_Sample.java
===================================================================
--- trunk/fb-contrib/samples/AWCBR_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/AWCBR_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,42 +0,0 @@
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Set;
-
-public class AWCBR_Sample {
- public void m(int[] v) {
- v[0]++;
- }
-
- public int testuninitedalloc(int i) {
- int[] data = new int[1];
- data[0] = i;
- m(data);
- i = data[0];
- return i;
- }
-
- public int testinitedalloc(int i) {
- int[] data = new int[] { i };
- m(data);
- i = data[0];
- return i;
- }
-
- public int testNoCall(int i) {
- // while silly don't report this, as there is no arg usage
- int[] data = new int[] { i };
- i = data[0];
- return i;
- }
-
- public boolean testFPInvoke(Method m) throws Exception {
-
- Set<String> s = new HashSet<String>();
- Object[] args = new Object[] { s };
- m.invoke(this, args);
-
- s = (Set<String>) args[0];
-
- return s.isEmpty();
- }
-}
Deleted: trunk/fb-contrib/samples/BAS_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BAS_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/BAS_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,254 +0,0 @@
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ForkJoinPool;
-import java.util.concurrent.Future;
-
-@SuppressWarnings("all")
-public class BAS_Sample {
- private final Map<String, String> m = new HashMap<>();
-
- private long value = 0;
- private Long stash = Long.valueOf(0);
-
- public void testIfScope(String s) {
- Object o = new Object();
- if (s.equals("Foo")) {
- s = o.toString();
- }
- }
-
- public String testFPForScope(String s) {
- Object o = new Object();
- while (s.length() > 0) {
- o = s.substring(0, 1);
- s = s.substring(1);
- }
- return s;
- }
-
- public String testFP2Scopes(String s) {
- Object o = new Object();
- if (s.equals("Boo")) {
- s = o.toString();
- } else if (s.equals("Hoo")) {
- s = o.toString();
- }
-
- return s;
- }
-
- public String test2InnerScopes(String s) {
- Object o = new Object();
- if (s != null) {
- if (s.equals("Boo")) {
- s = o.toString();
- } else if (s.equals("Hoo")) {
- s = o.toString();
- }
- }
-
- return s;
- }
-
- public String testFPLoopCond(List<String> in) {
- StringBuilder sb = new StringBuilder();
- for (String s : in) {
- sb.append(s);
- }
- return sb.toString();
- }
-
- public List<String> getList() {
- return null;
- }
-
- public String testSwitch(int a) {
- String v = "Test";
-
- switch (a) {
- case 1:
- v = "Testa";
- break;
-
- case 2:
- v = "Tesseract";
- break;
-
- case 3:
- v = "Testy";
- break;
-
- default:
- v = "Rossa";
- break;
- }
-
- return null;
- }
-
- public void testFPSync(Set<String> a, Set<String> b) {
- String c, d;
-
- synchronized (this) {
- c = a.iterator().next();
- d = b.iterator().next();
- }
-
- if (d.length() > 0) {
- d = c;
- }
- }
-
- public int testFPObjChange(Calendar c, boolean b) {
- int hour = c.get(Calendar.HOUR_OF_DAY);
- c.set(2000, Calendar.JANUARY, 1);
-
- if (b) {
- return hour;
- }
-
- return 0;
- }
-
- public void tstFPThisRefChange(long v, boolean b) {
- long oldValue = this.value;
- this.value = v;
-
- if (b) {
- if (oldValue < 0) {
- System.out.println("Negative");
- }
- }
- }
-
- public void tstFPRefChange(Holder h1, Holder h2, boolean b) {
-
- int h = h1.member;
- h1 = h2;
-
- if (b) {
- System.out.println(h);
- }
- }
-
- public void tstFPRefChangeThruMethodChain(Holder h1, Holder h2, boolean b) {
-
- String h = h1.toString().trim();
- h1 = h2;
-
- if (b) {
- System.out.println(h);
- }
- }
-
- public Long testFPRefNull(boolean b) {
-
- Long save = stash;
- stash = null;
-
- if (b) {
- return save;
- }
-
- return null;
-
- }
-
- public void testFPSrcOverwrite(int src, boolean b) {
- int d = src;
- src = 0;
-
- if (b) {
- System.out.println(d);
- }
- }
-
- public void testFPRiskies1(boolean b) {
- long start = System.currentTimeMillis();
-
- if (b) {
- long delta = System.currentTimeMillis() - start;
- System.out.println(delta);
- }
- }
-
- public String testFPIteratorNext(Collection<String> c, boolean b) {
- Iterator<String> it = c.iterator();
-
- String s = it.next();
-
- if (b) {
- if (s == null) {
- return "yay";
- }
- }
-
- return it.next();
- }
-
- public List<String> testFPSynchronized(String s, String p) {
- List<String> l = new ArrayList<>();
- String x = s;
- synchronized (s) {
- if (p != null) {
- l.add(p);
- return l;
- }
- }
-
- return null;
- }
-
- public void testFPNestedIfs(Map<String, String> x, int i, boolean b) {
-
- String s = x.get("hello");
-
- if (i == 0) {
- if (b) {
- System.out.println(s);
- }
- } else if (i == 1) {
- System.out.println(s);
- } else if (i == 2) {
- System.out.println(s);
- }
- }
-
- public boolean testFPFuture(boolean b) {
- ExecutorService s = new ForkJoinPool();
- Future f = s.submit(new Runnable() {
- @Override
- public void run() {
- }
- });
- if (b) {
- if (f.isDone()) {
- return true;
- }
- }
-
- return false;
- }
-
- public int testFPTwoCatches(List<Integer> x) throws Exception {
- String msg = "This is a test";
- try {
- return x.size() * x.get(0);
- } catch (NullPointerException e) {
- throw new Exception(msg + "NPE", e);
- } catch (IndexOutOfBoundsException e) {
- throw new Exception(msg + "IIOBE", e);
- }
- }
-
- static class Holder {
- int member;
- }
-}
Deleted: trunk/fb-contrib/samples/BED_Sample.java
===================================================================
--- trunk/fb-contrib/samples/BED_Sample.java 2016-11-18 03:24:22 UTC (rev 1802)
+++ trunk/fb-contrib/samples/BED_Sample.java 2016-11-18 03:30:45 UTC (rev 1803)
@@ -1,120 +0,0 @@
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.Hashtable;
-import java.util.zip.DataFormatException;
-
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
-
-@SuppressWarnings("all")
-public class BED_Sample {
- IOException ioe;
-
- public BED_Sample() throws IOException {
-
- }
-
- public BED_Sample(String name) throws NamingException {
- Hashtable<String, String> env = new Hashtable<>();
- env.put("name", name);
- DirContext context = new InitialDirContext(en...
[truncated message content] |
|
From: <dbr...@us...> - 2016-11-18 03:35:11
|
Revision: 1804
http://sourceforge.net/p/fb-contrib/code/1804
Author: dbrosius
Date: 2016-11-18 03:35:06 +0000 (Fri, 18 Nov 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/.classpath
trunk/fb-contrib/.project
trunk/fb-contrib/build.properties
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/etc/samples.fbp
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConcurrentCollectionIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousMapCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/TailRecursion.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WiringIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/UnmodifiableList.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/UnmodifiableSet.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/src/samples/java/AIOB_Sample.java
trunk/fb-contrib/src/samples/java/LO_Sample.java
trunk/fb-contrib/src/samples/java/MRC_Sample.java
trunk/fb-contrib/src/samples/java/SPP_Sample.java
trunk/fb-contrib/yank.xls
Added Paths:
-----------
trunk/fb-contrib/samples.xml
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousShadedClassUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseTryWithResources.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureBuilder.java
trunk/fb-contrib/src/samples/java/SSCU_Sample.java
trunk/fb-contrib/src/samples/java/UTWR_Sample.java
Modified: trunk/fb-contrib/.classpath
===================================================================
--- trunk/fb-contrib/.classpath 2016-11-18 03:30:45 UTC (rev 1803)
+++ trunk/fb-contrib/.classpath 2016-11-18 03:35:06 UTC (rev 1804)
@@ -1,39 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/*.*" kind="src" path="etc"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry excluding="lib/" kind="src" output="target/classes/samples" path="samples"/>
+ <classpathentry kind="src" output="target/classes/samples" path="src/samples/java"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes/test" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/backport-util-concurrent-3.1.jar"/>
- <classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.3.1.jar"/>
- <classpathentry kind="lib" path="lib/commons-lang3-3.3.jar"/>
- <classpathentry kind="lib" path="lib/slf4j-api-1.7.7.jar"/>
- <classpathentry kind="lib" path="lib/guava-17.0.jar" sourcepath="lib/sources/guava-17.0-sources.jar"/>
- <classpathentry kind="lib" path="lib/httpclient-cache-4.3.4.jar"/>
- <classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/>
- <classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/>
- <classpathentry kind="lib" path="lib/annotations-3.0.0.jar" sourcepath="/home/dave/.m2/repository/com/google/code/findbugs/annotations/3.0.0/annotations-3.0.0-sources.jar"/>
- <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar" sourcepath="/home/dave/.m2/repository/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2-sources.jar"/>
+ <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar" sourcepath="lib/sources/asm-debug-all-5.0.2-sources.jar"/>
<classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar" sourcepath="lib/sources/bcel-findbugs-6.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="http://commons.apache.org/proper/commons-bcel/apidocs/"/>
</attributes>
</classpathentry>
- <classpathentry kind="lib" path="lib/commons-codec-1.6.jar"/>
<classpathentry kind="lib" path="lib/findbugs-3.0.1.jar" sourcepath="lib/sources/findbugs-3.0.1-sources.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
- <classpathentry kind="lib" path="lib/testng-6.9.6.jar"/>
<classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar" sourcepath="lib/sources/jsr311-api-1.1.1-sources.jar"/>
<classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar"/>
- <classpathentry kind="lib" path="lib/commons-io-1.3.2.jar" sourcepath="lib/sources/commons-io-1.3.2-sources.jar"/>
<classpathentry kind="lib" path="lib/mockito-all-2.0.2-beta.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/findbugs"/>
- <classpathentry kind="lib" path="lib/spring-beans-4.3.2.RELEASE.jar"/>
- <classpathentry kind="lib" path="lib/spring-tx-4.3.2.RELEASE.jar"/>
- <classpathentry kind="lib" path="lib/spring-context-4.3.2.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/threetenbp-1.3.2.jar"/>
+ <classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
+ <classpathentry kind="lib" path="lib/commons-collections-3.2.2.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang3-3.4.jar"/>
+ <classpathentry kind="lib" path="lib/findbugs-ant-3.0.0.jar"/>
+ <classpathentry kind="lib" path="lib/guava-19.0.jar" sourcepath="lib/sources/guava-19.0-sources.jar"/>
+ <classpathentry kind="lib" path="lib/httpclient-4.5.2.jar"/>
+ <classpathentry kind="lib" path="lib/httpclient-cache-4.5.2.jar"/>
+ <classpathentry kind="lib" path="lib/httpcore-4.4.5.jar"/>
+ <classpathentry kind="lib" path="lib/slf4j-api-1.7.21.jar"/>
+ <classpathentry kind="lib" path="lib/spring-beans-4.3.3.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/spring-context-4.3.3.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/spring-tx-4.3.3.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/jena-shaded-guava-3.1.0.jar"/>
+ <classpathentry kind="lib" path="lib/findbugs-annotations-3.0.1.jar"/>
+ <classpathentry kind="lib" path="lib/testng-6.9.10.jar"/>
+ <classpathentry kind="lib" path="lib/jcommander-1.48.jar"/>
+ <classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry kind="output" path="target/classes/main"/>
</classpath>
Modified: trunk/fb-contrib/.project
===================================================================
--- trunk/fb-contrib/.project 2016-11-18 03:30:45 UTC (rev 1803)
+++ trunk/fb-contrib/.project 2016-11-18 03:35:06 UTC (rev 1804)
@@ -32,15 +32,4 @@
<nature>org.eclipse.pde.PluginNature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
</natures>
- <filteredResources>
- <filter>
- <id>1351977185587</id>
- <name>samples</name>
- <type>10</type>
- <matcher>
- <id>org.eclipse.ui.ide.multiFilter</id>
- <arguments>1.0-name-matches-false-false-.svn</arguments>
- </matcher>
- </filter>
- </filteredResources>
</projectDescription>
Modified: trunk/fb-contrib/build.properties
===================================================================
--- trunk/fb-contrib/build.properties 2016-11-18 03:30:45 UTC (rev 1803)
+++ trunk/fb-contrib/build.properties 2016-11-18 03:35:06 UTC (rev 1804)
@@ -3,9 +3,10 @@
META-INF/,\
.
jars.compile.order = .
-source.. = src/,\
- etc/,\
- samples/
+source.. = src/main/java,\
+ src/test/java,\
+ src/samples/java,\
+ etc/
output.. = target/classes/main
proxy.server =
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-11-18 03:30:45 UTC (rev 1803)
+++ trunk/fb-contrib/build.xml 2016-11-18 03:35:06 UTC (rev 1804)
@@ -14,21 +14,24 @@
<property file="build.properties" />
<property file="version.properties" />
- <property name="src.dir" value="${basedir}/src" />
+ <property name="src.dir" value="${basedir}/src/main/java" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="etc.dir" value="${basedir}/etc" />
+ <property name="test.dir" value="${basedir}/src/test/java" />
<property name="target.dir" value="${basedir}/target" />
- <property name="samples.dir" value="${basedir}/samples" />
+ <property name="samples.dir" value="${basedir}/src/samples/java" />
<property name="main.classes.dir" value="${target.dir}/classes/main" />
<property name="samples.classes.dir" value="${target.dir}/classes/samples" />
+ <property name="test.classes.dir" value="${target.dir}/classes/test" />
<property name="javadoc.dir" value="${target.dir}/javadoc" />
<property name="htdocs.dir" value="${basedir}/htdocs" />
<property name="javac.source" value="1.7" />
<property name="javac.target" value="1.7" />
<property name="javac.deprecation" value="on" />
<property name="javac.debug" value="on" />
+ <property name="test_reports.dir" value="${target.dir}/reports/test"/>
- <property name="fb-contrib.version" value="6.9.0-SNAPSHOT" />
+ <property name="fb-contrib.version" value="6.8.1" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -39,15 +42,16 @@
<target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib">
<mkdir dir="${user.home}/.ant/lib" />
- <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.6.1/yank-1.6.1.jar" dest="${user.home}/.ant/lib"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.8.0/yank-1.8.0.jar" dest="${user.home}/.ant/lib"/>
<get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/>
<get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/>
- <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.4.1/fb-delta-0.4.1.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.6.0/fb-delta-0.6.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/>
+ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/stringliterals/stringliterals/0.2.0/stringliterals-0.2.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/>
</target>
<target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank">
<mkdir dir="${lib.dir}" />
- <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true" separateClassifierTypes="true">
+ <yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" proxyServer="${proxy.server}" source="true" separateClassifierTypes="true" checkSHADigests="true">
<server url="http://repo1.maven.org/maven2" />
<generateVersions propertyFileName="${basedir}/version.properties" />
</yank:yank>
@@ -57,7 +61,8 @@
<echo message="fb-contrib - a findbugs plugin"/>
<echo message=""/>
<echo message=" This project requires three jars to build fb-contrib: yank, bug-rank-check-style, vcsversion and" />
- <echo message=" and optionally fb-delta, to generate delta's of bug reports"/>
+ <echo message=" and optionally fb-delta, to generate delta's of bug reports, as well as stringliterals to dump"/>
+ <echo message=" a report of all string literals used in the code"/>
<echo message=""/>
<echo message=" This project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
<echo message=" download yank.jar and place in ~/.ant/lib directory"/>
@@ -77,6 +82,10 @@
<echo message=" and can be downloaded and placed in ~/.ant/lib as well"/>
<echo message=" http://search.maven.org/#search%7Cga%7C1%7Cfb-delta"/>
<echo message="===="/>
+ <echo message=" If you want to generate a report of all string literals used in the code base, this project also uses stringliterals to do"/>
+ <echo message=" that, and can be downloaded and placed in ~/.ant/lib as well"/>
+ <echo message=" http://search.maven.org/#search%7Cga%7C1%7Cstringliterals"/>
+ <echo message="===="/>
<echo message=" This task can be automated by running ant infra_jars"/>
</target>
@@ -86,14 +95,21 @@
<target name="-init" depends="yank">
<mkdir dir="${lib.dir}" />
<mkdir dir="${main.classes.dir}" />
+ <mkdir dir="${test.classes.dir}" />
<mkdir dir="${samples.classes.dir}" />
<mkdir dir="${javadoc.dir}" />
<path id="fb-contrib.classpath">
<pathelement location="${lib.dir}/findbugs-${findbugs.version}.jar" />
<pathelement location="${lib.dir}/bcel-findbugs-${bcel-findbugs.version}.jar" />
- <pathelement location="${lib.dir}/annotations-${annotations.version}.jar" />
+ <pathelement location="${lib.dir}/findbugs-annotations-${findbugs-annotations.version}.jar" />
<pathelement location="${lib.dir}/asm-debug-all-${asm-debug-all.version}.jar" />
+ <pathelement location="${main.classes.dir}" />
</path>
+ <path id="fb-contrib.test.classpath">
+ <pathelement location="${lib.dir}/testng-${testng.version}.jar" />
+ <pathelement location="${lib.dir}/jcommander-${jcommander.version}.jar" />
+ <pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" />
+ </path>
<path id="fb-contrib.samples.classpath">
<pathelement location="${lib.dir}/javax.servlet.jsp-api-${javax.servlet.jsp-api.version}.jar" />
<pathelement location="${lib.dir}/junit-${junit.version}.jar" />
@@ -116,6 +132,7 @@
<pathelement location="${lib.dir}/spring-tx-${spring-tx.version}.jar" />
<pathelement location="${lib.dir}/javax.persistence-${javax.persistence.version}.jar" />
<pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" />
+ <pathelement location="${lib.dir}/jena-shaded-guava-${jena-shaded-guava.version}.jar" />
</path>
</target>
@@ -134,11 +151,18 @@
<classpath refid="fb-contrib.classpath" />
</javac>
</target>
+
+ <target name="compile_test" depends="compile" description="compiles java test files">
+ <javac srcdir="${test.dir}" destdir="${test.classes.dir}" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
+ <classpath refid="fb-contrib.classpath" />
+ <classpath refid="fb-contrib.test.classpath" />
+ </javac>
+ </target>
<target name="compile_samples" depends="-init" description="compiles sample problem files">
<javac srcdir="${samples.dir}" destdir="${samples.classes.dir}" source="1.7" target="1.7" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
<compilerarg value="-XDignore.symbol.file"/>
- <classpath refid="fb-contrib.classpath" />
+ <classpath refid="fb-contrib.classpath" />
<classpath refid="fb-contrib.samples.classpath" />
</javac>
<delete file="${samples.dir}/SJVU_Sample.class" />
@@ -148,7 +172,19 @@
<classpath refid="fb-contrib.samples.classpath" />
</javac>
</target>
+
+ <target name="test" depends="compile_test" unless="no.test" description="runs unit tests">
+ <mkdir dir="${test_reports.dir}" />
+ <taskdef resource="testngtasks" classpath="${lib.dir}/testng-${testng.version}.jar"/>
+ <testng outputDir="${test_reports.dir}">
+ <classfileset dir="${test.classes.dir}" includes="**/*.class"/>
+ <classpath refid="fb-contrib.classpath"/>
+ <classpath refid="fb-contrib.test.classpath"/>
+ <classpath location="${test.classes.dir}"/>
+ </testng>
+ </target>
+
<target name="jar" depends="compile" xmlns:vcs="antlib:com.mebigfatguy.vcsversion" description="produces the fb-contrib jar file">
<vcs:vcsversion vcs="git" revisionProperty="_rev_" dateProperty="_date_" branchProperty="_branch_" urlProperty="_url_"/>
<jar destfile="${target.dir}/fb-contrib-${fb-contrib.version}.jar">
@@ -202,6 +238,7 @@
<include name="**/*.md" />
<include name="**/*.xls" />
<include name="**/*.example" />
+ <include name="**/*.fbp" />
</fileset>
</zip>
</target>
@@ -213,7 +250,7 @@
</javadoc>
</target>
- <target name="build" depends="clean, -init, validate_xml, compile, compile_samples, jar" description="builds the plugin jar">
+ <target name="build" depends="-init, validate_xml, compile, compile_test, compile_samples, test, jar" description="builds the plugin jar">
</target>
<target name="install" depends="build" description="installs the plugin into FindBugs">
@@ -225,7 +262,7 @@
</copy>
</target>
- <target name="sample_delta" depends="build" xmlns:fbdelta="antlib:com.mebigfatguy.fbdelta" description="compares this runs reported bugs on the sample classes set, against the stored report">
+ <target name="sample_delta" depends="install" xmlns:fbdelta="antlib:com.mebigfatguy.fbdelta" description="compares this runs reported bugs on the sample classes set, against the stored report">
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${lib.dir}/findbugs-ant-${findbugs-ant.version}.jar"/>
<findbugs reportlevel="low" home="${findbugs.dir}" auxClassPathRef="fb-contrib.samples.classpath" output="xml:withMessages...
[truncated message content] |
|
From: <dbr...@us...> - 2016-11-23 20:08:49
|
Revision: 1807
http://sourceforge.net/p/fb-contrib/code/1807
Author: dbrosius
Date: 2016-11-23 20:08:45 +0000 (Wed, 23 Nov 2016)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/etc/messages.xml
trunk/fb-contrib/htdocs/index.shtml
trunk/fb-contrib/htdocs/repository.html
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples.xml
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConcurrentCollectionIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureBuilder.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/test/java/com/mebigfatguy/fbcontrib/utils/RegisterUtilsTest.java
Added Paths:
-----------
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnsynchronizedSingletonFieldWrites.java
trunk/fb-contrib/src/samples/java/USFW_Sample.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/build.xml 2016-11-23 20:08:45 UTC (rev 1807)
@@ -31,7 +31,7 @@
<property name="javac.debug" value="on" />
<property name="test_reports.dir" value="${target.dir}/reports/test"/>
- <property name="fb-contrib.version" value="6.8.1" />
+ <property name="fb-contrib.version" value="6.8.2" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -109,6 +109,9 @@
<pathelement location="${lib.dir}/testng-${testng.version}.jar" />
<pathelement location="${lib.dir}/jcommander-${jcommander.version}.jar" />
<pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" />
+ <pathelement location="${findbugs.dir}/lib/dom4j-1.6.1.jar" />
+ <pathelement location="${findbugs.dir}/lib/jaxen-1.1.6.jar" />
+
</path>
<path id="fb-contrib.samples.classpath">
<pathelement location="${lib.dir}/javax.servlet.jsp-api-${javax.servlet.jsp-api.version}.jar" />
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/etc/bugrank.txt 2016-11-23 20:08:45 UTC (rev 1807)
@@ -238,6 +238,7 @@
+0 BugPattern URV_INHERITED_METHOD_WITH_RELATED_TYPES
+0 BugPattern URV_UNRELATED_RETURN_VALUES
+0 BugPattern USBR_UNNECESSARY_STORE_BEFORE_RETURN
++0 BugPattern USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES
+0 BugPattern USS_USE_STRING_SPLIT
+0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT
+0 BugPattern UTAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/etc/findbugs.xml 2016-11-23 20:08:45 UTC (rev 1807)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -311,8 +311,10 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousShadedClassUse" speed="fast" reports="SSCU_SUSPICIOUS_SHADED_CLASS_USE"/>
- COMMENT OUT FOR POINT RELEASE -->
+ <Detector class="com.mebigfatguy.fbcontrib.detect.UnsynchronizedSingletonFieldWrites" speed="fast" reports="USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES"/>
+ COMMENT OUT FOR POINT RELEASE -->
+
<!-- BugPattern -->
<BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" />
@@ -582,4 +584,5 @@
<BugPattern abbrev="CCI" type="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY" category="CORRECTNESS"/>
<BugPattern abbrev="UTWR" type="UTWR_USE_TRY_WITH_RESOURCES" category="STYLE" experimental="true"/>
<BugPattern abbrev="SSCU" type="SSCU_SUSPICIOUS_SHADED_CLASS_USE" category="CORRECTNESS" experimental="true"/>
+ <BugPattern abbrev="USFW" type="USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES" category="CORRECTNESS" experimental="true"/>
</FindbugsPlugin>
Modified: trunk/fb-contrib/etc/messages.xml
===================================================================
--- trunk/fb-contrib/etc/messages.xml 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/etc/messages.xml 2016-11-23 20:08:45 UTC (rev 1807)
@@ -1665,6 +1665,16 @@
</Details>
</Detector>
+ <Detector class="com.mebigfatguy.fbcontrib.detect.UnsynchronizedSingletonFieldWrites">
+ <Details>
+ <![CDATA[
+ <p>Looks for writes to fields of classes that are believed to be classes used only as Singletons. These
+ classes include Enums, as well as spring beans that are Singleton scoped.</p>
+ <p>It is a fast detector.</p>
+ ]]>
+ </Details>
+ </Detector>
+
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger">
<Details></Details>
</Detector>
@@ -5679,6 +5689,17 @@
]]>
</Details>
</BugPattern>
+
+ <BugPattern type="USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES">
+ <ShortDescription>Method of Singleton class writes to a field in an unsynchronized manner</ShortDescription>
+ <LongDescription>Method {1} of Singleton class writes to a field in an unsynchronized manner</LongDescription>
+ <Details>
+ <![CDATA[
+ <p>This method writes to a field of this class. Since this class is seen as a Singleton this can produce race
+ conditions, or cause non-visible changes to other threads, because the field isn't accessed synchronously.
+ ]]>
+ </Details>
+ </BugPattern>
<!-- BugCode -->
@@ -5819,4 +5840,5 @@
<BugCode abbrev="CCI">Concurrent Collection Issues</BugCode>
<BugCode abbrev="UTWR">Use Try With Resources</BugCode>
<BugCode abbrev="SSCU">Suspicious Shaded Class Use</BugCode>
+ <BugCode abbrev="USFW">Unsynchronous Singleton Field Writes</BugCode>
</MessageCollection>
Modified: trunk/fb-contrib/htdocs/index.shtml
===================================================================
--- trunk/fb-contrib/htdocs/index.shtml 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/htdocs/index.shtml 2016-11-23 20:08:45 UTC (rev 1807)
@@ -68,7 +68,7 @@
</li>
</ul>
</p>
- <p style="font-weight: bold;">The latest version of fb-contrib is 6.8.1 available for download
+ <p style="font-weight: bold;">The latest version of fb-contrib is 6.8.2 available for download
<a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p>
<p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p>
<p style="font-weight: bold;">Please note that active development for this project is now done on
Modified: trunk/fb-contrib/htdocs/repository.html
===================================================================
--- trunk/fb-contrib/htdocs/repository.html 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/htdocs/repository.html 2016-11-23 20:08:45 UTC (rev 1807)
@@ -22,7 +22,7 @@
<table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;">
<tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr>
<tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr>
- <tr><td><b>Version:</b></td><td>6.8.1</td></tr>
+ <tr><td><b>Version:</b></td><td>6.8.2</td></tr>
</table>
</div>
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/pom.xml 2016-11-23 20:08:45 UTC (rev 1807)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.8.1</version>
+ <version>6.8.2</version>
<prerequisites>
<maven>2.2.1</maven>
Modified: trunk/fb-contrib/samples.xml
===================================================================
--- trunk/fb-contrib/samples.xml 2016-11-18 03:39:38 UTC (rev 1806)
+++ trunk/fb-contrib/samples.xml 2016-11-23 20:08:45 UTC (rev 1807)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<BugCollection version="3.0.1" sequence="0" timestamp="1479256649283" analysisTimestamp="1479256649381" release="">
+<BugCollection version="3.0.1" sequence="0" timestamp="1479928382089" analysisTimestamp="1479928382559" release="">
<Project projectName="Samples">
<Jar>/home/dave/dev/fb-contrib/target/classes/samples</Jar>
<AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
@@ -1516,6 +1516,29 @@
<Message>Called method String.getBytes(Charset)</Message>
</Method>
</BugInstance>
+ <BugInstance type="DLS_DEAD_LOCAL_STORE" priority="1" rank="15" abbrev="DLS" category="STYLE" instanceHash="79def569ec98541fd73e544709b9ac25" instanceOccurrenceNum="0" instanceOccurrenceMax="0" cweid="563">
+ <ShortMessage>Dead store to local variable</ShortMessage>
+ <LongMessage>Dead store to context in new BED_Sample(String)</LongMessage>
+ <Class classname="BED_Sample" primary="true">
+ <SourceLine classname="BED_Sample" start="18" end="105" sourcefile="BED_Sample.java" sourcepath="BED_Sample.java">
+ <Message>At BED_Sample.java:[lines 18-105]</Message>
+ </SourceLine>
+ <Message>In class BED_Sample</Message>
+ </Class>
+ <Method classname="BED_Sample" name="<init>" signature="(Ljava/lang/String;)V" isStatic="false" primary="true">
+ <SourceLine classname="BED_Sample" start="22" end="26" startBytecode="0" endBytecode="16" sourcefile="BED_Sample.java" sourcepath="BED_Sample.java"/>
+ <Message>In method new BED_Sample(String)</Message>
+ </Method>
+ <LocalVariable name="context" register="3" pc="29" role="LOCAL_VARIABLE_NAMED">
+ <Message>Local variable named context</Message>
+ </LocalVariable>
+ <SourceLine classname="BED_Sample" primary="true" start="25" end="25" startBytecode="28" endBytecode="28" sourcefile="BED_Sample.java" sourcepath="BED_Sample.java">
+ <Message>At BED_Sample.java:[line 25]</Message>
+ </SourceLine>
+ <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.DEAD_OBJECT_STORE" value="true"/>
+ <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.LOCAL_NAME" value="context"/>
+ <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.METHOD_RESULT" value="true"/>
+ </BugInstance>
<BugInstance type="DLS_DEAD_LOCAL_STORE" priority="1" rank="15" abbrev="DLS" category="STYLE" instanceHash="d9c72c4d31bddfd053659d13b086adf2" instanceOccurrenceNum="0" instanceOccurrenceMax="0" cweid="563">
<ShortMessage>Dead store to local variable</ShortMessage>
<LongMessage>Dead store to is in BED_Sample.doIt()</LongMessage>
@@ -2401,6 +2424,23 @@
<Message>At CAAL_Sample.java:[line 15]</Message>
</SourceLine>
</BugInstance>
+ <BugInstance type="CAAL_CONFUSING_ARRAY_AS_LIST" priority="2" rank="7" abbrev="CAAL" category="CORRECTNESS" instanceHash="3975618977829f30228696fd98eda368" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
+ <ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
+ <LongMessage>Method CAAL_Sample.testCAAL(char[]) calls Array.asList on an array of primitive values</LongMessage>
+ <Class classname="CAAL_Sample" primary="true">
+ <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ </SourceLine>
+ <Message>In class CAAL_Sample</Message>
+ </Class>
+ <Method classname="CAAL_Sample" name="testCAAL" signature="([C)V" isStatic="false" primary="true">
+ <SourceLine classname="CAAL_Sample" start="11" end="12" startBytecode="0" endBytecode="78" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java"/>
+ <Message>In method CAAL_Sample.testCAAL(char[])</Message>
+ </Method>
+ <SourceLine classname="CAAL_Sample" primary="true" start="11" end="11" startBytecode="8" endBytecode="8" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[line 11]</Message>
+ </SourceLine>
+ </BugInstance>
<BugInstance type="CAAL_CONFUSING_ARRAY_AS_LIST" priority="2" rank="7" abbrev="CAAL" category="CORRECTNESS" instanceHash="9130cff189697a73dc4c8b172b28e88f" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(double[]) calls Array.asList on an array of primitive values</LongMessage>
@@ -2526,6 +2566,29 @@
<Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.METHOD_RESULT" value="true"/>
<Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.NO_LOADS" value="true"/>
</BugInstance>
+ <BugInstance type="DLS_DEAD_LOCAL_STORE" priority="2" rank="17" abbrev="DLS" category="STYLE" instanceHash="8d45810983ce3547c197ddc3bd02a09a" instanceOccurrenceNum="0" instanceOccurrenceMax="0" cweid="563">
+ <ShortMessage>Dead store to local variable</ShortMessage>
+ <LongMessage>Dead store to l in CAAL_Sample.testCAAL(char[])</LongMessage>
+ <Class classname="CAAL_Sample" primary="true">
+ <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ </SourceLine>
+ <Message>In class CAAL_Sample</Message>
+ </Class>
+ <Method classname="CAAL_Sample" name="testCAAL" signature="([C)V" isStatic="false" primary="true">
+ <SourceLine classname="CAAL_Sample" start="11" end="12" startBytecode="0" endBytecode="8" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java"/>
+ <Message>In method CAAL_Sample.testCAAL(char[])</Message>
+ </Method>
+ <LocalVariable name="l" register="2" pc="12" role="LOCAL_VARIABLE_NAMED">
+ <Message>Local variable named l</Message>
+ </LocalVariable>
+ <SourceLine classname="CAAL_Sample" primary="true" start="11" end="11" startBytecode="11" endBytecode="11" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[line 11]</Message>
+ </SourceLine>
+ <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.LOCAL_NAME" value="l"/>
+ <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.METHOD_RESULT" value="true"/>
+ <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.NO_LOADS" value="true"/>
+ </BugInstance>
<BugInstance type="DLS_DEAD_LOCAL_STORE" priority="2" rank="17" abbrev="DLS" category="STYLE" instanceHash="16a66803b6865903daa61b77c398f1ae" instanceOccurrenceNum="0" instanceOccurrenceMax="0" cweid="563">
<ShortMessage>Dead store to local variable</ShortMessage>
<LongMessage>Dead store to l in CAAL_Sample.testCAAL(double[])</LongMessage>
@@ -2694,6 +2757,23 @@
<Message>At CAAL_Sample.java:[line 16]</Message>
</SourceLine>
</BugInstance>
+ <BugInstance type="UC_USELESS_VOID_METHOD" priority="3" rank="20" abbrev="UC" category="STYLE" instanceHash="24df9110e0ec9d2b233d21bf82af853d" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
+ <ShortMessage>Useless non-empty void method</ShortMessage>
+ <LongMessage>Method CAAL_Sample.testCAAL(char[]) seems to be useless</LongMessage>
+ <Class classname="CAAL_Sample" primary="true">
+ <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ </SourceLine>
+ <Message>In class CAAL_Sample</Message>
+ </Class>
+ <Method classname="CAAL_Sample" name="testCAAL" signature="([C)V" isStatic="false" primary="true">
+ <SourceLine classname="CAAL_Sample" start="11" end="12" startBytecode="0" endBytecode="78" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java"/>
+ <Message>In method CAAL_Sample.testCAAL(char[])</Message>
+ </Method>
+ <SourceLine classname="CAAL_Sample" primary="true" start="12" end="12" startBytecode="12" endBytecode="12" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[line 12]</Message>
+ </SourceLine>
+ </BugInstance>
<BugInstance type="UC_USELESS_VOID_METHOD" priority="3" rank="20" abbrev="UC" category="STYLE" instanceHash="c04ebe3ef7884c235addb6c48bd5d1f9" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
<ShortMessage>Useless non-empty void method</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(double[]) seems to be useless</LongMessage>
@@ -2922,6 +3002,30 @@
<Message>At CAAL_Sample.java:[line 15]</Message>
</SourceLine>
</BugInstance>
+ <BugInstance type="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG" priority="1" rank="7" abbrev="VA" category="CORRECTNESS" instanceHash="17bf4f8f0183d1e020ae2fd1b0821168" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
+ <ShortMessage>Primitive array passed to function expecting a variable number of object arguments</ShortMessage>
+ <LongMessage>char[] passed to varargs method java.util.Arrays.asList(Object[]) in CAAL_Sample.testCAAL(char[])</LongMessage>
+ <Class classname="CAAL_Sample" primary="true">
+ <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ </SourceLine>
+ <Message>In class CAAL_Sample</Message>
+ </Class>
+ <Method classname="CAAL_Sample" name="testCAAL" signature="([C)V" isStatic="false" primary="true">
+ <SourceLine classname="CAAL_Sample" start="11" end="12" startBytecode="0" endBytecode="78" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java"/>
+ <Message>In method CAAL_Sample.testCAAL(char[])</Message>
+ </Method>
+ <Type descriptor="[C" role="TYPE_FOUND">
+ <Message>Actual type char[]</Message>
+ </Type>
+ <Method classname="java.util.Arrays" name="asList" signature="([Ljava/lang/Object;)Ljava/util/List;" isStatic="true" role="METHOD_CALLED">
+ <SourceLine classname="java.util.Arrays" start="3800" end="3800" startBytecode="0" endBytecode="32" sourcefile="Arrays.java" sourcepath="java/util/Arrays.java"/>
+ <Message>Called method java.util.Arrays.asList(Object[])</Message>
+ </Method>
+ <SourceLine classname="CAAL_Sample" primary="true" start="11" end="11" startBytecode="8" endBytecode="8" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[line 11]</Message>
+ </SourceLine>
+ </BugInstance>
<BugInstance type="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG" priority="1" rank="7" abbrev="VA" category="CORRECTNESS" instanceHash="c2a4b2be51b7ea4a120c2699541e106f" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
<ShortMessage>Primitive array passed to function expecting a variable number of object arguments</ShortMessage>
<LongMessage>double[] passed to varargs method java.util.Arrays.asList(Object[]) in CAAL_Sample.testCAAL(double[])</LongMessage>
@@ -3257,14 +3361,14 @@
<Message>In class CAO_Sample</Message>
</Class>
<Method classname="CAO_Sample" name="testci" signature="(I)V" isStatic="false" primary="true">
- <SourceLine classname="CAO_Sample" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java"/>
+ <SourceLine classname="CAO_Sample" start="8" end="9" startBytecode="0" endBytecode="64" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java"/>
<Message>In method CAO_Sample.testci(int)</Message>
</Method>
<String value="- Method declared public but could be declared private">
<Message>Value - Method declared public but could be declared private</Message>
</String>
- <SourceLine classname="CAO_Sample" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java" synthetic="true">
- <Message>In CAO_Sample.java</Message>
+ <SourceLine classname="CAO_Sample" start="8" end="9" startBytecode="0" endBytecode="64" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java" synthetic="true">
+ <Message>At CAO_Sample.java:[lines 8-9]</Message>
</SourceLine>
</BugInstance>
<BugInstance type="OPM_OVERLY_PERMISSIVE_METHOD" priority="3" rank="20" abbrev="OPM" category="STYLE" instanceHash="ade4bec616aadf73e7d58c481278d97e" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
@@ -3277,14 +3381,14 @@
<Message>In class CAO_Sample</Message>
</Class>
<Method classname="CAO_Sample" name="testcj" signature="(J)V" isStatic="false" primary="true">
- <SourceLine classname="CAO_Sample" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java"/>
+ <SourceLine classname="CAO_Sample" start="16" end="17" startBytecode="0" endBytecode="64" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java"/>
<Message>In method CAO_Sample.testcj(long)</Message>
</Method>
<String value="- Method declared public but could be declared private">
<Message>Value - Method declared public but could be declared private</Message>
</String>
- <SourceLine classname="CAO_Sample" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java" synthetic="true">
- <Message>In CAO_Sample.java</Message>
+ <SourceLine classname="CAO_Sample" start="16" end="17" startBytecode="0" endBytecode="64" sourcefile="CAO_Sample.java" sourcepath="CAO_Sample.java" synthetic="true">
+ <Message>At CAO_Sample.java:[lines 16-17]</Message>
</SourceLine>
</BugInstance>
<BugInstance type="CBC_CONTAINS_BASED_CONDITIONAL" priority="2" rank="17" abbrev="CBC" category="STYLE" instanceHash="9fa3a87f741346028d7886158f00bdae" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
@@ -9488,23 +9592,6 @@
<Message>At ISB_Sample.java:[line 87]</Message>
</SourceLine>
</BugInstance>
- <BugInstance type="UPM_UNCALLED_PRIVATE_METHOD" priority="3" rank="20" abbrev="UPM" category="PERFORMANCE" instanceHash="bb44e2770c499a3b25207bc8b824abb2" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
- <ShortMessage>Private method is never called</ShortMessage>
- <LongMessage>Private method ISB_Sample.getBigger(String, String) is never called</LongMessage>
- <Class classname="ISB_Sample" primary="true">
- <SourceLine classname="ISB_Sample" start="5" end="127" sourcefile="ISB_Sample.java" sourcepath="ISB_Sample.java">
- <Message>At ISB_Sample.java:[lines 5-127]</Message>
- </SourceLine>
- <Message>In class ISB_Sample</Message>
- </Class>
- <Method classname="ISB_Sample" name="getBigger" signature="(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" isStatic="true" primary="true">
- <SourceLine classname="ISB_Sample" start="100" end="102" startBytecode="0" endBytecode="83" sourcefile="ISB_Sample.java" sourcepath="ISB_Sample.java"/>
- <Message>In method ISB_Sample.getBigger(String, String)</Message>
- </Method>
- <SourceLine classname="ISB_Sample" start="100" end="102" startBytecode="0" endBytecode="83" sourcefile="ISB_Sample.java" sourcepath="ISB_Sample.java" synthetic="true">
- <Message>At ISB_Sample.java:[lines 100-102]</Message>
- </SourceLine>
- </BugInstance>
<BugInstance type="USBR_UNNECESSARY_STORE_BEFORE_RETURN" priority="2" rank="17" abbrev="USBR" category="STYLE" instanceHash="ac5afe94dd68746f7b2d7ef7adcf0c9e" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
<ShortMessage>Method stores return result in local before immediately returning it</ShortMessage>
<LongMessage>Method ISB_Sample.testISB8() stores return result in local before immediately returning it</LongMessage>
@@ -11270,6 +11357,23 @@
<Message>Value LO_Sample</Message>
</String>
</BugInstance>
+ <BugInstance type="LO_SUSPECT_LOG_PARAMETER" priority="2" rank="7" abbrev="LO" category="CORRECTNESS" instanceHash="9b05ba81d400239efa6dc9159d301831" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
+ <ShortMessage>Constructor declares a Logger parameter</ShortMessage>
+ <LongMessage>Constructor new LO_Sample(Logger) declares a Logger parameter</LongMessage>
+ <Class classname="LO_Sample" primary="true">
+ <SourceLine classname="LO_Sample" start="15" end="129" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java">
+ <Message>At LO_Sample.java:[lines 15-129]</Message>
+ </SourceLine>
+ <Message>In class LO_Sample</Message>
+ </Class>
+ <Method classname="LO_Sample" name="<init>" signature="(Lorg/apache/log4j/Logger;)V" isStatic="false" primary="true">
+ <SourceLine classname="LO_Sample" start="38" end="40" startBytecode="0" endBytecode="69" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java"/>
+ <Message>In method new LO_Sample(Logger)</Message>
+ </Method>
+ <SourceLine classname="LO_Sample" start="38" end="40" startBytecode="0" endBytecode="69" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java" synthetic="true">
+ <Message>At LO_Sample.java:[lines 38-40]</Message>
+ </SourceLine>
+ </BugInstance>
<BugInstance type="NP_ALWAYS_NULL_EXCEPTION" priority="1" rank="7" abbrev="NP" category="CORRECTNESS" instanceHash="9e480fcdab07a3541fb8d0e22bcd9be4" instanceOccurrenceNum="0" instanceOccurrenceMax="0" cweid="476">
<ShortMessage>Null pointer dereference in method on exception path</ShortMessage>
<LongMessage>Null pointer dereference of is in LO_Sample.testStutter() on exception path</LongMessage>
@@ -11339,14 +11443,14 @@
<Message>In class LO_Sample</Message>
</Class>
<Method classname="LO_Sample" name="<init>" signature="(Lorg/apache/log4j/Logger;)V" isStatic="false" primary="true">
- <SourceLine classname="LO_Sample" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java"/>
+ <SourceLine classname="LO_Sample" start="38" end="40" startBytecode="0" endBytecode="69" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java"/>
<Message>In method new LO_Sample(Logger)</Message>
</Method>
<String value="- Method declared public but could be declared private">
<Message>Value - Method declared public but could be declared private</Message>
</String>
- <SourceLine classname="LO_Sample" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java" synthetic="true">
- <Message>In LO_Sample.java</Message>
+ <SourceLine classname="LO_Sample" start="38" end="40" startBytecode="0" endBytecode="69" sourcefile="LO_Sample.java" sourcepath="LO_Sample.java" synthetic="true">
+ <Message>At LO_Sample.java:[lines 38-40]</Message>
</SourceLine>
</BugInstance>
<BugInstance type="OS_OPEN_STREAM" priority="2" rank="16" abbrev="OS" category="BAD_PRACTICE" instanceHash="fb704331445d9f9d7a142368140da5ab" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
@@ -21751,6 +21855,26 @@
<Message>At PCOA_Sample.java:[lines 3-30]</Message>
</SourceLine>
</BugInstance>
+ <BugInstance type="OPM_OVERLY_PERMISSIVE_METHOD" priority="3" rank="20" abbrev="OPM" category="STYLE" instanceHash="fd022969c43d0b90018ba04d6bae5023" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
+ <ShortMessage>This method is declared more permissively than is used in the code base</ShortMessage>
+ <LongMessage>This method PCOA_Sample.nonOverridableMethod() is declared more permissively than is used in the code base</LongMessage>
+ <Class classname="PCOA_Sample" primary="true">
+ <SourceLine classname="PCOA_Sample" start="3" end="30" sourcefile="PCOA_Sample.java" sourcepath="PCOA_Sample.java">
+ <Message>At PCOA_Sample.java:[lines 3-30]</Message>
+ </SourceLine>
+ <Message>In class PCOA_Sample</Message>
+ </Class>
+ <Method classname="PCOA_Sample" name="nonOverridableMethod" signature="()V" isStatic="false" primary="true">
+ <SourceLine classname="PCOA_Sample" start="26" end="26" startBytecode="0" endBytecode="42" sourcefile="PCOA_Sample.java" sourcepath="PCOA_Sample.java"/>
+ <Message>In method PCOA_Sample.nonOverridableMethod()</Message>
+ </Method>
+ <String value="- Method declared public but could be declared private">
+ <Message>Value - Method declared public but could be declared private</Message>
+ </String>
+ <SourceLine classname="PCOA_Sample" start="26" end="26" startBytecode="0" endBytecode="42" sourcefile="PCOA_Sample.java" sourcepath="PCOA_Sample.java" synthetic="true">
+ <Message>At PCOA_Sample.java:[line 26]</Message>
+ </SourceLine>
+ </BugInstance>
<BugInstance type="OPM_OVERLY_PERMISSIVE_METHOD" priority="3" rank="20" abbrev="OPM" category="STYLE" instanceHash="91ab82fc9f135956756569048b3528e1" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
<ShortMessage>This method is declared more permissively than is used in the code base</ShortMessage>
<LongMessage>This method PCOA_Sample.overridableMethod() is declared more permissively than is used in the code base</LongMessage>
@@ -21808...
[truncated message content] |
|
From: <dbr...@us...> - 2017-01-08 19:50:42
|
Revision: 1809
http://sourceforge.net/p/fb-contrib/code/1809
Author: dbrosius
Date: 2017-01-08 19:50:36 +0000 (Sun, 08 Jan 2017)
Log Message:
-----------
sync from github
Modified Paths:
--------------
trunk/fb-contrib/build.xml
trunk/fb-contrib/etc/bugrank.txt
trunk/fb-contrib/etc/findbugs.xml
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples.xml
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/FBContrib.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/MethodInfo.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/debug/Debug.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbstractCollectionScanningDetector.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CloneUsability.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConcurrentCollectionIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DateComparison.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousMapCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SluggishGui.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousShadedClassUse.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/TailRecursion.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/Unjitable.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnsynchronizedSingletonFieldWrites.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseTryWithResources.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WiringIssues.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/BugType.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/FQMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/PublicAPI.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/QMethod.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureBuilder.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/StopOpcodeParsingException.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/ToString.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/UnmodifiableList.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/UnmodifiableSet.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/Values.java
trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java
trunk/fb-contrib/src/samples/java/CAAL_Sample.java
trunk/fb-contrib/src/samples/java/LO_Sample.java
trunk/fb-contrib/src/samples/java/PCAIL_Sample.java
trunk/fb-contrib/src/samples/java/SNG_Sample.java
trunk/fb-contrib/src/samples/java/UCC_Sample.java
trunk/fb-contrib/src/test/java/com/mebigfatguy/fbcontrib/utils/SignatureBuilderTest.java
trunk/fb-contrib/src/test/java/com/mebigfatguy/fbcontrib/utils/SignatureUtilsTest.java
Modified: trunk/fb-contrib/build.xml
===================================================================
--- trunk/fb-contrib/build.xml 2016-11-23 20:11:17 UTC (rev 1808)
+++ trunk/fb-contrib/build.xml 2017-01-08 19:50:36 UTC (rev 1809)
@@ -31,7 +31,7 @@
<property name="javac.debug" value="on" />
<property name="test_reports.dir" value="${target.dir}/reports/test"/>
- <property name="fb-contrib.version" value="6.8.2" />
+ <property name="fb-contrib.version" value="6.9.0-SNAPSHOT" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
@@ -249,7 +249,7 @@
<target name="javadoc" depends="-init" description="build the javadoc for the project">
<javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api" access="private">
<doctitle><![CDATA[<h1>fb-contrib javadoc</h1>]]></doctitle>
- <bottom><![CDATA[<i>Copyright © 2005-2016 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
+ <bottom><![CDATA[<i>Copyright © 2005-2017 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
Modified: trunk/fb-contrib/etc/bugrank.txt
===================================================================
--- trunk/fb-contrib/etc/bugrank.txt 2016-11-23 20:11:17 UTC (rev 1808)
+++ trunk/fb-contrib/etc/bugrank.txt 2017-01-08 19:50:36 UTC (rev 1809)
@@ -55,7 +55,7 @@
+0 BugPattern FPL_FLOATING_POINT_LOOPS
+6 BugPattern FP_FINAL_PARAMETERS
+0 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_FIELD
-+0 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_LOCAL
++4 BugPattern HCP_HTTP_REQUEST_RESOURCES_NOT_FREED_LOCAL
+0 BugPattern HES_EXECUTOR_NEVER_SHUTDOWN
+0 BugPattern HES_EXECUTOR_OVERWRITTEN_WITHOUT_SHUTDOWN
+4 BugPattern HES_LOCAL_EXECUTOR_SERVICE
Modified: trunk/fb-contrib/etc/findbugs.xml
===================================================================
--- trunk/fb-contrib/etc/findbugs.xml 2016-11-23 20:11:17 UTC (rev 1808)
+++ trunk/fb-contrib/etc/findbugs.xml 2017-01-08 19:50:36 UTC (rev 1809)
@@ -20,7 +20,7 @@
<!-- Detectors -->
-<!-- COMMENT OUT FOR RELEASE
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -30,7 +30,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
- COMMENT OUT FOR RELEASE -->
+<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
@@ -305,7 +305,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.ConcurrentCollectionIssues" speed="fast" reports="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY"/>
- <!-- COMMENT OUT FOR POINT RELEASE
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.detect.UseTryWithResources" speed="fast" reports="UTWR_USE_TRY_WITH_RESOURCES"/>
@@ -313,7 +313,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.UnsynchronizedSingletonFieldWrites" speed="fast" reports="USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES"/>
- COMMENT OUT FOR POINT RELEASE -->
+ <!-- COMMENT OUT FOR POINT RELEASE -->
<!-- BugPattern -->
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2016-11-23 20:11:17 UTC (rev 1808)
+++ trunk/fb-contrib/pom.xml 2017-01-08 19:50:36 UTC (rev 1809)
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
- <version>6.8.2</version>
+ <version>6.9.0-SNAPSHOT</version>
<prerequisites>
<maven>2.2.1</maven>
@@ -147,7 +147,7 @@
<dependency><scope>test</scope><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>19.0</version></dependency>
<dependency><scope>test</scope><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.10</version></dependency>
<dependency><scope>test</scope><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.4</version></dependency>
- <dependency><scope>test</scope><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.2.1</version></dependency>
+ <dependency><scope>test</scope><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.2.2</version></dependency>
<dependency><scope>test</scope><groupId>javax.persistence</groupId><artifactId>persistence-api</artifactId><version>1.0.2</version></dependency>
<dependency><scope>test</scope><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version></dependency>
<dependency><scope>test</scope><groupId>javax.servlet.jsp</groupId><artifactId>javax.servlet.jsp-api</artifactId><version>2.3.1</version></dependency>
Modified: trunk/fb-contrib/samples.xml
===================================================================
--- trunk/fb-contrib/samples.xml 2016-11-23 20:11:17 UTC (rev 1808)
+++ trunk/fb-contrib/samples.xml 2017-01-08 19:50:36 UTC (rev 1809)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<BugCollection version="3.0.1" sequence="0" timestamp="1479928382089" analysisTimestamp="1479928382559" release="">
+<BugCollection version="3.0.1" sequence="0" timestamp="1482370136475" analysisTimestamp="1482370136584" release="">
<Project projectName="Samples">
<Jar>/home/dave/dev/fb-contrib/target/classes/samples</Jar>
<AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry>
@@ -2411,8 +2411,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(byte[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2428,8 +2428,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(char[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2445,8 +2445,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(double[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2462,8 +2462,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(float[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2479,8 +2479,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(int[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2496,8 +2496,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(long[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2513,8 +2513,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(short[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2530,8 +2530,8 @@
<ShortMessage>Method calls Array.asList on an array of primitive values</ShortMessage>
<LongMessage>Method CAAL_Sample.testCAAL(boolean[]) calls Array.asList on an array of primitive values</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2547,8 +2547,8 @@
<ShortMessage>Dead store to local variable</ShortMessage>
<LongMessage>Dead store to l in CAAL_Sample.testCAAL(byte[])</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2570,8 +2570,8 @@
<ShortMessage>Dead store to local variable</ShortMessage>
<LongMessage>Dead store to l in CAAL_Sample.testCAAL(char[])</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2593,8 +2593,8 @@
<ShortMessage>Dead store to local variable</ShortMessage>
<LongMessage>Dead store to l in CAAL_Sample.testCAAL(double[])</LongMessage>
<Class classname="CAAL_Sample" primary="true">
- <SourceLine classname="CAAL_Sample" start="4" end="36" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
- <Message>At CAAL_Sample.java:[lines 4-36]</Message>
+ <SourceLine classname="CAAL_Sample" start="4" end="40" sourcefile="CAAL_Sample.java" sourcepath="CAAL_Sample.java">
+ <Message>At CAAL_Sample.java:[lines 4-40]</Message>
</SourceLine>
<Message>In class CAAL_Sample</Message>
</Class>
@@ -2616,8 +2616,8 @@
<ShortMessage>Dead store to local variable</ShortMessage>
<LongMessage>Dead store to l in CAAL_Sample.testCAAL(float[])</LongMessage>
<Class classname="CAAL_Sample" primary="...
[truncated message content] |