Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Possible NullPointerException in GMF(NullPointerException in GMF)
Possible NullPointerException in GMF [message #1011742] Wed, 20 February 2013 07:18 Go to next message
MyungWoon Oh is currently offline MyungWoon OhFriend
Messages: 52
Registered: March 2012
The Situation
- I opened 2 or more GMF editors.
- The focus is in the editor that has at least one diagram.

When I move focus to other editor that doesn't have any diagram yet, I got 2 Exceptions like below.

#1 Exception
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(
at org.eclipse.core.runtime.Assert.isNotNull(
at org.eclipse.gmf.runtime.diagram.ui.render.internal.commands.CopyImageCommand.<init>(
at org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.ImageSupportGlobalActionHandler$1.<init>(
at org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.ImageSupportGlobalActionHandler.getCopyCommand(
This happens because diagramPart.getDiagram() in org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.ImageSupportGlobalActionHandler.getCopyCommand( returns null if the diagramPart doesn't have any diagram yet.

#2 Exception
at org.eclipse.gmf.runtime.diagram.ui.actions.internal.ShowConnectionLabelsAction.createOperationSet(
This happens because getDiagramEditPart() in at org.eclipse.gmf.runtime.diagram.ui.actions.internal.ShowConnectionLabelsAction.createOperationSet( returns null if the the diagramPart doesn't have any diagram yet.

So, I think those 2 errors had better be fixed.
Thank you.
Re: Possible NullPointerException in GMF [message #1016990 is a reply to message #1011742] Fri, 08 March 2013 13:59 Go to previous message
Thomas Beyer is currently offline Thomas BeyerFriend
Messages: 55
Registered: February 2013
Hi MyungWoon,

there could be something misconfigured in the diagram, your are testing.
GMF creates the Notation-Diagram and its Domain-Model-counterpart upon every Diagram-creation.
Since these elements define the very root of your models, they should never be deleted.
GMF usually takes care that this won't happen.

Please check your generated
XXXDiagramEditorUtil.createDiagram(URI diagramURI, URI modelURI,IProgressMonitor progressMonitor)
to ensure everything will be created properly on diagram-creation.

So the case you are describing, the DiagramEditPart's query for its Notation-Diagram resulting in a NPE, should never happen.
Did you modify any code, that could possibly corrupt your models?

Previous Topic:Delete From Diagram
Next Topic:Dynamically extending the palette
Goto Forum:

Current Time: Sat Jun 23 06:44:13 GMT 2018

Powered by FUDForum. Page generated in 0.01671 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top