Bug 37286 SourceReferenceAction.isDeletedFromEditor fails on initializer from class file [ccp] [dnd]
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/SourceReferenceAction.java
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IImportContainer;
import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.corext.SourceRange;
import org.eclipse.jdt.internal.corext.refactoring.reorg.SourceReferenceUtil;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.corext.util.WorkingCopyUtil;
public abstract class SourceReferenceAction extends SelectionDispatchAction {
	
	private static final ISourceRange fgUnknownRange= new SourceRange(-1, 0);
	protected SourceReferenceAction(IWorkbenchSite site) {
		super(site);
	}
	protected ISourceReference[] getElementsToProcess(IStructuredSelection selection) {
		return SourceReferenceUtil.removeAllWithParentsSelected(getSelectedElements(selection));
	}