[Fb-contrib-commit] SF.net SVN: fb-contrib:[1730] trunk/fb-contrib
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2012-11-22 01:44:02
|
Revision: 1730
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1730&view=rev
Author: dbrosius
Date: 2012-11-22 01:43:55 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
sync with github
Modified Paths:
--------------
trunk/fb-contrib/.project
trunk/fb-contrib/build.properties
trunk/fb-contrib/pom.xml
trunk/fb-contrib/samples/CVAA_Sample.java
trunk/fb-contrib/samples/UNNC_Sample.java
trunk/fb-contrib/samples/UVA_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
Modified: trunk/fb-contrib/.project
===================================================================
--- trunk/fb-contrib/.project 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/.project 2012-11-22 01:43:55 UTC (rev 1730)
@@ -32,4 +32,15 @@
<nature>org.eclipse.pde.PluginNature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
</natures>
+ <filteredResources>
+ <filter>
+ <id>1351977185587</id>
+ <name>samples</name>
+ <type>10</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-.svn</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
</projectDescription>
Modified: trunk/fb-contrib/build.properties
===================================================================
--- trunk/fb-contrib/build.properties 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/build.properties 2012-11-22 01:43:55 UTC (rev 1730)
@@ -4,5 +4,6 @@
.
jars.compile.order = .
source.. = src/,\
- etc/
-output.. = bin/
+ etc/,\
+ samples/
+output.. = classes/
Modified: trunk/fb-contrib/pom.xml
===================================================================
--- trunk/fb-contrib/pom.xml 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/pom.xml 2012-11-22 01:43:55 UTC (rev 1730)
@@ -91,7 +91,7 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>findbugs</artifactId>
- <version>1.3.9</version>
+ <version>2.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: trunk/fb-contrib/samples/CVAA_Sample.java
===================================================================
--- trunk/fb-contrib/samples/CVAA_Sample.java 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/samples/CVAA_Sample.java 2012-11-22 01:43:55 UTC (rev 1730)
@@ -1,3 +1,4 @@
+import java.util.HashSet;
import java.util.Set;
@@ -27,7 +28,12 @@
return new Derived();
}
+ public void generics() {
+ Set<String>[] myStringSets = new HashSet[2];
+ Set<String>[] myStringSets2 = new Set[2];
+ }
+
public String fpVarArgs(String s1, Set<String> s2) {
return String.format("s1=%s s2=%s", s1, s2);
}
-}
\ No newline at end of file
+}
Modified: trunk/fb-contrib/samples/UNNC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/UNNC_Sample.java 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/samples/UNNC_Sample.java 2012-11-22 01:43:55 UTC (rev 1730)
@@ -5,8 +5,7 @@
public class UNNC_Sample {
-
- @SuppressWarnings("null")
+
public void testPosNEW()
{
UNNC_Sample sample = new UNNC_Sample();
@@ -16,7 +15,6 @@
}
}
- @SuppressWarnings("null")
public void testNegNEW()
{
UNNC_Sample sample = new UNNC_Sample();
@@ -28,7 +26,6 @@
System.out.println("OK");
}
- @SuppressWarnings("null")
public void testPosANEWARAY()
{
String[] s = new String[10];
@@ -37,7 +34,6 @@
}
}
- @SuppressWarnings("null")
public void testNegANEWARRAY()
{
String[] s = new String[10];
@@ -48,7 +44,6 @@
System.out.println("OK");
}
- @SuppressWarnings("null")
public void testPosMULTIANEWARRAY()
{
String[][] s = new String[10][5];
@@ -57,7 +52,6 @@
}
}
- @SuppressWarnings("null")
public void testNegMULTIANEWARRAY()
{
String[][] s = new String[10][5];
Modified: trunk/fb-contrib/samples/UVA_Sample.java
===================================================================
--- trunk/fb-contrib/samples/UVA_Sample.java 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/samples/UVA_Sample.java 2012-11-22 01:43:55 UTC (rev 1730)
@@ -4,35 +4,37 @@
public class UVA_Sample<T> extends ArrayList<T>
{
- public void testNormalUVA(String[] foo)
+ private static final long serialVersionUID = -7860932685876390245L;
+
+ public void testNormalUVA(String[] foo)
{}
-
+
public void testLowUVA1(int boo, String[] hoo)
{}
-
+
public static void testStaticUVA(Date[] d)
{}
-
+
public void fpNoParms()
{}
-
+
public void fpHasOtherArrayUVA1(String[] one, int[] two)
{}
-
+
public void fpTooManyArgs(int i, char j, long k, String[] moo)
{}
-
+
public void fpNotAtEnd(String[] foo, int bar)
{}
-
+
public void fpAlreadyVarArg(String...darnit)
{}
-
+
public void fpSimilarVarArg(String info, String...data)
{}
-
+
@Override
- public <T> T[] toArray(T[] a)
+ public <E> E[] toArray(E[] a)
{
return null;
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2012-11-22 01:43:55 UTC (rev 1730)
@@ -1,17 +1,17 @@
/*
* fb-contrib - Auxiliary detectors for Java programs
* Copyright (C) 2005-2012 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* 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
@@ -27,23 +27,23 @@
public class CollectStatistics extends BytecodeScanningDetector implements NonReportingDetector
{
private int numMethodCalls;
-
- public CollectStatistics(@SuppressWarnings("unused") BugReporter bugReporter) {
+
+ public CollectStatistics(BugReporter bugReporter) {
Statistics.getStatistics().clear();
}
-
+
@Override
public void visitCode(Code obj) {
-
+
numMethodCalls = 0;
-
+
byte[] code = obj.getCode();
if (code != null) {
super.visitCode(obj);
Statistics.getStatistics().addMethodStatistics(getClassName(), getMethodName(), getMethodSig(), new Statistics.MethodInfo(code.length, numMethodCalls));
}
}
-
+
@Override
public void sawOpcode(int seen) {
switch (seen) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java 2012-10-31 17:32:54 UTC (rev 1729)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleConstantAllocationInLoop.java 2012-11-22 01:43:55 UTC (rev 1730)
@@ -142,15 +142,17 @@
}
if ((seen == INVOKEINTERFACE) || (seen == INVOKEVIRTUAL) || ((seen == INVOKESPECIAL))) {
//ignore possible method chaining
- OpcodeStack.Item item = stack.getStackItem(types.length);
- Integer allocation = (Integer)item.getUserValue();
- if (allocation != null) {
- String retType = Type.getReturnType(signature).getSignature();
- if (!"V".equals(retType) && retType.equals(item.getSignature())) {
- sawAllocationNumber = allocation;
- sawAllocation = true;
+ if (stack.getStackDepth() > types.length) {
+ OpcodeStack.Item item = stack.getStackItem(types.length);
+ Integer allocation = (Integer)item.getUserValue();
+ if (allocation != null) {
+ String retType = Type.getReturnType(signature).getSignature();
+ if (!"V".equals(retType) && retType.equals(item.getSignature())) {
+ sawAllocationNumber = allocation;
+ sawAllocation = true;
+ }
}
- }
+ }
}
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|