Community
Participate
Working Groups
With eclipse 2.0.1 release on redhat 7.2, workbench crashes everytime with the follwoing operation. 1) Create a new class file in a package. 2) Drag the .java file in the Package Explorer with Ctrl key down. 3) Drop it on the same package. -> The "Name Conflict" dialog pops up and the dnd cursor remains on screen. 4) Leave everything alone for a while until the dnd cursor will disappear. (about a minite) 5) Depress the cancel button on the dialog. -> Workbench crashes. The crash also occurs on the Navigator.
This sounds like a problem in UI. I think there is a further problem in SWT where when an exceptions happens in dnd at a critical time, we don't or can't clean up properly (a C program would have the same failure as well). Assigning to UI but putting VI on the CC list to monitor this PR for SWT issues It could turn out that it's SWT that it causing the exception in dnd, not Ecluipse.
Eclipse is just hanging on my machine. Do you have a stack trace in the log? I don't think a UI exception occurs. When I cancel the name conflict dialog immediately Eclipse does not hang. Is there a limitation where a Motif drop operation has to return within a certain amount of time? We don't return from the drop event listener until the dialog has been closed. Yet, the drag icon disappears after some time.
When I try this in an inner Eclipse I get a VM core dump. This definitely looks like a SWT problem. I don't have a simple test case yet.
Created attachment 2143 [details] Core dump when cancelling name conflict dialog
Not sure if this is also a problem in the 2.1 stream. Navigator and Packages view DND is currently broken, i.e., does not work at all. See bug 24593.
Able to reproduce problem with a simple SWT example. You should probably reassign this to me under swt. import org.eclipse.swt.*; import org.eclipse.swt.dnd.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; public class PR24542 { public static void main (String [] args) { Display display = Display.getDefault (); final Shell shell = new Shell (display); final Label label1 = new Label (shell, SWT.BORDER); label1.setText ("TEXT"); final Label label2 = new Label (shell, SWT.BORDER); shell.addListener (SWT.Resize, new Listener () { public void handleEvent (Event e) { Rectangle rect = shell.getClientArea (); int center = rect.width / 2; label1.setBounds (rect.x, rect.y, center, rect.height); label2.setBounds (center, rect.y, center, rect.height); } }); shell.setSize (200, 200); setDragDrop (label1); setDragDrop (label2); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } public static void setDragDrop (final Label label) { Transfer[] types = new Transfer[] {TextTransfer.getInstance()}; int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK; final DragSource source = new DragSource (label, operations); source.setTransfer(types); source.addDragListener (new DragSourceListener () { public void dragStart(DragSourceEvent event) { event.doit = (label.getText ().length () != 0); }; public void dragSetData (DragSourceEvent event) { event.data = label.getText (); } public void dragFinished(DragSourceEvent event) { if (event.detail == DND.DROP_MOVE) label.setText (""); } }); DropTarget target = new DropTarget(label, operations); target.setTransfer(types); target.addDropListener (new DropTargetAdapter() { public void drop(DropTargetEvent event) { MessageBox b = new MessageBox(label.getShell(), SWT.OK); b.setMessage("hello"); b.open(); if (event.data == null) { event.detail = DND.DROP_NONE; return; } label.setText ((String) event.data); } }); } }
Also a problem in 20021009 2.0.2 build.
Fixed in 2.1 > 20021011. Motif has a timeout call SelectionTimeout (XtAppGetSelectionTimeout and XtAppSetSelectionTimeout) which has a default value of 5 seconds. Just before the data transfer is requested I change this value to be infinite and after the drop callback returns, I change this back to the original value. Leaving this bug report open for now while we decide what to do about 2.0.2.
Fixed in 2.1 and 2.0.2.