Bug 37399 Organize Imports can remove required inner interfaces [code manipulation]
import com.epiphany.shr.sf.ClusterSingletonStepped.SingletonStep; After organize imports, this import is turned into: import com.epiphany.shr.sf.ClusterSingletonStepped; If it is not legal to have inner interfaces I appologize and I will flog the coder. Otherwise, it appears that organize imports can potentially cause compiler errors that are hard to track down. I run it, and things look ok, but part of my import is gone. Interface definition: public abstract class ClusterSingletonStepped extends ClusterSingleton { ..... public interface SingletonStep ..... } Thanks for looking at this. Please let me know if I can add any additional information or answer any questions.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
ICompilationUnit wc= (ICompilationUnit) unit.getWorkingCopy(null, JavaUI.getBufferFactory(), null);
		StringBuffer buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class A {\n");
		buf.append("    public Object foo() {\n");
		buf.append("    }\n");
		buf.append("}\n");	
		wc.getBuffer().setContents(buf.toString());
		
		String[] order= new String[] { "com", "com.foreigncompany", "com.mycompany" };
		int threshold= 99;
		ImportsStructure importsStructure= new ImportsStructure(wc, order, threshold, true);
		importsStructure.addImport("java.util.HashMap");
		importsStructure.create(false, null);
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("\n");
		buf.append("import java.util.HashMap;\n");
		buf.append("\n");		
		buf.append("public class A {\n");
		buf.append("    public Object foo() {\n");
		buf.append("    }\n");
		buf.append("}\n");	
		
		assertEqualStringIgnoreDelim(wc.getSource(), buf.toString());
	}	
	
		
}