[Fb-contrib-commit] SF.net SVN: fb-contrib:[1819] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2017-04-22 21:22:21
|
Revision: 1819 http://sourceforge.net/p/fb-contrib/code/1819 Author: dbrosius Date: 2017-04-22 21:22:18 +0000 (Sat, 22 Apr 2017) Log Message: ----------- sync from github Modified Paths: -------------- trunk/fb-contrib/build.xml trunk/fb-contrib/etc/findbugs.xml 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/BloatedSynchronizedBlock.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java trunk/fb-contrib/src/samples/java/ex/IOI_Sample.java Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/build.xml 2017-04-22 21:22:18 UTC (rev 1819) @@ -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.0" /> + <property name="fb-contrib.version" value="7.0.1" /> <property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" /> Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/etc/findbugs.xml 2017-04-22 21:22:18 UTC (rev 1819) @@ -30,7 +30,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" /> - COMMENT OUT FOR RELEASE --> + COMMENT OUT FOR RELEASE --> <Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" /> @@ -313,11 +313,11 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryApiConversion" speed="fast" reports="UAC_UNNECESSARY_API_CONVERSION_DATE_TO_INSTANT"/> - <!-- 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"/> - <!-- COMMENT OUT FOR POINT RELEASE --> + COMMENT OUT FOR POINT RELEASE --> <!-- BugPattern --> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/htdocs/index.shtml 2017-04-22 21:22:18 UTC (rev 1819) @@ -68,7 +68,7 @@ </li> </ul> </p> - <p style="font-weight: bold;">The latest version of fb-contrib is 7.0.0 available for download + <p style="font-weight: bold;">The latest version of fb-contrib is 7.0.1 available for download <a href="http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fb-contrib%22">here</a>.</p> <p style="font-weight: bold;">This version requires FindBugs 3.0.1 or better</p> <p style="font-weight: bold;">Please note that active development for this project is now done on Modified: trunk/fb-contrib/htdocs/repository.html =================================================================== --- trunk/fb-contrib/htdocs/repository.html 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/htdocs/repository.html 2017-04-22 21:22:18 UTC (rev 1819) @@ -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.0</td></tr> + <tr><td><b>Version:</b></td><td>7.0.1</td></tr> </table> </div> Modified: trunk/fb-contrib/pom.xml =================================================================== --- trunk/fb-contrib/pom.xml 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/pom.xml 2017-04-22 21:22:18 UTC (rev 1819) @@ -8,7 +8,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>com.mebigfatguy.fb-contrib</groupId> <artifactId>fb-contrib</artifactId> - <version>7.0.0</version> + <version>7.0.1</version> <prerequisites> <maven>2.2.1</maven> Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -45,8 +45,9 @@ * variables, and not member variables, or this. */ public class BloatedSynchronizedBlock extends BytecodeScanningDetector { + private static final String BSB_MIN_SAFE_CODE_SIZE = "fb-contrib.bsb.minsize"; + private final BugReporter bugReporter; - private static final String BSB_MIN_SAFE_CODE_SIZE = "fb-contrib.bsb.minsize"; private OpcodeStack stack; private BitSet unsafeAliases; private Map<Integer, Integer> branchInfo; 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-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/FindClassCircularDependencies.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -233,6 +233,9 @@ return removedClass; } + /** + * finds class dependency loops in a directed graph + */ static class LoopFinder { private Map<String, Set<String>> dGraph = null; Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IOIssues.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -170,6 +170,16 @@ return IOIUserValue.BUFFER; } else if ("java.io.FileInputStream".equals(clsName) || "java.io.FileOutputStream".equals(clsName)) { if (clsVersion >= Constants.MAJOR_1_7) { + if (!getMethod().isStatic()) { + String sig = getSigConstantOperand(); + int numParms = SignatureUtils.getNumParameters(sig); + if (stack.getStackDepth() > numParms) { + OpcodeStack.Item itm = stack.getStackItem(numParms); + if (itm.getRegisterNumber() == 0) { + return null; + } + } + } bugReporter.reportBug(new BugInstance(this, BugType.IOI_USE_OF_FILE_STREAM_CONSTRUCTORS.name(), NORMAL_PRIORITY).addClass(this) .addMethod(this).addSourceLine(this)); } Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -38,7 +38,6 @@ * looks for classes that use objects from com.sun.xxx packages. As these are internal to sun and subject to change, this should not be done. */ public class IncorrectInternalClassUse implements Detector { - private final BugReporter bugReporter; private static final Set<String> internalPackages = UnmodifiableSet.create( // @formatter:off @@ -77,6 +76,8 @@ // @formatter:on ); + private final BugReporter bugReporter; + /** * constructs a IICU detector given the reporter to report bugs on * 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-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/OptionalIssues.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -50,7 +50,7 @@ @CustomUserValue public class OptionalIssues extends BytecodeScanningDetector { - private Set<String> BOXED_OPTIONAL_TYPES = UnmodifiableSet.create("Ljava/lang/Integer;", "Ljava/lang/Long;", "Ljava/lang/Double;"); + private static Set<String> BOXED_OPTIONAL_TYPES = UnmodifiableSet.create("Ljava/lang/Integer;", "Ljava/lang/Long;", "Ljava/lang/Double;"); private static final FQMethod OPTIONAL_OR_ELSE_METHOD = new FQMethod("java/util/Optional", "orElse", "(Ljava/lang/Object;)Ljava/lang/Object;"); private static final FQMethod OPTIONAL_OR_ELSE_GET_METHOD = new FQMethod("java/util/Optional", "orElseGet", Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/RuntimeExceptionDeclared.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -42,7 +42,6 @@ * code, and not propagated. */ public class RuntimeExceptionDeclared extends PreorderVisitor implements Detector { - private final BugReporter bugReporter; private static JavaClass runtimeExceptionClass; static { @@ -53,6 +52,7 @@ } } + private final BugReporter bugReporter; private final Set<String> runtimeExceptions = new HashSet<>(); /** Modified: trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java =================================================================== --- trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/main/java/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -46,7 +46,6 @@ * unsafe. When iterators are to be used, synchronization should be done manually. */ public class SyncCollectionIterators extends BytecodeScanningDetector { - private final BugReporter bugReporter; private static final Set<String> synchCollectionNames = UnmodifiableSet.create("synchronizedSet", "synchronizedMap", "synchronizedList", "synchronizedSortedSet", "synchronizedSortedMap"); @@ -56,6 +55,7 @@ SEEN_NOTHING, SEEN_SYNC, SEEN_LOAD } + private final BugReporter bugReporter; private State state; private Set<String> memberCollections; private BitSet localCollections; Modified: trunk/fb-contrib/src/samples/java/ex/IOI_Sample.java =================================================================== --- trunk/fb-contrib/src/samples/java/ex/IOI_Sample.java 2017-04-15 00:00:24 UTC (rev 1818) +++ trunk/fb-contrib/src/samples/java/ex/IOI_Sample.java 2017-04-22 21:22:18 UTC (rev 1819) @@ -44,4 +44,12 @@ } } } + + class FPBofoStream extends FileInputStream { + + public FPBofoStream(File f) throws IOException { + super(f); + } + + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |