Community
Participate
Working Groups
Build Identifier: 20110301-1815 If working with Dynamic Features, the generaded accessors code call " Object eDynamicGet(int dynamicFeatureID, EStructuralFeature eFeature, boolean resolve, boolean coreType)" instead of "Object eDynamicGet(int featureID, boolean resolve, boolean coreType)" causing an ArrayIndexOutOfBoundsException when the eClass extends a Class with static features. Reproducible: Always Steps to Reproduce: 1. Create in a model, a Class that extends ENamedElement (from ecore) 2. Create one or more EAttributes 2. Set de genmodel property "Feature Delegation" to "Dynamic" 3. Generate Code
You can't use dynamic delegation when extending a statically generated base class.
With Reflective Feature Delegation I don't have this problem. Can I asume that when extending a statically generated base class I should work with "Reflective" mode ?
Yes, I was going to mention that I wasn't even sure if reflective works. But dynamic is definitely optimized to make assumptions that everything is fully dynamic. I.e., look at the extra overhead of the other version of eDynamicGet. public Object eDynamicGet(int featureID, boolean resolve, boolean coreType) { return eDynamicGet(featureID - eStaticFeatureCount(), eClass().getEStructuralFeature(featureID), resolve, coreType); } It has to do more work just to call a method that could be more efficiently called directly. I'm not sure the value of using either dynamic or reflective when the base class is neither...