Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317590 - Model Browser: invalid emf model element
Summary: Model Browser: invalid emf model element
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.9.0 M1   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-22 10:42 EDT by Gabriel BARBIER CLA
Modified: 2010-10-18 08:31 EDT (History)
5 users (show)

See Also:
nicolas.bros: indigo+


Attachments
the invalid model ... (178 bytes, application/octet-stream)
2010-06-22 10:42 EDT, Gabriel BARBIER CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel BARBIER CLA 2010-06-22 10:42:24 EDT
Created attachment 172419 [details]
the invalid model ...

Hello,
When navigating a model that references non Emf objects (standard java objects), the following error occurs:
java.lang.Class cannot be cast to org.eclipse.emf.EObject

To reproduce the bug, use the provided model (be careful to open these model, you will have to install the b3 project from this repository = http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.b3).

Regards,
Gabriel
Comment 1 Gabriel BARBIER CLA 2010-06-22 10:43:28 EDT
I forgot to add that the same model had been correctly opened in the Ecore reflexive editor.
Comment 2 Nicolas Bros CLA 2010-07-07 05:46:38 EDT
I could not find an editor that opens files with this "b3" extension. From what I see in the sources, it looks like the corresponding genmodel has to be generated, but I didn't understand how.
Comment 3 Nicolas Bros CLA 2010-07-07 06:18:50 EDT
I found how to make it work: I had to install com.google.collect 0.8.0, which is not in Orbit, contrary to the 1.0.0 version, which is incompatible.
Comment 4 Nicolas Bros CLA 2010-07-07 06:56:46 EDT
Fixed in revision 2664, by working on Objects instead of EObjects (I previously assumed EObject#eGet returned EObjects or lists of EObjects).


I noticed another problem, though: the model browser keeps refreshing itself when showing a "BuildUnit", because org.eclipse.b3.build.impl.BuildUnitImpl.getBuilders() is implemented in a way that modifies the model each time it is called. And since the model browser refreshes itself each time the model changes, it keeps refreshing (using 100% of one CPU core).

In ModelQuerySetImpl, I fixed the same problem a while ago by doing this:

public EList<ModelQuery> getQueries() {
	if (queries == null) {
		queries = new EObjectContainmentWithInverseEList<ModelQuery>(ModelQuery.class, this, QueryPackage.MODEL_QUERY_SET__QUERIES, QueryPackage.MODEL_QUERY__MODEL_QUERY_SET);
	}
	return queries;
}
Comment 5 Hugo Bruneliere CLA 2010-10-04 13:46:44 EDT
Bug fixed.