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
if (super.validateDrop(target, dragOperation, transferType)) {
            return true;
        }
        return validateTarget(target, transferType).isOK();
    }
    /**
     * Ensures that the drop target meets certain criteria
     */
    private IStatus validateTarget(Object target, TransferData transferType) {
        if (!(target instanceof IResource)) {
            return info(ResourceNavigatorMessages
                    .getString("DropAdapter.targetMustBeResource")); 
        }
        IResource resource = (IResource) target;
        if (!resource.isAccessible()) {
            return error(ResourceNavigatorMessages
                    .getString("DropAdapter.canNotDropIntoClosedProject")); 
        }
        IContainer destination = getActualTarget(resource);
        if (destination.getType() == IResource.ROOT) {
            return error(ResourceNavigatorMessages
                    .getString("DropAdapter.resourcesCanNotBeSiblings")); 
        }
        String message = null;
        
        if (LocalSelectionTransfer.getInstance().isSupportedType(transferType)) {
            IResource[] selectedResources = getSelectedResources();
            if (selectedResources == null)
                message = ResourceNavigatorMessages
                        .getString("DropAdapter.dropOperationErrorOther");