Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338836

Summary: Generating code for RCP produces classes with errors.
Product: [Modeling] EMF Reporter: Mauro Condarelli <mc5686>
Component: ToolsAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Complete project including all models (and other stuff) none

Description Mauro Condarelli CLA 2011-03-03 12:19:42 EST
Created attachment 190291 [details]
Complete project including all models (and other stuff)

I include a complete (real, not snippet) project.

You can generate edit and editor from this in the usual manner.
It compiles and runs (I did not include sample data, just tell me if it is needed).

If You change the "Runtime Platform" in world.genmodel to "RCP" it generates with no errors, but the editor has dependency errors and will not compile.

I didn't test with the other two models included in the project.
Comment 1 Ed Merks CLA 2011-03-03 13:02:22 EST
I can't reproduce the problem you've described with any of these models!  They all generate RCP editors without any references to XMLTypeEditor.  I'm not sure what to say...
Comment 2 Mauro Condarelli CLA 2011-03-03 17:07:54 EST
Did You modify "Runtime Platform" in world.genmodel to "RCP"?

As-is the models compile, but generates for the IDE.

I cross-checked and I get the same identical behavior on four machines:
the one I currently use for this development (win7), other two I had with eclpse-helios installed (one Win-Vista and one Linux-ubuntu), then, to be real sure, I downloaded a fresh copy of eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz from www.eclipse.org (actually www.garr.it) and installed it on pristine ubuntu 10.10 installation.

Results are absolutely the same.


Description	Resource	Path	Location	Type
EcoreEditor cannot be resolved to a variable	WorldEditorAdvisor.java	/it.condarelli.writer.model.editor/src/it/condarelli/writer/model/world/presentation	line 85	Java Problem
The import org.eclipse.emf.ecore.presentation cannot be resolved	WorldEditorAdvisor.java	/it.condarelli.writer.model.editor/src/it/condarelli/writer/model/world/presentation	line 55	Java Problem
The import org.eclipse.emf.ecore.xml.type.presentation cannot be resolved	WorldEditorAdvisor.java	/it.condarelli.writer.model.editor/src/it/condarelli/writer/model/world/presentation	line 57	Java Problem
XMLTypeEditor cannot be resolved to a variable	WorldEditorAdvisor.java	/it.condarelli.writer.model.editor/src/it/condarelli/writer/model/world/presentation	line 84	Java Problem


Tomorrow I will be very tied for my real work, but in the weekend I will try to regenerate the interfaces from ecore as You suggested.

If I remember correctly I added a few methods to the implementations and, to avoid casting) I added them also to the interfaces, but I will find soon and I have all this in a local SVN, so I can play at will.
Comment 3 Ed Merks CLA 2011-03-03 17:26:45 EST
Yes, I changed them and they each generate and advisor class, so I know they're doing RCP.  So strange.  One thing you could do to avoid all these types of problems is to put these models in separate bundles.  That's definitely what's causing the unneeded usedGenPackages to show up...
Comment 4 Mauro Condarelli CLA 2011-03-04 04:58:41 EST
Can You tell me which version of EMF are You using and where should I take it from?
I will separate my three models in three separate plugins, but I would like to be sure we are running the same code.
Everything seems very strange.
Can You write down a recipe to setup a pristine machine with the "Right" version of EMF?
As said I am now using a clean eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz version with just subversive added; no other installed plugins or customizations.
Comment 5 Ed Merks CLA 2011-03-04 10:29:11 EST
I extract everything from CVS to bootstrap my environment: http://wiki.eclipse.org/EMF/Getting_Source

I'll try your steps on an installed version of 2.6 when I have some time...
Comment 6 Mauro Condarelli CLA 2011-03-06 05:25:05 EST
Thanks Ed.
In the meantime I refactored my code in three different projects, importing just the ecore model (and backporting my code changes afterwards).
The error is gone, but I'm using now a completely different generation path.
If You are interested in tracking down what triggered that odd behavior I'm available to help you debug, otherwise I'm happy with the new setup.
Thanks.
Mauro
Comment 7 Ed Merks CLA 2011-04-07 10:40:16 EDT
Given there are a thousand other things that need more attention, I'll just resolve this...