Bug 77404 [Navigator] ArrayStoreException thrown by NavigatorDropAdapter.getSelecetdResources
I20041101 Select a method in the Outline view Drag it over the Navigator view NavigatorDropAdapter.getSelectedResources throws the following exception (which is currently quitely eaten by the SWT DND mechanism but in the very near future this exception will be thrown): java.lang.ArrayStoreException at java.util.AbstractCollection.toArray(AbstractCollection.java:174) at org.eclipse.ui.views.navigator.NavigatorDropAdapter.getSelectedResources (NavigatorDropAdapter.java:136) at org.eclipse.ui.views.navigator.NavigatorDropAdapter.validateTarget (NavigatorDropAdapter.java:379) at org.eclipse.ui.views.navigator.NavigatorDropAdapter.validateDrop (NavigatorDropAdapter.java:355) at org.eclipse.jface.viewers.ViewerDropAdapter.doDropValidation (ViewerDropAdapter.java:169) at org.eclipse.jface.viewers.ViewerDropAdapter.dragOver (ViewerDropAdapter.java:215) at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:59) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:800) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:824) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:809) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:617) at org.eclipse.swt.dnd.DropTarget.notifyListeners(DropTarget.java:511) at org.eclipse.swt.dnd.DropTarget.DragOver(DropTarget.java:338) at org.eclipse.swt.dnd.DropTarget.access$5(DropTarget.java:314) at org.eclipse.swt.dnd.DropTarget$3.method4(DropTarget.java:234) at org.eclipse.swt.internal.ole.win32.COMObject.callback4(COMObject.java:97) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:287) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:267) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:161) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:800) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2794) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2448) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1527) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1498) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:276) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:704) at org.eclipse.core.launcher.Main.main(Main.java:688)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/NavigatorDropAdapter.java
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.DropTargetListener;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.TransferData;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CopyFilesAndFoldersOperation;
import org.eclipse.ui.actions.MoveFilesAndFoldersOperation;
import org.eclipse.ui.actions.ReadOnlyStateChecker;
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.part.PluginDropAdapter;
import org.eclipse.ui.part.ResourceTransfer;
/**
 * Implements drop behaviour for drag and drop operations
 * that land on the resource navigator.
 * 
 * @since 2.0
 */
public class NavigatorDropAdapter extends PluginDropAdapter implements
        IOverwriteQuery {
    /**
     * A flag indicating that overwrites should always occur.