Lines 670-673
Link Here
|
670 |
}); |
670 |
}); |
671 |
assertTrue("Y#foo(String) should override X#foo(T)", bindings[0].overrides(bindings[1])); |
671 |
assertTrue("Y#foo(String) should override X#foo(T)", bindings[0].overrides(bindings[1])); |
672 |
} |
672 |
} |
|
|
673 |
|
674 |
/* |
675 |
* Ensures that a method in a subtype overrides the corresponding method in the super type |
676 |
* even if the two methods have different return types. |
677 |
* (regression test for bug 105808 [1.5][dom] MethodBinding#overrides(..) should not consider return types) |
678 |
*/ |
679 |
public void test031() throws CoreException { |
680 |
try { |
681 |
IJavaProject project = createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, "", "1.4"); |
682 |
IMethodBinding[] bindings = createMethodBindings( |
683 |
new String[] { |
684 |
"/P/p1/X.java", |
685 |
"package p1;\n" + |
686 |
"public class X {\n" + |
687 |
" Object foo() {\n" + |
688 |
" }\n" + |
689 |
"}", |
690 |
"/P/p1/Y.java", |
691 |
"package p1;\n" + |
692 |
"public class Y extends X {\n" + |
693 |
" String foo() {\n" + |
694 |
" }\n" + |
695 |
"}", |
696 |
}, |
697 |
new String[] { |
698 |
"Lp1/Y;.foo()Ljava/lang/String;", |
699 |
"Lp1/X;.foo()Ljava/lang/Object;" |
700 |
}, |
701 |
project); |
702 |
assertTrue("Y#foo() should override X#foo()", bindings[0].overrides(bindings[1])); |
703 |
} finally { |
704 |
deleteProject("P2"); |
705 |
} |
706 |
} |
707 |
|
673 |
} |
708 |
} |