[Fb-contrib-commit] SF.net SVN: fb-contrib:[1829] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2017-12-26 23:49:47
|
Revision: 1829 http://sourceforge.net/p/fb-contrib/code/1829 Author: dbrosius Date: 2017-12-26 23:49:41 +0000 (Tue, 26 Dec 2017) Log Message: ----------- sync from github Modified Paths: -------------- trunk/fb-contrib/.classpath trunk/fb-contrib/build.xml trunk/fb-contrib/etc/bugrank.txt trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/etc/samples.fbp trunk/fb-contrib/htdocs/index.shtml trunk/fb-contrib/pom.xml trunk/fb-contrib/samples.xml trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/MethodInfo.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/Statistics.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BuryingLogic.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousMapCollection.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ParallelLists.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousShadedClassUse.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseAddAll.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseSplit.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseToArray.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/UseTryWithResources.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/WiringIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/BugType.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureBuilder.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/ToString.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/Values.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java trunk/fb-contrib/src/samples/java/ex/COM_Sample.java trunk/fb-contrib/src/samples/java/ex/HES_Sample.java trunk/fb-contrib/src/samples/java/ex/LO_Sample.java trunk/fb-contrib/src/samples/java/ex/MRC_Sample.java trunk/fb-contrib/src/samples/java/ex/PSC_Sample.java trunk/fb-contrib/src/samples/java/ex/SEO_Sample.java trunk/fb-contrib/src/samples/java/ex/SPP_Sample.java trunk/fb-contrib/src/samples/java/ex/WI_Sample.java trunk/fb-contrib/yank.xls Added Paths: ----------- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/collect/CollectNullableMethodStatus.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/AnnotationIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/MapUsageIssues.java trunk/fb-contrib/src/samples/java/ex/AI_Sample.java trunk/fb-contrib/src/samples/java/ex/MUP_Sample.java Modified: trunk/fb-contrib/.classpath =================================================================== --- trunk/fb-contrib/.classpath 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/.classpath 2017-12-26 23:49:41 UTC (rev 1829) @@ -45,5 +45,6 @@ <classpathentry kind="lib" path="lib/javax.ws.rs-api-2.0.1.jar"/> <classpathentry kind="lib" path="lib/mockito-core-2.8.47.jar" sourcepath="/home/dave/.m2/repository/org/mockito/mockito-core/2.8.47/mockito-core-2.8.47-sources.jar"/> <classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/> + <classpathentry kind="lib" path="lib/log4j-api-2.9.1.jar"/> <classpathentry kind="output" path="target/classes/main"/> </classpath> Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/build.xml 2017-12-26 23:49:41 UTC (rev 1829) @@ -31,7 +31,7 @@ <property name="javac.debug" value="on" /> <property name="test_reports.dir" value="${target.dir}/reports/test"/> - <property name="fb-contrib.version" value="7.0.5" /> + <property name="fb-contrib.version" value="7.1.0-SNAPSHOT" /> <property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" /> @@ -42,7 +42,7 @@ <target name="infra_jars" description="pull jars needed to build fb-contrib to ${user.dir}/.ant/lib"> <mkdir dir="${user.home}/.ant/lib" /> - <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.8.0/yank-1.8.0.jar" dest="${user.home}/.ant/lib"/> + <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/2.0.0/yank-2.0.0.jar" dest="${user.home}/.ant/lib"/> <get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/> <get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/> <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.6.0/fb-delta-0.6.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/> @@ -103,6 +103,7 @@ <pathelement location="${lib.dir}/bcel-findbugs-${bcel-findbugs.version}.jar" /> <pathelement location="${lib.dir}/findbugs-annotations-${findbugs-annotations.version}.jar" /> <pathelement location="${lib.dir}/asm-debug-all-${asm-debug-all.version}.jar" /> + <pathelement location="${lib.dir}/jsr305-${jsr305.version}.jar" /> <pathelement location="${main.classes.dir}" /> </path> <path id="fb-contrib.test.classpath"> @@ -118,9 +119,11 @@ <pathelement location="${lib.dir}/asm-debug-all-${asm-debug-all.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}/jsr305-${jsr305.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}/log4j-api-${log4j-api.version}.jar" /> <pathelement location="${lib.dir}/commons-lang3-${commons-lang3.version}.jar" /> <pathelement location="${lib.dir}/commons-io-${commons-io.version}.jar" /> <pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" /> Modified: trunk/fb-contrib/etc/bugrank.txt =================================================================== --- trunk/fb-contrib/etc/bugrank.txt 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/etc/bugrank.txt 2017-12-26 23:49:41 UTC (rev 1829) @@ -3,6 +3,7 @@ +0 BugPattern AFBR_ABNORMAL_FINALLY_BLOCK_RETURN +0 BugPattern AIOB_ARRAY_INDEX_OUT_OF_BOUNDS +0 BugPattern AIOB_ARRAY_STORE_TO_NULL_REFERENCE ++1 BugPattern AI_ANNOTATION_ISSUES_NEEDS_NULLABLE +0 BugPattern AOM_ABSTRACT_OVERRIDDEN_METHOD +0 BugPattern AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE +0 BugPattern BAS_BLOATED_ASSIGNMENT_SCOPE @@ -104,6 +105,7 @@ +0 BugPattern LO_INVALID_FORMATTING_ANCHOR +0 BugPattern LO_INVALID_STRING_FORMAT_NOTATION +0 BugPattern LO_LOGGER_LOST_EXCEPTION_STACK_TRACE ++0 BugPattern LO_NON_PRIVATE_STATIC_LOGGER +0 BugPattern LO_STUTTERED_MESSAGE +0 BugPattern LO_SUSPECT_LOG_CLASS +0 BugPattern LO_SUSPECT_LOG_PARAMETER @@ -129,6 +131,7 @@ +2 BugPattern MOM_MISLEADING_OVERLOAD_MODEL +0 BugPattern MRC_METHOD_RETURNS_CONSTANT +0 BugPattern MUC_MODIFYING_UNMODIFIABLE_COLLECTION ++0 BugPattern MUP_CONTAINSKEY_BEFORE_GET +0 BugPattern NAB_NEEDLESS_AUTOBOXING_CTOR +0 BugPattern NAB_NEEDLESS_AUTOBOXING_VALUEOF +0 BugPattern NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION @@ -282,5 +285,6 @@ +0 BugPattern WEM_OBSCURING_EXCEPTION +0 BugPattern WEM_WEAK_EXCEPTION_MESSAGING +0 BugPattern WI_DUPLICATE_WIRED_TYPES ++0 BugPattern WI_MANUALLY_ALLOCATING_AN_AUTOWIRED_BEAN +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 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/etc/findbugs.xml 2017-12-26 23:49:41 UTC (rev 1829) @@ -15,12 +15,15 @@ <Earlier class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections" /> <LaterCategory name="reporting" spanplugins="true" /> </SplitPass> - + <SplitPass> + <Earlier class="com.mebigfatguy.fbcontrib.collect.CollectNullableMethodStatus" /> + <LaterCategory name="reporting" spanplugins="true" /> + </SplitPass> </OrderingConstraints> <!-- Detectors --> -<!-- COMMENT OUT FOR RELEASE +<!-- COMMENT OUT FOR RELEASE --> <Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/> @@ -30,7 +33,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" /> - COMMENT OUT FOR RELEASE --> + <!-- COMMENT OUT FOR RELEASE --> <Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" /> @@ -176,7 +179,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING,LO_INVALID_STRING_FORMAT_NOTATION,LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING,LO_TOSTRING_PARAMETER" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_LOGGER_LOST_EXCEPTION_STACK_TRACE,LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE,LO_INVALID_FORMATTING_ANCHOR,LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS,LO_EXCEPTION_WITH_LOGGER_PARMS,LO_APPENDED_STRING_IN_FORMAT_STRING,LO_INVALID_STRING_FORMAT_NOTATION,LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING,LO_TOSTRING_PARAMETER,LO_NON_PRIVATE_STATIC_LOGGER" /> <Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" /> @@ -281,7 +284,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ConflatingResourcesAndFiles" speed="fast" reports="CRF_CONFLATING_RESOURCES_AND_FILES" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.OverlyPermissiveMethod" speed="fast" reports="OPM_OVERLY_PERMISSIVE_METHOD" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.OverlyPermissiveMethod" speed="moderate" reports="OPM_OVERLY_PERMISSIVE_METHOD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes" speed="fast" reports="STT_STRING_PARSING_A_FIELD,STT_TOSTRING_STORED_IN_FIELD,STT_TOSTRING_MAP_KEYING" /> @@ -301,7 +304,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BuryingLogic" speed="fast" reports="BL_BURYING_LOGIC"/> - <Detector class="com.mebigfatguy.fbcontrib.detect.WiringIssues" speed="fast" reports="WI_DUPLICATE_WIRED_TYPES"/> + <Detector class="com.mebigfatguy.fbcontrib.detect.WiringIssues" speed="fast" reports="WI_DUPLICATE_WIRED_TYPES,WI_MANUALLY_ALLOCATING_AN_AUTOWIRED_BEAN"/> <Detector class="com.mebigfatguy.fbcontrib.detect.ConcurrentCollectionIssues" speed="fast" reports="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY"/> @@ -313,14 +316,21 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryApiConversion" speed="fast" reports="UAC_UNNECESSARY_API_CONVERSION_DATE_TO_INSTANT,UAC_UNNECESSARY_API_CONVERSION_FILE_TO_PATH"/> - <!-- COMMENT OUT FOR POINT RELEASE + <!-- COMMENT OUT FOR POINT RELEASE --> <Detector class="com.mebigfatguy.fbcontrib.detect.UseTryWithResources" speed="fast" reports="UTWR_USE_TRY_WITH_RESOURCES"/> <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionIssues" speed="fast" reports="RFI_SET_ACCESSIBLE"/> - COMMENT OUT FOR POINT RELEASE --> + <Detector class="com.mebigfatguy.fbcontrib.detect.AnnotationIssues" speed="fast" reports="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE"/> + <Detector class="com.mebigfatguy.fbcontrib.detect.MapUsageIssues" speed="fast" reports="MUP_CONTAINSKEY_BEFORE_GET"/> + + <Detector class="com.mebigfatguy.fbcontrib.collect.CollectNullableMethodStatus" speed="fast" reports="" hidden="true" /> + + + <!-- COMMENT OUT FOR POINT RELEASE --> + <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> @@ -484,6 +494,7 @@ <BugPattern abbrev="LO" type="LO_INVALID_STRING_FORMAT_NOTATION" category="CORRECTNESS" /> <BugPattern abbrev="LO" type="LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING" category="CORRECTNESS"/> <BugPattern abbrev="LO" type="LO_TOSTRING_PARAMETER" category="CORRECTNESS" /> + <BugPattern abbrev="LO" type="LO_NON_PRIVATE_STATIC_LOGGER" 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" /> @@ -594,6 +605,7 @@ <BugPattern abbrev="DMC" type="DMC_DUBIOUS_MAP_COLLECTION" category="CORRECTNESS"/> <BugPattern abbrev="BL" type="BL_BURYING_LOGIC" category="STYLE"/> <BugPattern abbrev="WI" type="WI_DUPLICATE_WIRED_TYPES" category="CORRECTNESS"/> + <BugPattern abbrev="WI" type="WI_MANUALLY_ALLOCATING_AN_AUTOWIRED_BEAN" category="CORRECTNESS"/> <BugPattern abbrev="CCI" type="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY" category="CORRECTNESS"/> <BugPattern abbrev="UTWR" type="UTWR_USE_TRY_WITH_RESOURCES" category="STYLE" experimental="true"/> <BugPattern abbrev="SSCU" type="SSCU_SUSPICIOUS_SHADED_CLASS_USE" category="CORRECTNESS"/> @@ -606,4 +618,6 @@ <BugPattern abbrev="UAC" type="UAC_UNNECESSARY_API_CONVERSION_DATE_TO_INSTANT" category="CORRECTNESS"/> <BugPattern abbrev="UAC" type="UAC_UNNECESSARY_API_CONVERSION_FILE_TO_PATH" category="CORRECTNESS"/> <BugPattern abbrev="RFI" type="RFI_SET_ACCESSIBLE" category="CORRECTNESS" experimental="true"/> + <BugPattern abbrev="AI" type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="MUP" type="MUP_CONTAINSKEY_BEFORE_GET" category="STYLE" experimental="true" /> </FindbugsPlugin> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/etc/messages.xml 2017-12-26 23:49:41 UTC (rev 1829) @@ -30,6 +30,14 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.collect.CollectNullableMethodStatus"> + <Details> + <![CDATA[ + <p>Collects method calls that can return null</p> + ]]> + </Details> + </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering"> <Details> @@ -909,7 +917,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities"> <Details> <![CDATA[ - <p>Looks for odd patterns of use of Logger classes from either log4j, SLF4J or Commons Logging.</p> + <p>Looks for odd patterns of use of Logger classes from either Log4j, Log4j2, SLF4J or Commons Logging.</p> <p>It is a fast detector.</p> ]]> </Details> @@ -1705,7 +1713,25 @@ </Details> </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.AnnotationIssues"> + <Details> + <![CDATA[ + <p>Looks for issues around use of standard anntations</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.MapUsageIssues"> + <Details> + <![CDATA[ + <p>Looks for dubious usage patterns around the Map interface</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger"> <Details></Details> </Detector> @@ -4030,8 +4056,8 @@ <LongDescription>Method {1} attempts to log using numbered formatting anchors</LongDescription> <Details> <![CDATA[ - <p>This method attempts to use an SLF4J logger to log a parameterized expression using formatting anchors. - However, SLF4J uses simple non numbered anchors such as {}, rather than anchors with digits in them as the + <p>This method attempts to use an SLF4J or Log4j2 logger to log a parameterized expression using formatting anchors. + However, SLF4J and Log4j2 use simple non numbered anchors such as {}, rather than anchors with digits in them as the code uses. Thus no parameter replacement will occur.</p> <p>This pattern is invalid: <code>LOGGER.error("{0} is broken", theThing);</code> @@ -4047,8 +4073,8 @@ <LongDescription>Method {1} attempts to log using String.format notation</LongDescription> <Details> <![CDATA[ - <p>This method attempts to use an SLF4J logger to log a parameterized expression using String.format notation. - However, SLF4J uses simple non numbered anchors such as {}, rather than anchors with percent signs in them as the + <p>This method attempts to use an SLF4J or Log4j2 logger to log a parameterized expression using String.format notation. + However, SLF4J and Log4j2 uses simple non numbered anchors such as {}, rather than anchors with percent signs in them as the code uses. Thus no parameter replacement will occur.</p> <p>This pattern is invalid: <code>LOGGER.error("%s is broken", theThing);</code> @@ -4060,11 +4086,11 @@ </BugPattern> <BugPattern type="LO_INCORRECT_NUMBER_OF_ANCHOR_PARAMETERS"> - <ShortDescription>Method passes an incorrect number of parameters to an SLF4J logging statement</ShortDescription> - <LongDescription>Method {1} passes an incorrect number of parameters to an SLF4J logging statement</LongDescription> + <ShortDescription>Method passes an incorrect number of parameters to an SLF4J or Log4j2 logging statement</ShortDescription> + <LongDescription>Method {1} passes an incorrect number of parameters to an SLF4J or Log4j2 logging statement</LongDescription> <Details> <![CDATA[ - <p>This method passes the wrong number of parameters to an SLF4J logging method (error, warn, info, debug) based on the number of anchors {} in the + <p>This method passes the wrong number of parameters to an SLF4J or Log4j2 logging method (error, warn, info, debug) based on the number of anchors {} in the format string. An additional exception argument is allowed if found.</p> ]]> </Details> @@ -4076,7 +4102,7 @@ <Details> <![CDATA[ <p>This method passes a standard exception as a logger parameter, and expects this exception to be substituted in - an SLF4J style parameter marker '{}'. This marker will not be translated as SLF4J doesn't process the Exception + an SLF4J or Log4j style parameter marker '{}'. This marker will not be translated as SLF4J or Log4j2 doesn't process the Exception class for markers. </p> ]]> @@ -4084,11 +4110,11 @@ </BugPattern> <BugPattern type="LO_APPENDED_STRING_IN_FORMAT_STRING"> - <ShortDescription>Method passes a concatenated string to SLF4J's format string</ShortDescription> - <LongDescription>Method {1} passes a concatenated string to SLF4J's format string</LongDescription> + <ShortDescription>Method passes a concatenated string to SLF4J's or Log4j2's format string</ShortDescription> + <LongDescription>Method {1} passes a concatenated string to SLF4J's or Log4j2's format string</LongDescription> <Details> <![CDATA[ - <p>This method uses an SLF4J logger to log a string, where the first (format) string is created using concatenation. + <p>This method uses an SLF4J or Log4j2 logger to log a string, where the first (format) string is created using concatenation. You should use {} markers to inject dynamic content into the string, so that String building is delayed until the actual log string is needed. If the log level is high enough that this log statement isn't used, then the appends will never be executed.</p> @@ -4098,13 +4124,13 @@ <BugPattern type="LO_EMBEDDED_SIMPLE_STRING_FORMAT_IN_FORMAT_STRING"> - <ShortDescription>Method passes a simple String.format result to an SLF4J's format string</ShortDescription> - <LongDescription>Method {1} passes a simple String.format result to an SLF4J's format string</LongDescription> + <ShortDescription>Method passes a simple String.format result to an SLF4J's or Log4j2's format string</ShortDescription> + <LongDescription>Method {1} passes a simple String.format result to an SLF4J's or Log4j2's format string</LongDescription> <Details> <![CDATA[ - <p>This method uses an SLF4J logger to log a string, which was produced through a call to String.format, where + <p>This method uses an SLF4J or Log4j2 logger to log a string, which was produced through a call to String.format, where the format string passed was a constant string containing only simple format markers that could be directly handled - by slf4j. Rather than doing + by slf4j or Log4j. Rather than doing <pre> logger.error("String.format("This %s is an error", s)); <pre> @@ -4132,6 +4158,31 @@ </Details> </BugPattern> + <BugPattern type="LO_NON_PRIVATE_STATIC_LOGGER"> + <ShortDescription>Class defines non private logger using a static class context</ShortDescription> + <LongDescription>Class {0} defines a non private logger using a static class context</LongDescription> + <Details> + <![CDATA[ + <p>This class defines a static logger as non private. It does so by passing the name of a + class such as + <code><pre>public static final Logger LOG = LoggerFactory.getLogger(Foo.class);</pre></code> + Since this class is public it may be used in other classes, but doing so, will provide the incorrect + class reference as the class is hard coded. + </p> + <p> + It is recommend to define static loggers as private, and just redefine a new logger in any class + that you need to have logging done. + <p> + <p>If you wish to have a base class define the logger, and have derived classes use that logger, you can + potentially use instance based logging, such as + <code><pre>protected final Logger LOG = LoggerFactory.getLogger(getClass());</pre></code> + However this has the downside of being an instance based logger, and creating a logger object in each instance + of the class where it is used. + </p> + ]]> + </Details> + </BugPattern> + <BugPattern type="IICU_INCORRECT_INTERNAL_CLASS_USE"> <ShortDescription>Class relies on internal API classes</ShortDescription> <LongDescription>Class {0} relies on internal API classes</LongDescription> @@ -5778,6 +5829,19 @@ </Details> </BugPattern> + <BugPattern type="WI_MANUALLY_ALLOCATING_AN_AUTOWIRED_BEAN"> + <ShortDescription>Method allocates an object with new when the class is defined as an autowireable bean</ShortDescription> + <LongDescription>Method {1} allocates an object with new when the class is defined as an autowireable bean</LongDescription> + <Details> + <![CDATA[ + <p>this method allocates an object with new, but the class of the object that is being created is marked with a Spring annotation + denoting that this class is to be used through an @Autowire annotation. Allocating it with new, will likely mean that fields on the + class will not be autowired, but instead be null. You should just autowire an instance of this class into the class in question, or if + need be, use spring's getBean(name) method to fetch one.</p> + ]]> + </Details> + </BugPattern> + <BugPattern type="CCI_CONCURRENT_COLLECTION_ISSUES_USE_PUT_IS_RACY"> <ShortDescription>Method gets and sets a value of a ConcurrentHashMap in a racy manner</ShortDescription> <LongDescription>Method {1} gets and sets a value of a ConcurrentHashMap in a racy manner </LongDescription> @@ -5945,6 +6009,89 @@ ]]> </Details> </BugPattern> + + <BugPattern type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE"> + <ShortDescription>Method that can return null, is missing a @Nullable annotation</ShortDescription> + <LongDescription>Method {1} that can return null, is missing a @Nullable annotation</LongDescription> + <Details> + <![CDATA[ + <p>This method can return null, but is not annotated with an @Nullable annotation. Without this annotation, + various IDEs, and static analysis tools may not be able to fully discover possible NullPointerExceptions in + your code. By Adding these annotations, you will discover problems around null-ness, more easily.</p> + <p>Unfortunately there isn't just one @Nullable annotation, but this detector will recognize:</p> + <ul> + <li>org.jetbrains.annotations.Nullable</li> + <li>javax.annotation.Nullable</li> + <li>javax.annotation.CheckForNull</li> + <li>edu.umd.cs.findbugs.annotations.Nullable</li> + <li>org.springframework.lang.Nullable</li> + <li>android.support.annotations.Nullable</li> + </ul> + <p> + You can supply a comma separated list of classes that are custom Nullable Annotations if you desire, by using the + system property -Dfb-contrib.ai.annotations="com.acme.Foo,com.acme.Boo" when run. + ]]> + </Details> + </BugPattern> + + <BugPattern type="MUP_CONTAINSKEY_BEFORE_GET"> + <ShortDescription>Method check a map with containsKey(), before using get()</ShortDescription> + <LongDescription>Method {1} checks a map with containsKey(), before using get()</LongDescription> + <Details> + <![CDATA[ + <p>This method checks for the presense of a key in a map using containsKey(), before attempting to fetch the value of the key + using get(). This equates to doing two map lookups in a row. It is much simpler to just fetch the value with get, and checking + for non null instead.</p> + <p>As an example, instead of using + <code> + <pre> + Map<String, String> myMap = getSomeMap(); + if (myMap.containsKey("foo")) { + String value = myMap.get("foo"); + .... + } + </pre> + </code> + convert this to + <code> + <pre> + Map<String, String> myMap = getSomeMap(); + String value = myMap.get("foo"); + if (value != null) { + .... + } + </pre> + </code> + </p> + <p>The only caveat to this is that if you use a null value in a map to represent a third state for the key, then in this case + using containsKey is 'correct'. This means if an entry found in the map with a null value is taken differently then no entry + at all. However this is a very subtle programming paradigm, and likely to cause problems. If you wish to mark an entry as + not being present, it is better to use a named 'sentinel' value to denote this, so instead of: + <code> + <pre> + Map<String, String> myMap = getSomeMap(); + if (myMap.containsKey("foo")) { + String value = myMap.get("foo"); + .... + } + </pre> + </code> + convert this to + <code> + <pre> + Map<String, String> myMap = getSomeMap(); + String value = myMap.get("foo"); + if (NOT_FOUND.equals(value)) { + .... + } + where NOT_FOUND is some constant that denotes this special status. Of course you will need to find a special + sentinel value for each type you are using that isn't possible to have normally. + </p> + </pre> + </code> + ]]> + </Details> + </BugPattern> <!-- BugCode --> @@ -6089,4 +6236,6 @@ <BugCode abbrev="OI">Optional Issues</BugCode> <BugCode abbrev="UAC">Unnecessary Api Conversion</BugCode> <BugCode abbrev="RFI">Reflection Issues</BugCode> + <BugCode abbrev="AI">Annotation Issues</BugCode> + <BugCode abbrev="MUP">Map Usage Issues</BugCode> </MessageCollection> Modified: trunk/fb-contrib/etc/samples.fbp =================================================================== --- trunk/fb-contrib/etc/samples.fbp 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/etc/samples.fbp 2017-12-26 23:49:41 UTC (rev 1829) @@ -1,30 +1,31 @@ <Project projectName="sample"> - <Jar>../target/classes/samples</Jar> - <AuxClasspathEntry>../lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-codec-1.10.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-collections-3.2.2.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-lang3-3.4.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/guava-19.0.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/httpclient-4.5.2.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/httpclient-cache-4.5.2.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/httpcore-4.4.5.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/junit-4.12.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/log4j-1.2.17.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/slf4j-api-1.7.21.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/spring-beans-4.3.3.RELEASE.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/spring-context-4.3.3.RELEASE.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/spring-tx-4.3.3.RELEASE.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/threetenbp-1.3.2.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/jena-shaded-guava-3.1.0.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-io-2.4.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/testng-6.9.10.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.ws.rs-api-2.0.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/jersey-media-multipart-2.25.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/mockito-core-2.8.47.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/hamcrest-core-1.3.jar</AuxClasspathEntry> - <SrcDir>../src/samples/java</SrcDir> + <Jar>./../target/classes/samples</Jar> + <AuxClasspathEntry>./../lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/commons-codec-1.10.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/commons-collections-3.2.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/commons-lang3-3.4.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/guava-19.0.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/httpclient-4.5.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/httpclient-cache-4.5.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/httpcore-4.4.5.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/junit-4.12.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/log4j-1.2.17.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/slf4j-api-1.7.21.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/spring-beans-4.3.3.RELEASE.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/spring-context-4.3.3.RELEASE.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/spring-tx-4.3.3.RELEASE.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/threetenbp-1.3.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/jena-shaded-guava-3.1.0.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/commons-io-2.4.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/testng-6.9.10.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/javax.ws.rs-api-2.0.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/jersey-media-multipart-2.25.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/mockito-core-2.8.47.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/hamcrest-core-1.3.jar</AuxClasspathEntry> + <AuxClasspathEntry>../lib/log4j-api-2.9.1.jar</AuxClasspathEntry> + <SrcDir>./../src/samples/java</SrcDir> </Project> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/htdocs/index.shtml 2017-12-26 23:49:41 UTC (rev 1829) @@ -77,19 +77,28 @@ </div> <hr/> - <img id="git_image" src="flip1.gif" onClick="toggleBlock('git', 'git_image');" align="top"/> + <img id="git_image" src="flip2.gif" onClick="toggleBlock('git', 'git_image');" align="top"/> Detectors added in git<br/> - <div id="git" style="display:none;"> + <div id="git" style="display:block;"> <ul> <li><b>[UTWR] Use Try With Resources</b><br/> Looks for try/finally blocks that manage resources, without using try-with-resources. </li> + <li><b>[RFI} Reflection Issues</b><br/> + Looks for issues around reflection, especially in light of java 9 and 10. + </li> + <li><b>[AI] Annotation Issues</b><br/> + Looks for issues around use of common annotations + </li> + <li><b>[MUP] Map Usage Issues</b><br/> + Looks for odd usage patterns when using Maps + </li> </ul> </div> <hr/> - <img id="v7_0_0_image" src="flip2.gif" onClick="toggleBlock('v7_0_0', 'v7_0_0_image');" align="top"/> + <img id="v7_0_0_image" src="flip1.gif" onClick="toggleBlock('v7_0_0', 'v7_0_0_image');" align="top"/> Detectors added in v7.0.0<br/> - <div id="v7_0_0" style="display:block;"> + <div id="v7_0_0" style="display:none;"> <ul> <li><b>[SSCU] Suspicious Shaded Class Use</b><br/> Looks for use of classes that have been shaded into 3rdparty jars, rather than using the Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/pom.xml 2017-12-26 23:49:41 UTC (rev 1829) @@ -6,7 +6,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>7.0.5</version> + <version>7.1.0-SNAPSHOT</version> <!-- TODO: Delete this and replace with enforcer plugin. This is for maven plugins only! Latest maven will through warnings. --> <prerequisites> @@ -303,6 +303,12 @@ <version>1.3</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + <version>2.9.1</version> + <scope>test</scope> + </dependency> </dependencies> <build> Modified: trunk/fb-contrib/samples.xml =================================================================== --- trunk/fb-contrib/samples.xml 2017-09-24 01:18:06 UTC (rev 1828) +++ trunk/fb-contrib/samples.xml 2017-12-26 23:49:41 UTC (rev 1829) @@ -1,14 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> -<BugCollection version="3.0.1" sequence="0" timestamp="1491777371371" analysisTimestamp="1491777371509" release=""> +<BugCollection version="3.0.1" sequence="0" timestamp="1513438250950" analysisTimestamp="1513438251053" release=""> <Project projectName="Samples"> <Jar>/home/dave/dev/fb-contrib/target/classes/samples</Jar> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/junit-4.12.jar</AuxClasspathEntry> + <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/jsr305-3.0.2.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/testng-6.9.10.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/log4j-1.2.17.jar</AuxClasspathEntry> + <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/log4j-api-2.9.1.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/commons-lang3-3.4.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/commons-io-2.4.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry> @@ -23,7 +25,8 @@ <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/spring-context-4.3.3.RELEASE.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/spring-tx-4.3.3.RELEASE.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/javax.persistence-2.1.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/mockito-all-2.0.2-beta.jar</AuxClasspathEntry> + <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/mockito-core-2.8.47.jar</AuxClasspathEntry> + <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/hamcrest-core-1.3.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/jena-shaded-guava-3.1.0.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/javax.ws.rs-api-2.0.1.jar</AuxClasspathEntry> <AuxClasspathEntry>/home/dave/dev/fb-contrib/lib/jersey-media-multipart-2.25.1.jar</AuxClasspathEntry> @@ -160,6 +163,23 @@ <Message>At ACEM_Sample.java:[line 8]</Message> </SourceLine> </BugInstance> + <BugInstance type="IOI_USE_OF_FILE_STREAM_CONSTRUCTORS" priority="2" rank="18" abbrev="IOI" category="PERFORMANCE" instanceHash="3974c72a8ede5202c739fa557f4d32d6" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method uses a FileInputStream or FileOutputStream constructor</ShortMessage> + <LongMessage>Method ex.AFBR_Sample.test5() uses a FileInputStream or FileOutputStream constructor</LongMessage> + <Class classname="ex.AFBR_Sample" primary="true"> + <SourceLine classname="ex.AFBR_Sample" start="7" end="56" sourcefile="AFBR_Sample.java" sourcepath="ex/AFBR_Sample.java"> + <Message>At AFBR_Sample.java:[lines 7-56]</Message> + </SourceLine> + <Message>In class ex.AFBR_Sample</Message> + </Class> + <Method classname="ex.AFBR_Sample" name="test5" signature="()I" isStatic="false" primary="true"> + <SourceLine classname="ex.AFBR_Sample" start="46" end="56" startBytecode="0" endBytecode="244" sourcefile="AFBR_Sample.java" sourcepath="ex/AFBR_Sample.java"/> + <Message>In method ex.AFBR_Sample.test5()</Message> + </Method> + <SourceLine classname="ex.AFBR_Sample" primary="true" start="48" end="48" startBytecode="8" endBytecode="8" sourcefile="AFBR_Sample.java" sourcepath="ex/AFBR_Sample.java"> + <Message>At AFBR_Sample.java:[line 48]</Message> + </SourceLine> + </BugInstance> <BugInstance type="UTWR_USE_TRY_WITH_RESOURCES" priority="2" rank="17" abbrev="UTWR" category="STYLE" instanceHash="ec7e6902ec57bf55eb9d354038d69126" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> <ShortMessage>Method manually handles closing an auto-closeable resource</ShortMessage> <LongMessage>Method ex.AFBR_Sample.test5() manually handles closing an auto-closeable resource</LongMessage> @@ -503,6 +523,94 @@ <Message>At AIOB_Sample.java:[line 28]</Message> </SourceLine> </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="8997fff7d130e44fa3336877e73ec213" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.AI_Sample.fpAnon() that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.AI_Sample" primary="true"> + <SourceLine classname="ex.AI_Sample" start="7" end="47" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"> + <Message>At AI_Sample.java:[lines 7-47]</Message> + </SourceLine> + <Message>In class ex.AI_Sample</Message> + </Class> + <Method classname="ex.AI_Sample" name="fpAnon" signature="()Ljava/lang/String;" isStatic="false" primary="true"> + <SourceLine classname="ex.AI_Sample" start="42" end="42" startBytecode="0" endBytecode="61" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"/> + <Message>In method ex.AI_Sample.fpAnon()</Message> + </Method> + <SourceLine classname="ex.AI_Sample" start="42" end="42" startBytecode="0" endBytecode="61" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java" synthetic="true"> + <Message>At AI_Sample.java:[line 42]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="5137a654788eabfd87288e02e5d97d22" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.AI_Sample.getFoo2() that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.AI_Sample" primary="true"> + <SourceLine classname="ex.AI_Sample" start="7" end="47" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"> + <Message>At AI_Sample.java:[lines 7-47]</Message> + </SourceLine> + <Message>In class ex.AI_Sample</Message> + </Class> + <Method classname="ex.AI_Sample" name="getFoo2" signature="()Ljava/lang/String;" isStatic="false" primary="true"> + <SourceLine classname="ex.AI_Sample" start="15" end="15" startBytecode="0" endBytecode="46" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"/> + <Message>In method ex.AI_Sample.getFoo2()</Message> + </Method> + <SourceLine classname="ex.AI_Sample" start="15" end="15" startBytecode="0" endBytecode="46" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java" synthetic="true"> + <Message>At AI_Sample.java:[line 15]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="a2329dbcb997792e9c8452d56dd06c8f" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.AI_Sample.nullBecauseOfConditional() that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.AI_Sample" primary="true"> + <SourceLine classname="ex.AI_Sample" start="7" end="47" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"> + <Message>At AI_Sample.java:[lines 7-47]</Message> + </SourceLine> + <Message>In class ex.AI_Sample</Message> + </Class> + <Method classname="ex.AI_Sample" name="nullBecauseOfConditional" signature="()Ljava/lang/String;" isStatic="false" primary="true"> + <SourceLine classname="ex.AI_Sample" start="23" end="28" startBytecode="0" endBytecode="91" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"/> + <Message>In method ex.AI_Sample.nullBecauseOfConditional()</Message> + </Method> + <SourceLine classname="ex.AI_Sample" start="23" end="28" startBytecode="0" endBytecode="91" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java" synthetic="true"> + <Message>At AI_Sample.java:[lines 23-28]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" priority="2" rank="18" abbrev="RCN" category="STYLE" instanceHash="7be70d2b36f5fc44c80e4cfd33db7d33" instanceOccurrenceNum="0" instanceOccurrenceMax="0" cweid="476"> + <ShortMessage>Redundant nullcheck of value known to be non-null</ShortMessage> + <LongMessage>Redundant nullcheck of f, which is known to be non-null in ex.AI_Sample.nullBecauseOfConditional()</LongMessage> + <Class classname="ex.AI_Sample" primary="true"> + <SourceLine classname="ex.AI_Sample" start="7" end="47" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"> + <Message>At AI_Sample.java:[lines 7-47]</Message> + </SourceLine> + <Message>In class ex.AI_Sample</Message> + </Class> + <Method classname="ex.AI_Sample" name="nullBecauseOfConditional" signature="()Ljava/lang/String;" isStatic="false" primary="true"> + <SourceLine classname="ex.AI_Sample" start="23" end="28" startBytecode="0" endBytecode="91" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"/> + <Message>In method ex.AI_Sample.nullBecauseOfConditional()</Message> + </Method> + <LocalVariable name="f" register="1" pc="5" role="LOCAL_VARIABLE_VALUE_OF"> + <Message>Value loaded from f</Message> + </LocalVariable> + <Method classname="ex.AI_Sample" name="getFoo3" signature="()Ljava/lang/String;" isStatic="false" role="METHOD_RETURN_VALUE_OF"> + <SourceLine classname="ex.AI_Sample" start="19" end="19" startBytecode="0" endBytecode="44" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"/> + <Message>Return value of ex.AI_Sample.getFoo3() of type String</Message> + </Method> + <SourceLine classname="ex.AI_Sample" primary="true" start="24" end="24" startBytecode="6" endBytecode="6" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java" role="SOURCE_REDUNDANT_NULL_CHECK"> + <Message>Redundant null check at AI_Sample.java:[line 24]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="SIC_INNER_SHOULD_BE_STATIC_ANON" priority="3" rank="20" abbrev="SIC" category="PERFORMANCE" instanceHash="ff70b4f8148a02742ee4b8cde54a4050" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Could be refactored into a named static inner class</ShortMessage> + <LongMessage>The class ex.AI_Sample$1 could be refactored into a named _static_ inner class</LongMessage> + <Class classname="ex.AI_Sample$1" primary="true"> + <SourceLine classname="ex.AI_Sample$1" start="1" end="45" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java"> + <Message>At AI_Sample.java:[lines 1-45]</Message> + </SourceLine> + <Message>In class ex.AI_Sample$1</Message> + </Class> + <SourceLine classname="ex.AI_Sample$1" start="1" end="45" sourcefile="AI_Sample.java" sourcepath="ex/AI_Sample.java" synthetic="true"> + <Message>At AI_Sample.java:[lines 1-45]</Message> + </SourceLine> + </BugInstance> <BugInstance type="AOM_ABSTRACT_OVERRIDDEN_METHOD" priority="2" rank="7" abbrev="AOM" category="CORRECTNESS" instanceHash="6741663e6374c0c0b6968eeb59450e3b" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> <ShortMessage>Abstract method overrides a concrete implementation</ShortMessage> <LongMessage>Abstract method ex.AOM_Sample.test1() overrides a concrete implementation</LongMessage> @@ -642,6 +750,93 @@ <Message>At AWCBR_Sample.java:[lines 8-9]</Message> </SourceLine> </BugInstance> + <BugInstance type="FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY" priority="2" rank="9" abbrev="FCCD" category="CORRECTNESS" instanceHash="4897e60fb3065f5dbd581a772aa46136" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Class has a circular dependency with other classes</ShortMessage> + <LongMessage>Class ex.Annot has a circular dependency with other classes</LongMessage> + <Class classname="ex.Annot" primary="true"> + <SourceLine classname="ex.Annot" start="119" end="119" sourcefile="FCCD_Sample.java" sourcepath="ex/FCCD_Sample.java"> + <Message>At FCCD_Sample.java:[line 119]</Message> + </SourceLine> + <Message>In class ex.Annot</Message> + </Class> + <Class classname="ex.ChildAnnot"> + <SourceLine classname="ex.ChildAnnot" start="122" end="122" sourcefile="FCCD_Sample.java" sourcepath="ex/FCCD_Sample.java"> + <Message>At FCCD_Sample.java:[line 122]</Message> + </SourceLine> + <Message>In class ex.ChildAnnot</Message> + </Class> + <SourceLine classname="ex.Annot" start="119" end="119" sourcefile="FCCD_Sample.java" sourcepath="ex/FCCD_Sample.java" synthetic="true"> + <Message>At FCCD_Sample.java:[line 119]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="fa23afba710182705db6423aea37dd8a" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.BAS_Sample.getList() that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.BAS_Sample" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="15" end="248" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"> + <Message>At BAS_Sample.java:[lines 15-248]</Message> + </SourceLine> + <Message>In class ex.BAS_Sample</Message> + </Class> + <Method classname="ex.BAS_Sample" name="getList" signature="()Ljava/util/List;" isStatic="false" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="70" end="70" startBytecode="0" endBytecode="43" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"/> + <Message>In method ex.BAS_Sample.getList()</Message> + </Method> + <SourceLine classname="ex.BAS_Sample" start="70" end="70" startBytecode="0" endBytecode="43" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java" synthetic="true"> + <Message>At BAS_Sample.java:[line 70]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="92e57e61cc45518deac85e60646b751a" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.BAS_Sample.testFPRefNull(boolean) that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.BAS_Sample" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="15" end="248" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"> + <Message>At BAS_Sample.java:[lines 15-248]</Message> + </SourceLine> + <Message>In class ex.BAS_Sample</Message> + </Class> + <Method classname="ex.BAS_Sample" name="testFPRefNull" signature="(Z)Ljava/lang/Long;" isStatic="false" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="154" end="161" startBytecode="0" endBytecode="109" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"/> + <Message>In method ex.BAS_Sample.testFPRefNull(boolean)</Message> + </Method> + <SourceLine classname="ex.BAS_Sample" start="154" end="161" startBytecode="0" endBytecode="109" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java" synthetic="true"> + <Message>At BAS_Sample.java:[lines 154-161]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="1e3e5af97f920b2e8dd86b8b9786b026" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.BAS_Sample.testFPSynchronized(String, String) that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.BAS_Sample" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="15" end="248" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"> + <Message>At BAS_Sample.java:[lines 15-248]</Message> + </SourceLine> + <Message>In class ex.BAS_Sample</Message> + </Class> + <Method classname="ex.BAS_Sample" name="testFPSynchronized" signature="(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;" isStatic="false" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="198" end="207" startBytecode="0" endBytecode="223" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"/> + <Message>In method ex.BAS_Sample.testFPSynchronized(String, String)</Message> + </Method> + <SourceLine classname="ex.BAS_Sample" start="198" end="207" startBytecode="0" endBytecode="223" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java" synthetic="true"> + <Message>At BAS_Sample.java:[lines 198-207]</Message> + </SourceLine> + </BugInstance> + <BugInstance type="AI_ANNOTATION_ISSUES_NEEDS_NULLABLE" priority="3" rank="11" abbrev="AI" category="CORRECTNESS" instanceHash="244bf80ed6ef603c094abf2d69311ef4" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> + <ShortMessage>Method that can return null, is missing a @Nullable annotation</ShortMessage> + <LongMessage>Method ex.BAS_Sample.testSwitch(int) that can return null, is missing a @Nullable annotation</LongMessage> + <Class classname="ex.BAS_Sample" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="15" end="248" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"> + <Message>At BAS_Sample.java:[lines 15-248]</Message> + </SourceLine> + <Message>In class ex.BAS_Sample</Message> + </Class> + <Method classname="ex.BAS_Sample" name="testSwitch" signature="(I)Ljava/lang/String;" isStatic="false" primary="true"> + <SourceLine classname="ex.BAS_Sample" start="74" end="94" startBytecode="0" endBytecode="170" sourcefile="BAS_Sample.java" sourcepath="ex/BAS_Sample.java"/> + <Message>In method ex.BAS_Sample.testSwitch(int)</Message> + </Method> + <SourceLine classname="ex.BAS_Sample" start="74" end="94" startBytecode="0" endBytecode="170" sou... [truncated message content] |