Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Code generation error for node without domain element
Code generation error for node without domain element [message #780798] Thu, 19 January 2012 12:25 Go to next message
Eclipse UserFriend
Hi,

I have a node mapping in my gmpmap model without a domain element. When I try to generate the diagram code, I get this error:

Exception (No Definition getLabelFeatureText(OclInvalid_Class) for GenChildNode could be found!) while generating code

org.eclipse.gmf.internal.xpand.model.EvaluationException: No Definition getLabelFeatureText(OclInvalid_Class) for GenChildNode could be found!
at org.eclipse.gmf.internal.xpand.XpandFacade.evaluate(XpandFacade.java:57)
at org.eclipse.gmf.internal.xpand.ast.ExpandStatement.evaluateInternal(ExpandStatement.java:139)
at org.eclipse.gmf.internal.xpand.ast.Statement.evaluate(Statement.java:29)
at...

I cannot make sense of it. I know it is caused by this particular node (if I remove it, everything works fine). Also, the validation does not complain about anything.

Any advice?

cheers,
Christian
Re: Code generation error for node without domain element [message #780806 is a reply to message #780798] Thu, 19 January 2012 12:57 Go to previous messageGo to next message
Eclipse UserFriend
I located the template that is causing the error: NavigatorLabelProvider.xpt

It seems getLabelFeatureText() is invoked with an invalid parameter (OclInvalid_Class). Still I'm puzzled...
Re: Code generation error for node without domain element [message #780809 is a reply to message #780806] Thu, 19 January 2012 13:10 Go to previous messageGo to next message
Eclipse UserFriend
I think the getText method for GenNodes causes the problem. It checks whether there are any labels and if there are none it uses the model elements metaclass to produce a label, but that is null. Strangely, in the same method for GenLink (also below) there is an explicit check whether the modelFacet is null (then an empty string is returned).

IS THIS A BUG IN THE TEMPLATE?


«DEFINE getText FOR gmfgen::GenNode-»
«IF labels->isEmpty()-»
«EXPAND getLabelFeatureText(modelFacet.metaClass)-»
«ELSE-»
«EXPAND getDiagramLabelText(labels->asSequence())-»
«ENDIF-»
«ENDDEFINE»

«DEFINE getText FOR gmfgen::GenLink-»
«IF labels->isEmpty()-»
«IF null <> modelFacet-»
«EXPAND getText(modelFacet)-»
«ELSE-»
«EXPAND returnEmptyString-»
«ENDIF-»
«ELSE-»
«EXPAND getDiagramLabelText(labels->asSequence())-»
«ENDIF-»
«ENDDEFINE»
Re: Code generation error for node without domain element [message #780810 is a reply to message #780809] Thu, 19 January 2012 13:26 Go to previous messageGo to next message
Eclipse UserFriend
This code fixes the problem:


«DEFINE getText FOR gmfgen::GenNode-»
«IF labels->isEmpty()-»
«IF null <> modelFacet-»
«EXPAND getLabelFeatureText(modelFacet.metaClass)-»
«ELSE-»
«EXPAND returnEmptyString-»
«ENDIF-»
«ELSE-»
«EXPAND getDiagramLabelText(labels->asSequence())-»
«ENDIF-»
«ENDDEFINE»
Re: Code generation error for node without domain element [message #780812 is a reply to message #780810] Thu, 19 January 2012 13:44 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Hi,

Please report the issue, and your fix (as a patch) to
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMF-Tooling

Regards,

--
http://mickaelistria.wordpress.com
http://twitter.com/#!/mickaelistria
http://www.petalslink.com
Re: Code generation error for node without domain element [message #781064 is a reply to message #780812] Fri, 20 January 2012 10:12 Go to previous message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
Hello,

I've submitted https://bugs.eclipse.org/bugs/show_bug.cgi?id=369192 for that.
For me the fix looks very safe and I think we will be able to push it into both master and 2.4.maintenance streams.

Regards,
Michael "Borlander" Golubev
at Montages Think Tank, Prague, Czech Republic
Montages AG, Zürich, Switzerland
Previous Topic:GMF Palette getting to know the node that was selected
Next Topic:Semantic refresh failed error
Goto Forum:
  


Current Time: Thu Apr 25 21:30:00 GMT 2024

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

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

Back to the top