[Fb-contrib-commit] SF.net SVN: fb-contrib:[1823] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2017-07-19 21:29:50
|
Revision: 1823 http://sourceforge.net/p/fb-contrib/code/1823 Author: dbrosius Date: 2017-07-19 21:29:47 +0000 (Wed, 19 Jul 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/htdocs/repository.html trunk/fb-contrib/pom.xml trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousShadedClassUse.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/BugType.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/utils/Values.java trunk/fb-contrib/src/samples/java/ex/BED_Sample.java trunk/fb-contrib/src/samples/java/ex/FCCD_Sample.java trunk/fb-contrib/src/samples/java/ex/LO_Sample.java trunk/fb-contrib/src/samples/java/ex/OPM_Sample.java trunk/fb-contrib/src/samples/java/ex/UTAO_Sample.java trunk/fb-contrib/yank.xls Added Paths: ----------- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java trunk/fb-contrib/src/samples/java/ex/RFI_Sample.java trunk/fb-contrib/src/samples/java/ex/opm/ trunk/fb-contrib/src/samples/java/ex/opm/RuleMatcher.java Modified: trunk/fb-contrib/.classpath =================================================================== --- trunk/fb-contrib/.classpath 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/.classpath 2017-07-19 21:29:47 UTC (rev 1823) @@ -18,8 +18,11 @@ <classpathentry kind="lib" path="lib/findbugs-3.0.1.jar" sourcepath="lib/sources/findbugs-3.0.1-sources.jar"/> <classpathentry kind="lib" path="lib/junit-4.12.jar"/> <classpathentry kind="lib" path="lib/javax.persistence-2.1.1.jar" sourcepath="/home/dave/.m2/repository/org/eclipse/persistence/javax.persistence/2.1.1/javax.persistence-2.1.1-sources.jar"/> - <classpathentry kind="lib" path="lib/mockito-all-2.0.2-beta.jar"/> - <classpathentry combineaccessrules="false" kind="src" path="/findbugs"/> + <classpathentry combineaccessrules="false" kind="src" path="/findbugs"> + <accessrules> + <accessrule kind="nonaccessible" pattern="org/hamcrest/**"/> + </accessrules> + </classpathentry> <classpathentry kind="lib" path="lib/threetenbp-1.3.2.jar"/> <classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/> <classpathentry kind="lib" path="lib/commons-collections-3.2.2.jar"/> @@ -40,5 +43,7 @@ <classpathentry kind="lib" path="lib/commons-io-2.4.jar"/> <classpathentry kind="lib" path="lib/jersey-media-multipart-2.25.1.jar"/> <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="output" path="target/classes/main"/> </classpath> Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/build.xml 2017-07-19 21:29:47 UTC (rev 1823) @@ -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.2" /> + <property name="fb-contrib.version" value="7.0.3" /> <property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" /> @@ -108,7 +108,8 @@ <path id="fb-contrib.test.classpath"> <pathelement location="${lib.dir}/testng-${testng.version}.jar" /> <pathelement location="${lib.dir}/jcommander-${jcommander.version}.jar" /> - <pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" /> + <pathelement location="${lib.dir}/mockito-core-${mockito-core.version}.jar" /> + <pathelement location="${lib.dir}/hamcrest-core-${hamcrest-core.version}.jar" /> <pathelement location="${findbugs.dir}/lib/dom4j-1.6.1.jar" /> <pathelement location="${findbugs.dir}/lib/jaxen-1.1.6.jar" /> @@ -134,7 +135,8 @@ <pathelement location="${lib.dir}/spring-context-${spring-context.version}.jar" /> <pathelement location="${lib.dir}/spring-tx-${spring-tx.version}.jar" /> <pathelement location="${lib.dir}/javax.persistence-${javax.persistence.version}.jar" /> - <pathelement location="${lib.dir}/mockito-all-${mockito-all.version}.jar" /> + <pathelement location="${lib.dir}/mockito-core-${mockito-core.version}.jar" /> + <pathelement location="${lib.dir}/hamcrest-core-${hamcrest-core.version}.jar" /> <pathelement location="${lib.dir}/jena-shaded-guava-${jena-shaded-guava.version}.jar" /> <pathelement location="${lib.dir}/javax.ws.rs-api-${javax.ws.rs-api.version}.jar" /> <pathelement location="${lib.dir}/jersey-media-multipart-${jersey-media-multipart.version}.jar" /> Modified: trunk/fb-contrib/etc/bugrank.txt =================================================================== --- trunk/fb-contrib/etc/bugrank.txt 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/etc/bugrank.txt 2017-07-19 21:29:47 UTC (rev 1823) @@ -64,11 +64,13 @@ +0 BugPattern IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING +0 BugPattern IKNC_INCONSISTENT_HTTP_PARAM_CASING +1 BugPattern IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES ++0 BugPattern IMC_IMMATURE_CLASS_LOWER_CLASS +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 IMC_IMMATURE_CLASS_PRINTSTACKTRACE ++0 BugPattern IMC_IMMATURE_CLASS_UPPER_PACKAGE +0 BugPattern IMC_IMMATURE_CLASS_WRONG_FIELD_ORDER +0 BugPattern IOI_COPY_WITH_READER +0 BugPattern IOI_DOUBLE_BUFFER_COPY @@ -162,6 +164,7 @@ +0 BugPattern PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS +0 BugPattern PSC_PRESIZE_COLLECTIONS +0 BugPattern PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION ++0 BugPattern RFI_SET_ACCESSIBLE +0 BugPattern ROOM_REFLECTION_ON_OBJECT_METHODS +0 BugPattern S508C_APPENDED_STRING +0 BugPattern S508C_NON_ACCESSIBLE_JCOMPONENT Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/etc/findbugs.xml 2017-07-19 21:29:47 UTC (rev 1823) @@ -20,7 +20,7 @@ <!-- Detectors --> -<!-- COMMENT OUT FOR RELEASE +<!-- COMMENT OUT FOR RELEASE <Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/> @@ -77,7 +77,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessAutoboxing" speed="fast" reports="NAB_NEEDLESS_AUTOBOXING_CTOR,NAB_NEEDLESS_BOXING_STRING_CTOR,NAB_NEEDLESS_AUTOBOXING_VALUEOF,NAB_NEEDLESS_BOXING_PARSE,NAB_NEEDLESS_BOXING_VALUEOF,NAB_NEEDLESS_BOX_TO_UNBOX,NAB_NEEDLESS_BOX_TO_CAST,NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryStoreBeforeReturn" speed="fast" reports="USBR_UNNECESSARY_STORE_BEFORE_RETURN,UAC_UNNECESSARY_API_CONVERSION_FILE_TO_PATH" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryStoreBeforeReturn" speed="fast" reports="USBR_UNNECESSARY_STORE_BEFORE_RETURN" /> <Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod" speed="fast" reports="COM_COPIED_OVERRIDDEN_METHOD,COM_PARENT_DELEGATED_CALL" /> @@ -285,7 +285,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.StringifiedTypes" speed="fast" reports="STT_STRING_PARSING_A_FIELD,STT_TOSTRING_STORED_IN_FIELD,STT_TOSTRING_MAP_KEYING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING,IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES,IMC_IMMATURE_CLASS_PRINTSTACKTRACE,IMC_IMMATURE_CLASS_WRONG_FIELD_ORDER" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ImmatureClass" speed="moderate" reports="IMC_IMMATURE_CLASS_NO_EQUALS,IMC_IMMATURE_CLASS_NO_HASHCODE,IMC_IMMATURE_CLASS_NO_PACKAGE,IMC_IMMATURE_CLASS_NO_TOSTRING,IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES,IMC_IMMATURE_CLASS_PRINTSTACKTRACE,IMC_IMMATURE_CLASS_WRONG_FIELD_ORDER,IMC_IMMATURE_CLASS_UPPER_PACKAGE,IMC_IMMATURE_CLASS_LOWER_CLASS" /> <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" /> @@ -313,10 +313,11 @@ <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 --> <!-- BugPattern --> @@ -571,6 +572,8 @@ <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_NO_TOSTRING" category="STYLE" /> <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_PRINTSTACKTRACE" category="STYLE" /> <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_WRONG_FIELD_ORDER" category="STYLE" /> + <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_UPPER_PACKAGE" category="STYLE" /> + <BugPattern abbrev="IMC" type="IMC_IMMATURE_CLASS_LOWER_CLASS" category="STYLE" /> <BugPattern abbrev="JXI" type="JXI_GET_ENDPOINT_CONSUMES_CONTENT" category="CORRECTNESS" /> <BugPattern abbrev="JXI" type="JXI_INVALID_CONTEXT_PARAMETER_TYPE" category="CORRECTNESS" /> <BugPattern abbrev="JXI" type="JXI_PARM_PARAM_NOT_FOUND_IN_PATH" category="CORRECTNESS" /> @@ -591,12 +594,13 @@ <BugPattern abbrev="WI" type="WI_DUPLICATE_WIRED_TYPES" 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" experimental="true"/> - <BugPattern abbrev="USFW" type="USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES" category="CORRECTNESS" experimental="true"/> - <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_USES_IMMEDIATE_EXECUTION" category="CORRECTNESS" experimental="true"/> - <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_USES_DELAYED_EXECUTION" category="CORRECTNESS" experimental="true"/> - <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_CHECKING_REFERENCE" category="CORRECTNESS" experimental="true"/> - <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_PRIMITIVE_VARIANT_PREFERRED" category="CORRECTNESS" experimental="true"/> - <BugPattern abbrev="UAC" type="UAC_UNNECESSARY_API_CONVERSION_DATE_TO_INSTANT" category="CORRECTNESS" experimental="true"/> - <BugPattern abbrev="UAC" type="UAC_UNNECESSARY_API_CONVERSION_FILE_TO_PATH" category="CORRECTNESS" experimental="true"/> + <BugPattern abbrev="SSCU" type="SSCU_SUSPICIOUS_SHADED_CLASS_USE" category="CORRECTNESS"/> + <BugPattern abbrev="USFW" type="USFW_UNSYNCHRONIZED_SINGLETON_FIELD_WRITES" category="CORRECTNESS"/> + <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_USES_IMMEDIATE_EXECUTION" category="CORRECTNESS"/> + <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_USES_DELAYED_EXECUTION" category="CORRECTNESS"/> + <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_CHECKING_REFERENCE" category="CORRECTNESS"/> + <BugPattern abbrev="OI" type="OI_OPTIONAL_ISSUES_PRIMITIVE_VARIANT_PREFERRED" category="CORRECTNESS"/> + <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"/> </FindbugsPlugin> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/etc/messages.xml 2017-07-19 21:29:47 UTC (rev 1823) @@ -1696,7 +1696,16 @@ </Details> </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionIssues"> + <Details> + <![CDATA[ + <p>Looks for issues around the use of java reflection.</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> + <Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger"> <Details></Details> </Detector> @@ -3691,8 +3700,8 @@ </BugPattern> <BugPattern type="UTAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT"> - <ShortDescription>JUnit test method asserts that a value is true or false</ShortDescription> - <LongDescription>JUnit test method {1} asserts that a value is true or false</LongDescription> + <ShortDescription>JUnit test method asserts that a value is equal to true or false</ShortDescription> + <LongDescription>JUnit test method {1} asserts that a value is equal to true or false</LongDescription> <Details> <![CDATA[ <p>This method asserts that a value is equal to true or false. It is simpler to just @@ -5318,18 +5327,18 @@ <p>This method builds a key for a map, using a StringBuilder, either implicitly or explicitly. This means the type of the key is something more t han a String constant, it is a properly formatted String. However, there is no type based verification that all uses of this key will follow this formatting. It is much better to use a proper, simple, - bean class that holds two (or more fields) so that it is clear what is expected for key use. + bean class that holds two (or more) fields so that it is clear what is expected for key use. </p> <p> Example<br/> instead of - {@code + <pre><code> V v = myMap.get(tableName + "-" + columnName); - } + </code></pre> use - {@code + <pre><code> V v = myMap.get(new ColumnSpec(tableName, columnName)); - } + </code></pre> where ColumnSpec is a simple bean-like class of your creation. The advantages, are <ul> <li>The ColumnSpec fully describes what is expected, you need a tableName and columnName</li> @@ -5469,7 +5478,30 @@ </Details> </BugPattern> + <BugPattern type="IMC_IMMATURE_CLASS_UPPER_PACKAGE"> + <ShortDescription>Class is defined in a package with upper case characters</ShortDescription> + <LongDescription>Class {0} is defined in a package with upper case characters</LongDescription> + <Details> + <![CDATA[ + <p>This class is defined within a package that uses upper case letters. Package names are + expected to be in the form of alllowercase.</p> + ]]> + </Details> + </BugPattern> + <BugPattern type="IMC_IMMATURE_CLASS_LOWER_CLASS"> + <ShortDescription>Class does not start with an upper case letter</ShortDescription> + <LongDescription>Class {0} does not start with an upper case letter</LongDescription> + <Details> + <![CDATA[ + <p>This class has been given a name that does not start with an upper case letter. + Classes should follow a pattern of uppercasing the first letter of each word, AsAnExample</p> + ]]> + </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> @@ -5873,6 +5905,19 @@ ]]> </Details> </BugPattern> + + <BugPattern type="RFI_SET_ACCESSIBLE"> + <ShortDescription>Method uses AccessibleObject.setAccessible to modify accessibility of classes</ShortDescription> + <LongDescription>Method {1} uses AccessibleObject.setAccessible to modify accessibility of classes</LongDescription> + <Details> + <![CDATA[ + <p>This method uses the reflective setAccessible method to alter the behavior of methods and fields in classes + in ways that were not expected to be accessed by the author. Doing so circumvents the protections that the author + provided through the class definition, and may expose your application unexpected side effects and problems. This + functionality is deprecated in Java 9, and in Java 10 it is expected that this functionality won't work at all. + ]]> + </Details> + </BugPattern> <!-- BugCode --> @@ -6016,4 +6061,5 @@ <BugCode abbrev="USFW">Unsynchronized Singleton Field Writes</BugCode> <BugCode abbrev="OI">Optional Issues</BugCode> <BugCode abbrev="UAC">Unnecessary Api Conversion</BugCode> + <BugCode abbrev="RFI">Reflection Issues</BugCode> </MessageCollection> Modified: trunk/fb-contrib/etc/samples.fbp =================================================================== --- trunk/fb-contrib/etc/samples.fbp 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/etc/samples.fbp 2017-07-19 21:29:47 UTC (rev 1823) @@ -1,29 +1,30 @@ <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/mockito-all-2.0.2-beta.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> - <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> + <SrcDir>./././../src/samples/java</SrcDir> </Project> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/htdocs/index.shtml 2017-07-19 21:29:47 UTC (rev 1823) @@ -68,7 +68,7 @@ </li> </ul> </p> - <p style="font-weight: bold;">The latest version of fb-contrib is 7.0.2 available for download + <p style="font-weight: bold;">The latest version of fb-contrib is 7.0.3 available for download <a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p> <p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p> <p style="font-weight: bold;">Please note that active development for this project is now done on Modified: trunk/fb-contrib/htdocs/repository.html =================================================================== --- trunk/fb-contrib/htdocs/repository.html 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/htdocs/repository.html 2017-07-19 21:29:47 UTC (rev 1823) @@ -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>7.0.2</td></tr> + <tr><td><b>Version:</b></td><td>7.0.3</td></tr> </table> </div> Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/pom.xml 2017-07-19 21:29:47 UTC (rev 1823) @@ -1,23 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- pom.xml developed by Grzegorz Slowikowski --> -<project - xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>7.0.2</version> + <version>7.0.3</version> + <!-- TODO: Delete this and replace with enforcer plugin. This is for maven plugins only! Latest maven will through warnings. --> <prerequisites> - <maven>2.2.1</maven> + <maven>3.2.5</maven> </prerequisites> + <!-- TODO: Oss parent is obsolete, define items directly for releasing --> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> - <version>5</version> + <version>9</version> + <relativePath /> </parent> <name>FindBugs Contrib plugin library</name> @@ -71,15 +72,18 @@ <email>she...@ya...</email> </contributor> <contributor> - <name>Juan Martín Sotuyo Dodero</name> - <email>jua...@gm...</email> + <name>Juan Martín Sotuyo Dodero</name> + <email>jua...@gm...</email> </contributor> <contributor> - <name>Richard Fearn</name> + <name>Richard Fearn</name> </contributor> <contributor> - <name>Mikkel Kjeldsen</name> + <name>Mikkel Kjeldsen</name> </contributor> + <contributor> + <name>Jeremy Landis</name> + </contributor> </contributors> <licenses> @@ -130,6 +134,12 @@ <artifactId>findbugs</artifactId> <version>3.0.1</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> @@ -140,69 +150,166 @@ <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>annotations</artifactId> - <version>3.0.0</version> + <version>3.0.1u2</version> <scope>provided</scope> </dependency> - <dependency><scope>test</scope><groupId>backport-util-concurrent</groupId><artifactId>backport-util-concurrent</artifactId><version>3.1</version></dependency> - <dependency><scope>test</scope><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>19.0</version></dependency> - <dependency><scope>test</scope><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.10</version></dependency> - <dependency><scope>test</scope><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.4</version></dependency> - <dependency><scope>test</scope><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.2.2</version></dependency> - <dependency><scope>test</scope><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version></dependency> - <dependency><scope>test</scope><groupId>javax.servlet.jsp</groupId><artifactId>javax.servlet.jsp-api</artifactId><version>2.3.1</version></dependency> - <dependency><scope>test</scope><groupId>javax.ws.rs</groupId><artifactId>javax.ws.rs-api</artifactId><version>2.0.1</version></dependency> - <dependency><scope>test</scope><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency> - <dependency><scope>test</scope><groupId>log4j</groupId><artifactId>log4j</artifactId><version>1.2.17</version></dependency> - <dependency><scope>test</scope><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.3</version></dependency> - <dependency><scope>test</scope><groupId>org.apache.httpcomponents</groupId><artifactId>httpclient</artifactId><version>4.5.2</version></dependency> - <dependency><scope>test</scope><groupId>org.apache.httpcomponents</groupId><artifactId>httpcore</artifactId><version>4.4.5</version></dependency> - <dependency><scope>test</scope><groupId>org.mockito</groupId><artifactId>mockito-all</artifactId><version>2.0.2-beta</version></dependency> - <dependency><scope>test</scope><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.7.21</version></dependency> - <dependency><scope>test</scope><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId><version>4.3.3.RELEASE</version></dependency> - <dependency><scope>test</scope><groupId>org.testng</groupId><artifactId>testng</artifactId><version>6.9.10</version></dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>4.3.3.RELEASE</version> - <scope>test</scope> + <scope>test</scope> + <groupId>backport-util-concurrent</groupId> + <artifactId>backport-util-concurrent</artifactId> + <version>3.1</version> </dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>4.3.3.RELEASE</version> - <scope>test</scope> + <scope>test</scope> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>22.0-android</version> </dependency> <dependency> - <groupId>org.threeten</groupId> - <artifactId>threetenbp</artifactId> - <version>1.3.2</version> - <scope>test</scope> + <scope>test</scope> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.10</version> </dependency> <dependency> - <groupId>org.apache.jena</groupId> - <artifactId>jena-shaded-guava</artifactId> - <version>3.1.0</version> - <scope>test</scope> + <scope>test</scope> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.5</version> </dependency> <dependency> - <groupId>org.glassfish.jersey.media</groupId> - <artifactId>jersey-media-multipart</artifactId> - <version>2.25.1</version> - <scope>test</scope> + <scope>test</scope> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2.2</version> </dependency> <dependency> - <groupId>org.eclipse.persistence</groupId> - <artifactId>javax.persistence</artifactId> - <version>2.1.1</version> - <scope>test</scope> + <scope>test</scope> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <version>3.1.0</version> </dependency> + <dependency> + <scope>test</scope> + <groupId>javax.servlet.jsp</groupId> + <artifactId>javax.servlet.jsp-api</artifactId> + <version>2.3.1</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>javax.ws.rs</groupId> + <artifactId>javax.ws.rs-api</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.6</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.5.3</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + <version>4.4.6</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>2.8.47</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.25</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.springframework</groupId> + <artifactId>spring-tx</artifactId> + <version>4.3.9.RELEASE</version> + </dependency> + <dependency> + <scope>test</scope> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <version>6.9.10</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>4.3.9.RELEASE</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>4.3.9.RELEASE</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.threeten</groupId> + <artifactId>threetenbp</artifactId> + <version>1.3.5</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.jena</groupId> + <artifactId>jena-shaded-guava</artifactId> + <version>3.3.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-multipart</artifactId> + <version>2.25.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.glassfish.hk2</groupId> + <artifactId>osgi-resource-locator</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.eclipse.persistence</groupId> + <artifactId>javax.persistence</artifactId> + <version>2.1.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <version>1.3</version> + <scope>test</scope> + </dependency> </dependencies> <build> - <outputDirectory>${basedir}/target/classes/main</outputDirectory> + <outputDirectory>${project.basedir}/target/classes/main</outputDirectory> <resources> <resource> - <directory>${basedir}</directory> + <directory>${project.basedir}</directory> <includes> <include>plugin.xml</include> <include>license.txt</include> @@ -209,7 +316,7 @@ </includes> </resource> <resource> - <directory>${basedir}/etc</directory> + <directory>${project.basedir}/etc</directory> <excludes> <exclude>*.xsd</exclude> <exclude>*.xsl</exclude> @@ -219,14 +326,40 @@ <pluginManagement> <plugins> - <plugin><artifactId>maven-clean-plugin</artifactId><version>2.6.1</version></plugin> - <plugin><groupId>org.codehaus.mojo</groupId><artifactId>buildnumber-maven-plugin</artifactId><version>1.3</version></plugin> - <plugin><groupId>org.codehaus.mojo</groupId><artifactId>build-helper-maven-plugin</artifactId><version>1.9.1</version></plugin> - <plugin><groupId>org.codehaus.mojo</groupId><artifactId>findbugs-maven-plugin</artifactId><version>2.5.5</version></plugin> - <plugin><artifactId>maven-compiler-plugin</artifactId><version>3.3</version></plugin> - <plugin><artifactId>maven-deploy-plugin</artifactId><version>2.8.2</version></plugin> - <plugin><artifactId>maven-install-plugin</artifactId><version>2.5.2</version></plugin> - <plugin><artifactId>maven-jar-plugin</artifactId><version>2.6</version> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <version>1.4</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> + <groupId>com.github.hazendaz.spotbugs</groupId> + <artifactId>spotbugs-maven-plugin</artifactId> + <version>3.0.6</version> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.6.1</version> + </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8.2</version> + </plugin> + <plugin> + <artifactId>maven-install-plugin</artifactId> + <version>2.5.2</version> + </plugin> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>3.0.2</version> <configuration> <archive> <manifestEntries> @@ -242,18 +375,39 @@ <Bundle-Vendor>FB-Contrib Project</Bundle-Vendor> <Require-Bundle>edu.umd.cs.findbugs.plugin.eclipse</Require-Bundle> <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> - <Export-Package>com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, com.mebigfatguy.fbcontrib.debug</Export-Package> - <Import-Package>edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bcel, edu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, org.apache.bcel.generic</Import-Package> + <Export-Package>com.mebigfatguy.fbcontrib.collect, com.mebigfatguy.fbcontrib.detect, + com.mebigfatguy.fbcontrib.debug</Export-Package> + <Import-Package>edu.umd.cs.findbugs, edu.umd.cs.findbugs.ba, edu.umd.cs.findbugs.bcel, + edu.umd.cs.findbugs.visitclass, org.apache.bcel, org.apache.bcel.classfile, + org.apache.bcel.generic</Import-Package> </manifestEntries> </archive> </configuration> </plugin> - <plugin><artifactId>maven-pmd-plugin</artifactId><version>3.5</version></plugin> - <plugin><artifactId>maven-project-info-reports-plugin</artifactId><version>2.7</version></plugin> - <plugin><artifactId>maven-resources-plugin</artifactId><version>2.7</version></plugin> - <plugin><artifactId>maven-site-plugin</artifactId><version>3.4</version></plugin> - <plugin><artifactId>maven-source-plugin</artifactId><version>2.2.1</version></plugin> - <plugin><artifactId>maven-surefire-plugin</artifactId><version>2.18.1</version></plugin> + <plugin> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>2.9</version> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <artifactId>maven-site-plugin</artifactId> + <version>3.6</version> + </plugin> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <version>3.0.1</version> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.20</version> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <version>3.5</version> + </plugin> </plugins> </pluginManagement> @@ -261,8 +415,16 @@ <plugin> <artifactId>maven-pmd-plugin</artifactId> <dependencies> - <dependency><groupId>net.sourceforge.pmd</groupId><artifactId>pmd-java</artifactId><version>5.5.1</version></dependency> - <dependency><groupId>net.sourceforge.pmd</groupId><artifactId>pmd-core</artifactId><version>5.5.1</version></dependency> + <dependency> + <groupId>net.sourceforge.pmd</groupId> + <artifactId>pmd-java</artifactId> + <version>5.5.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.pmd</groupId> + <artifactId>pmd-core</artifactId> + <version>5.5.1</version> + </dependency> </dependencies> <configuration> <rulesets> @@ -286,7 +448,8 @@ </executions> </plugin> <plugin> - <groupId>org.codehaus.mojo</groupId><artifactId>buildnumber-maven-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> <executions> <execution> <phase>validate</phase> @@ -297,7 +460,8 @@ </executions> </plugin> <plugin> - <groupId>org.codehaus.mojo</groupId><artifactId>build-helper-maven-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> <configuration> <sources> <source>src/samples/java</source> @@ -314,7 +478,7 @@ </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> - <version>2.10</version> + <version>3.0.1</version> <executions> <execution> <id>unpack-findbugs-core</id> @@ -343,20 +507,31 @@ </plugin> <plugin> - <groupId>org.codehaus.mojo</groupId><artifactId>findbugs-maven-plugin</artifactId> + <groupId>com.github.hazendaz.spotbugs</groupId> + <artifactId>spotbugs-maven-plugin</artifactId> <dependencies> - <dependency><groupId>com.google.code.findbugs</groupId><artifactId>findbugs</artifactId><version>3.0.1</version></dependency> + <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> <plugins> - <plugin><groupId>com.mebigfatguy.fb-contrib</groupId><artifactId>fb-contrib</artifactId><version>${project.version}</version></plugin> + <plugin> + <groupId>com.mebigfatguy.fb-contrib</groupId> + <artifactId>fb-contrib</artifactId> + <version>${project.version}</version> + </plugin> </plugins> </configuration> <executions> <execution> - <goals><goal>check</goal></goals> + <goals> + <goal>check</goal> + </goals> </execution> </executions> </plugin> @@ -375,7 +550,8 @@ <reporting> <plugins> <plugin> - <artifactId>maven-pmd-plugin</artifactId><version>3.6</version> + <artifactId>maven-pmd-plugin</artifactId> + <version>3.6</version> <configuration> <rulesets> <ruleset>/rulesets/java/basic.xml</ruleset> Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BogusExceptionDeclaration.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -48,7 +48,7 @@ public class BogusExceptionDeclaration extends BytecodeScanningDetector { private static final Set<String> safeClasses = UnmodifiableSet.create( - //@formatter:off + //@formatter:off Values.SLASHED_JAVA_LANG_OBJECT, Values.SLASHED_JAVA_LANG_STRING, Values.SLASHED_JAVA_LANG_INTEGER, @@ -275,8 +275,8 @@ */ private void removeThrownExceptionHierarchy(String thrownException) { try { - if (Values.DOTTED_JAVA_LANG_EXCEPTION.equals(thrownException)) { - // Exception can be thrown even tho the method isn't declared to throw Exception in the case of templated Exceptions + if (Values.DOTTED_JAVA_LANG_EXCEPTION.equals(thrownException) || Values.DOTTED_JAVA_LANG_THROWABLE.equals(thrownException)) { + // Exception/Throwable can be thrown even tho the method isn't declared to throw Exception/Throwable in the case of templated Exceptions clearExceptions(); } else { removeException(thrownException); Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -29,9 +29,11 @@ import org.apache.bcel.classfile.Constant; import org.apache.bcel.classfile.ConstantClass; +import org.apache.bcel.classfile.ElementValue; import org.apache.bcel.classfile.JavaClass; import com.mebigfatguy.fbcontrib.utils.BugType; +import com.mebigfatguy.fbcontrib.utils.SignatureUtils; import com.mebigfatguy.fbcontrib.utils.ToString; import com.mebigfatguy.fbcontrib.utils.Values; @@ -38,6 +40,7 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; +import edu.umd.cs.findbugs.internalAnnotations.DottedClassName; /** * looks for classes that have dependencies on each other in a circular way. Class initialization can be compromised in this scenario, and usually points to a @@ -67,6 +70,22 @@ } @Override + public void visitAnnotation(@DottedClassName String annotationClass, Map<String, ElementValue> map, boolean runtimeVisible) { + if (!runtimeVisible) { + return; + } + + for (ElementValue v : map.values()) { + if (v.getElementValueType() == ElementValue.CLASS) { + String annotationClsAttr = SignatureUtils.stripSignature(v.stringifyValue()); + + Set<String> dependencies = getDependenciesForClass(clsName); + dependencies.add(annotationClsAttr); + } + } + } + + @Override public void sawOpcode(int seen) { if ((seen == INVOKESPECIAL) || (seen == INVOKESTATIC) || (seen == INVOKEVIRTUAL)) { processInvoke(); Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -1,5 +1,6 @@ package com.mebigfatguy.fbcontrib.detect; +import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -29,6 +30,7 @@ public class ImmatureClass extends BytecodeScanningDetector { private static final Pattern ARG_PATTERN = Pattern.compile("(arg|parm|param)\\d"); + private static final String PACKAGE_INFO = "package-info"; private static final int MAX_EMPTY_METHOD_SIZE = 2; // ACONST_NULL, ARETURN @@ -59,10 +61,24 @@ JavaClass cls = classContext.getJavaClass(); fieldStatus = FieldStatus.NONE; - if (cls.getPackageName().isEmpty()) { + String packageName = cls.getPackageName(); + if (packageName.isEmpty()) { bugReporter.reportBug(new BugInstance(this, BugType.IMC_IMMATURE_CLASS_NO_PACKAGE.name(), LOW_PRIORITY).addClass(cls)); } + if (!packageName.equals(packageName.toLowerCase(Locale.ENGLISH))) { + bugReporter.reportBug(new BugInstance(this, BugType.IMC_IMMATURE_CLASS_UPPER_PACKAGE.name(), LOW_PRIORITY).addClass(cls)); + } + + String simpleClassName = cls.getClassName(); + int dotPos = simpleClassName.lastIndexOf('.'); + if (dotPos >= 0) { + simpleClassName = simpleClassName.substring(dotPos + 1); + } + if (!Character.isUpperCase(simpleClassName.charAt(0)) && !simpleClassName.contains("$") && !PACKAGE_INFO.equals(simpleClassName)) { + bugReporter.reportBug(new BugInstance(this, BugType.IMC_IMMATURE_CLASS_LOWER_CLASS.name(), LOW_PRIORITY).addClass(cls)); + } + if ((!cls.isAbstract()) && (!cls.isEnum()) && !cls.getClassName().contains("$") && !isTestClass(cls)) { try { Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/InvalidConstantArgument.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -61,12 +61,13 @@ ParameterInfo.createIntegerParameterInfo(0, true, EtchedBorder.LOWERED, EtchedBorder.RAISED)), new InvalidPattern("javax/swing/JScrollBar#\\<init\\>\\(I.*\\)V", ParameterInfo.createIntegerParameterInfo(0, true, Adjustable.HORIZONTAL, Adjustable.VERTICAL)), + // TODO: Until travis-ci issue uncovered, add type param as integer on next three. new InvalidPattern("java/lang/Thread#setPriority\\(I\\)V", - new ParameterInfo<>(0, true, Range.createIntegerRange(Thread.MIN_PRIORITY, Thread.MAX_PRIORITY))), + new ParameterInfo<Integer>(0, true, Range.createIntegerRange(Thread.MIN_PRIORITY, Thread.MAX_PRIORITY))), new InvalidPattern("java/math/BigDecimal#divide\\(Ljava/math/BigDecimal;.*I\\)Ljava/math/BigDecimal;", - new ParameterInfo<>(0, false, Range.createIntegerRange(BigDecimal.ROUND_UP, BigDecimal.ROUND_UNNECESSARY))), + new ParameterInfo<Integer>(0, false, Range.createIntegerRange(BigDecimal.ROUND_UP, BigDecimal.ROUND_UNNECESSARY))), new InvalidPattern("java/math/BigDecimal#setScale\\(II\\)Ljava/math/BigDecimal;", - new ParameterInfo<>(0, false, Range.createIntegerRange(BigDecimal.ROUND_UP, BigDecimal.ROUND_UNNECESSARY))), + new ParameterInfo<Integer>(0, false, Range.createIntegerRange(BigDecimal.ROUND_UP, BigDecimal.ROUND_UNNECESSARY))), new InvalidPattern("java/sql/Connection#createStatement\\(II\\)Ljava/sql/Statement;", ParameterInfo.createIntegerParameterInfo(0, true, ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE)), new InvalidPattern("java/sql/Connection#createStatement\\(III?\\)Ljava/sql/Statement;", Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -430,6 +430,8 @@ // to Foo.class.getName() loggingClassName = (String) userValue; } + } else { + return; } } } else if (SIG_STRING_AND_FACTORY_TO_LOG4J_LOGGER.equals(signature) && (stack.getStackDepth() > 1)) { Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -194,7 +194,7 @@ if (OR_ELSE_METHODS.contains(curCalledMethod)) { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); - if ((itm.getReturnValueOf() != null) && !isTrivialStackOps()) { + if ((itm.getRegisterNumber() < 0) && (itm.getReturnValueOf() != null) && !isTrivialStackOps()) { bugReporter.reportBug(new BugInstance(this, BugType.OI_OPTIONAL_ISSUES_USES_IMMEDIATE_EXECUTION.name(), NORMAL_PRIORITY) .addClass(this).addMethod(this).addSourceLine(this)); } Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java 2017-05-29 20:54:00 UTC (rev 1822) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -155,8 +155,8 @@ String parms = methodSig.split("\\(|\\)")[1]; if (parms.indexOf(Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR) >= 0) { - outer: for (JavaClass cls : constrainingClasses) { - Method[] methods = cls.getMethods(); + outer: for (JavaClass constrainCls : constrainingClasses) { + Method[] methods = constrainCls.getMethods(); for (Method m : methods) { if (methodName.equals(m.getName()) && methodSig.equals(m.getSignature())) { methodSignatureIsConstrained = true; @@ -494,9 +494,9 @@ continue; } - JavaClass cls = Repository.lookupClass(clsName); - if (cls.isClass() && (!cls.isAbstract())) { - Map<JavaClass, List<MethodInfo>> definers = getClassDefiners(cls); + JavaClass clz = Repository.lookupClass(clsName); + if (clz.isClass() && (!clz.isAbstract())) { + Map<JavaClass, List<MethodInfo>> definers = getClassDefiners(clz); if (!definers.isEmpty()) { parameterDefiners.put(Integer.valueOf(i + (methodIsStatic ? 0 : 1)), definers); @@ -675,18 +675,18 @@ /** * returns whether this class is used to convert types of some sort, such that you don't want to suggest reducing the class specified to be more generic * - * @param cls + * @param conversionCls * the class to check * @return whether this class is used in conversions */ - private boolean isaConversionClass(JavaClass cls) { - for (AnnotationEntry entry : cls.getAnnotationEntries()) { + private boolean isaConversionClass(JavaClass conversionCls) { + for (AnnotationEntry entry : conversionCls.getAnnotationEntries()) { if (CONVERSION_ANNOTATIONS.contains(entry.getAnnotationType())) { return true; } // this ignores the fact that this class might be a grand child, but meh - if (CONVERSION_SUPER_CLASSES.contains(cls.getSuperclassName())) { + if (CONVERSION_SUPER_CLASSES.contains(conversionCls.getSuperclassName())) { return true; } } Added: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java (rev 0) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/ReflectionIssues.java 2017-07-19 21:29:47 UTC (rev 1823) @@ -0,0 +1,89 @@ +/* + * fb-contrib - Auxiliary detectors for Java programs + * Copyright (C) 2005-2017 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of... [truncated message content] |