Bug 81505 Search Again throws NPE if a search query cannot be rerun
I200412162000 - new workspace, new Java Propject with CU p/A.java: package p; public class A {} - Find identifier occurrences for A - activate the search result view and don't open the context menu - press F5 -> the problem seems to be that the query is rerun although it answers false to canRerun() Error 2004-12-17 12:04:49.929 An internal error occurred during: "Search for Occurrences in File". java.lang.NullPointerException at org.eclipse.jdt.internal.ui.search.OccurrencesSearchQuery.run(OccurrencesSearchQuery.java:46) at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:85) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchQuery.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.ui.search;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.IDocument;
import org.eclipse.search.ui.ISearchQuery;
import org.eclipse.search.ui.ISearchResult;
public class OccurrencesSearchQuery implements ISearchQuery {
	private OccurrencesSearchResult fResult;
	private IOccurrencesFinder fFinder;
	private IDocument fDocument;
	private IJavaElement fElement;
	private String fSingularLabel;
	private String fPluralLabelPattern;
	private String fJobLabel;