Skip to main content



      Home
Home » Modeling » EMF » Code generator in EMF 2.7 produced wrong codes
Code generator in EMF 2.7 produced wrong codes [message #701714] Mon, 25 July 2011 09:21 Go to next message
Eclipse UserFriend
Originally posted by: Dongyue Mou

Hallo everybody,

I just migrated all my projects to Eclipse 3.7 with EMF 2.7. Then, I found
that all classes XxxxxSwitch in the packages xxxxx.util generated by the EMF
code generator contain the same compilation error: the class
org.eclipse.emf.ecore.util.Switch<T> can not be resolved.

With a little research, I think the Switch is now called EcoreSwitch, is it
right?

And how can I let code generator produces the right code?

The plugin versions are listed below:
org.eclipse.emf.codegen 2.6.0.v20110606
org.eclipse.emf.ecore 2.7.0.v20110605

Best regards!
Dongyue Mou

--
Re: Code generator in EMF 2.7 produced wrong codes [message #701744 is a reply to message #701714] Mon, 25 July 2011 10:15 Go to previous messageGo to next message
Eclipse UserFriend
Dongyue,

Comments below.

On 25/07/2011 6:21 AM, Dongyue Mou wrote:
> Hallo everybody,
>
> I just migrated all my projects to Eclipse 3.7 with EMF 2.7. Then, I
> found that all classes XxxxxSwitch in the packages xxxxx.util
> generated by the EMF code generator contain the same compilation
> error: the class org.eclipse.emf.ecore.util.Switch<T> can not be
> resolved.
That class is in the 2.7 runtime.
>
> With a little research, I think the Switch is now called EcoreSwitch,
> is it right?
No, it's to support switch composition:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=287249
>
> And how can I let code generator produces the right code?
The code is right.
>
> The plugin versions are listed below:
> org.eclipse.emf.codegen 2.6.0.v20110606
> org.eclipse.emf.ecore 2.7.0.v20110605
I expect your target platform contains an older version of Ecore (even
if your IDE itself has installed the latest one).

If you set the Runtime Version property in the GenModel to 2.6, it will
not try to use this stuff that's new to 2.7.
>
> Best regards!
> Dongyue Mou
>
Re: Code generator in EMF 2.7 produced wrong codes [message #702493 is a reply to message #701744] Tue, 26 July 2011 08:10 Go to previous message
Eclipse UserFriend
Originally posted by: Dongyue Mou

Hi Merks,

you are right, my projects are still referring the old plugins. After
rebuilding the eclipse workspace, the problem is solved.
Thanks!

Best regards!
Dongyue Mou

"Ed Merks" schrieb im Newsbeitrag news:j0jt7g$cr0$1@news.eclipse.org...

Dongyue,

Comments below.

On 25/07/2011 6:21 AM, Dongyue Mou wrote:
> Hallo everybody,
>
> I just migrated all my projects to Eclipse 3.7 with EMF 2.7. Then, I found
> that all classes XxxxxSwitch in the packages xxxxx.util generated by the
> EMF code generator contain the same compilation error: the class
> org.eclipse.emf.ecore.util.Switch<T> can not be resolved.
That class is in the 2.7 runtime.
>
> With a little research, I think the Switch is now called EcoreSwitch, is
> it right?
No, it's to support switch composition:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=287249
>
> And how can I let code generator produces the right code?
The code is right.
>
> The plugin versions are listed below:
> org.eclipse.emf.codegen 2.6.0.v20110606
> org.eclipse.emf.ecore 2.7.0.v20110605
I expect your target platform contains an older version of Ecore (even
if your IDE itself has installed the latest one).

If you set the Runtime Version property in the GenModel to 2.6, it will
not try to use this stuff that's new to 2.7.
>
> Best regards!
> Dongyue Mou
>
Previous Topic:How to fix Couldn't resolve reference to EClass in query2
Next Topic:Genercis in eclipse Idingo
Goto Forum:
  


Current Time: Sun Jul 13 08:56:28 EDT 2025

Powered by FUDForum. Page generated in 0.03965 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top