Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352690

Summary: [DND] EditorAreaDropAdapter should ignore empty events
Product: [Eclipse Project] Platform Reporter: Benjamin Muskalla <b.muskalla>
Component: IDEAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, peter, pwebster, remy.suen, reprogrammer, snjezana.peco
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
patch
none
mylyn/context/zip
none
I faced the issue while was working on https://issues.jboss.org/browse/JBIDE-15499. none

Description Benjamin Muskalla CLA 2011-07-20 22:50:13 EDT
EditorAreaDropAdapter should ignore the dropevent in case event.data is null. This can happend if other applications don't provide sufficient or no data at all in their events (eg. drag and drop a url from chromium on Linux).

Related bugs: 
349021: drag and drop does not work with Chrome on Linux
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349021

95105: [DND] DBCS3.3: DBCS named file drag&drop not function
Comment 1 Benjamin Muskalla CLA 2011-07-20 22:51:04 EDT
Created attachment 200045 [details]
patch

.
Comment 2 Benjamin Muskalla CLA 2011-07-20 22:51:05 EDT
Created attachment 200046 [details]
mylyn/context/zip
Comment 3 Dani Megert CLA 2011-07-21 02:57:22 EDT
I agree to protect the code but then we should do it for all potential cases and not just 'null' ==> simply replace the assert with
    if (event.data instanceof String[]) { open editor code }

The bonus question is whether we should log this, as the source app is not behaving correctly. Reporting it could make it easier to detect the issue.
Comment 4 Benjamin Muskalla CLA 2011-07-22 10:27:50 EDT
*** Bug 352814 has been marked as a duplicate of this bug. ***
Comment 5 Benjamin Muskalla CLA 2011-07-22 10:31:46 EDT
About the bonus: I think we should rather let others participate in the dnd operation and delegate the event. But given the current infrastructure, I don't see a clean way to do this. See also comment #2 on bug 349021.
Comment 6 Benjamin Muskalla CLA 2011-12-13 08:27:53 EST
*** Bug 364878 has been marked as a duplicate of this bug. ***
Comment 7 Eric Moffatt CLA 2013-10-21 15:03:26 EDT
Dani, there's already an 'event.data instanceof String[]' there, does that mean that we can close this bug ?
Comment 8 Dani Megert CLA 2013-10-22 08:16:52 EDT
(In reply to Eric Moffatt from comment #7)
> Dani, there's already an 'event.data instanceof String[]' there, does that
> mean that we can close this bug ?

Nope. That code is in an Assert and fails if 'event.data' in 'null' (that's this bug).
Comment 9 Snjezana Peco CLA 2013-11-11 16:31:18 EST
Created attachment 237376 [details]
I faced the issue while was working on https://issues.jboss.org/browse/JBIDE-15499.
Comment 10 Snjezana Peco CLA 2013-11-11 16:38:35 EST
See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=349021#c3
Comment 11 Lars Vogel CLA 2019-11-27 07:27:21 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.