| Summary: | JavaTypeImpl with clazz=java.lang.String doesn't match StringTypeImpl | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] M2T | Reporter: | Ali AKAR <ali.akar82> | ||||
| Component: | Xpand | Assignee: | Karsten Thoms <karsten.thoms> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | karsten.thoms, r.sezestre, stephaneberle9, sven.efftinge | ||||
| Version: | 1.1.0 | Flags: | karsten.thoms:
juno+
|
||||
| Target Milestone: | M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
could you please provide a small sample project to reproduce the issue? Created attachment 204008 [details] patch for bug 357392 this patches the bug 357392 OK for the patch ! Applied and reviewed the patch. Thanks for submitting. Bug resolved before Xpand 1.2 release date => Closing |
From the xtend/xpand file the type of my feature is StringTypeImpl and from the Ecore it's a JavaTypeImpl where the clazz attribute is a java.lang.String. In my Ecore the type of the feature is not an EString, but an Identifier with the instanceclassname is a java.lang.String. That's why features are not found when compiling an xtend file. I have modified JavaTypeImpl#internalIsAssignableFrom(final Type t) to the code below: @Override protected boolean internalIsAssignableFrom(final Type t) { if (t instanceof JavaTypeImpl){ return clazz.isAssignableFrom(((JavaTypeImpl) t).clazz); }else if (t instanceof StringTypeImpl){ return clazz.isAssignableFrom(String.class); }else if(t instanceof BooleanTypeImpl){ return clazz.isAssignableFrom(Boolean.class); }else if(t instanceof IntegerTypeImpl){ return clazz.isAssignableFrom(Integer.class); }else if(t instanceof RealTypeImpl){ return clazz.isAssignableFrom(Double.class) || clazz.isAssignableFrom(Float.class); } return false; } This code resolve my problem but I don't know if it's a good idea to do this at this level.