[Fb-contrib-commit] SF.net SVN: fb-contrib:[1758] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2013-12-11 03:20:31
|
Revision: 1758 http://sourceforge.net/p/fb-contrib/code/1758 Author: dbrosius Date: 2013-12-11 03:20:25 +0000 (Wed, 11 Dec 2013) Log Message: ----------- prepare for the 5.0.1 release Modified Paths: -------------- trunk/fb-contrib/.classpath trunk/fb-contrib/build.properties 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/FCBL_Sample.java trunk/fb-contrib/samples/JAO_Sample.java trunk/fb-contrib/samples/LO_Sample.java trunk/fb-contrib/samples/PRMC_Sample.java trunk/fb-contrib/samples/samples.fbp trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.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/InvalidConstantArgument.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java Added Paths: ----------- trunk/fb-contrib/yank.xls Modified: trunk/fb-contrib/.classpath =================================================================== --- trunk/fb-contrib/.classpath 2013-11-17 21:58:00 UTC (rev 1757) +++ trunk/fb-contrib/.classpath 2013-12-11 03:20:25 UTC (rev 1758) @@ -4,15 +4,18 @@ <classpathentry kind="src" path="src"/> <classpathentry excluding="lib/" kind="src" path="samples"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="samples/lib/jsp-api-2.2.1.jar"/> - <classpathentry kind="lib" path="samples/lib/junit-4.10.jar" sourcepath="/home/dave/.m2/repository/junit/junit/4.10/junit-4.10-sources.jar"/> - <classpathentry kind="lib" path="samples/lib/log4j-1.2.16.jar"/> - <classpathentry kind="lib" path="samples/lib/servlet-api-3.0.1.jar"/> - <classpathentry kind="lib" path="samples/lib/commons-lang3-3.1.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/findbugs"/> - <classpathentry kind="lib" path="samples/lib/commons-collections-3.2.1.jar"/> - <classpathentry kind="lib" path="samples/lib/backport-util-concurrent-3.1.jar" sourcepath="/home/dave/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1-sources.jar"/> - <classpathentry kind="lib" path="samples/lib/slf4j-api-1.7.5.jar"/> - <classpathentry kind="lib" path="samples/lib/junit.jar"/> + <classpathentry kind="lib" path="lib/annotations-2.0.2.jar"/> + <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/commons-lang3-3.1.jar"/> + <classpathentry kind="lib" path="lib/findbugs-2.0.2.jar"/> + <classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/> + <classpathentry kind="lib" path="lib/javax.servlet.jsp-api-2.2.1.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="output" path="classes"/> </classpath> Modified: trunk/fb-contrib/build.properties =================================================================== --- trunk/fb-contrib/build.properties 2013-11-17 21:58:00 UTC (rev 1757) +++ trunk/fb-contrib/build.properties 2013-12-11 03:20:25 UTC (rev 1758) @@ -7,3 +7,5 @@ etc/,\ samples/ output.. = classes/ + +proxy.server = Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2013-11-17 21:58:00 UTC (rev 1757) +++ trunk/fb-contrib/build.xml 2013-12-11 03:20:25 UTC (rev 1758) @@ -1,15 +1,15 @@ <!-- fb-contrib Ant build script. Dave Brosius --> -<project name="fb-contrib" default="install"> +<project name="fb-contrib" default="info"> - <property file="build.properties" /> + <property file="build.properties" /> + <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="samples.dir" value="${basedir}/samples" /> - <property name="sampleslib.dir" value="${samples.dir}/lib" /> <property name="javadoc.dir" value="${basedir}/javadoc" /> <property name="htdocs.dir" value="${basedir}/htdocs" /> <property name="javac.source" value="1.5" /> @@ -17,79 +17,10 @@ <property name="javac.deprecation" value="on" /> <property name="javac.debug" value="on" /> - <property name="fb-contrib.version" value="5.0.0" /> + <property name="fb-contrib.version" value="5.0.1" /> <property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" /> - - <property name="findbugs.version" value="2.0.1" /> - <property name="findbugs-bcel.version" value="2.0.1" /> - <property name="annotations.version" value="2.0.1" /> - <property name="asm-tree.version" value="3.3.1" /> - - <property name="findbugs-url" value="http://repo1.maven.org/maven2/com/google/code/findbugs/findbugs/${findbugs.version}/findbugs-${findbugs.version}.jar" /> - <property name="findbugs-bcel-url" value="http://repo1.maven.org/maven2/com/google/code/findbugs/bcel/${findbugs-bcel.version}/bcel-${findbugs-bcel.version}.jar" /> - <property name="annotations-url" value="http://repo1.maven.org/maven2/com/google/code/findbugs/annotations/${annotations.version}/annotations-${annotations.version}.jar" /> - <property name="asm-tree-url" value="http://repo1.maven.org/maven2/asm/asm-tree/${asm-tree.version}/asm-tree-${asm-tree.version}.jar" /> - - <!-- properties for samples lib dependencies --> - <property name="commons-lang3.version" value="3.1" /> - <property name="jsp-api.version" value="2.2.1" /> - <property name="junit.version" value="4.10" /> - <property name="log4j.version" value="1.2.16" /> - <property name="servlet-api.version" value="3.0.1" /> - <property name="backport-util-concurrent.version" value="3.1" /> - <property name="commons-collections.version" value="3.2.1" /> - <property name="slf4j.version" value="1.7.5" /> - - <property name="commons-lang3-url" value="http://repo1.maven.org/maven2/org/apache/commons/commons-lang3/${commons-lang3.version}/commons-lang3-${commons-lang3.version}.jar" /> - <property name="jsp-api-url" value="http://repo1.maven.org/maven2/javax/servlet/jsp/javax.servlet.jsp-api/${jsp-api.version}/javax.servlet.jsp-api-${jsp-api.version}.jar" /> - <property name="junit-url" value="http://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar" /> - <property name="log4j-url" value="http://repo1.maven.org/maven2/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar" /> - <property name="servlet-api-url" value="http://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/${servlet-api.version}/javax.servlet-api-${servlet-api.version}.jar" /> - <property name="backport-util-concurrent-url" value="http://repo1.maven.org/maven2/backport-util-concurrent/backport-util-concurrent/${backport-util-concurrent.version}/backport-util-concurrent-${backport-util-concurrent.version}.jar" /> - <property name="commons-collections-url" value="http://repo1.maven.org/maven2/commons-collections/commons-collections/${commons-collections.version}/commons-collections-${commons-collections.version}.jar" /> - <property name="slf4j-api-url" value="http://repo1.maven.org/maven2/org/slf4j/slf4j-api/${slf4j.version}/slf4j-api-${slf4j.version}.jar" /> - - <target name="check"> - <available file="${dest}/${name}-${version}.jar" property="jar-exists" /> - </target> - - <target name="_pull" depends="check" unless="jar-exists"> - <get src="${url}" dest="${dest}/${name}-${version}.jar" verbose="true" ignoreerrors="true" /> - </target> - - <macrodef name="pull"> - <attribute name="url" /> - <attribute name="dest" /> - <attribute name="name" /> - <attribute name="version" /> - - <sequential> - <antcall target="_pull"> - <param name="url" value="@{url}" /> - <param name="dest" value="@{dest}" /> - <param name="name" value="@{name}" /> - <param name="version" value="@{version}" /> - </antcall> - </sequential> - </macrodef> - - <target name="pullall"> - <pull url="${findbugs-url}" dest="${lib.dir}" name="findbugs" version="${findbugs.version}" /> - <pull url="${findbugs-bcel-url}" dest="${lib.dir}" name="findbugs-bcel" version="${findbugs-bcel.version}" /> - <pull url="${annotations-url}" dest="${lib.dir}" name="annotations" version="${annotations.version}" /> - <pull url="${asm-tree-url}" dest="${lib.dir}" name="asm-tree" version="${asm-tree.version}" /> - <pull url="${commons-lang3-url}" dest="${sampleslib.dir}" name="commons-lang3" version="${commons-lang3.version}" /> - <pull url="${jsp-api-url}" dest="${sampleslib.dir}" name="jsp-api" version="${jsp-api.version}" /> - <pull url="${junit-url}" dest="${sampleslib.dir}" name="junit" version="${junit.version}" /> - <pull url="${log4j-url}" dest="${sampleslib.dir}" name="log4j" version="${log4j.version}" /> - <pull url="${servlet-api-url}" dest="${sampleslib.dir}" name="servlet-api" version="${servlet-api.version}" /> - <pull url="${backport-util-concurrent-url}" dest="${sampleslib.dir}" name="backport-util-concurrent" version="${backport-util-concurrent.version}" /> - <pull url="${commons-collections-url}" dest="${sampleslib.dir}" name="commons-collections" version="${commons-collections.version}" /> - <pull url="${slf4j-api-url}" dest="${sampleslib.dir}" name="slf4j-api" version="${slf4j.version}" /> - </target> - <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}" /> <delete dir="${javadoc.dir}" /> @@ -103,27 +34,42 @@ </delete> <delete dir="${basedir}/plugin" /> </target> + + <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"> + <server url="http://repo1.maven.org/maven2" /> + <generateVersions propertyFileName="${basedir}/version.properties" /> + </yank:yank> + </target> + + <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=" http://search.maven.org/#artifactdetails%7Ccom.mebigfatguy.yank%7Cyank%7C0.4.2%7Cjar"/> + <antcall target="install"/> + </target> - <target name="-init" description="prepares repository for a build"> + <target name="-init" depends="yank" description="prepares repository for a build"> <mkdir dir="${lib.dir}" /> - <mkdir dir="${sampleslib.dir}" /> <mkdir dir="${classes.dir}" /> <mkdir dir="${javadoc.dir}" /> <path id="fb-contrib.classpath"> <pathelement location="${lib.dir}/findbugs-${findbugs.version}.jar" /> - <pathelement location="${lib.dir}/findbugs-bcel-${findbugs-bcel.version}.jar" /> + <pathelement location="${lib.dir}/bcel-${bcel.version}.jar" /> <pathelement location="${lib.dir}/annotations-${annotations.version}.jar" /> <pathelement location="${lib.dir}/asm-tree-${asm-tree.version}.jar" /> </path> <path id="fb-contrib.samples.classpath"> - <pathelement location="${sampleslib.dir}/jsp-api-${jsp-api.version}.jar" /> - <pathelement location="${sampleslib.dir}/junit-${junit.version}.jar" /> - <pathelement location="${sampleslib.dir}/servlet-api-${servlet-api.version}.jar" /> - <pathelement location="${sampleslib.dir}/log4j-${log4j.version}.jar" /> - <pathelement location="${sampleslib.dir}/commons-lang3-${commons-lang3.version}.jar" /> - <pathelement location="${sampleslib.dir}/commons-lang3-${commons-lang3.version}.jar" /> - <pathelement location="${sampleslib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" /> - <pathelement location="${sampleslib.dir}/slf4j-api-${slf4j.version}.jar" /> + <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}/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" /> </path> <mkdir dir="${classes.dir}/com" /> <mkdir dir="${classes.dir}/com/mebigfatguy" /> @@ -140,7 +86,7 @@ </xmlvalidate> </target> - <target name="compile" depends="-init, pullall" description="compiles java files"> + <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"> <classpath refid="fb-contrib.classpath" /> </javac> Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2013-11-17 21:58:00 UTC (rev 1757) +++ trunk/fb-contrib/etc/findbugs.xml 2013-12-11 03:20:25 UTC (rev 1758) @@ -31,7 +31,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" /> @@ -177,7 +177,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" /> + <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.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" /> @@ -248,12 +248,12 @@ <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.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" /> @@ -385,6 +385,7 @@ <BugPattern abbrev="LO" type="LO_STUTTERED_MESSAGE" category="STYLE" /> <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="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" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2013-11-17 21:58:00 UTC (rev 1757) +++ trunk/fb-contrib/etc/messages.xml 2013-12-11 03:20:25 UTC (rev 1758) @@ -6,11 +6,9 @@ <ShortDescription>fb-contrib plugin</ShortDescription> <Details> <![CDATA[ - <p> - This plugin contains FindBugs detectors from the fb-contrib project - </p> + <p>This plugin contains FindBugs detectors from the fb-contrib project</p> ]]> - </Details> + </Details> </Plugin> <!-- Detectors --> @@ -20,61 +18,61 @@ <![CDATA[ <p>Collects statistics for other detectors</p> ]]> - </Details> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering"> <Details> <![CDATA[ - <p> Looks for appending strings inside of calls to StringBuffer or StringBuilder append.</p> - <p> <pre> + <p>Looks for appending strings inside of calls to StringBuffer or StringBuilder append.</p> + <pre> StringBuffer sb = new StringBuffer(); sb.append(a + b); return sb.toString(); - </pre></p> + </pre> <p>It is a fast detector</p> ]]> - </Details> + </Details> </Detector> <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> 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, + <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> <p>It is a slow detector</p> ]]> - </Details> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.CyclomaticComplexity"> <Details> <![CDATA[ - <p> Calculates the McCabe Cyclomatic Complexity measure and reports methods that have an + <p>Calculates the McCabe Cyclomatic Complexity measure and reports methods that have an excessive value. This report value can be set with system property 'fb-contrib.cc.limit'.</p> <p>It is a slow detector</p> ]]> - </Details> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.OverlyConcreteParameter"> <Details> <![CDATA[ - <p> Looks for parameters that are defined by classes, but where the method only use methods defined by an + <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, and makes low impact changes more difficult.</p> <p>It is a slow detector</p> ]]> - </Details> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.ListIndexedIterating"> <Details> <![CDATA[ - <p> Looks for for loops that iterate over a java.util.List using an integer index, and get, - rather than using an Iterator. An iterator may perform better depending on List implementation, + <p>Looks for for loops that iterate over a java.util.List using an integer index, and get, + rather than using an Iterator. An iterator may perform better depending on List implementation, but more importantly will allow the code to be converted to other collection types.</p> <p>It is a moderately fast detector</p> ]]> @@ -84,7 +82,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedCollectionContents"> <Details> <![CDATA[ - <p> Looks for collections or arrays that hold objects that are unrelated through class or + <p>Looks for collections or arrays that hold objects that are unrelated through class or interface inheritance other than java.lang.Object. Doing so makes for brittle code, relying either on positional correspondence for type, or a reliance on instanceof to determine type. A better design usually can be had by creating a separate class, @@ -98,7 +96,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DeclaredRuntimeException"> <Details> <![CDATA[ - <p> Looks for methods that declare Runtime exceptions in their throws clause. While doing + <p>Looks for methods that declare Runtime exceptions in their throws clause. While doing so is not illegal, it may represent a misunderstanding as to the exception in question. 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> @@ -111,7 +109,7 @@ <Details> <![CDATA[ <p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em></p> - <p> Looks for methods that use a high percentage of methods from another class over its own + <p>Looks for methods that use a high percentage of methods from another class over its own methods. When this is the case, it is often better to implement this method in that other class, by refactoring the class to accept parameters it needs from the source class. The reporting percentage can be set with system property 'fb-contrib.ce.percent'.</p> @@ -123,7 +121,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LiteralStringComparison"> <Details> <![CDATA[ - <p> Looks for methods that compare strings against literal strings, where the literal string + <p>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.</p> <p>It is a fast detector</p> @@ -134,7 +132,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.</p> <p>It is a fast detector</p> @@ -145,7 +143,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousListCollection"> <Details> <![CDATA[ - <p> Looks for fields that are implementations of java.util.List, but that are used in a set-like fashion. + <p>Looks for fields that are implementations of java.util.List, but that are used in a set-like fashion. Since lookup type operations are performed using a linear search for Lists, the performance for large Lists will be poor. Consideration should be made as to whether these fields should be sets. In the case that order is important, consider using LinkedHashSet.</p> @@ -157,7 +155,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ParallelLists"> <Details> <![CDATA[ - <p> Looks for classes that maintain two or more lists or arrays associated one-for-one through the same index + <p>Looks for classes that maintain two or more lists or arrays associated one-for-one through the same index to hold two or more pieces of related information. It would be better to create a new class that holds all of these pieces of information, and place instances of this class in one list. Or if the two list are related in key/value fashion, then a map.</p> @@ -180,7 +178,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.AbstractClassEmptyMethods"> <Details> <![CDATA[ - <p> Looks for abstract classes that define empty methods or methods that simply throw an + <p>Looks for abstract classes that define empty methods or methods that simply throw an exception. Since this is an abstract class, it may be cleaner to simple define this method as abstract, so that correct subclass behaviour is enforced.</p> <p>It is a fast detector</p> @@ -191,7 +189,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ManualArrayCopy"> <Details> <![CDATA[ - <p> Looks for methods that copy data from one array to another using a loop. It is + <p>Looks for methods that copy data from one array to another using a loop. It is better performing to use System.arraycopy to do such copying as this is a native method.</p> <p>It is a fast detector</p> ]]> @@ -201,7 +199,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.FloatingPointLoops"> <Details> <![CDATA[ - <p> Looks for methods that use floating point indexes for loops. Since floating point + <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 hard to find problems. It is usually better to use integer indexing, and calculating the correct floating point value from the index.</p> @@ -213,7 +211,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse"> <Details> <![CDATA[ - <p> Looks for method calls to collection classes where the method is not defined by the Collections + <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> <table border="1"> <tr><th>Old Method</th><th>New Method</th></tr> @@ -237,15 +235,15 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading"> <Details> <![CDATA[ - <p> Looks for methods that have the same signature, except where one uses a + <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') + test('a') </pre> would map to <pre> - public void test(Character c) + public void test(Character c) </pre> but instead maps to one that takes an int, long, float or double. </p> @@ -257,11 +255,10 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.AbnormalFinallyBlockReturn"> <Details> <![CDATA[ - <p> Looks for methods that have finally blocks that return values - or throw exceptions. This code will swallow normal program flow and - hide real program logic. - </p> - <p>It is a fast detector</p> + <p>Looks for methods that have finally blocks that return values + or throw exceptions. This code will swallow normal program flow and + hide real program logic.</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -269,11 +266,10 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.StaticMethodInstanceInvocation"> <Details> <![CDATA[ - <p> Looks for methods that make static method calls using an instance reference. + <p>Looks for methods that make static method calls using an instance reference. For documentation purposes, it is better to call the method using the class name. - This may represent a change in definition that should be noticed. - </p> - <p>It is a fast detector</p> + This may represent a change in definition that should be noticed.</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -281,7 +277,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SpuriousThreadStates"> <Details> <![CDATA[ - <p> Looks for methods that call wait, notify or notifyAll on an instance of a + <p>Looks for methods that call wait, notify or notifyAll on an instance of a java.lang.Thread. Since the internal workings of the threads is to synchronize on the thread itself, introducing client calls will confuse the thread state of the object in question, and will cause spurious thread state changes, either waking threads up @@ -294,7 +290,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessAutoboxing"> <Details> <![CDATA[ - <p> Looks for methods that pass a primitive wrapper class object to the + <p>Looks for methods that pass a primitive wrapper class object to the same class' Constructor. Patterns found are: <ul> <li>new Boolean(Boolean)</li> @@ -310,7 +306,7 @@ <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(myString).boxedValue(), when instead it is simpler to use BoxedClass.parseBoxed(myString)</p> - <p>It is a fast detector</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -372,7 +368,7 @@ <Details> <![CDATA[ <p>Looks for methods that build XML based strings by concatenation strings - and custom values together. Doing so makes brittle code, that is difficult to + and custom values together. Doing so makes brittle code, that is difficult to modify, validate and understand. It is cleaner to create external XML files that are transformed at runtime, using parameters set through Transformer.setParameter. <p>It is a fast detector</p> @@ -432,7 +428,7 @@ <![CDATA[ <p>Looks for methods that implement AWT or Swing listeners and perform time consuming operations. Doing these operations in the GUI thread will cause the - interface to appear sluggish and non-responsive to the user. It is better to + interface to appear sluggish and non-responsive to the user. It is better to use a separate thread to do the time consuming work so that the user has a better experience.</p> <p>It is a fast detector</p> @@ -443,7 +439,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessInstanceRetrieval"> <Details> <![CDATA[ - <p>Looks for methods that call a method to retrieve a reference to an object, + <p>Looks for methods that call a method to retrieve a reference to an object, to use to load a constant. It is simpler and more performant to access the static variable directly from the class itself.</p> <p>It is a fast detector</p> @@ -454,7 +450,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DateComparison"> <Details> <![CDATA[ - <p> Looks for inefficient comparison of Date objects using two comparisons when one would do.</p> + <p>Looks for inefficient comparison of Date objects using two comparisons when one would do.</p> <p>It is a fast detector</p> ]]> </Details> @@ -463,7 +459,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousWaitOnConcurrentObject"> <Details> <![CDATA[ - <p>Looks for calls to the wait method on mutexes defined in the java.util.concurrent + <p>Looks for calls to the wait method on mutexes defined in the java.util.concurrent package where it is likely that await was intended.</p> <p>It is a fast detector</p> ]]> @@ -483,8 +479,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat"> <Details> <![CDATA[ - <p>Looks for classes that maintain collections or StringBuffer/StringBuilders in - static member variables, and that do not appear to provide a way to clear or remove + <p>Looks for classes that maintain collections or StringBuffer/StringBuilders in + static member variables, and that do not appear to provide a way to clear or remove items from these members. Such class fields are likely causes of memory bloat.</p> <p>It is a fast detector</p> ]]> @@ -494,9 +490,9 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LocalSynchronizedCollection"> <Details> <![CDATA[ - <p>Looks for allocations of synchronized collections that are stored in local - variables, and never stored in fields or returned from methods. As local variables - are by definition thread safe, using synchronized collections in this context + <p>Looks for allocations of synchronized collections that are stored in local + variables, and never stored in fields or returned from methods. As local variables + are by definition thread safe, using synchronized collections in this context makes no sense.</p> <p>It is a moderately fast detector</p> ]]> @@ -506,8 +502,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.FieldCouldBeLocal"> <Details> <![CDATA[ - <p>Looks for classes that define fields that are used in a locals only fashion, - specifically private fields that are accessed first in each method with a + <p>Looks for classes that define fields that are used in a locals only fashion, + specifically private fields that are accessed first in each method with a store vs. a load.</p> <p>It is a slow detector</p> ]]> @@ -530,7 +526,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonRecycleableTaglibs"> <Details> <![CDATA[ - <p>Looks for tag libraries that are not recycleable because backing members + <p>Looks for tag libraries that are not recycleable because backing members of taglib attributes are set in areas besides the setter method for the attribute.</p> <p>It is a fast detector</p> ]]> @@ -540,9 +536,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.Section508Compliance"> <Details> <![CDATA[ - <p>Looks for violation of Section 508, Accessibility for People with disabilities Act. - </p> - <p>It is a fast detector</p> + <p>Looks for violation of Section 508, Accessibility for People with disabilities Act.</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -570,7 +565,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessMemberCollectionSynchronization"> <Details> <![CDATA[ - <p>Looks for classes that define private synchronized collections as static or instance + <p>Looks for classes that define private synchronized collections as static or instance members, that are only altered in a static initializer or constructor. Since the multithreaded use of this collection is read-only, the use of synchronization is unnecessary.</p> <p>It is a moderately fast detector</p> @@ -581,7 +576,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InheritanceTypeChecking"> <Details> <![CDATA[ - <p>Looks for if/else blocks where a series of them use instanceof on the same + <p>Looks for if/else blocks where a series of them use instanceof on the same variable to determine what to do. If these classes are related by inheritance, this often is better handled through calling a single overridden method.</p> <p>It is a moderately fast detector</p> @@ -635,7 +630,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UseCharacterParameterizedMethod"> <Details> <![CDATA[ - <p>Looks for methods that pass single character string constants as parameters to + <p>Looks for methods that pass single character string constants as parameters to methods that alternatively have an overridden method that accepts a character instead. It is easier for the method to handle a single character than a String.</p> <p>It is a fast detector.</p> @@ -669,9 +664,9 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleIncompleteSerialization"> <Details> <![CDATA[ - <p>Looks for classes that don't handle serialization of parent class member fields - when the class in question is serializable but is derived from a non serializable - classes.</p> + <p>Looks for classes that don't handle serialization of parent class member fields + when the class in question is serializable but is derived from a non serializable + classes.</p> <p>It is a fast detector.</p> ]]> </Details> @@ -681,7 +676,7 @@ <Details> <![CDATA[ <p>Looks for class that implement Comparator or Comparable, and whose compare or compareTo - methods return constant values only, but that don't represent the three possible choice + 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> ]]> @@ -700,8 +695,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope"> <Details> <![CDATA[ - <p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em> - Looks for assignments to variables in a scope larger than its use. As long as the evaluation of the assignment + <p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em></p> + <p>Looks for assignments to variables in a scope larger than its use. As long as the evaluation of the assignment does not have side effects, the assignment can be moved into the inner scope where it is used.</p> <p>It is a fast detector.</p> ]]> @@ -711,7 +706,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor"> <Details> <![CDATA[ - <p>Looks for classes that implement interfaces by relying on methods being + <p>Looks for classes that implement interfaces by relying on methods being implemented in superclasses, even though the superclass knows nothing about the interface being implemented by the child.</p> <p>It is a fast detector.</p> @@ -757,7 +752,7 @@ <Details> <![CDATA[ <p>Looks for loops that transfer the contents of one collection to another. These collection sources might - be local variables or member fields, including sets, maps key/values, lists, or arrays. It is simpler to + be local variables or member fields, including sets, maps key/values, lists, or arrays. It is simpler to just use the addAll method of the collection class. In the case where the source is an array, you can use Arrays.asList(array), and use that as the source to addAll.</p> <p>It is a fast detector.</p> @@ -769,7 +764,7 @@ <Details> <![CDATA[ <p>Looks for private or static methods that only return one constant value. Since there is no - chance for derived classes overriding this behavior, the return of a constant value + chance for derived classes overriding this behavior, the return of a constant value seems dubious.</p> <p>It is a fast detector</p> ]]> @@ -780,7 +775,7 @@ <Details> <![CDATA[ <p>Looks for classes that implement the Serializable interface and implement the - standard readObject and writeObject methods by simply deferring to the Stream + standard readObject and writeObject methods by simply deferring to the Stream parameter's defaultReadObject or defaultWriteObject and nothing else. As this is the built in behavior, these methods are not needed.</p> <p>It is a fast detector</p> @@ -818,12 +813,11 @@ <Details> <![CDATA[ <p>Looks for methods that return a parameter after modifying that parameter. - Doing this will confuse the user of this method, as it will be assumed that the + Doing this will confuse the user of this method, as it will be assumed that the passed in argument is different than the output, or at least won't be changed. If the purpose of this method is just to modify the parameter, this method should probably be changed to have a void return type. If you must return a variable, perhaps - a clone of the parameter should be returned. - </p> + a clone of the parameter should be returned.</p> <p>It is a fast detector</p> ]]> </Details> @@ -838,7 +832,7 @@ <li>Passing a constant as the second (actual) parameter</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> + <li>Using the assert keyword</li> </ul> </p> <p>It is a fast detector</p> @@ -911,7 +905,7 @@ <p>Looks for sets or keySets of maps that contain other collections. As typically collections calculate their hashCode, equals and compareTo methods by iterating the collection and evaluating the same function on each item in the collection, this can be costly from a performance point of view.</p> - <p>In addition, using a set, or keySet of a map, infers that you will be looking for items based on + <p>In addition, using a set, or keySet of a map, infers that you will be looking for items based on the value of a collection, which seems dubious at best.</p> <p>Finally, as collections are often modified, this may cause problems if the collection is modified, thus changing hashCodes, etc, while the collection is in the set.</p> @@ -925,7 +919,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BogusExceptionDeclaration"> <Details> <![CDATA[ - <p>Looks for constructors, static methods and private methods that declare that they throw + <p>Looks for constructors, static methods and private methods that declare that they throw checked exceptions that the actual code never throws. Since these methods can't be overridden, there is no reason to add these exceptions to the method declaration.</p> <p>It is a moderately fast detector</p> @@ -948,7 +942,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DeprecatedTypesafeEnumPattern"> <Details> <![CDATA[ - <p>Looks for classes that appear to implement the old style type safe enum pattern + <p>Looks for classes that appear to implement the old style type safe enum pattern that was used before Java added Enum support to the language. Since this class is compiled with Java 1.5 or later, it would be simpler to just use Java enums.</p> <p>It is a fast detector</p> @@ -975,18 +969,18 @@ 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> - ]]> + ]]> </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousUninitializedArray"> <Details> <![CDATA[ - <p>Looks for methods that return arrays that are allocated but not initialized - in this method. While it's possible that the calling method will do the work of - initializing the array, it is not a usual pattern, and it is suspected that this array - was just forgotten to be initialized.</p> - <p>It is a fast detector</p> + <p>Looks for methods that return arrays that are allocated but not initialized + in this method. While it's possible that the calling method will do the work of + initializing the array, it is not a usual pattern, and it is suspected that this array + was just forgotten to be initialized.</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -994,10 +988,10 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InappropriateToStringUse"> <Details> <![CDATA[ - <p>Looks for methods that perform algorithmic operations on Strings that are returned - from a toString() method. As toString should only be used for debug/trace purposes, it - shouldn't be used for algorithm use.</p> - <p>It is a fast detector</p> + <p>Looks for methods that perform algorithmic operations on Strings that are returned + from a toString() method. As toString should only be used for debug/trace purposes, it + shouldn't be used for algorithm use.</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -1005,9 +999,9 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing"> <Details> <![CDATA[ - <p>Looks for methods that use the same name with different casing to access objects in HttpRequest parameters - and attributes. As these parameter names are case sensitive this will lead to confusion.</p> - <p>It is a fast detector</p> + <p>Looks for methods that use the same name with different casing to access objects in HttpRequest parameters + and attributes. As these parameter names are case sensitive this will lead to confusion.</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -1019,7 +1013,7 @@ to a class or interface higher up in the inheritance chain. You only need to cast to that class or interface.</p> <p>It is a fast detector</p> - ]]> + ]]> </Details> </Detector> @@ -1050,18 +1044,18 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment"> <Details> <![CDATA[ - <p>Finds contravariant array assignments. Since arrays are mutable data structures, their use + <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 {} - - B[] b = new B[2]; - A[] a = b; - a[0] = new A(); // results in ArrayStoreException (Runtime) + class A {} + class B extends A {} + + B[] b = new B[2]; + A[] a = b; + a[0] = new A(); // results in ArrayStoreException (Runtime) </pre> - <p>It is a fast detector</p> + <p>It is a fast detector</p> ]]> </Details> </Detector> @@ -1069,8 +1063,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField"> <Details> <![CDATA[ - <p>Looks for fields in serializable classes that are defined as both final and - transient. As a transient field is not initialized when streamed, and is not + <p>Looks for fields in serializable classes that are defined as both final and + transient. As a transient field is not initialized when streamed, and is not initialized in a constructor, it will remain null because it is defined final.</p> <p>It is a fast detector</p> ]]> @@ -1079,94 +1073,93 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard"> <Details> - <![CDATA[ - <p>Looks for code that checks to see if a field or local variable is not null, - before entering a code block either an if, or while statement, and then reassigns that - field or local variable. It is likely that guard should have been to see if that + <![CDATA[ + <p>Looks for code that checks to see if a field or local variable is not null, + before entering a code block either an if, or while statement, and then reassigns that + field or local variable. It is likely that guard should have been to see if that field or local variable is null, not, not null.</p> - <p>It is a fast detector</p> - ]]> - </Details> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods"> <Details> - <![CDATA[ - <p>This detector looks for calls to more pointless or deprecated methods.</p> - <p>It is a fast detector</p> - ]]> - </Details> + <![CDATA[ + <p>This detector looks for calls to more pointless or deprecated methods.</p> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods"> <Details> - <![CDATA[ - <p>This detector looks for reflective calls on methods that are found in the class java.lang.Object. - As these methods are always available, there is no reason to use reflection to call them. - </p> - <p>It is a fast detector</p> - ]]> - </Details> + <![CDATA[ + <p>This detector looks for reflective calls on methods that are found in the class java.lang.Object. + As these methods are always available, there is no reason to use reflection to call them.</p> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.ImproperPropertiesUse"> <Details> - <![CDATA[ - <p>This detector looks for java.util.Properties use where values other than String - are placed in the properties object. As the Properties object was intended to be a - String to String only collection, putting other types in the Properties object is - incorrect, and takes advantage of a poor design decision by the original Properties class - designers to derive from Hashtable, rather than using aggregation.</p> - <p>It is a fast detector</p> - ]]> - </Details> + <![CDATA[ + <p>This detector looks for java.util.Properties use where values other than String + are placed in the properties object. As the Properties object was intended to be a + String to String only collection, putting other types in the Properties object is + incorrect, and takes advantage of a poor design decision by the original Properties class + designers to derive from Hashtable, rather than using aggregation.</p> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleConstantAllocationInLoop"> <Details> - <![CDATA[ - <p>This detector looks for allocations of objects using the default constructor in a loop, where - the object allocated is never assigned to any object that is used outside the loop. - It is possible that this allocation can be done outside the loop to avoid excessive garbage.</p> - <p>It is a fast detector</p> - ]]> - </Details> + <![CDATA[ + <p>This detector looks for allocations of objects using the default constructor in a loop, where + the object allocated is never assigned to any object that is used outside the loop. + It is possible that this allocation can be done outside the loop to avoid excessive garbage.</p> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.WriteOnlyCollection"> <Details> - <![CDATA[ + <![CDATA[ <p>This detector looks for allocations and initializations of Java collections, but that are never - read from or accessed to gain information. This represents a collection of no use, and most probably - can be removed. It is similar to a dead local store.</p> - <p>It is a fast detector</p> - ]]> - </Details> + read from or accessed to gain information. This represents a collection of no use, and most probably + can be removed. It is similar to a dead local store.</p> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.UseVarArgs"> <Details> - <![CDATA[ - <p>This detector looks for definitions of methods that have an array as the last parameter. + <![CDATA[ + <p>This detector looks for definitions of methods that have an array as the last parameter. Since this class is compiled with Java 1.5 or better, it would be more flexible for clients of this method to define this parameter as a vararg parameter.</p> - <p>It is a fast detector</p> - ]]> - </Details> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleUnsuspectedSerialization"> <Details> - <![CDATA[ - <p>This detector looks for code that serializes objects that are non-static inner - classes of other classes. Since there is a reference to the containing class, this class will be serialized as well. - It is often the case that this is not what is wanted, and will cause much more data to be serialized - than is necessary.</p> - <p>It is a fast detector</p> - ]]> - </Details> + <![CDATA[ + <p>This detector looks for code that serializes objects that are non-static inner + classes of other classes. Since there is a reference to the containing class, this class will be serialized as well. + It is often the case that this is not what is wanted, and will cause much more data to be serialized + than is necessary.</p> + <p>It is a fast detector</p> + ]]> + </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.SideEffectConstructor"> <Details> <![CDATA[ @@ -1177,7 +1170,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousGetterSetterUse"> <Details> <![CDATA[ @@ -1191,182 +1184,175 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.LingeringGraphicsObjects"> <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 + .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 - be created in a short period of time, it is better to dispose them as soon as possible - </p> + 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> ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks"> <Details> <![CDATA[ - <p>This detector looks for two or more try catch blocks that are consecutive - and catch the same kind of exception, and each catch block mandatorily throws - the same exception. These two catch blocks can and should be made into one + <p>This detector looks for two or more try catch blocks that are consecutive + and catch the same kind of exception, and each catch block mandatorily throws + the same exception. These two catch blocks can and should be made into one catch block to simply the code.</p> <p>It is a fast detector</p> ]]> </Details> </Detector> - <Detector class="com.mebigfatguy.fbcontrib.detect.CommonsEqualsBuilderToEquals"> - <Details> - <![CDATA[ - <p>This detector looks for uses for Commons-lang EqualsBuilder where the - result of equals() is returned instead of calling the method isEquals().</p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <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>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <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>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.CompareClassNameEquals"> - <Details> - <![CDATA[ - <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]. - - Comparing class name ignores the class loader. - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.BackportReusePublicIdentifiers"> - <Details> - <![CDATA[ - <p> Detects use of 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>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.CloneUsability"> - <Details> - <![CDATA[ - <p> Looks for classes that implement clone() that do not specialize the return value, and do - not swallow CloneNotSupportedException. Not doing so makes the clone method not as simple to use, - and should be harmless to do so. - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingArrayAsList"> - <Details> - <![CDATA[ - <p> Looks for calls to Arrays.asList where the parameter is a primitive array. - This does not produce a list that holds the primitive boxed values, but a list of - one item, the array itself. - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.PresizeCollections"> - <Details> - <![CDATA[ - <p> Looks for methods that create collections using the default constructor, - even though the number of elements that will be placed in the collection is known - apriori, and thus could be pre-allocated. Not doing so just causes more intermediate - reallocations which is unnecessary. - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.UnboundMethodTemplateParameter"> - <Details> - <![CDATA[ - <p> Looks for methods that declare method level template parameter(s) that are not bound to any of the - method's parameters, and thus is not adding any validation/type safety to the method, and is - just confusing. - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.NonProductiveMethodCall"> - <Details> - <![CDATA[ - <p> Looks for common methods that are non mutating where the return value is ignored. As these methods - do not change the object they are called on, calling this methods is pointless. They can be removed. - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayIndexOutOfBounds"> - <Details> - <![CDATA[ - <p>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> - </p> - <p>It is a fast detector</p> - ]]> - </Details> - </Detector> - - <Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument"> - <Details> - <![CDATA[ - <p>Looks for method calls that take a parameter value that does not match one of the expected - values for that parameter. It is likely this parameter value should really be an enum, but predates - the additio... [truncated message content] |