Community
Participate
Working Groups
In some case when drag a shape with Ctrl key , I get a NullPointerException in DragEditPartsTrackerEx like: java.lang.NullPointerException at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.addSourceCommands(DragEditPartsTrackerEx.java:97) at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.getCommand(DragEditPartsTrackerEx.java:62) at org.eclipse.gef.tools.DragEditPartsTracker.handleDragInProgress(DragEditPartsTracker.java:351) at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.handleDragInProgress(DragEditPartsTrackerEx.java:178) at org.eclipse.gef.tools.AbstractTool.mouseDrag(AbstractTool.java:994) at org.eclipse.gef.tools.SelectionTool.mouseDrag(SelectionTool.java:511) at org.eclipse.gef.EditDomain.mouseDrag(EditDomain.java:230) ... I check the source code of DragEditPartsTrackerEx.java and find that it maybe a miss in getCommand(). "if (getTargetEditPart()!=null)" is checked following the "addSourceCommands(false, command); " , but targetEditPart is also used in addSourceCommands() method. In some case targetEditPart is null, NullPointerException is throwed. /** * @see org.eclipse.gef.tools.AbstractTool#getCommand() */ protected Command getCommand() { if (!isMove()) { CompoundCommand command = new CompoundCommand(); **** addSourceCommands(false, command); **** if (getTargetEditPart()!=null){ command.add(getTargetEditPart().getCommand(getTargetRequest())); if (command.canExecute()) return command; } } CompoundCommand command = new CompoundCommand(); addSourceCommands(true, command); return command; }
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug
This problem remains until current version. It would be nice if it get fixed. If you need help, I will provide a patch.