[Fb-contrib-commit] SF.net SVN: fb-contrib: [546] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/de
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-06-03 05:19:32
|
Revision: 546 Author: dbrosius Date: 2006-06-02 22:19:26 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=546&view=rev Log Message: ----------- For COM, when invoking a method make sure the class, method name and signature match, not just the constant pool index :) Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-05-24 18:15:48 UTC (rev 545) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-06-03 05:19:26 UTC (rev 546) @@ -29,6 +29,7 @@ import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle; import org.apache.bcel.generic.InstructionList; +import org.apache.bcel.generic.InvokeInstruction; import org.apache.bcel.generic.ReferenceType; import edu.umd.cs.findbugs.BugInstance; @@ -173,6 +174,19 @@ if (!childRefType.getSignature().equals(parentRefType.getSignature())) return false; } + } else if (childin instanceof InvokeInstruction) { + String childClassName = ((InvokeInstruction) childin).getClassName(childPoolGen); + String parentClassName = ((InvokeInstruction) parentin).getClassName(parentPoolGen); + if (!childClassName.equals(parentClassName)) + return false; + String childMethodName = ((InvokeInstruction) childin).getMethodName(childPoolGen); + String parentMethodName = ((InvokeInstruction) parentin).getMethodName(parentPoolGen); + if (!childMethodName.equals(parentMethodName)) + return false; + String childSignature = ((InvokeInstruction) childin).getSignature(childPoolGen); + String parentSignature = ((InvokeInstruction) parentin).getSignature(parentPoolGen); + if (!childSignature.equals(parentSignature)) + return false; } else { if (!childin.equals(parentin)) return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |