Permalink
Browse files

Merge branch 'findbugs' into spotbugs

Conflicts:
	build.xml
	pom.xml
	src/main/java/com/mebigfatguy/fbcontrib/detect/PresizeCollections.java
  • Loading branch information...
mebigfatguy committed Dec 27, 2017
2 parents 6499bb3 + 9ba9531 commit c221b81fa38431a74fc5fc43911b77c7ddc6b1dc
View
@@ -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.2.0.sb" />
<property name="fb-contrib.version" value="7.2.1.sb-SNAPSHOT" />
<property name="sonatype.dir" value="${user.home}/.fb-contrib-${fb-contrib.version}-sonatype" />
View
@@ -23,7 +23,7 @@
<!-- Detectors -->
<!-- COMMENT OUT FOR RELEASE
<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.debug.OCSDebugger" speed="fast"/>
@@ -33,7 +33,7 @@
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" />
COMMENT OUT FOR RELEASE -->
<!-- COMMENT OUT FOR RELEASE -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" />
View
@@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mebigfatguy.fb-contrib</groupId>
<artifactId>fb-contrib</artifactId>
<version>7.2.0.sb</version>
<version>7.2.1.sb-SNAPSHOT</version>
<!-- TODO: Delete this and replace with enforcer plugin. This is for maven plugins only! Latest maven will through warnings. -->
<prerequisites>
@@ -416,13 +416,18 @@ private void addExceptionRanges(Code c) {
}
/**
* returns if the conditional is based on a method call from an object that has no sizing to determine what presize should be.
*
* returns if the conditional is based on a method call from an object that has no sizing to determine what presize should be. it's possible the correct
* implementation should just return true, if <code>if ((seen != IFNE) || (stack.getStackDepth() == 0))</code>
*
* @param seen
* the current visited opcode
* @return whether this conditional is based on a unsized object
*/
private boolean branchBasedOnUnsizedObject(int seen) {
if ((seen == Const.IF_ACMPEQ) || (seen == Const.IF_ACMPNE)) {
return true;
}
if ((seen != Const.IFNE) || (stack.getStackDepth() == 0)) {
return false;
}
@@ -2,6 +2,7 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@@ -212,4 +213,22 @@ public void fpNoAllocation(List<String> ss, List<Integer> ii) {
return result;
}
public List<String> fpStreamSource249(BooReader br) throws IOException, ClassNotFoundException {
List<String> result = new ArrayList<>();
Object o;
while (br.tokenType() != BooReader.BooTokenType.END) {
result.add(br.nextToken());
}
return result;
}
interface BooReader {
enum BooTokenType { START, MIDDLE, END };
BooTokenType tokenType();
String nextToken();
}
}

0 comments on commit c221b81

Please sign in to comment.