Community
Participate
Working Groups
Build Identifier: Build id: I20100527-1700 (Helios up-to-date as of today; same behavior with up-to-date Galileo) Using Ecore and modeling the following classes (without any attributes, non-abstract) BOClass<T> BORepository<T extends BOClass<T>> and generating the model code the generated class BosFactoryImpl.java causes the error Bound mismatch: The generic method createBORepository() of type BosFactory is not applicable for the arguments (). The inferred type BOClass<BOClass<T>> is not a valid substitute for the bounded parameter <T extends BOClass<T>> Erasing the type parameter on BOClass, that is in the situation BOClass BORepository<T extends BOClass> the generated model code has no errors (the model validates without errors or warnings in both cases). Reproducible: Always Steps to Reproduce: 1. Create an Ecore project in Eclipse using the attached Ecore model. 2. Create a genmodel for the Ecore model without modifikation 3. Generate the model code. 4. The generated class BosFactoryImpl.java shows the mentioned error
Created attachment 171497 [details] Ecore model causing the error
Created attachment 171498 [details] Genmodel used to generate code (unmodified, i.e. as created by the wizard)
The problem isn't reproducible with EMF 2.6. I'll guess that it's a duplicate of 273142. With which version of EMF did you have this problem? *** This bug has been marked as a duplicate of bug 273142 ***
This issue is not a EMF problem it is a general problem of the combination of generics and the factory pattern. See the discussion with Ed about a similar problem here: http://www.eclipse.org/forums/index.php?t=msg&th=201011&start=0&S=18d906509b3e9af7d72d772ca0b20a88