Project: JDT
Bug 159802 [add import] reports "No type '$missing$' found" in status bar
Reported: 2006-10-04 16:13:37 | Status: resolved fixed

Using the "Add Import" shortcut (default: Shift-Ctrl-M) with the cursor immediately after a type name does not recognize the type name in some cases. 1. Create a new class, let's call it ImportBug. 2. In the class, create a method, say "importBug()": public class ImportBug { void importBug() { } } 3. In the body of the method, type the name of a class, such as 'LinkedList'. Leave the cursor at the end of the word LinkedList. 4. Use the shortcut for "Add Import" (the default on Linux is Shift-Ctrl-M). 5. Note the text in the status bar: "No type '$missing$' found." The status bar text leads me to believe that the Add Import function can't find the word 'LinkedList'. Other info: 1. It also does not work in a cast, e.g. at the end of this line: LinkedList ret = ((LinkedList 2. It does work after 'new', e.g.: LinkedList ret = new LinkedList

Files changed in fix:
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