Bug 32987 Cannot resolve interfaces in same file
in the same file create the following and create an anonymous inner class using the Ctrl+Space mechanism for the Xtra interface: public class Test3 { void method() { Xtra x = new Xtra(); //<-- select anonymous inner class for this using // Ctrl+space } } interface Xtra { public void method(); } result: ------------------------ package org.test; public class Test3 { void method() { Xtra x= new Xtra() { }; } } interface Xtra { public void method(); } -------------------------- as you can see the method method() is missing from the anonymous Xtra inteface!
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
super(constructorCompletion, cu, start, length, null, displayName, relevance);
		Assert.isNotNull(declaringTypeName);
		Assert.isNotNull(jproject);
		
		fDeclaringType= getDeclaringType(jproject, declaringTypeName);
		setImage(getImageForType(fDeclaringType));
		setCursorPosition(constructorCompletion.indexOf('(') + 1);
	}
	private Image getImageForType(IType type) {
		String imageName= JavaPluginImages.IMG_OBJS_CLASS; 
		if (type != null) {
			try {
				if (type.isInterface()) {
					imageName= JavaPluginImages.IMG_OBJS_INTERFACE;
				}
			} catch (JavaModelException e) {
				JavaPlugin.log(e);
			}
		}
		return JavaPluginImages.get(imageName);
	}
	
	private IType getDeclaringType(IJavaProject project, String typeName) {
		try {
			return project.findType(typeName);
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
		return null;
	}