Bug 9528 CCE while coping a project to the clipboard
Test pass for M3 Got the following CCE while copying text to the clipboard. java.lang.ClassCastException: org.eclipse.jdt.internal.core.JavaProject at org.eclipse.jdt.internal.ui.reorg.SourceReferenceAction.getWorkingCopyElements (SourceReferenceAction.java:139) at org.eclipse.jdt.internal.ui.reorg.SourceReferenceAction.getSelectedElements (SourceReferenceAction.java:85) at org.eclipse.jdt.internal.ui.reorg.SourceReferenceAction.getElementsToProcess (SourceReferenceAction.java:59) at org.eclipse.jdt.internal.ui.reorg.CopySourceReferencesToClipboardAction.perform (CopySourceReferencesToClipboardAction.java:21) at org.eclipse.jdt.internal.ui.reorg.SourceReferenceAction$1.run (SourceReferenceAction.java:50) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56) at org.eclipse.jdt.internal.ui.reorg.SourceReferenceAction.run (SourceReferenceAction.java:47) at org.eclipse.jface.action.Action.runWithEvent(Action.java:452) at org.eclipse.ui.internal.RetargetAction.runWithEvent (RetargetAction.java:137) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:788) at org.eclipse.ui.internal.Workbench.run(Workbench.java:771) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/SourceReferenceAction.java
private ISelectionProvider fSelectionProvider;
	protected SourceReferenceAction(String name, ISelectionProvider provider) {
		super(name, provider);
		fSelectionProvider= provider;
	}
	protected ISelectionProvider getSelectionProvider(){
		return fSelectionProvider;
	}
	
	/*
	 * @see Action#run
	 */
	public final void run() {
		new BusyIndicator().showWhile(JavaPlugin.getActiveWorkbenchShell().getDisplay(), new Runnable() {
			public void run() {
				try {
					perform();
				} catch (CoreException e) {
					ExceptionHandler.handle(e, getText(), "Unexpected exception. See log for details.");
				}
			}
		});
	}
	
	protected ISourceReference[] getElementsToProcess() {
		return SourceReferenceUtil.removeAllWithParentsSelected(getSelectedElements());
	}