Bug 44411 NPE in JavaSearchResultCollector [search]
Build 20030930 JavaSearchResultCollector.fView is null: Thread [ModalContext] (Suspended (exception NullPointerException)) JavaSearchResultCollector.accept(IResource, int, int, IJavaElement, int) line: 130 MatchLocator.report(IResource, int, int, IJavaElement, int) line: 923 MatchLocator.report(int, int, IJavaElement, int) line: 916 MatchLocator.reportAccurateReference(int, int, char[][], IJavaElement, int) line: 984 TypeReferenceLocator.matchReportReference(ArrayTypeReference, IJavaElement, int, MatchLocator) line: 162 TypeReferenceLocator.matchReportReference(AstNode, IJavaElement, int, MatchLocator) line: 176 MatchLocator.reportMatching(AbstractMethodDeclaration, IJavaElement, int, boolean, MatchingNodeSet) line: 1155 MatchLocator.reportMatching(TypeDeclaration, IJavaElement, int, MatchingNodeSet) line: 1330 MatchLocator.reportMatching(CompilationUnitDeclaration, boolean) line: 1216 MatchLocator.process(PossibleMatch, boolean) line: 857 MatchLocator.locateMatches(JavaProject, PossibleMatch[], int, int) line: 590 MatchLocator.locateMatches(JavaProject, PossibleMatchSet) line: 627 MatchLocator.locateMatches(String[], IWorkspace, ICompilationUnit[]) line: 714 SearchEngine.search(IWorkspace, ISearchPattern, IJavaSearchScope, IJavaSearchResultCollector) line: 568 SearchEngine.search(IWorkspace, IJavaElement, int, IJavaSearchScope, IJavaSearchResultCollector) line: 495 JavaSearchOperation.execute(IProgressMonitor) line: 96 WorkspaceModifyOperation$1.run(IProgressMonitor) line: 71 Workspace.run(IWorkspaceRunnable, ISchedulingRule, IProgressMonitor) line: 1555 Workspace.run(IWorkspaceRunnable, IProgressMonitor) line: 1572 JavaSearchOperation(WorkspaceModifyOperation).run(IProgressMonitor) line: 85 ModalContext$ModalContextThread.run() line: 101
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java
if (!getProgressMonitor().isCanceled()) {
			String matchesString= getFormattedMatchesString(fMatchCount);
			getProgressMonitor().setTaskName(MessageFormat.format(DONE, new String[]{matchesString}));
		}
		if (fView != null) {
			if (fPotentialMatchCount > 0)
				explainPotentialMatch(fPotentialMatchCount);
			fView.searchFinished();
		}
		
		fView= null;
		fMonitor= null;
	}
	private void explainPotentialMatch(final int potentialMatchCount) {
		
		final Shell shell= fView.getSite().getShell();
		final String title;
		if (potentialMatchCount == 1)
			title= new String(SearchMessages.getString("Search.potentialMatchDialog.title.foundPotentialMatch")); 
		else
			title= new String(SearchMessages.getFormattedString("Search.potentialMatchDialog.title.foundPotentialMatches", "" + potentialMatchCount)); 
		
		shell.getDisplay().syncExec(new Runnable() {
			public void run() {
				OptionalMessageDialog.open(
					POTENTIAL_MATCH_DIALOG_ID, 
					shell,
					title,
					null,
					SearchMessages.getString("Search.potentialMatchDialog.message"),