[Fb-contrib-commit] SF.net SVN: fb-contrib:[1456] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2010-01-10 02:14:16
|
Revision: 1456
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1456&view=rev
Author: dbrosius
Date: 2010-01-10 02:14:08 +0000 (Sun, 10 Jan 2010)
Log Message:
-----------
if the target type is java.lang.Object, then ignore
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 2010-01-10 02:05:50 UTC (rev 1455)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java 2010-01-10 02:14:08 UTC (rev 1456)
@@ -115,19 +115,21 @@
if(!value.isNull()) {
String sourceSignature = value.getSignature();
String targetSignature = arrayref.getSignature();
- try{
- if(Type.getType(sourceSignature) instanceof ObjectType ) {
- ObjectType sourceType = (ObjectType) Type.getType(sourceSignature);
- ObjectType targetType = (ObjectType) ((ArrayType) Type.getType(targetSignature)).getBasicType();
- if(!sourceType.equals(targetType) && !sourceType.subclassOf(targetType)){
- bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", HIGH_PRIORITY)
- .addClass(this)
- .addMethod(this)
- .addSourceLine(this));
+ if (!"Ljava/lang/Object;".equals(targetSignature)) {
+ try{
+ if(Type.getType(sourceSignature) instanceof ObjectType ) {
+ ObjectType sourceType = (ObjectType) Type.getType(sourceSignature);
+ ObjectType targetType = (ObjectType) ((ArrayType) Type.getType(targetSignature)).getBasicType();
+ if(!sourceType.equals(targetType) && !sourceType.subclassOf(targetType)){
+ bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", HIGH_PRIORITY)
+ .addClass(this)
+ .addMethod(this)
+ .addSourceLine(this));
+ }
}
+ } catch (ClassNotFoundException cnfe) {
+ bugReporter.reportMissingClass(cnfe);
}
- } catch (ClassNotFoundException cnfe) {
- bugReporter.reportMissingClass(cnfe);
}
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|