Community
Participate
Working Groups
Build Identifier: 20110916-0149 Hi, I am following instructions given in the book Eclipse Modeling Project - A DSL toolkit. I noticed that after I changed the shape of the Topic figure to a rounded rectangle (page 77), and launch the diagram editor, I get a Semantic refresh failed error, with a null pointer exception, if I open a previously created model. I have attached my dsl project, the generated diagram editor that contains the class that causes the error to be raised, as well as the MindMap model that I created, which causes the Semantic refresh failed error to appear, each time I try to load the mind map that I created earlier, when it had a rectangle shape, rather than a rounded rectangle shape. Elvis Dowson Reproducible: Always Steps to Reproduce: 1. Create a mindMap model using the steps described in the DSL toolkit book, to create the default rectangle topic shape. 2. Modify the dsl project, to generate rounded rectangles. 3. Run the generated diagram editor, and load the previous created mind map diagram. It will generate the Semantic refresh error in the console window.
Created attachment 209822 [details] Stack trace of the Semantic refresh error
Created attachment 209823 [details] MindMap DSL project, for generating the full diagram editor.
Created attachment 209824 [details] MindMap diagram project, containing the class org.eclipse.mindmap.diagram.edit.policies.MapCanonicalEditPolicy !STACK 0 java.lang.NullPointerException at org.eclipse.mindmap.diagram.edit.policies.MapCanonicalEditPolicy.refreshConnections(MapCanonicalEditPolicy.java:208) at org.eclipse.mindmap.diagram.edit.policies.MapCanonicalEditPolicy.refreshSemantic(MapCanonicalEditPolicy.java:173) at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.refresh(CanonicalEditPolicy.java:961) at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.refreshOnActivate(CanonicalEditPolicy.java:638) at org.eclipse.mindmap.diagram.edit.policies.MapCanonicalEditPolicy.refreshOnActivate(MapCanonicalEditPolicy.java:54) at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.activate(CanonicalEditPolicy.java:628) at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:174) at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:156) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:195) at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1) at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205) at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart.activate(DiagramEditPart.java:349) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:215)
Created attachment 209825 [details] Example MindMap model, to reproduce the Semantic refresh error.
Hello, The diagram file MyIdeas.mmd contains the edge without both source/target that is triggering the failure. <edges xmi:type="notation:Connector" xmi:id="_TgbrsEINEeG6O7GAAyBlig" type="4001"> <styles xmi:type="notation:FontStyle" xmi:id="_TgcSwEINEeG6O7GAAyBlig" fontName="Lucida Grande"/> <element xsi:nil="true"/> <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_TgcSwUINEeG6O7GAAyBlig" points="[39, 13, -141, -50]$[141, 49, -39, -14]"/> </edges> If you remove this, the diagram will be opened without any exceptions. In the normal situation the end-less links like this should not be created by a diagram editor. May be it was a result of some exception thrown earlier, at the time of the link creation. For sure the nature of the problem is not related to the fact you made some changes and regenerated -- the diagram code is fine, it is the sample diagram that has a problem. I was unable to reproduce anything with the new diagram -- I've created a bunch of nodes and links similar to the setup from the diagram and all of the links had their ends correctly set.