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
/* (non-Javadoc)
	 * @see JavaTypeCompletionProposal#updateReplacementString(char, int, ImportsStructure)
	 */
	protected boolean updateReplacementString(IDocument document, char trigger, int offset, ImportsStructure impStructure) throws CoreException, BadLocationException {
		String replacementString= getReplacementString();
		
		
		StringBuffer buf= new StringBuffer();
		buf.append(replacementString);
		
		if (!replacementString.endsWith(")")) { 
			buf.append(')');
		}	
		buf.append(" {\n"); 
		if (!createStubs(buf, impStructure)) {
			return false;
		}
		buf.append("}"); 
		
		
		String lineDelim= StubUtility.getLineDelimiterFor(document);
		int tabWidth= CodeFormatterUtil.getTabWidth();
		IRegion region= document.getLineInformationOfOffset(getReplacementOffset());
		int indent= Strings.computeIndent(document.get(region.getOffset(), region.getLength()), tabWidth);
		
		String replacement= StubUtility.codeFormat(buf.toString(), indent, lineDelim);
		setReplacementString(Strings.trimLeadingTabsAndSpaces(replacement));
		int pos= offset;
		while (pos < document.getLength() && Character.isWhitespace(document.getChar(pos))) {