[Fb-contrib-commit] SF.net SVN: fb-contrib:[1420] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2009-12-31 22:58:41
|
Revision: 1420 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1420&view=rev Author: dbrosius Date: 2009-12-31 22:58:30 +0000 (Thu, 31 Dec 2009) Log Message: ----------- CVAA shouldn't fire if the array basic types are the same in checkSignatures 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-12-28 06:24:35 UTC (rev 1419) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ContraVariantArrayAssignment.java 2009-12-31 22:58:30 UTC (rev 1420) @@ -119,7 +119,7 @@ if(Type.getType(sourceSignature) instanceof ObjectType ) { ObjectType sourceType = (ObjectType) Type.getType(sourceSignature); ObjectType targetType = (ObjectType) ((ArrayType) Type.getType(targetSignature)).getBasicType(); - if(!sourceType.subclassOf(targetType)){ + if(!sourceType.equals(targetType) && !sourceType.subclassOf(targetType)){ bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", HIGH_PRIORITY) .addClass(this) .addMethod(this) @@ -159,7 +159,7 @@ if(isObjectType(sourceSignature) && isObjectType(targetSignature)){ ObjectType sourceType = (ObjectType) ((ArrayType) Type.getType(sourceSignature)).getBasicType(); ObjectType targetType = (ObjectType) ((ArrayType) Type.getType(targetSignature)).getBasicType(); - if(!targetType.subclassOf(sourceType)) { + if(!targetType.equals(sourceType) && !targetType.subclassOf(sourceType)) { bugReporter.reportBug(new BugInstance(this, "CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT", NORMAL_PRIORITY) .addClass(this) .addMethod(this) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |