eclipse-modisco / org.eclipse.modisco

Eclipse Public License 2.0
0 stars 0 forks source link

[Move to EMF Facet] Fails to load catalog elements because metamodel is overwritten by AcceleoBuilder #334

Open eclipse-modisco-bot opened 3 hours ago

eclipse-modisco-bot commented 3 hours ago

| --- | --- | | Bugzilla Link | 312050 | | Status | NEW | | Importance | P5 normal | | Reported | May 07, 2010 08:47 EDT | | Modified | May 23, 2016 05:25 EDT | | Version | 0.8.0 | | Reporter | Nicolas Bros |

Description

You get several "Failed to load" errors on QuerySets, Facets and UiCustom (attached).

After debugging, I found out the corresponding Resources in the MoDiscoResourceSet contained DynamicEObjectImpl objects, instead of the expected generated implementation classes.

Several of the MoDisco projects that were checked-out are Acceleo projects, so have the Acceleo builder enabled.

AcceleoBuilder registers all ecore files it finds in Acceleo projects and their dependencies, putting a dynamic version of the metamodel into the EPackage.Registry.

After this, EClassifier#isInstance returns false when asked whether OCLModelQueryImpl is an instance of ModelQuery (it should be true of course).

The reason for this is that these metaclasses now reside in two different metamodels: the one for which an implementation was generated, and the one that was loaded dynamically.

And this is what is causing the aforementioned "Failed to load" errors.

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on May 07, 2010 08:49

Created attachment 167459 stacktrace

:notepad_spiral: stacktrace.txt

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on May 07, 2010 10:12

Bug 305831 has been marked as a duplicate of this bug.

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on Oct 18, 2010 08:30

Created attachment 181087 patch

Anyway, here is a patch that fixes the problem, by removing only javadoc comments as the comment suggests, and putting back removed comments in the unhandled comments list.

:notepad_spiral: Bug 312050.patch

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on Oct 18, 2010 08:32

Scratch that! Wrong bug.

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on Oct 19, 2010 06:12

Created attachment 181165 example project

Here is a project that shows the problem:

you get a message in the log giving the identity of the metaclass: metaclass A: org.eclipse.emf.ecore.impl.EClassImpl@461984

you get a new message in the log, with a different ID for the metaclass, indicating it is not the same metaclass anymore: metaclass A: org.eclipse.emf.ecore.impl.EClassImpl@1be72d6

:compression: bug312050.zip

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on Oct 19, 2010 06:46

Actually, this is not conclusive, because A.xmi contains a dynamic instance.\ I need to find a better example.

eclipse-modisco-bot commented 3 hours ago

By Nicolas Bros on Oct 19, 2010 09:38

See: org.eclipse.acceleo.common.utils.ModelUtils.registerEcorePackages(String pathName). This is where Acceleo registers the EPackages.

eclipse-modisco-bot commented 3 hours ago

By Gregoire Dupe on Sep 28, 2011 07:14

We will switch to EMF Facet before to try to solve such bugs. => P5