| java.lang.Object org.drools.util.asm.MethodComparator
MethodComparator | public class MethodComparator (Code) | | The purpose of this utility it to check if 2 method implementations are equivalent, by comparing the bytecode.
This essentual for node sharing where java semantics are involved.
author: Michael Neale |
Inner Class :public static class Tracer implements ClassVisitor | |
compareBytecode | public static boolean compareBytecode(List b1, List b2)(Code) | | Compares 2 bytecode listings.
Returns true if they are identical.
|
equivalent | public boolean equivalent(String method1, ClassReader class1, String method2, ClassReader class2)(Code) | | This actually does the comparing.
Class1 and Class2 are class reader instances to the respective classes. method1 and method2 are looked up on the
respective classes and their contents compared.
This is a convenience method.
|
getMethodBytecode | public List getMethodBytecode(String methodName, ClassReader classReader)(Code) | | This will return a series of bytecode instructions which can be used to compare one method with another.
debug info like local var declarations and line numbers are ignored, so the focus is on the content.
|
getMethodBytecode | public static List getMethodBytecode(String methodName, byte[] bytes)(Code) | | This will return a series of bytecode instructions which can be used to compare one method with another.
debug info like local var declarations and line numbers are ignored, so the focus is on the content.
|
|
|