Bug 261865 [CommonNavigator] Drag from Project Explorer to Package Explorer gets "assertion failed"
The CommonDropAdapter should be keeping track of the event.detail variable and setting it properly at the end. It currently does not do this all the time. If dragging from the project explorer, a JDT drag adapter checks this code in an assert to verify there is no more work to do. BasicSelectionTransferDragAdapter.dragFinished(etc) has the following code: public void dragFinished(DragSourceEvent event) { // Make sure we don't have to do any remaining work Assert.isTrue(event.detail != DND.DROP_MOVE); LocalSelectionTransfer.getInstance().setSelection(null); LocalSelectionTransfer.getInstance().setSelectionSetTime(0); } Currently, CommonDropAdapter only modifies this event.detail variable via the superclass, and even then, only in some situations. public void drop(DropTargetEvent event) { validateDrop(getCurrentTarget(), getCurrentOperation(), event.currentDataType); if (PluginTransfer.getInstance().isSupportedType(event.currentDataType)) super.drop(event); The superclass and the super-superclass execute the following line almost universally in this method: event.detail = DND.DROP_NONE; This command indicates the event no longer has any work to do. This line is missing from CommonDropAdapter.drop(DropTargetEvent event) in two places. Patch attached. The effect of this bug is that any time this bug is hit, an error dialog appears and something is logged to the error log. Very annoying for users.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerDropAdapter.java
*   <li><code>performDrop</code> - carries out a drop into a viewer</li>
 * </ul>
 * The <code>setFeedbackEnabled</code> method can be called to turn on and off 
 * visual insertion feedback (on by default).
 * </p>
 */
public abstract class ViewerDropAdapter extends DropTargetAdapter {
    /**
     * Constant describing the position of the cursor relative 
     * to the target object.  This means the mouse is positioned
     * slightly before the target.
     * @see #getCurrentLocation()
     */
    public static final int LOCATION_BEFORE = 1;
    /**
     * Constant describing the position of the cursor relative 
     * to the target object.  This means the mouse is positioned
     * slightly after the target.
     * @see #getCurrentLocation()
     */
    public static final int LOCATION_AFTER = 2;
    /**
     * Constant describing the position of the cursor relative 
     * to the target object.  This means the mouse is positioned
     * directly on the target.
     * @see #getCurrentLocation()
     */
    public static final int LOCATION_ON = 3;
    /**
     * Constant describing the position of the cursor relative