[Fb-contrib-commit] SF.net SVN: fb-contrib:[1780] trunk/fb-contrib
Brought to you by:
dbrosius
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_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," /> <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm" speed="fast" reports="SCA_SUSPICIOUS_CLONE_ALGORITHM" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.WeakExceptionMessaging" speed="fast" reports="WEM_WEAK_EXCEPTION_MESSAGING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.WeakExceptionMessaging" speed="fast" reports="WEM_WEAK_EXCEPTION_MESSAGING,WEM_OBSCURING_EXCEPTION" /> <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" /> @@ -285,13 +285,13 @@ <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 --> <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" /> - COMMENT OUT FOR POINT RELEASE --> + <!-- COMMENT OUT FOR POINT RELEASE --> <!-- BugPattern --> @@ -328,6 +328,7 @@ <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION" category="PERFORMANCE" /> <BugPattern abbrev="USBR" type="USBR_UNNECESSARY_STORE_BEFORE_RETURN" category="STYLE" /> <BugPattern abbrev="COM" type="COM_COPIED_OVERRIDDEN_METHOD" category="STYLE" /> + <BugPattern abbrev="COM" type="COM_PARENT_DELEGATED_CALL" category="STYLE" /> <BugPattern abbrev="ABC" type="ABC_ARRAY_BASED_COLLECTIONS" category="CORRECTNESS" /> <BugPattern abbrev="ODN" type="ODN_ORPHANED_DOM_NODE" category="CORRECTNESS" /> <BugPattern abbrev="AOM" type="AOM_ABSTRACT_OVERRIDDEN_METHOD" category="CORRECTNESS" /> @@ -416,15 +417,23 @@ <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_NO_CHECKED" category="STYLE" /> <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_RETURN_FALSE" category="STYLE" /> <BugPattern abbrev="CFS" type="CFS_CONFUSING_FUNCTION_SEMANTICS" category="STYLE" /> - <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT" category="STYLE" /> - <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE" category="STYLE" /> - <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT" category="STYLE" /> - <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="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT" category="STYLE" /> + <BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE" category="STYLE" /> + <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_EQUALS" category="CORRECTNESS" /> + <BugPattern abbrev="UTAO" type="UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT" 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_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" /> + <BugPattern abbrev="WEM" type="WEM_OBSCURING_EXCEPTION" category="STYLE" /> <BugPattern abbrev="SCSS" type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" category="CORRECTNESS" /> <BugPattern abbrev="LO" type="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE" category="CORRECTNESS" /> <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_CLASS" category="CORRECTNESS" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/etc/messages.xml 2015-08-16 23:20:38 UTC (rev 1780) @@ -851,13 +851,13 @@ </Details> </Detector> - <Detector class="com.mebigfatguy.fbcontrib.detect.JUnitAssertionOddities"> + <Detector class="com.mebigfatguy.fbcontrib.detect.UnitTestAssertionOddities"> <Details> <![CDATA[ - <p>Looks for junit 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</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> @@ -2189,6 +2189,17 @@ ]]> </Details> </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> + <Details> + <![CDATA[ + <p>This method is implemented to just delegate it's implementation by calling + the superclass method with the same signature. This method can just be removed.</p> + ]]> + </Details> + </BugPattern> <BugPattern type="ABC_ARRAY_BASED_COLLECTIONS"> <ShortDescription>Method uses array as basis of collection</ShortDescription> @@ -3332,8 +3343,8 @@ </BugPattern> <BugPattern type="MRC_METHOD_RETURNS_CONSTANT"> - <ShortDescription>Private method only returns one constant value</ShortDescription> - <LongDescription>Private method {1} only returns one constant value</LongDescription> + <ShortDescription>Private or static method only returns one constant value</ShortDescription> + <LongDescription>Private or static method {1} only returns one constant value</LongDescription> <Details> <![CDATA[ <p>This private or static method only returns one constant value. As this method is private or static, @@ -3431,9 +3442,9 @@ </Details> </BugPattern> - <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT"> - <ShortDescription>Method passes constant to second (actual) assertion parameter</ShortDescription> - <LongDescription>Method {1} passes constant to second (actual) assertion parameter</LongDescription> + <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> <Details> <![CDATA[ <p>This method calls assert passing a constant value as the second of the two values. The assert @@ -3443,9 +3454,9 @@ </Details> </BugPattern> - <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE"> - <ShortDescription>Method asserts that two doubles are exactly equal</ShortDescription> - <LongDescription>Method {1} asserts that two doubles are exactly equal</LongDescription> + <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> <Details> <![CDATA[ <p>This method calls assert with two doubles or Doubles. Due to the imprecision of doubles, you @@ -3454,9 +3465,9 @@ </Details> </BugPattern> - <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT"> - <ShortDescription>Method asserts that a value is true or false</ShortDescription> - <LongDescription>Method {1} asserts that a value is true or false</LongDescription> + <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> <Details> <![CDATA[ <p>This method asserts that a value is equal to true or false. It is simpler to just @@ -3465,9 +3476,9 @@ </Details> </BugPattern> - <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL"> - <ShortDescription>Method asserts that an auto-boxed value is not null</ShortDescription> - <LongDescription>Method {1} asserts that an auto-boxed value is not null</LongDescription> + <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> <Details> <![CDATA[ <p>This method asserts that a primitive value that was autoboxed into a boxed primitive was not @@ -3477,9 +3488,9 @@ </Details> </BugPattern> - <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_ASSERT_USED"> - <ShortDescription>Method uses Java asserts rather than a junit assertion</ShortDescription> - <LongDescription>Method {1} uses Java asserts rather than a junit assertion</LongDescription> + <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> <Details> <![CDATA[ <p>This method uses a Java assert to assure that a certain state is in effect. As this is @@ -3489,9 +3500,9 @@ </Details> </BugPattern> - <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS"> - <ShortDescription>Method passes boolean expression to Assert.assertTrue</ShortDescription> - <LongDescription>Method {1} passes boolean expression to Assert.assertTrue</LongDescription> + <BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS"> + <ShortDescription>Junit test method passes boolean expression to Assert.assertTrue</ShortDescription> + <LongDescription>Junit test method {1} passes boolean expression to Assert.assertTrue</LongDescription> <Details> <![CDATA[ <p>This method evaluates a boolean expression and passes that to Assert.assertTrue. It is better @@ -3501,9 +3512,9 @@ </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> + <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> <Details> <![CDATA[ <p>This JUnit test method has no assertions. While a unit test could still be valid if it relies on whether @@ -3513,7 +3524,90 @@ ]]> </Details> </BugPattern> + + <BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_ACTUAL_CONSTANT"> + <ShortDescription>TestNG test method passes constant to first (actual) assertion parameter</ShortDescription> + <LongDescription>TestNG test method {1} passes constant to forst (actual) assertion parameter</LongDescription> + <Details> + <![CDATA[ + <p>This method calls assert passing a constant value as the first of the two values. The assert + method assumes that the expected value is the second parameter, and so it appears that the order + of values has been swapped here.</p> + ]]> + </Details> + </BugPattern> + <BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_INEXACT_DOUBLE"> + <ShortDescription>TestNG test method asserts that two doubles are exactly equal</ShortDescription> + <LongDescription>TestNG 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 + should be using the assert method that takes a range parameter that gives a range of error.</p> + ]]> + </Details> + </BugPattern> + + <BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_BOOLEAN_ASSERT"> + <ShortDescription>TestNG test method asserts that a value is true or false</ShortDescription> + <LongDescription>TestNG 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 + use assertTrue, or assertFalse, instead.</p> + ]]> + </Details> + </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> + <Details> + <![CDATA[ + <p>This method asserts that a primitive value that was autoboxed into a boxed primitive was not + null. This will never happen, as primitives are never null, and thus the autoboxed value isn't + either.</p> + ]]> + </Details> + </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> + <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 following exception to occur.</p> + ]]> + </Details> + </BugPattern> + + <BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_USE_ASSERT_EQUALS"> + <ShortDescription>TestNG test method passes boolean expression to Assert.assertTrue</ShortDescription> + <LongDescription>TestNG test method {1} passes boolean expression to Assert.assertTrue</LongDescription> + <Details> + <![CDATA[ + <p>This method evaluates a boolean expression and passes that to Assert.assertTrue. It is better + to pass the two values that are being equated to the Assert.assertEquals method so that the + TestNG failure method is more meaningful of the intended test.</p> + ]]> + </Details> + </BugPattern> + + <BugPattern type="UTAO_TESTNG_ASSERTION_ODDITIES_NO_ASSERT"> + <ShortDescription>TestNG test method appears to have no assertions</ShortDescription> + <LongDescription>TestNG test method {1} appears to have no assertions</LongDescription> + <Details> + <![CDATA[ + <p>This TestNG 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> <LongDescription>Clone method {1} stores a new value to member field of source object</LongDescription> @@ -3538,6 +3632,20 @@ ]]> </Details> </BugPattern> + + <BugPattern type="WEM_OBSCURING_EXCEPTION"> + <ShortDescription>Method throws a java.lang.Exception that wraps a more useful exception</ShortDescription> + <LongDescription>Method {1} throws a java.lang.Exception that wraps a more useful exception</LongDescription> + <Details> + <![CDATA[ + <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. + </p> + ]]> + </Details> + </BugPattern> <BugPattern type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT"> <ShortDescription>Method modifies http session attribute without calling setAttribute</ShortDescription> @@ -4883,7 +4991,7 @@ <BugCode abbrev="MOM">Misleading Overload Model</BugCode> <BugCode abbrev="EXS">Exception Softening</BugCode> <BugCode abbrev="CFS">Confusing Function Semantics</BugCode> - <BugCode abbrev="JAO">JUnit Assertion Oddities</BugCode> + <BugCode abbrev="UTAO">Unit Test Assertion Oddities</BugCode> <BugCode abbrev="SCA">Suspicious Clone Algorithm</BugCode> <BugCode abbrev="WEM">Weak Exception Messaging</BugCode> <BugCode abbrev="SCSS">Suspicious Clustered Session Support</BugCode> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/htdocs/index.shtml 2015-08-16 23:20:38 UTC (rev 1780) @@ -68,7 +68,7 @@ </li> </ul> </p> - <p style="font-weight: bold;">The latest version of fb-contrib is 6.2.0 available for download + <p style="font-weight: bold;">The latest version of fb-contrib is 6.2.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 @@ -429,8 +429,8 @@ Looks for implementation of clone where an assignment is made to a field of the source object. It is likely that that store should have occurred on the cloned object, as the clone operation is almost always considered read only.</li> - <li><b>[JAO] JUnit Assertion Oddities</b><br/> - Looks for junit test case methods that use assertions with odd parameters. Things such as, + <li><b>[UTAO] Unit Test Assertion Oddities</b><br/> + Looks for junit or testng test case methods that use assertions with odd parameters. Things such as, passing a constant as the second (actual) parameter, not using the three parameter version of asserts for doubles, or passing true or false as the first parameter instead of using assertTrue, or assertFalse.</li> Modified: trunk/fb-contrib/htdocs/repository.html =================================================================== --- trunk/fb-contrib/htdocs/repository.html 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/htdocs/repository.html 2015-08-16 23:20:38 UTC (rev 1780) @@ -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.0.0</td></tr> + <tr><td><b>Version:</b></td><td>6.2.1</td></tr> </table> </div> Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/pom.xml 2015-08-16 23:20:38 UTC (rev 1780) @@ -8,7 +8,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>6.2.0</version> + <version>6.3.0</version> <prerequisites> <maven>2.2.1</maven> @@ -70,6 +70,9 @@ <name>Thrawn</name> <email>she...@ya...</email> </contributor> + <contributor> + <name>Juan Martín Sotuyo Dodero</name> + </contributor> </contributors> <licenses> @@ -137,6 +140,7 @@ <build> <sourceDirectory>${basedir}/src</sourceDirectory> + <outputDirectory>${basedir}/target/classes/main</outputDirectory> <resources> <resource> <directory>${basedir}</directory> Modified: trunk/fb-contrib/samples/ABC_Sample.java =================================================================== --- trunk/fb-contrib/samples/ABC_Sample.java 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/samples/ABC_Sample.java 2015-08-16 23:20:38 UTC (rev 1780) @@ -28,7 +28,7 @@ public UseComparator() { testComp = new TreeMap<byte[], byte[]>(new Comparator<byte[]>() { - @Override + @Override public int compare(byte[] b1, byte[] b2) { return b1.length - b2.length; } Modified: trunk/fb-contrib/samples/AIOB_Sample.java =================================================================== --- trunk/fb-contrib/samples/AIOB_Sample.java 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/samples/AIOB_Sample.java 2015-08-16 23:20:38 UTC (rev 1780) @@ -10,11 +10,11 @@ a[4] = 2; fa[4] = 2; } - + public void testOutOfBoundsGuard() { int[] a = new int[4]; - if (a.length > 4){ + if (a.length > 4) { a[4] = 2; } } Modified: trunk/fb-contrib/samples/BAS_Sample.java =================================================================== --- trunk/fb-contrib/samples/BAS_Sample.java 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/samples/BAS_Sample.java 2015-08-16 23:20:38 UTC (rev 1780) @@ -6,6 +6,9 @@ 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 { @@ -165,22 +168,48 @@ 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); - } + + 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() { + 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; } Modified: trunk/fb-contrib/samples/BED_Sample.java =================================================================== --- trunk/fb-contrib/samples/BED_Sample.java 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/samples/BED_Sample.java 2015-08-16 23:20:38 UTC (rev 1780) @@ -24,17 +24,17 @@ env.put("name", name); DirContext context = new InitialDirContext(env); } - + public void doesTheNasty() throws FileNotFoundException, IOException { - + } - + public void doesTheNasty2() throws IOException, FileNotFoundException { - + } - + public void fpJustAwful() throws IOException, Exception { - + } private void badThrow() throws SQLException { Modified: trunk/fb-contrib/samples/CBC_Sample.java =================================================================== --- trunk/fb-contrib/samples/CBC_Sample.java 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/samples/CBC_Sample.java 2015-08-16 23:20:38 UTC (rev 1780) @@ -1,45 +1,47 @@ public class CBC_Sample { - private static final Integer ONE = Integer.valueOf(1); - private static final Integer TWO = Integer.valueOf(2); - private static final Integer THREE = Integer.valueOf(3); - - enum Giant {Fee, Fi, Fo, Fum }; - - public void testCBCStrings(String x) { - if (x.equals("foo") || x.equals("bar") || x.equals("baz")) { - System.out.println("yup"); - } - } - - public void testCBCClass(Class<?> x) { - if (x.equals(String.class) || x.equals(Integer.class) || x.equals(Long.class)) { - System.out.println("yup"); - } - } - - public void testCBCEnum(Giant x) { - if (x.equals(Giant.Fee) || x.equals(Giant.Fi) || x.equals(Giant.Fo) || x.equals(Giant.Fum)) { - System.out.println("yup"); - } - } - - public void testCBCEnumDoubleEquals(Giant x) { - if ((x == Giant.Fee) || (x ==Giant.Fi) || (x == Giant.Fo) || (x == Giant.Fum)) { - System.out.println("yup"); - } - } - - public void testCBCInteger(Integer x) { - if (x.equals(ONE) || x.equals(TWO) || x.equals(THREE)) { - System.out.println("yup"); - } - } - - public void testCBCPrimitiveInt(int x) { - if ((x == 1) || (x == 2) || (x == 3)) { - System.out.println("yup"); - } - } + private static final Integer ONE = Integer.valueOf(1); + private static final Integer TWO = Integer.valueOf(2); + private static final Integer THREE = Integer.valueOf(3); + + enum Giant { + Fee, Fi, Fo, Fum + }; + + public void testCBCStrings(String x) { + if (x.equals("foo") || x.equals("bar") || x.equals("baz")) { + System.out.println("yup"); + } + } + + public void testCBCClass(Class<?> x) { + if (x.equals(String.class) || x.equals(Integer.class) || x.equals(Long.class)) { + System.out.println("yup"); + } + } + + public void testCBCEnum(Giant x) { + if (x.equals(Giant.Fee) || x.equals(Giant.Fi) || x.equals(Giant.Fo) || x.equals(Giant.Fum)) { + System.out.println("yup"); + } + } + + public void testCBCEnumDoubleEquals(Giant x) { + if ((x == Giant.Fee) || (x == Giant.Fi) || (x == Giant.Fo) || (x == Giant.Fum)) { + System.out.println("yup"); + } + } + + public void testCBCInteger(Integer x) { + if (x.equals(ONE) || x.equals(TWO) || x.equals(THREE)) { + System.out.println("yup"); + } + } + + public void testCBCPrimitiveInt(int x) { + if ((x == 1) || (x == 2) || (x == 3)) { + System.out.println("yup"); + } + } } Modified: trunk/fb-contrib/samples/CD_Sample.java =================================================================== --- trunk/fb-contrib/samples/CD_Sample.java 2015-05-31 14:59:57 UTC (rev 1779) +++ trunk/fb-contrib/samples/CD_Sample.java 2015-08-16 23:20:38 UTC (rev 1780) @@ -1,7 +1,7 @@ public class CD_Sample { Child c = new Child();; - + public void cdTest() { c.childTest(); } @@ -9,7 +9,7 @@ class Child { SubChild sc = new SubChild(); - + public void childTest() { sc.subChildTest(); } @@ -17,26 +17,47 @@ class SubChild { CD_Sample cds = new CD_Sample(); - + public void subChildTest() { 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; - } - } + 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; + } + } } + +class SuspectBuilderUse { + private int data; + + public static class Builder { + + int data; + + public void setData(int data) { + this.data = data; + } + } + + public SuspectBuilderUse(Builder b) { + this.data = b.data; + } + + ... [truncated message content] |