[Fb-contrib-commit] SF.net SVN: fb-contrib:[1376] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-10-15 14:05:38
|
Revision: 1376
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1376&view=rev
Author: dbrosius
Date: 2009-10-15 14:05:30 +0000 (Thu, 15 Oct 2009)
Log Message:
-----------
more patches from bhaskar maddala
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java 2009-10-15 04:16:44 UTC (rev 1375)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java 2009-10-15 14:05:30 UTC (rev 1376)
@@ -49,6 +49,7 @@
public class ContraVariantArrayAssignment extends BytecodeScanningDetector {
private final BugReporter bugReporter;
private final OpcodeStack stack;
+ private final boolean checkMethods;
/**
* constructs a CVAA detector given the reporter to report bugs on.
@@ -57,7 +58,8 @@
*/
public ContraVariantArrayAssignment(final BugReporter bugReporter) {
this.bugReporter = bugReporter;
- this.stack = new OpcodeStack();
+ stack = new OpcodeStack();
+ checkMethods = System.getProperty("CCVA_CHECKMETHODS") != null;
}
/**
@@ -109,7 +111,7 @@
case INVOKEVIRTUAL:
case INVOKEINTERFACE:
case INVOKESPECIAL:
- if(stack.getStackDepth() > 0){
+ if(checkMethods && stack.getStackDepth() > 0){
String signature = getSigConstantOperand();
checkMethodInvocation(signature);
}
@@ -134,7 +136,7 @@
try{
if(isArrayType(sourceSignature)) {
if(!isArrayType(targetSignature)){
- bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", HIGH_PRIORITY)
+ bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", LOW_PRIORITY)
.addClass(this)
.addMethod(this)
.addSourceLine(this));
@@ -143,7 +145,7 @@
ObjectType sourceType = (ObjectType) ((ArrayType) Type.getType(sourceSignature)).getBasicType();
ObjectType targetType = (ObjectType) ((ArrayType) Type.getType(targetSignature)).getBasicType();
if(sourceType.subclassOf(targetType) && !targetType.subclassOf(sourceType)) {
- bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", HIGH_PRIORITY)
+ bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", NORMAL_PRIORITY)
.addClass(this)
.addMethod(this)
.addSourceLine(this));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|