Bug 61699 NPE When searching without text selection
I-2004-05-11 I had a case where the I had a NPE in JavaSearchPage.trySimpleTextSelection. Inspection of the code revealed that ITextSelection.getText() can return null, but we're not checking the condition.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
data.setJavaElement(null);
		} 
		
		textSearchJob= new JavaSearchQuery(querySpec);
		new SearchResultUpdater((JavaSearchResult) textSearchJob.getSearchResult());
		NewSearchUI.runQuery(textSearchJob);	
		return true;
	}
	
	
	private int getLimitTo() {
		for (int i= 0; i < fLimitTo.length; i++) {
			if (fLimitTo[i].getSelection())
				return i;
		}
		return -1;
	}
	private void setLimitTo(int searchFor) {
		fLimitTo[DECLARATIONS].setEnabled(true);
		fLimitTo[IMPLEMENTORS].setEnabled(false);
		fLimitTo[REFERENCES].setEnabled(true);			
		fLimitTo[ALL_OCCURRENCES].setEnabled(true);
		fLimitTo[READ_ACCESSES].setEnabled(false);
		fLimitTo[WRITE_ACCESSES].setEnabled(false);
		
		if (!(searchFor == TYPE || searchFor == INTERFACE) && fLimitTo[IMPLEMENTORS].getSelection()) {
			fLimitTo[IMPLEMENTORS].setSelection(false);
			fLimitTo[REFERENCES].setSelection(true);
		}
		if (!(searchFor == FIELD) && (getLimitTo() == READ_ACCESSES || getLimitTo() == WRITE_ACCESSES)) {