What is the expected output? What do you see instead?
I expect the final method to be marked as NOT overridable.
Failing Test:
public void testMediumFinalCost2() throws Exception {
MethodInfo method =
repo.getClass(Medium.class.getName()).getMethod("finalCost2()I");
assertFalse(method.canOverride());
MethodCost cost = computer.compute(Medium.class.getName(),
"finalCost2()I");
assertEquals(3l, cost.getTotalComplexityCost());
}
* Method necessary to add to the class Medium (static class inside
MetricComputerTest)
CODE:
/**
* I cost 2, but I am a <em>final</em> instance method that can not be
overridden.
* My cost is unavoidable.
*/
public final int finalCost2() {
int i = 0;
return i > 0 ? i > 1 ? 1 : 2 : 2;
}
Misko followed up on the mailing list with:
QUOTE:
Sounds like a real bug! Can you create a tests case and fix the
bug? :-) If you can't fix it send me the test case and I will patch it
in and submit a fix for you.
-- Misko
http://groups.google.com/group/testability-explorer/browse_thread/thread/49b34c6
ca1ad1209
Original issue reported on code.google.com by jawol...@gmail.com on 8 Oct 2008 at 12:26
Original issue reported on code.google.com by
jawol...@gmail.com
on 8 Oct 2008 at 12:26