Bug 66635 AddImportOnSelectionAction passes null process monitor to all types cache
I20040611_0100 Title says it all. We should avoid passing in null since the operation can take a while.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
AddImportsOperation op= new AddImportsOperation(cu, new IJavaElement[] { type }, settings, false);
					try {
						PlatformUI.getWorkbench().getProgressService().runInUI(
							PlatformUI.getWorkbench().getProgressService(),
							new WorkbenchRunnableAdapter(op, op.getScheduleRule()),
							op.getScheduleRule());
					} catch (InvocationTargetException e) {
						ExceptionHandler.handle(e, getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), null); 
					} catch (InterruptedException e) {
						
					}
					return;
				} catch (CoreException e) {
					ExceptionHandler.handle(e, getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), null); 
				} catch (BadLocationException e) {
					JavaPlugin.log(e);
					MessageDialog.openError(getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), e.getMessage()); 
				}
			}
		}		
	}
	
	private int getNameStart(IDocument doc, int pos) throws BadLocationException {
		while (pos > 0) {
			char ch= doc.getChar(pos - 1);
			if (!Character.isJavaIdentifierPart(ch) && ch != '.') {
				return pos;
			}
			pos--;
		}