Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand/Xtend] Check File problem
[Xpand/Xtend] Check File problem [message #1044867] Fri, 19 April 2013 08:41 Go to next message
serhat gezgin is currently offline serhat gezgin
Messages: 231
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

When i create check for my translation i get;

00:39:23.997 [main] ERROR o.e.x.typesystem.xsd.XSDMetaModel - org.eclipse.internal.xtend.type.baseimpl.types.ObjectTypeImpl cannot be cast to org.eclipse.xtend.typesystem.ParameterizedType
java.lang.ClassCastException: org.eclipse.internal.xtend.type.baseimpl.types.ObjectTypeImpl cannot be cast to org.eclipse.xtend.typesystem.ParameterizedType
	at org.eclipse.xtend.expression.TypeSystemImpl.internalGetTypeForName(TypeSystemImpl.java:183) [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
	at org.eclipse.xtend.expression.TypeSystemImpl.getTypeForName(TypeSystemImpl.java:244) [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
	at org.eclipse.xtend.expression.TypeSystemImpl.getTypeForName(TypeSystemImpl.java:221) [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
	at org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel$1.createNew(EmfRegistryMetaModel.java:123) ~[org.eclipse.xtend.typesystem.emf_1.3.0.v201302260541.jar:na]
	at org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel$1.createNew(EmfRegistryMetaModel.java:1) ~[org.eclipse.xtend.typesystem.emf_1.3.0.v201302260541.jar:na]
	at org.eclipse.internal.xtend.util.Cache.get(Cache.java:26) [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
	at org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel.getTypeForEClassifier(EmfRegistryMetaModel.java:356) [org.eclipse.xtend.typesystem.emf_1.3.0.v201302260541.jar:na]
	at org.eclipse.xtend.typesystem.xsd. 
.
.
.

00:39:24.468 [main] ERROR o.eclipse.xtend.check.CheckComponent - Error in Component  of type org.eclipse.xtend.check.CheckComponent: 
	EvaluationException : Type not found : Model
	metamodel::Checks.chk[53,82] on line 5 'Model "No entities defined"'


errors but i dont understand why

my workflow is ;

<workflow>
  <component class="org.eclipse.xtend.typesystem.xsd.XMLReader">
    <modelSlot value="model" />
    <uri value="${modelFile}" />
    <metaModel id="mm"
      class="org.eclipse.xtend.typesystem.xsd.XSDMetaModel">
      <schemaFile value="metamodel/ir.xsd" />
    </metaModel>
  </component>
  <!-- check model -->
  <component class="org.eclipse.xtend.check.CheckComponent">
	<metaModel idRef="mm"/>
	<checkFile value="metamodel::Checks" />
	<emfAllChildrenSlot value="model" />
  </component>
  <component class="org.eclipse.xpand2.Generator">
    <metaModel idRef="mm" />
    <expand value="template::DeepTravelTemplate::Root FOR model" />
    <outlet path="${toPath}" />
    <globalVarDef name="domainModelAbsClases" value="{}"/>
    <globalVarDef name="domainModelAbsAndConcreateClases" value="{}"/>
    <globalVarDef name="enums" value="{}"/>
    <globalVarDef name="enumLiterals" value="{}"/>
  </component>
</workflow>


and my Check lang;

import ir;

extension metamodel::MetamodelExtension;

context ir::IClafer ERROR 
	"Names should not contain _ character." :
	(!(id.split("_").size > 1) && !(id.toCharList().last().matches("_")));
	/*
context ir::IClafer ERROR 
	"Names should be unique" :
	eRootContainer.eAllContents.typeSelect(ir::IClafer).select(e|e.id==id).size==1;*/


anyone can help me for solving this ?

Regards,
Re: [Xpand/Xtend] Check File problem [message #1051781 is a reply to message #1044867] Mon, 29 April 2013 04:05 Go to previous message
Eclipse User
Morning,

i face the same problem. In my opinion that's in responsibility of
Xtend. I have filled a bug report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=406765

To avoid the problem there are several workarounds:
Solution 1:
* Remove EmfRegistryMetaModel from your context/generator call.

Solution 2:
* Implement your own MetaModel having a type implementation for
"java::lang::Object[]".

Solution 3:
* Suppress the log message in EmfRegistryMetaModel#getKnownTypes() :-(

Regards
Ralf

Am 19.04.2013 14:41, schrieb serhat gezgin:
> Hi all,
>
> When i create check for my translation i get;
>
>
> 00:39:23.997 [main] ERROR o.e.x.typesystem.xsd.XSDMetaModel -
> org.eclipse.internal.xtend.type.baseimpl.types.ObjectTypeImpl cannot be
> cast to org.eclipse.xtend.typesystem.ParameterizedType
> java.lang.ClassCastException:
> org.eclipse.internal.xtend.type.baseimpl.types.ObjectTypeImpl cannot be
> cast to org.eclipse.xtend.typesystem.ParameterizedType
> at
> org.eclipse.xtend.expression.TypeSystemImpl.internalGetTypeForName(TypeSystemImpl.java:183)
> [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
> at
> org.eclipse.xtend.expression.TypeSystemImpl.getTypeForName(TypeSystemImpl.java:244)
> [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
> at
> org.eclipse.xtend.expression.TypeSystemImpl.getTypeForName(TypeSystemImpl.java:221)
> [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
> at
> org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel$1.createNew(EmfRegistryMetaModel.java:123)
> ~[org.eclipse.xtend.typesystem.emf_1.3.0.v201302260541.jar:na]
> at
> org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel$1.createNew(EmfRegistryMetaModel.java:1)
> ~[org.eclipse.xtend.typesystem.emf_1.3.0.v201302260541.jar:na]
> at org.eclipse.internal.xtend.util.Cache.get(Cache.java:26)
> [org.eclipse.xtend_1.3.0.v201302260541.jar:na]
> at
> org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel.getTypeForEClassifier(EmfRegistryMetaModel.java:356)
> [org.eclipse.xtend.typesystem.emf_1.3.0.v201302260541.jar:na]
> at org.eclipse.xtend.typesystem.xsd.
Previous Topic:XPand: No definition Found
Next Topic:MWE and Check language
Goto Forum:
  


Current Time: Sun Apr 20 23:13:01 EDT 2014

Powered by FUDForum. Page generated in 0.01646 seconds