Is there a way to compare if the two methods are equivalent in function (i.e. they do the same) and not equivalent in value (i.e. all the code in the method is the same)?
For example, these two methods are encoded differently, but perform the same function.
public int doIt(int a, int b) {
a = a + 1;
b = b + 1;
return a + b;
}
public int doIt2(int z, int x) {
int total = z + x + 2;
return total;
}
I was looking for a way to do this in Eclipse, but I wonder if this is possible even with the trivial method.
source
share