Community
Participate
Working Groups
deleteProject(jp);
}
public void testBug382907() throws JavaModelException {
this.workingCopy = getWorkingCopy("/Converter15/src/Implement.java", true/*resolve*/);
String contents =
"public class Implement {\n" +
" public interface I<T> {\n" +
" void m(T t);\n" +
" T m2();\n" +
" } \n"+
" public static class S<T> implements I<T> {\n" +
" public void m(T t) {\n" +
" }\n" +
" public T m2() {\n" +
" return null;\n" +
"}\n" +
"class BaseCall {\n" +
" public interface I<T> extends Implement.I<T> {\n" +
" public static class X<T> extends Implement.S<T> implements I<T> {\n" +
"}\n";
ASTNode node = buildAST(
contents,
this.workingCopy);
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
CompilationUnit unit = (CompilationUnit) node;
node = (ASTNode)((AbstractTypeDeclaration)((AbstractTypeDeclaration)unit.types().get(1)).bodyDeclarations().get(0)).bodyDeclarations().get(0);
IMethodBinding mb = ((MethodDeclaration) node).resolveBinding();
node = (ASTNode)((AbstractTypeDeclaration)((AbstractTypeDeclaration)unit.types().get(0)).bodyDeclarations().get(0)).bodyDeclarations().get(0);
IMethodBinding sm = ((MethodDeclaration) node).resolveBinding();
System.out.println("node: " + mb);
System.out.println("node: " + sm);
assertTrue("isSubsignature should return true", sm.isSubsignature(mb));