Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318154 - [All diagrams] Multiple exceptions "Received wrong transfer data" during drag&drop
Summary: [All diagrams] Multiple exceptions "Received wrong transfer data" during drag...
Status: REOPENED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 425746 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-28 05:50 EDT by Ansgar Radermacher CLA
Modified: 2015-09-29 09:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ansgar Radermacher CLA 2010-06-28 05:50:29 EDT
Build Identifier: 

Multiple exception named "Received wrong transfer data" occur during drag&drop of elements into diagrams (probably all, tested with class and composite).

Reproducible: Always

Steps to Reproduce:
1. Open error log
2. Drag an element into a diagram
3. Exceptions occur (no stack avail.), yet object is placed correctly into diagram
Comment 1 Ansgar Radermacher CLA 2010-07-14 16:57:36 EDT
Is related to bug 302065 (should we mark it a duplicate?)
Comment 2 Camille Letavernier CLA 2013-03-22 13:00:17 EDT
Cannot reproduce on the current version (0.10M6).

I close the task
Comment 3 Ansgar Radermacher CLA 2013-03-25 08:08:02 EDT
This bug is still reproducible, but probably specific to SWT/GTK (on unix?). As stated in bug 327892, it's is very likely not a Papyrus bug.
Comment 4 Ansgar Radermacher CLA 2014-01-30 16:13:53 EST
*** Bug 425746 has been marked as a duplicate of this bug. ***
Comment 5 Ansgar Radermacher CLA 2014-01-31 03:27:37 EST
Roman found a good hint (thanks) in http://www.eclipse.org/forums/index.php/t/201875/

The error is caused by a check in the JFace function LocalSelectionTransfer.nativeToJava(transferData).
The culprit is that the attribute "pValue" within transferData is 0. According to the documentation, pValue is:

Pointer to the data being transferred. (Warning: This field is platform dependent)
IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.

Thus, LocalSelectionTransfer should not raise an exception if pValue is 0. It seems to be a JFace bug.

However, it might be necessary to enable the following workaround (as indicated in the forum entry above): replace the nativeToJava call with getSelection. The respective call is in function initializeGraphicalViewer() of class UMLDiagramEditor of each Papyrus diagram (need to change the template).

replace
  return LocalSelectionTransfer.getTransfer().nativeToJava(data);
with 
  return LocalSelectionTransfer.getTransfer().getSelection();
Comment 6 Ansgar Radermacher CLA 2014-02-03 05:07:14 EST
Should be fixed with commit d2ecee698a8bd9839d7685bfc6d12b616d26751b. Roman, can you please verify.
Comment 7 Ronan Bar CLA 2014-02-03 05:21:08 EST
Confirmed fixed on 1.0.0.v201402030925
Comment 8 Ansgar Radermacher CLA 2014-02-03 05:38:25 EST
Now all diagram editors use the method getSelection instead of nativeToJava
Comment 9 matthieu perin CLA 2015-09-29 09:51:55 EDT
Hi,

I am experiencing the exact same bug : 
Lots of "Received wrong transfer data" from jface as soon as I tried to Drag&Drop an element from tree view into a diagram (input pin into an activity in an activity diagram in my case).

I am running the 32bit linux version using both Luna (1.0.2.v201508261054) and Mars (1.1.1.201508071204) version with same result.

Do not hesitate to ask me if you need more info.