Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321852 - [Class Diagram] Can not drop class in a package
Summary: [Class Diagram] Can not drop class in a package
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Patrick Tessier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 07:36 EDT by saadia dhouib CLA
Modified: 2011-02-28 08:11 EST (History)
2 users (show)

See Also:


Attachments
mylyn/context/zip (1.31 KB, application/octet-stream)
2010-08-16 04:57 EDT, Patrick Tessier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description saadia dhouib CLA 2010-08-05 07:36:58 EDT
When I try to drop a class from the model explorer inside a package in a class diagram, I have an event loop exception error.
Comment 1 Vincent Lorenzo CLA 2010-08-05 08:11:27 EDT
Steps to reproduce : 
1/ Create a package in the model explorer
2/ Create a class in this package, in the Model Explorer
3/ Drop the package in a class Diagram
4/ Try drop the class into the package
Comment 2 Patrick Tessier CLA 2010-08-16 04:47:33 EDT
I have reproduced the bug 
 the following error log is:
 java.lang.NullPointerException
	at org.eclipse.papyrus.diagram.clazz.custom.policies.ClassDiagramDragDropEditPolicy.dropChildNodeWithContainmentLink(ClassDiagramDragDropEditPolicy.java:260)
	at org.eclipse.papyrus.diagram.clazz.custom.policies.ClassDiagramDragDropEditPolicy.getSpecificDropCommand(ClassDiagramDragDropEditPolicy.java:113)
	at org.eclipse.papyrus.diagram.common.editpolicies.CommonDiagramDragDropEditPolicy.getDropObjectsCommand(CommonDiagramDragDropEditPolicy.java:240)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy.getCommand(DragDropEditPolicy.java:80)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:501)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.getCommand(AbstractTransferDropTargetListener.java:215)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramDropTargetListener.isEnabled(DiagramDropTargetListener.java:224)
	at org.eclipse.jface.util.DelegatingDropAdapter.updateCurrentListener(DelegatingDropAdapter.java:365)
	at org.eclipse.jface.util.DelegatingDropAdapter.dragOver(DelegatingDropAdapter.java:182)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:80)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
	at org.eclipse.swt.dnd.DropTarget.DragOver(DropTarget.java:366)
	at org.eclipse.swt.dnd.DropTarget$3.method4(DropTarget.java:250)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback4(COMObject.java:101)
	at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
	at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363)
	at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
	at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 3 Patrick Tessier CLA 2010-08-16 04:57:48 EDT
Created attachment 176657 [details]
mylyn/context/zip

impacted classes
Comment 4 Patrick Tessier CLA 2010-08-16 04:59:04 EDT
the problem is solved, a test have been added
Comment 5 Patrick Tessier CLA 2010-08-16 05:19:34 EDT
now, a class can be dropped anywhere, can you confirm Saadia?
Comment 6 Patrick Tessier CLA 2010-08-16 05:31:15 EDT
comment from Saadia:
When I drop a class, which is not contained in a package, from the model explorer to a package: Graphically, the class is inside the package, but is not moved inside the package in the model explorer.

Steps to reproduce:

1. Create a package in the model explorer.

2. Create a class outside the package in the model explorer, 

3. Drop the class inside the package.
Comment 7 Patrick Tessier CLA 2011-02-28 08:11:05 EST
Now it runs. so I close the bug