Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 382907
Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java (-1 / +38 lines)
Lines 11452-11456 Link Here
11452
			deleteProject(jp);
11452
			deleteProject(jp);
11453
		}
11453
		}
11454
	}
11454
	}
11455
11455
	public void testBug382907() throws JavaModelException {
11456
    	this.workingCopy = getWorkingCopy("/Converter15/src/Implement.java", true/*resolve*/);
11457
    	String contents =
11458
    					"public class Implement {\n" +
11459
    					"	public interface I<T> {\n" +
11460
    					"		void m(T t);\n" +
11461
    					"		T m2();\n" +
11462
    					"	}	\n"+
11463
    					"	public static class S<T> implements I<T> {\n" +
11464
    					"		public void m(T t) {\n" +
11465
    					"		}\n" +
11466
    					"		public T m2() {\n" +
11467
    					"			return null;\n" +
11468
    					"		}\n" +
11469
    					"	}\n" +
11470
    					"}\n" +
11471
    					"class BaseCall {\n" +
11472
    					"	public interface I<T> extends Implement.I<T> {\n" +
11473
    					"		void m(T t);\n" +
11474
    					"		T m2();\n" +
11475
    					"	}\n" +
11476
    					"	public static class X<T> extends Implement.S<T> implements I<T> {\n" +
11477
    					"	}\n" +
11478
    					"}\n";
11479
    	
11480
    	ASTNode node = buildAST(
11481
    			contents,
11482
    			this.workingCopy);
11483
    	assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
11484
    	CompilationUnit unit = (CompilationUnit) node;
11485
    	node = (ASTNode)((AbstractTypeDeclaration)((AbstractTypeDeclaration)unit.types().get(1)).bodyDeclarations().get(0)).bodyDeclarations().get(0);
11486
    	IMethodBinding mb = ((MethodDeclaration) node).resolveBinding();
11487
    	node = (ASTNode)((AbstractTypeDeclaration)((AbstractTypeDeclaration)unit.types().get(0)).bodyDeclarations().get(0)).bodyDeclarations().get(0);
11488
    	IMethodBinding sm = ((MethodDeclaration) node).resolveBinding();
11489
    	System.out.println("node: " + mb);
11490
    	System.out.println("node: " + sm);
11491
    	assertTrue("isSubsignature should return true", sm.isSubsignature(mb));
11492
    }
11456
}
11493
}

Return to bug 382907