Project: JDT
Bug 154840 [Add Import] on private enum constants results in compilation error
Reported: 2006-08-23 06:28:52 | Status: resolved fixed

Eclipse SDK Version: 3.2.0 Build id: M20060629-1905 Consider the following snippet: --- public class Machine { private State state; public boolean isAlive() { return state != State.DEAD; } private enum State { IDLE, RUNNING, DEAD } } --- Run Source -> Add Import on "State.DEAD". Two compiler errors appear: - DEAD cannot be resolved. - The import Machine cannot be resolved.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/CodeGenerationMessages.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java