Q7

Sticky data during Drag&Drop

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.16, 1.3.9
  • Fix Version/s: 1.3.10
  • Component/s: Runtime
  • Labels:
  • Test Mode:
    Manual

Description

Starting from the second drop the data being dropped is the one dragged first when runtime is loaded.
org.eclipse.emf.edit.ui.dnd.LocalTransfer class is used in both drag source and drop target.
org.eclipse.swt.dnd.ByteArrayTransfer.nativeToJava(TransferData) method is never called for drop operation in this case.

Proper stack (when dragged for first time)
Thread [main] (Suspended (breakpoint at line 60 in DocumentationExplorer$1))	
	DocumentationExplorer$1.dragSetData(DragSourceEvent) line: 60	
	DNDListener.handleEvent(Event) line: 54	
	EventTable.sendEvent(Event) line: 84	
	Widget.sendEvent_aroundBody2(Widget, Event) line: 1053	
	Widget$AjcClosure3.run(Object[]) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$4$2f127892proceed(Widget, Event, AroundClosure) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$4$2f127892(Widget, Event, AroundClosure) line: 134	
	DragSource(Widget).sendEvent(Event) line: 1051	
	Widget.sendEvent_aroundBody4(Widget, int, Event, boolean) line: 1077	
	Widget$AjcClosure5.run(Object[]) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$1$bd9fb3e7proceed(Widget, int, Event, boolean, AroundClosure) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$1$bd9fb3e7(Widget, int, Event, boolean, AroundClosure) line: 67	
	DragSource(Widget).sendEvent(int, Event, boolean) line: 1066	
	DragSource(Widget).sendEvent(int, Event) line: 1062	
	DragSource(Widget).notifyListeners(int, Event) line: 774	
	DragSource.GetData(int, int) line: 457	
	DragSource.access$7(DragSource, int, int) line: 436	
	DragSource$4.method3(int[]) line: 259	
	COMObject.callback3(int[]) line: 92	
	COM.VtblCall(int, int, FORMATETC, STGMEDIUM) line: not available [native method]	
	IDataObject.GetData(FORMATETC, STGMEDIUM) line: 25	
	LocalTransfer(Transfer).getData(IDataObject, FORMATETC, STGMEDIUM) line: 44	
	ByteArrayTransfer.nativeToJava_aroundBody2(ByteArrayTransfer, TransferData) line: 196	
	ByteArrayTransfer$AjcClosure3.run(Object[]) line: 1	
	ClipboardAspect.ajc$around$com_xored_tesla_swt_aspects_ClipboardAspect$11$e312bc05proceed(ByteArrayTransfer, TransferData, AroundClosure) line: 1 //Never gets here on the second drop	
	ClipboardAspect.ajc$around$com_xored_tesla_swt_aspects_ClipboardAspect$11$e312bc05(ByteArrayTransfer, TransferData, AroundClosure) line: 284	
	LocalTransfer(ByteArrayTransfer).nativeToJava(TransferData) line: 189	
	LocalTransfer.nativeToJava(TransferData) line: 115	
	DropTarget.Drop(int, int, int, int, int) line: 443	
	DropTarget$3.method6(int[]) line: 258	
	COMObject.callback6(int[]) line: 119	
	COM.DoDragDrop(int, int, int, int[]) line: not available [native method]	
	DragSource.drag(Event) line: 363	
	DragSource.access$0(DragSource, Event) line: 289	
	DragSource$1.handleEvent(Event) line: 172	
	EventTable.sendEvent(Event) line: 84	
	Widget.sendEvent_aroundBody2(Widget, Event) line: 1053	
	Widget$AjcClosure3.run(Object[]) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$4$2f127892proceed(Widget, Event, AroundClosure) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$4$2f127892(Widget, Event, AroundClosure) line: 134	
	Tree(Widget).sendEvent(Event) line: 1051	
	Display.runDeferredEvents() line: 4169	
	Display.readAndDispatch() line: 3758	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2701	
	Workbench.runUI() line: 2665	
	Workbench.access$4(Workbench) line: 2499	
	Workbench$7.run() line: 679	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 668	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	VozoneApplication.start(IApplicationContext) line: 81	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 353	
	EclipseStarter.run(String[], Runnable) line: 180	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 601	
	Main.invokeFramework(String[], URL[]) line: 629	
	Main.basicRun(String[]) line: 584	
	Main.run(String[]) line: 1438	
	Main.main(String[]) line: 1414
Bad stack
Thread [main] (Suspended)	
	Class<T>.getDeclaredField(String) line: 1898	
	ClipboardAspect.ajc$around$com_xored_tesla_swt_aspects_ClipboardAspect$11$e312bc05(ByteArrayTransfer, TransferData, AroundClosure) line: 260	
	LocalTransfer(ByteArrayTransfer).nativeToJava(TransferData) line: 189	
	LocalTransfer.nativeToJava(TransferData) line: 115	
	DropTarget.Drop(int, int, int, int, int) line: 443	
	DropTarget$3.method6(int[]) line: 258	
	COMObject.callback6(int[]) line: 119	
	COM.DoDragDrop(int, int, int, int[]) line: not available [native method]	
	DragSource.drag(Event) line: 363	
	DragSource.access$0(DragSource, Event) line: 289	
	DragSource$1.handleEvent(Event) line: 172	
	EventTable.sendEvent(Event) line: 84	
	Widget.sendEvent_aroundBody2(Widget, Event) line: 1053	
	Widget$AjcClosure3.run(Object[]) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$4$2f127892proceed(Widget, Event, AroundClosure) line: 1	
	RecordingAspect.ajc$around$com_xored_tesla_recording_aspects_RecordingAspect$4$2f127892(Widget, Event, AroundClosure) line: 134	
	Tree(Widget).sendEvent(Event) line: 1051	
	Display.runDeferredEvents() line: 4169	
	Display.readAndDispatch() line: 3758	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2701	
	Workbench.runUI() line: 2665	
	Workbench.access$4(Workbench) line: 2499	
	Workbench$7.run() line: 679	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 668	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	VozoneApplication.start(IApplicationContext) line: 81	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 353	
	EclipseStarter.run(String[], Runnable) line: 180	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 601	
	Main.invokeFramework(String[], URL[]) line: 629	
	Main.basicRun(String[]) line: 584	
	Main.run(String[]) line: 1438	
	Main.main(String[]) line: 1414	
	Main.main(String[]) line: 1414

Steps to reproduce:
1. Create two tree views.
2. Add drag&drop support:

Drag support
viewer1.addDragSupport(DND.DROP_MOVE,
            new Transfer[] { LocalTransfer.getInstance() }, new DragSourceAdapter() {
            
                List<?> getSelection() {
                    return ((IStructuredSelection) viewer.getSelection()).toList();
                }
                @Override
                public void dragStart(DragSourceEvent event) {
                    event.doit = Iterables.all(getSelection(), Predicates.instanceOf(ObjectAttribute.class));
                }

                @Override
                public void dragSetData(DragSourceEvent event) {
                    //this code is only invoked once is runtime is loaded.
                    event.data = getSelection();
                }});
Drop support
viewer2.addDropSupport(DND.DROP_MOVE | DND.DROP_COPY, new Transfer[] {LocalTransfer.getInstance() }, new ViewerDropAdapter(viewer) {

            @Override
            public boolean performDrop(Object data) {
                // Data is always the same here if runtime is loaded.
                return true;
            }

            @Override
            public boolean validateDrop(Object target, int operation, TransferData transferType) {
                return true;
            }

3. The data being dropped is always the same even if dragged items are different.

Activity

Hide
komaz added a comment - 06/Nov/13 1:22 PM

Having mockup would be awesome, at least we'll immediately understand how many platforms are affected by this issue.

Show
komaz added a comment - 06/Nov/13 1:22 PM Having mockup would be awesome, at least we'll immediately understand how many platforms are affected by this issue.
Hide
Vasili Gulevich added a comment - 08/Nov/13 11:46 AM - edited

Mockup implemented

Mockup fixed to use org.eclipse.emf.edit.ui.dnd.LocalTransfer instead of its copy.

Show
Vasili Gulevich added a comment - 08/Nov/13 11:46 AM - edited Mockup implemented Mockup fixed to use org.eclipse.emf.edit.ui.dnd.LocalTransfer instead of its copy.
Vasili Gulevich made changes - 08/Nov/13 11:49 AM
Link This issue blocks VZ-2249 [ VZ-2249 ]
Hide
Ulyana Skorokhodova added a comment - 11/Nov/13 11:38 AM

Please, use OS Windows to reproduce

Show
Ulyana Skorokhodova added a comment - 11/Nov/13 11:38 AM Please, use OS Windows to reproduce
Hide
Andrey Sobolev added a comment - 11/Nov/13 3:35 PM

Fixed.

Show
Andrey Sobolev added a comment - 11/Nov/13 3:35 PM Fixed.
Andrey Sobolev made changes - 11/Nov/13 3:35 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Transition Time In Source Status Execution Times Last Executer Last Execution Date
Open Open Resolved Resolved
5d 2h 47m 1 Andrey Sobolev 11/Nov/13 3:35 PM

People

Vote (0)
Watch (0)

Dates

  • Created:
    06/Nov/13 12:48 PM
    Updated:
    12/Nov/13 9:42 AM
    Resolved:
    11/Nov/13 3:35 PM