[Fb-contrib-commit] SF.net SVN: fb-contrib:[1789] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2016-01-25 22:40:05
|
Revision: 1789 http://sourceforge.net/p/fb-contrib/code/1789 Author: dbrosius Date: 2016-01-25 22:39:59 +0000 (Mon, 25 Jan 2016) Log Message: ----------- sync from github Modified Paths: -------------- trunk/fb-contrib/.classpath trunk/fb-contrib/build.xml trunk/fb-contrib/etc/bugrank.txt trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/htdocs/index.shtml trunk/fb-contrib/htdocs/repository.html trunk/fb-contrib/license.txt trunk/fb-contrib/plugin.xml trunk/fb-contrib/pom.xml trunk/fb-contrib/samples/BED_Sample.java trunk/fb-contrib/samples/IMC_Sample.java trunk/fb-contrib/samples/PRMC_Sample.java trunk/fb-contrib/samples/SPP_Sample.java trunk/fb-contrib/samples/UCPM_Sample.java trunk/fb-contrib/samples/UTAO_Sample.java trunk/fb-contrib/samples/samples.fbp trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/StatisticsKey.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/Debug.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/debug/OCSDebugger.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CharsetIssues.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CircularDependencies.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CloneUsability.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CollectionNamingConfusion.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsEqualsBuilderToEquals.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsHashcodeBuilderToHashcode.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CommonsStringBuilderToString.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CompareClassNameEquals.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflatingResourcesAndFiles.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConflictingTimeUnits.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContainsBasedConditional.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeprecatedTypesafeEnumPattern.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HangingExecutors.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/HttpClientProblems.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ImproperPropertiesUse.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JAXRSIssues.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JPAIssues.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LingeringGraphicsObjects.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalTypeDetector.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MissingMethodsDetector.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ModifyingUnmodifiableCollection.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MoreDumbMethods.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonFunctionalField.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonProductiveMethodCall.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyPermissiveMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorMansEnum.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ReflectionOnObjectMethods.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StackedTryBlocks.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticArrayCreatedInMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StringifiedTypes.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuboptimalExpressionOrder.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousLoopSearch.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TailRecursion.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/TristateBooleanPattern.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnboundMethodTemplateParameter.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Unjitable.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnusedParameter.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WeakExceptionMessaging.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/AttributesUtils.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/BugType.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CodeByteUtils.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/CollectionUtils.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/FQMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/OpcodeUtils.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/PublicAPI.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/QMethod.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/TernaryPatcher.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/ToString.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/UnmodifiableSet.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Values.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/XClassUtils.java trunk/fb-contrib/yank.xls Added Paths: ----------- trunk/fb-contrib/samples/IOI_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/IOIssues.java Modified: trunk/fb-contrib/.classpath =================================================================== --- trunk/fb-contrib/.classpath 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/.classpath 2016-01-25 22:39:59 UTC (rev 1789) @@ -16,7 +16,7 @@ <classpathentry kind="lib" path="lib/httpcore-4.3.2.jar"/> <classpathentry kind="lib" path="lib/httpclient-4.3.4.jar"/> <classpathentry kind="lib" path="lib/annotations-3.0.0.jar"/> - <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar"/> + <classpathentry kind="lib" path="lib/asm-debug-all-5.0.2.jar" sourcepath="/home/dave/.m2/repository/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2-sources.jar"/> <classpathentry kind="lib" path="lib/bcel-findbugs-6.0.jar" sourcepath="lib/sources/bcel-findbugs-6.0-sources.jar"> <attributes> <attribute name="javadoc_location" value="http://commons.apache.org/proper/commons-bcel/apidocs/"/> @@ -29,5 +29,7 @@ <classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar" sourcepath="lib/sources/jsr311-api-1.1.1-sources.jar"/> <classpathentry kind="lib" path="lib/spring-tx-4.2.3.RELEASE.jar"/> <classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar"/> + <classpathentry kind="lib" path="lib/commons-io-1.3.2.jar" sourcepath="lib/sources/commons-io-1.3.2-sources.jar"/> + <classpathentry kind="lib" path="lib/mockito-all-2.0.2-beta.jar"/> <classpathentry kind="output" path="target/classes/main"/> </classpath> Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/build.xml 2016-01-25 22:39:59 UTC (rev 1789) @@ -28,7 +28,7 @@ <property name="javac.deprecation" value="on" /> <property name="javac.debug" value="on" /> - <property name="fb-contrib.version" value="6.4.2" /> + <property name="fb-contrib.version" value="6.6.0" /> <property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" /> @@ -42,6 +42,7 @@ <get src="http://repo1.maven.org/maven2/com/mebigfatguy/yank/yank/1.4.0/yank-1.4.0.jar" dest="${user.home}/.ant/lib"/> <get src="https://bitbucket.org/kjlubick/bugrankcheckstyle/downloads/bug-rank-check-style-1.0.0.jar" dest="${user.home}/.ant/lib"/> <get src="http://repo1.maven.org/maven2/com/mebigfatguy/vcsversion/vcsversion/0.4.0/vcsversion-0.4.0.jar" dest="${user.home}/.ant/lib"/> + <get src="http://repo1.maven.org/maven2/com/mebigfatguy/fb-delta/fb-delta/0.2.0/fb-delta-0.2.0.jar" dest="${user.home}/.ant/lib" ignoreerrors="true"/> </target> <target name="yank" xmlns:yank="antlib:com.mebigfatguy.yank" unless="no.yank"> @@ -55,7 +56,8 @@ <target name="info"> <echo message="fb-contrib - a findbugs plugin"/> <echo message=""/> - <echo message=" This project requires three jars to build fb-contrib: yank, bug-rank-check-style and vcsversion" /> + <echo message=" This project requires three jars to build fb-contrib: yank, bug-rank-check-style, vcsversion and" /> + <echo message=" and optionally fb-delta, to generate delta's of bug reports"/> <echo message=""/> <echo message=" This project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/> <echo message=" download yank.jar and place in ~/.ant/lib directory"/> @@ -70,6 +72,12 @@ <echo message=" and can be downloaded and placed in ~/.ant/lib as well"/> <echo message=" http://search.maven.org/#search%7Cga%7C1%7Cvcsversion"/> <echo message="===="/> + <echo message=" If you want to generate delta reports between two sample.xml runs, this project also uses fb-delta to do"/> + <echo message=" delta-ing between two samples.xml files, to report what has been 'fixed' and what is 'new'"/> + <echo message=" and can be downloaded and placed in ~/.ant/lib as well"/> + <echo message=" http://search.maven.org/#search%7Cga%7C1%7Cfb-delta"/> + <echo message="===="/> + <echo message=" This task can be automated by running ant infra_jars"/> </target> @@ -93,9 +101,10 @@ <pathelement location="${lib.dir}/javax.servlet-api-${javax.servlet-api.version}.jar" /> <pathelement location="${lib.dir}/log4j-${log4j.version}.jar" /> <pathelement location="${lib.dir}/commons-lang3-${commons-lang3.version}.jar" /> - <pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" /> - <pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" /> - <pathelement location="${lib.dir}/guava-${guava.version}.jar" /> + <pathelement location="${lib.dir}/commons-io-${commons-io.version}.jar" /> + <pathelement location="${lib.dir}/backport-util-concurrent-${backport-util-concurrent.version}.jar" /> + <pathelement location="${lib.dir}/slf4j-api-${slf4j-api.version}.jar" /> + <pathelement location="${lib.dir}/guava-${guava.version}.jar" /> <pathelement location="${lib.dir}/httpclient-cache-${httpclient-cache.version}.jar" /> <pathelement location="${lib.dir}/httpcore-${httpcore.version}.jar" /> <pathelement location="${lib.dir}/httpclient-${httpclient.version}.jar" /> @@ -103,6 +112,7 @@ <pathelement location="${lib.dir}/jsr311-api-${jsr311-api.version}.jar" /> <pathelement location="${lib.dir}/spring-tx-${spring-tx.version}.jar" /> <pathelement location="${lib.dir}/javax.persistence-${javax.persistence.version}.jar" /> + <pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" /> </path> </target> @@ -111,7 +121,7 @@ <xmlvalidate lenient="false" failonerror="yes"> <attribute name="http://apache.org/xml/features/validation/schema" value="true" /> <attribute name="http://xml.org/sax/features/namespaces" value="true" /> - <fileset dir="${etc.dir}" includes="*.xml" /> + <fileset dir="${etc.dir}" includes="*.xml" excludes="findbugs-exclude.xml"/> </xmlvalidate> <bug-rank-check-style findbugsxml="etc/findbugs.xml" failOnMissingDetector="false" /> </target> @@ -195,7 +205,7 @@ <target name="javadoc" depends="-init" description="build the javadoc for the project"> <javadoc packagenames="com.mebigfatguy.*" sourcepath="${src.dir}" classpathref="fb-contrib.classpath" destdir="${javadoc.dir}" windowtitle="fb-contrib api"> <doctitle><![CDATA[<h1>fb-contrib javadoc</h1>]]></doctitle> - <bottom><![CDATA[<i>Copyright © 2005-2015 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom> + <bottom><![CDATA[<i>Copyright © 2005-2016 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom> </javadoc> </target> @@ -210,6 +220,21 @@ </fileset> </copy> </target> + + <target name="sample_delta" depends="build" xmlns:fbdelta="antlib:com.mebigfatguy.fbdelta" description="compares this runs reported bugs on the sample classes set, against the stored report"> + <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${lib.dir}/findbugs-ant-${findbugs-ant.version}.jar"/> + <findbugs reportlevel="low" home="${findbugs.dir}" auxClassPathRef="fb-contrib.samples.classpath" output="xml:withMessages" jvmargs="-ea -Xmx800m" projectName="Samples" outputFile="${target.dir}/samples.xml"> + <class location="${samples.classes.dir}" /> + </findbugs> + + <fbdelta:fbdelta baseReport="${basedir}/samples.xml" updateReport="${target.dir}/samples.xml" outputReport="${target.dir}/samples_delta.xml" changed="delta"/> + <antcall target="report"/> + </target> + + <target name="report" if="${delta}"> + <loadfile property="diff" srcFile="${target.dir}/samples_delta.xml"/> + <echo>${diff}</echo> + </target> <target name="release" depends="build, srczip, html, javadoc" description="prepares everything for a release" /> Modified: trunk/fb-contrib/etc/bugrank.txt =================================================================== --- trunk/fb-contrib/etc/bugrank.txt 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/etc/bugrank.txt 2016-01-25 22:39:59 UTC (rev 1789) @@ -60,10 +60,13 @@ +0 BugPattern IICU_INCORRECT_INTERNAL_CLASS_USE +0 BugPattern IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING +0 BugPattern IKNC_INCONSISTENT_HTTP_PARAM_CASING ++1 BugPattern IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES +2 BugPattern IMC_IMMATURE_CLASS_NO_EQUALS +2 BugPattern IMC_IMMATURE_CLASS_NO_HASHCODE +0 BugPattern IMC_IMMATURE_CLASS_NO_PACKAGE +2 BugPattern IMC_IMMATURE_CLASS_NO_TOSTRING ++0 BugPattern IOI_COPY_WITH_READER ++0 BugPattern IOI_DOUBLE_BUFFER_COPY +0 BugPattern IPU_IMPROPER_PROPERTIES_USE +0 BugPattern IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY +0 BugPattern ISB_EMPTY_STRING_APPENDING Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/etc/findbugs.xml 2016-01-25 22:39:59 UTC (rev 1789) @@ -28,8 +28,6 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedSynchronizedBlock" speed="fast" reports="BSB_BLOATED_SYNCHRONIZED_BLOCK" hidden="true" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" /> COMMENT OUT FOR RELEASE --> @@ -209,7 +207,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" - reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" /> + reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE,MDM_LOCK_ISLOCKED,MDM_SIGNAL_NOT_SIGNALALL" /> <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods" speed="fast" reports="ROOM_REFLECTION_ON_OBJECT_METHODS" /> @@ -247,7 +245,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonProductiveMethodCall" speed="fast" reports="NPMC_NON_PRODUCTIVE_METHOD_CALL" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument" speed="fast" reports="ICA_INVALID_CONSTANT_ARRAY" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.InvalidConstantArgument" speed="fast" reports="ICA_INVALID_CONSTANT_ARGUMENT" /> <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> @@ -287,18 +285,21 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes" speed="fast" reports="STT_STRING_PARSING_A_FIELD,STT_TOSTRING_STORED_IN_FIELD" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING,IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES" /> <Detector class="com.mebigfatguy.fbcontrib.detect.JAXRSIssues" speed="fast" reports="JXI_GET_ENDPOINT_CONSUMES_CONTENT,JXI_INVALID_CONTEXT_PARAMETER_TYPE,JXI_PARM_PARAM_NOT_FOUND_IN_PATH,JXI_UNDEFINED_PARAMETER_SOURCE_IN_ENDPOINT" /> - - <!-- COMMENT OUT FOR POINT RELEASE + <Detector class="com.mebigfatguy.fbcontrib.detect.StackedTryBlocks" speed="fast" reports="STB_STACKED_TRY_BLOCKS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.JPAIssues" speed="fast" reports="JPAI_TRANSACTION_ON_NON_PUBLIC_METHOD,JPAI_HC_EQUALS_ON_MANAGED_ENTITY,JPAI_NON_PROXIED_TRANSACTION_CALL,JPAI_INEFFICIENT_EAGER_FETCH,JPAI_IGNORED_MERGE_RESULT,JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING,JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING"/> <Detector class="com.mebigfatguy.fbcontrib.detect.SuboptimalExpressionOrder" speed="fast" reports="SEO_SUBOPTIMAL_EXPRESSION_ORDER"/> - COMMENT OUT FOR POINT RELEASE --> + <Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues" speed="fast" reports="IOI_DOUBLE_BUFFER_COPY,IOI_COPY_WITH_READER"/> + <!-- COMMENT OUT FOR POINT RELEASE --> + <!-- COMMENT OUT FOR POINT RELEASE --> + <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> @@ -539,6 +540,7 @@ <BugPattern abbrev="STT" type="STT_TOSTRING_STORED_IN_FIELD" category="STYLE" /> <BugPattern abbrev="SLS" type="SLS_SUSPICIOUS_LOOP_SEARCH" category="CORRECTNESS" /> <BugPattern abbrev="CRF" type="CRF_CONFLATING_RESOURCES_AND_FILES" category="CORRECTNESS" /> + <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES" category="STYLE" /> <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_EQUALS" category="STYLE" /> <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_HASHCODE" category="STYLE" /> <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_PACKAGE" category="STYLE" /> @@ -555,5 +557,7 @@ <BugPattern abbrev="JPAI" type="JPAI_NON_SPECIFIED_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/> <BugPattern abbrev="JPAI" type="JPAI_UNNECESSARY_TRANSACTION_EXCEPTION_HANDLING" category="CORRECTNESS" experimental="true"/> <BugPattern abbrev="SEO" type="SEO_SUBOPTIMAL_EXPRESSION_ORDER" category="PERFORMANCE" experimental="true"/> + <BugPattern abbrev="IOI" type="IOI_DOUBLE_BUFFER_COPY" category="PERFORMANCE" experimental="true"/> + <BugPattern abbrev="IOI" type="IOI_COPY_WITH_READER" category="PERFORMANCE" experimental="true"/> </FindbugsPlugin> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/etc/messages.xml 2016-01-25 22:39:59 UTC (rev 1789) @@ -1573,6 +1573,15 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.detect.IOIssues"> + <Details> + <![CDATA[ + <p>Looks for various issues around doing I/O with streams and reader/writers.</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger"> <Details></Details> @@ -5082,6 +5091,19 @@ </Details> </BugPattern> + <BugPattern type="IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES"> + <ShortDescription>Method uses IDE generated parameter names</ShortDescription> + <LongDescription>Method {1} uses IDE generated parameter names</LongDescription> + <Details> + <![CDATA[ + <p>This method appears to have been generated from an interface or super class using an IDE. + As such the IDE generated generic names (arg0, arg1, arg2) for parameters for this method, + and the author of this method did not change them to be meaningful. For better understandability + it is recommended that you name these parameters with regard to their function. + ]]> + </Details> + </BugPattern> + <BugPattern type="JXI_GET_ENDPOINT_CONSUMES_CONTENT"> <ShortDescription>JAX-RS Method implements a GET request but consumes input</ShortDescription> <LongDescription>JAX-RS Method {1} implements a GET request but consumes input</LongDescription> @@ -5236,7 +5258,7 @@ <LongDescription>Method {1} orders expressions in a conditional in a sub optimal way</LongDescription> <Details> <![CDATA[ - <p>This method builds a conditional for an if or while statement where the expressions contain both simple + <p>This method builds a conditional expression, for example, in an if or while statement where the expressions contain both simple local variable comparisons, as well as comparisons on method calls. The expression orders these so that the method calls come before the simple local variable call comparisons. This causes method calls to be executed in conditions when they do not need to be, and thus potentially causes a lot of code to be executed for nothing. By ordering the expressions so that @@ -5247,6 +5269,33 @@ ]]> </Details> </BugPattern> + + <BugPattern type="IOI_DOUBLE_BUFFER_COPY"> + <ShortDescription>Method passes a Buffered Stream/Reader/Writer to a already buffering copy method</ShortDescription> + <LongDescription>Method {1} passes a Buffered Stream/Reader/Writer to a already buffering copy method</LongDescription> + <Details> + <![CDATA[ + <p>This method copies data from input to output using streams or reader/writers using a well known copy method, from java.nio, commons-io, + springframework, guava or poi. These methods are efficient in that they copy these files using buffers. However this method is also + buffering the streams, causing a double buffering to occur. So data first goes to one buffer, then is copied too another buffer, before + making it to the destination (or vice-versa). This just causes the copy operation to be inefficent both from a time perspective, as well + as a memory allocation one. When using these copy methods, do not pass buffered streams/readers/writers. + ]]> + </Details> + </BugPattern> + + <BugPattern type="IOI_COPY_WITH_READER"> + <ShortDescription>Method performs bulk stream copy with a java.io.Reader derived input</ShortDescription> + <LongDescription>Method {1} performs bulk stream copy with a java.io.Reader derived input</LongDescription> + <Details> + <![CDATA[ + <p>This method copies data from a java.io.Reader derived class to an output class, using a bulk copy method + supplied by java.nio, commons-io, springframework, guava or poi. Since you are copying the entire stream, you + don't care about it's contents, and thus using a Reader is wasteful as a reader has to do the hard work of + converting byte data to characters, when there is no need to do this. Use stream based inputs for better performance.</p> + ]]> + </Details> + </BugPattern> <!-- BugCode --> @@ -5380,4 +5429,5 @@ <BugCode abbrev="JXI">JAX-RS Issues</BugCode> <BugCode abbrev="JPAI">JPA Issues</BugCode> <BugCode abbrev="SEO">Suboptimal Expression Order</BugCode> + <BugCode abbrev="IOI">IO Issues</BugCode> </MessageCollection> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/htdocs/index.shtml 2016-01-25 22:39:59 UTC (rev 1789) @@ -68,7 +68,7 @@ </li> </ul> </p> - <p style="font-weight: bold;">The latest version of fb-contrib is 6.4.2 available for download + <p style="font-weight: bold;">The latest version of fb-contrib is 6.6.0 available for download <a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p> <p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p> <p style="font-weight: bold;">Please note that active development for this project is now done on @@ -81,6 +81,13 @@ Detectors added in git<br/> <div id="git" style="display:none;"> <ul> + </ul> + </div> + <hr/> + <img id="git_image" src="flip2.gif" onClick="toggleBlock('v6_6_0', 'v6_6_0_image');" align="top"/> + Detectors added in v6.6.0<br/> + <div id="v6_6_0" style="display:block;"> + <ul> <li><b>[STB] Stacked Try Blocks</b><br/> Looks for two or more try catch blocks that are consecutive and catch the same kind of exception, and throw the same exception always. These blocks can @@ -97,12 +104,15 @@ called won't have side-effects that are desired. At present it only looks for simple sequences of 'and' based conditions. </li> + <li><b>[IOI] IO Issues</b><br/> + looks for various issues around input/output/streaming Library use. + </li> </ul> </div> <hr/> - <img id="v6_4_0_image" src="flip2.gif" onClick="toggleBlock('v6_4_0', 'v6_4_0_image');" align="top"/> + <img id="v6_4_0_image" src="flip1.gif" onClick="toggleBlock('v6_4_0', 'v6_4_0_image');" align="top"/> Detectors added in v6.4.0<br/> - <div id="v6_4_0" style="display:block;"> + <div id="v6_4_0" style="display:none;"> <ul> <li><b>[OPM] Overly Permissive Method</b><br/> Looks for methods that are declared more permissively than the code is using. For instance, declaring Modified: trunk/fb-contrib/htdocs/repository.html =================================================================== --- trunk/fb-contrib/htdocs/repository.html 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/htdocs/repository.html 2016-01-25 22:39:59 UTC (rev 1789) @@ -22,7 +22,7 @@ <table style="margin-left: 40px; background-color: #A0A0FF; padding: 20px; border-width: 1px; border-style: outset; border-color: #000000;"> <tr><td><b>GroupId:</b></td><td>com.mebigfatguy.fb-contrib</td></tr> <tr><td><b>ArtifactId:</b></td><td>fb-contrib</td></tr> - <tr><td><b>Version:</b></td><td>6.4.2</td></tr> + <tr><td><b>Version:</b></td><td>6.6.0</td></tr> </table> </div> Modified: trunk/fb-contrib/license.txt =================================================================== --- trunk/fb-contrib/license.txt 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/license.txt 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,8 +1,8 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -10,7 +10,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -112,7 +112,7 @@ former contains code derived from the library, whereas the latter must be combined with the library in order to run. - GNU LESSER GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -146,7 +146,7 @@ on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -432,7 +432,7 @@ of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -455,7 +455,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries @@ -485,7 +485,7 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. @@ -500,5 +500,3 @@ Ty Coon, President of Vice That's all there is to it! - - Modified: trunk/fb-contrib/plugin.xml =================================================================== --- trunk/fb-contrib/plugin.xml 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/plugin.xml 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> -<plugin> +<plugin id="eclipse_fb_plugin" name="eclipse_fb_plugin" version="1.0"> <extension point="edu.umd.cs.findbugs.plugin.eclipse.findbugsPlugins"> <findbugsPlugin fbPluginId="com.mebigfatguy.fbcontrib" libraryPath="."></findbugsPlugin> </extension> Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/pom.xml 2016-01-25 22:39:59 UTC (rev 1789) @@ -8,7 +8,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>6.4.2</version> + <version>6.6.0</version> <prerequisites> <maven>2.2.1</maven> @@ -219,6 +219,7 @@ <dependency><groupId>com.google.code.findbugs</groupId><artifactId>findbugs</artifactId><version>3.0.1</version></dependency> </dependencies> <configuration> + <excludeFilterFile>etc/findbugs-exclude.xml</excludeFilterFile> <effort>Max</effort> </configuration> <executions> Modified: trunk/fb-contrib/samples/BED_Sample.java =================================================================== --- trunk/fb-contrib/samples/BED_Sample.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/BED_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -66,6 +66,13 @@ } } + static void fpJustThrowIt(boolean permissible, String message) throws IOException { + IOException e = new FileNotFoundException(message); + if (!permissible) { + throw e; + } + } + public Object iAmCreatingAnObject() { return new Object() { private byte[] iHaveToThrowAnException() throws IOException { @@ -78,4 +85,24 @@ File.createTempFile("foo", "bar"); return "Test".getBytes("UTF-8"); } + + private void issue92a() throws InterruptedException { + System.out.println("test"); + } + + public static void issue92b() throws InterruptedException { + System.out.println("test"); + } + + public static Process fpInterrupted(String command) throws IOException, InterruptedException { + + Object sync = new Object(); + Process p = Runtime.getRuntime().exec(command); + synchronized (sync) { + sync.wait(); + } + + return p; + } + } Modified: trunk/fb-contrib/samples/IMC_Sample.java =================================================================== --- trunk/fb-contrib/samples/IMC_Sample.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/IMC_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -3,15 +3,20 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.junit.Assert; +import org.junit.Test; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Opcodes; + public class IMC_Sample { private String reportMe; - + @SuperSecret class FPClassIMC { private String dontReportMe; } - + class FPFieldIMC { @SuperSecret private String dontReportMe; @@ -21,15 +26,40 @@ class IMCFPHasAToString { @SuperSecret private String fooo; - + @Override public String toString() { return fooo; } } - @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE, ElementType.FIELD}) +@Target({ ElementType.TYPE, ElementType.FIELD }) @interface SuperSecret { } + +class FPIMCTestClass { + + private int data1, data2; + + @Test + public void doTest() { + Assert.assertEquals(data1, data2); + } +} + +class MyVisitor extends AnnotationVisitor { + + String name; + + public MyVisitor() { + super(Opcodes.ASM4); + } + + @Override + public AnnotationVisitor visitAnnotation(String arg0, String arg1) { + name = arg0; + + return super.visitAnnotation(arg0, arg1); + } +} Added: trunk/fb-contrib/samples/IOI_Sample.java =================================================================== --- trunk/fb-contrib/samples/IOI_Sample.java (rev 0) +++ trunk/fb-contrib/samples/IOI_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -0,0 +1,30 @@ +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; + +import org.apache.commons.io.IOUtils; + +public class IOI_Sample { + + public byte[] getIOIData(File f) throws IOException { + try (InputStream is = new BufferedInputStream(new FileInputStream(f)); ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + + IOUtils.copy(is, baos); + + return baos.toByteArray(); + } + } + + public byte[] getIOIReaderData(File f) throws IOException { + try (FileReader r = new FileReader(f); ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + + IOUtils.copy(r, baos); + + return baos.toByteArray(); + } + } +} Property changes on: trunk/fb-contrib/samples/IOI_Sample.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/fb-contrib/samples/PRMC_Sample.java =================================================================== --- trunk/fb-contrib/samples/PRMC_Sample.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/PRMC_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -127,6 +127,20 @@ System.out.println(Arrays.asList("foo")); System.out.println(Arrays.asList("bar")); } + + public void fpWithFinally() { + Object foo = new Object(); + try { + willThrow(); + System.err.println(foo.toString()); + } finally { + System.out.println(foo.toString()); + } + } + + void willThrow() { + throw new RuntimeException("kaboom!"); + } public void setValue(int i) { } Modified: trunk/fb-contrib/samples/SPP_Sample.java =================================================================== --- trunk/fb-contrib/samples/SPP_Sample.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/SPP_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -387,6 +387,14 @@ } return Math.random() > 0.5; } + + public boolean fpNullAndInstanceOfUnrelated(Throwable t, Object tag) { + if ((tag != null) && (t instanceof RuntimeException)) { + return true; + } + + return false; + } public void testToString() { SPP_Sample s = new SPP_Sample(); Modified: trunk/fb-contrib/samples/UCPM_Sample.java =================================================================== --- trunk/fb-contrib/samples/UCPM_Sample.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/UCPM_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -57,4 +57,13 @@ // no tag, starts with doesn't have a char equivalent return s.startsWith("*") ? s.substring(1) : s; } + + public String fpGitHubIssue95(int value) { + return "(" + value + ")"; + } + + public String okIssue95(int value) { + StringBuilder sb = new StringBuilder(); + return sb.append("(").append(value).append(")").toString(); + } } Modified: trunk/fb-contrib/samples/UTAO_Sample.java =================================================================== --- trunk/fb-contrib/samples/UTAO_Sample.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/UTAO_Sample.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,5 +1,7 @@ import org.junit.Assert; import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; import junit.framework.TestCase; @@ -9,8 +11,8 @@ public void testExactDoubles(double d1, double d2) { Assert.assertEquals(d1, d2); Assert.assertEquals("Still bad", d1, d2); - Assert.assertEquals(0.1, d1, d2); // Actually good - Assert.assertEquals("This one is ok", 0.1, d1, d2); // Still good + Assert.assertEquals(0.1, d1, d2); // Actually good + Assert.assertEquals("This one is ok", 0.1, d1, d2); // Still good } public void testTrue(boolean b) { @@ -20,11 +22,11 @@ public void testFalse(boolean b) { Assert.assertEquals("Wow this is bad", false, b); } - + public void testNull(String s) { Assert.assertEquals(null, s); } - + public void testNotNull(String s) { Assert.assertNotEquals(null, s); } @@ -46,23 +48,23 @@ Assert.assertTrue(s.equals(s2)); Assert.assertTrue(s.length() == s.length()); } - + public void testUseAssertNotEquals(String s, String s2) { Assert.assertFalse(s.equals(s2)); Assert.assertFalse(s.length() == s.length()); Assert.assertFalse("this is bad", s.equals(s2)); Assert.assertFalse("this is reallly bad", s.length() == s.length()); } - + public void testUseAssertNotEqualsCrossed(String s, String s2) { - Assert.assertTrue(!s.equals(s2)); + Assert.assertTrue(!s.equals(s2)); Assert.assertTrue(s.length() != s.length()); Assert.assertTrue("this is bad", !s.equals(s2)); Assert.assertTrue("this is reallly bad", s.length() != s.length()); } - + public void testUseAssertEqualsCrossed(String s, String s2) { - Assert.assertFalse(!s.equals(s2)); + Assert.assertFalse(!s.equals(s2)); Assert.assertFalse(s.length() != s.length()); Assert.assertFalse("this is bad", !s.equals(s2)); Assert.assertFalse("this is reallly bad", s.length() != s.length()); @@ -87,16 +89,16 @@ private void check(String a, String b) { Assert.assertEquals(a, b); } - - @Test(expected=RuntimeException.class) + + @Test(expected = RuntimeException.class) public void fpNoAssertsWithJUnitExpects() { throw new RuntimeException(); } - + @Test @SuppressWarnings("deprecation") public void usingOldClasses(int x) { - junit.framework.Assert.assertEquals(0, x); + junit.framework.Assert.assertEquals(0, x); } } @@ -114,20 +116,20 @@ public void testFalse(boolean b) { org.testng.Assert.assertEquals(b, false, "Wow this is bad"); } - + @org.testng.annotations.Test public void testExactDoubles(double d1, double d2) { - org.testng.Assert.assertEquals(d1, d2, "Don't ever do this!"); + org.testng.Assert.assertEquals(d1, d2, "Don't ever do this!"); } - + @org.testng.annotations.Test public void testNull(String s) { - org.testng.Assert.assertEquals(s, null); + org.testng.Assert.assertEquals(s, null); } - + @org.testng.annotations.Test public void testNotNull(String s) { - org.testng.Assert.assertNotEquals(s, null); + org.testng.Assert.assertNotEquals(s, null); } @org.testng.annotations.Test @@ -151,33 +153,53 @@ org.testng.Assert.assertTrue(s.equals(s2)); org.testng.Assert.assertTrue(s.length() == s.length()); } - + @org.testng.annotations.Test public void testUseAssertNotEquals(String s, String s2) { - org.testng.Assert.assertFalse(s.equals(s2)); - org.testng.Assert.assertFalse(s.length() == s.length()); + org.testng.Assert.assertFalse(s.equals(s2)); + org.testng.Assert.assertFalse(s.length() == s.length()); } - + @org.testng.annotations.Test public void testUseAssertNotEqualsCrossed(String s, String s2) { - org.testng.Assert.assertTrue(!s.equals(s2)); - org.testng.Assert.assertTrue(s.length() != s.length()); + org.testng.Assert.assertTrue(!s.equals(s2)); + org.testng.Assert.assertTrue(s.length() != s.length()); } - + @org.testng.annotations.Test public void testUseAssertEqualsCrossed(String s, String s2) { - org.testng.Assert.assertFalse(!s.equals(s2)); - org.testng.Assert.assertFalse(s.length() != s.length()); + org.testng.Assert.assertFalse(!s.equals(s2)); + org.testng.Assert.assertFalse(s.length() != s.length()); } @org.testng.annotations.Test public void test3ArgNP(float foo, int boo) { - org.testng.Assert.assertEquals(foo, 1.0f, 0.1); - org.testng.Assert.assertEquals(boo, 20, 0); + org.testng.Assert.assertEquals(foo, 1.0f, 0.1); + org.testng.Assert.assertEquals(boo, 20, 0); } - - @org.testng.annotations.Test(expectedExceptions=RuntimeException.class) + + @org.testng.annotations.Test(expectedExceptions = RuntimeException.class) public void fpNoAssertsWithNGExpects() { throw new RuntimeException(); } } + +class GitHubIssue94 { + private Object realObject; + + @Mock + private Object mockObject; + + @org.testng.annotations.BeforeMethod + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + + realObject = new Object(); + } + + @org.testng.annotations.Test + public void fpShouldNotEqualMockObject() { + org.testng.Assert.assertNotEquals(realObject, mockObject); + } + +} Modified: trunk/fb-contrib/samples/samples.fbp =================================================================== --- trunk/fb-contrib/samples/samples.fbp 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/samples/samples.fbp 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,20 +1,23 @@ <Project projectName="sample"> - <Jar>../target/classes/samples</Jar> - <AuxClasspathEntry>../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-collections-3.2.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/log4j-1.2.17.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-lang3-3.3.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/slf4j-api-1.7.7.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/guava-17.0.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/httpclient-4.3.4.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/httpclient-cache-4.3.4.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/httpcore-4.3.2.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/commons-codec-1.6.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/junit-4.12.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/testng-6.9.6.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/jsr311-api-1.1.1.jar</AuxClasspathEntry> - <AuxClasspathEntry>../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry> - <SrcDir>./.</SrcDir> + <Jar>././../target/classes/samples</Jar> + <AuxClasspathEntry>././../lib/backport-util-concurrent-3.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/commons-collections-3.2.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/javax.servlet-api-3.1.0.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/javax.servlet.jsp-api-2.3.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/log4j-1.2.17.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/commons-lang3-3.3.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/slf4j-api-1.7.7.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/guava-17.0.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/httpclient-4.3.4.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/httpclient-cache-4.3.4.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/httpcore-4.3.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/commons-codec-1.6.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/commons-io-1.3.2.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/junit-4.12.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/testng-6.9.6.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/jsr311-api-1.1.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>././../lib/javax.persistence-2.1.1.jar</AuxClasspathEntry> + <AuxClasspathEntry>./../lib/mockito-all-2.0.2-beta.jar</AuxClasspathEntry> + <AuxClasspathEntry>../lib/asm-debug-all-5.0.2.jar</AuxClasspathEntry> + <SrcDir>./././.</SrcDir> </Project> Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/FBContrib.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,6 +1,6 @@ /* * fb-contrib - Auxiliary detectors for Java programs - * Copyright (C) 2005-2015 Dave Brosius + * Copyright (C) 2005-2016 Dave Brosius * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,7 @@ public static void main(final String[] args) { JOptionPane.showMessageDialog(null, "To use fb-contrib, copy this jar file into your local FindBugs plugin directory, and use FindBugs as usual.\n\nfb-contrib is a trademark of MeBigFatGuy.com\nFindBugs is a trademark of the University of Maryland", - "fb-contrib: copyright 2005-2015", JOptionPane.INFORMATION_MESSAGE); + "fb-contrib: copyright 2005-2016", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectMethodsReturningImmutableCollections.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,6 +1,6 @@ /* * fb-contrib - Auxiliary detectors for Java programs - * Copyright (C) 2005-2015 Dave Brosius + * Copyright (C) 2005-2016 Dave Brosius * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,6 +1,6 @@ /* * fb-contrib - Auxiliary detectors for Java programs - * Copyright (C) 2005-2015 Dave Brosius + * Copyright (C) 2005-2016 Dave Brosius * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/ImmutabilityType.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,6 +1,6 @@ /* * fb-contrib - Auxiliary detectors for Java programs - * Copyright (C) 2005-2015 Dave Brosius + * Copyright (C) 2005-2016 Dave Brosius * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/MethodInfo.java 2016-01-25 22:39:59 UTC (rev 1789) @@ -1,6 +1,6 @@ /* * fb-contrib - Auxiliary detectors for Java programs - * Copyright (C) 2005-2015 Dave Brosius + * Copyright (C) 2005-2016 Dave Brosius * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java 2015-12-30 20:32:17 UTC (rev 1788) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java 2016-01-25 22:39:59 UTC (r... [truncated message content] |