Bug 117025 Invalid "Unsupported search pattern" message while search again
This problem exist since 3.0 I guess, here's the scenario.. Test case is a simple class: class X { void foo() {} void bar() { foo(); } } Here are steps: 1) Search reference to foo() method => you get 1 match in Search view: OK 2) Rename foo (using refactoring or directly in code, it does not matter) 3) Go back to Search view and select "Search again" item => you get "Java Search" dialog: 'Unsupported search pattern: "foo"' I think user should have a better error message than this one which definitely sounds like an internal error. perhaps something like: Java element "foo" does no longer exist...
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchQuery.java
ISafeRunnable runnable= new ISafeRunnable() {
					public void handleException(Throwable exception) {
						ticks[iPrime]= 0;
						String message= SearchMessages.JavaSearchQuery_error_participant_estimate; 
						JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, message, exception));
					}
					public void run() throws Exception {
						ticks[iPrime]= participantDescriptors[iPrime].getParticipant().estimateTicks(fPatternData);
					}
				};
				
				Platform.run(runnable);
				totalTicks+= ticks[i];
			}
			monitor.beginTask(SearchMessages.JavaSearchQuery_task_label, totalTicks); 
			IProgressMonitor mainSearchPM= new SubProgressMonitor(monitor, 1000);
			boolean ignorePotentials= NewSearchUI.arePotentialMatchesIgnored();
			NewSearchResultCollector collector= new NewSearchResultCollector(textResult, ignorePotentials);
			
			SearchPattern pattern;
			String stringPattern= null;
			
			if (fPatternData instanceof ElementQuerySpecification) {
				pattern= SearchPattern.createPattern(((ElementQuerySpecification)fPatternData).getElement(), fPatternData.getLimitTo(), SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE);
				stringPattern= ((ElementQuerySpecification)fPatternData).getElement().getElementName();
			} else {
				PatternQuerySpecification patternSpec = (PatternQuerySpecification) fPatternData;
				stringPattern= patternSpec.getPattern();
				int matchMode= getMatchMode(stringPattern) | SearchPattern.R_ERASURE_MATCH;
				if (patternSpec.isCaseSensitive())