Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generating model project .. only available if source level is 1.5 or greater -- but I AM greater?!
Generating model project .. only available if source level is 1.5 or greater -- but I AM greater?! [message #1123493] Wed, 02 October 2013 16:16 Go to next message
Michael Vorburger is currently offline Michael Vorburger
Messages: 62
Registered: July 2009
Member
We're trying to regenerate a (very old, had it for many years) model, and it fails with:

Generating model project
Generating Java class ... failed with an unhandled exception
A problem was detected while parsing a Java file
Line 92: Syntax error, type parameters are only available if source level is 1.5 or greater

OK, indeed the genmodel's Compliance Level shows as 1.4 in Properties (in fact looking at the *.genmodel file it didn't even have a complianceLevel, probably it's from before that was introduced).

No big deal, changing that to 7.0... let's also change Project > Properties > Java Compiler > Enable project specific settings > Compiler compliance level 1.7.

Regenerate again - same error! Sad So just WHICH "source level" WHERE is it trying to tell us about? Wink (If it would help to know exact EMF versions used, please let me know and I'll dump it somewhere - but its a mixed of 2.9.0/2.8.0/2.7.0 bundles.)

Thanks!
Re: Generating model project .. only available if source level is 1.5 or greater -- but I AM greater [message #1123517 is a reply to message #1123493] Wed, 02 October 2013 16:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26150
Registered: July 2009
Senior Member
Michael,

Are you generating only the model, or also things like the edit and
editor projects? Which Facade Helper Class is specified? What's the
workspace default setting for the compliance level? Can you run it
under debug control to see which file is causing the problem? Is it
parsing some existing file or parsing some newly generated thing in memory?



On 02/10/2013 6:16 PM, Michael Vorburger wrote:
> We're trying to regenerate a (very old, had it for many years) model,
> and it fails with:
>
> Generating model project
> Generating Java class ... failed with an unhandled exception
> A problem was detected while parsing a Java file
> Line 92: Syntax error, type parameters are only available if
> source level is 1.5 or greater
>
> OK, indeed the genmodel's Compliance Level shows as 1.4 in Properties
> (in fact looking at the *.genmodel file it didn't even have a
> complianceLevel, probably it's from before that was introduced).
>
> No big deal, changing that to 7.0... let's also change Project >
> Properties > Java Compiler > Enable project specific settings >
> Compiler compliance level 1.7.
>
> Regenerate again - same error! :( So just WHICH "source level" WHERE
> is it trying to tell us about? ;) (If it would help to know exact EMF
> versions used, please let me know and I'll dump it somewhere - but its
> a mixed of 2.9.0/2.8.0/2.7.0 bundles.)
>
> Thanks!
Re: Generating model project .. only available if source level is 1.5 or greater -- but I AM greater [message #1123545 is a reply to message #1123517] Wed, 02 October 2013 17:27 Go to previous messageGo to next message
Michael Vorburger is currently offline Michael Vorburger
Messages: 62
Registered: July 2009
Member
Ed, thank you for your support. Your reactivity is incredible. As always.

> Are you generating only the mode

in this case, only Generate Model Code, not the edit and editor projects.

> Which Facade Helper Class is specified?

Properties view says org.eclipse.emf.codegen.merge.java.facade.ast.ASTFacadeHelper.

> What's the workspace default setting for the compliance level?

It was 1.6.

> Can you run it under debug control to see which file is causing the problem? Is it
parsing some existing file or parsing some newly generated thing in memory?

It's parsing existing *.java files; the "..." I omitted in the original post are exiting classes which use generics. (Someone, long ago, manually hacked those; not bothering about being able to regenerate anymore.)
Re: Generating model project .. only available if source level is 1.5 or greater -- but I AM greater [message #1124531 is a reply to message #1123545] Thu, 03 October 2013 16:35 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26150
Registered: July 2009
Senior Member
Michael,

I'd need to see the projects in question but it sounds likely that there
is some inconsistency in the project's settings. E.g., what does the
MANIFEST.MF specify for the BREE? What do you see exactly in the
..classpath file? We do have tests that we generate 1.4 compliant code
for that setting so the problem is likely more one of parsing the
existing contents and the settings used for that not agreeing with what
the GenModel says and what the project's various settings specify... If
you can't fix it, please open a bugzilla with a project that I can use
to reproduce the issue you see...



On 02/10/2013 7:27 PM, Michael Vorburger wrote:
> Ed, thank you for your support. Your reactivity is incredible. As always.
>
>> Are you generating only the mode
>
> in this case, only Generate Model Code, not the edit and editor projects.
>
>> Which Facade Helper Class is specified?
>
> Properties view says
> org.eclipse.emf.codegen.merge.java.facade.ast.ASTFacadeHelper.
>
>> What's the workspace default setting for the compliance level?
>
> It was 1.6.
>
>> Can you run it under debug control to see which file is causing the
>> problem? Is it
> parsing some existing file or parsing some newly generated thing in
> memory?
>
> It's parsing existing *.java files; the "..." I omitted in the
> original post are exiting classes which use generics. (Someone, long
> ago, manually hacked those; not bothering about being able to
> regenerate anymore.)
Previous Topic:How to fill AnyType mixed content with Java code
Next Topic:EMF-Databinding and associated attributes
Goto Forum:
  


Current Time: Thu Oct 30 16:01:33 GMT 2014

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

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