String text= ((ITextSelection)selection).getText().trim(); if (text.length() > 0 && JavaConventions.validateJavaTypeName(text).isOK()) { fInitialFilter= text; fSelectionMode= FULL_SELECTION;
String text= ((ITextSelection)selection).getText(); if (text != null) { text= text.trim(); if (text.length() > 0 && JavaConventions.validateJavaTypeName(text).isOK()) { fInitialFilter= text; fSelectionMode= FULL_SELECTION; }
	public int open() {		try {			ensureConsistency();		} catch (InvocationTargetException e) {			ExceptionHandler.handle(e, JavaUIMessages.TypeSelectionDialog_error3Title, JavaUIMessages.TypeSelectionDialog_error3Message); 			return CANCEL;		} catch (InterruptedException e) {			// cancelled by user			return CANCEL;		}		if (fInitialFilter == null) {			IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow();			if (window != null) {				ISelection selection= window.getSelectionService().getSelection();				if (selection instanceof ITextSelection) {					String text= ((ITextSelection)selection).getText().trim();					if (text.length() > 0 && JavaConventions.validateJavaTypeName(text).isOK()) {						fInitialFilter= text;						fSelectionMode= FULL_SELECTION;					}				}			}		}		return super.open();	}