Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Carr, Brian M
On compilation, I'm receiving the following error:

----------
496. ERROR in /path/to/my/source/file/MyClass.java (at line 142)
        case DELETE:
             ^^^^^^
The field Action.DELETE cannot be referenced from an enum case label; only enum constants can be used in enum switch
----------

The context surrounding looks like this:


switch(affUpdt.getActionSwitch()) {
    case ADD:
        //do something
         break;
     case DELETE:
        //do something
         break;
     case UPDATE:
        //do something
          break;
     default:
        //do something
}

where getActionSwitch returns an enum of type Action, which is defined in a groovy source file.  Within eclipse, I do not get an error, but in maven, I am unable to compile.

Is this a bug or am I missing something obvious?

--b
______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
[hidden email]


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Andrew Eisenberg
Hi there,

It's hard to say whether or not this is a bug, and which component is
causing it without some more information.  I'll need to ask a few
questions first:

1. What version of Groovy are you using in Eclipse?
2. What about in maven?
3. Are you using gmaven or the groovy-eclipse-compiler for maven?
4. I copied your snippet into Eclipse and I am getting a different
error (it's likely that the snippet above just doesn't reflect what
you really have in your code).  Apparently, groovy doesn't like it if
there is no statement between the last label and the switch's close
bracket.  This shows up on the command line, too.
5. What happens when you compile the snippet on the command line?



On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
<[hidden email]> wrote:

> switch(affUpdt.getActionSwitch()) {
>    case ADD:
>        //do something
>         break;
>     case DELETE:
>        //do something
>         break;
>     case UPDATE:
>        //do something
>          break;
>     default:
>        //do something
> }

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Carr, Brian M
1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
3.) groovy-eclipse-compiler
4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code

5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant


______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
[hidden email]

On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:

> Hi there,
>
> It's hard to say whether or not this is a bug, and which component is
> causing it without some more information.  I'll need to ask a few
> questions first:
>
> 1. What version of Groovy are you using in Eclipse?
> 2. What about in maven?
> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
> 4. I copied your snippet into Eclipse and I am getting a different
> error (it's likely that the snippet above just doesn't reflect what
> you really have in your code).  Apparently, groovy doesn't like it if
> there is no statement between the last label and the switch's close
> bracket.  This shows up on the command line, too.
> 5. What happens when you compile the snippet on the command line?
>
>
>
> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
> <[hidden email]> wrote:
>> switch(affUpdt.getActionSwitch()) {
>>    case ADD:
>>        //do something
>>         break;
>>     case DELETE:
>>        //do something
>>         break;
>>     case UPDATE:
>>        //do something
>>          break;
>>     default:
>>        //do something
>> }
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Andrew Eisenberg
Can you create a stand alone snippet that recreates the problem?

One thing is that the groovy-eclipse-compiler for maven is based off
of 1.7.5 and we have included a few fixes for enums since then, so
there may be a bug in the groovy-eclipse-compiler that is fixed when
running inside of Eclipse.

I am planning on doing a refresh of the packages soon so that they are
updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
 I hope to get this done in the next week or so.  In the meantime, it
would be good to know if this is reproducible on the command line.

On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
<[hidden email]> wrote:

> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
> 3.) groovy-eclipse-compiler
> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>
> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>
>
> ______________________________
> Brian M. Carr
> Identity and Access Management
> ITS Applications
> University of Texas at Austin
> V: 512-232-6419
> F: 512-471-5746
> [hidden email]
>
> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>
>> Hi there,
>>
>> It's hard to say whether or not this is a bug, and which component is
>> causing it without some more information.  I'll need to ask a few
>> questions first:
>>
>> 1. What version of Groovy are you using in Eclipse?
>> 2. What about in maven?
>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>> 4. I copied your snippet into Eclipse and I am getting a different
>> error (it's likely that the snippet above just doesn't reflect what
>> you really have in your code).  Apparently, groovy doesn't like it if
>> there is no statement between the last label and the switch's close
>> bracket.  This shows up on the command line, too.
>> 5. What happens when you compile the snippet on the command line?
>>
>>
>>
>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>> <[hidden email]> wrote:
>>> switch(affUpdt.getActionSwitch()) {
>>>    case ADD:
>>>        //do something
>>>         break;
>>>     case DELETE:
>>>        //do something
>>>         break;
>>>     case UPDATE:
>>>        //do something
>>>          break;
>>>     default:
>>>        //do something
>>> }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Carr, Brian M
I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.

--b
______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
[hidden email]

On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:

> Can you create a stand alone snippet that recreates the problem?
>
> One thing is that the groovy-eclipse-compiler for maven is based off
> of 1.7.5 and we have included a few fixes for enums since then, so
> there may be a bug in the groovy-eclipse-compiler that is fixed when
> running inside of Eclipse.
>
> I am planning on doing a refresh of the packages soon so that they are
> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
> I hope to get this done in the next week or so.  In the meantime, it
> would be good to know if this is reproducible on the command line.
>
> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
> <[hidden email]> wrote:
>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>> 3.) groovy-eclipse-compiler
>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>
>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>
>>
>> ______________________________
>> Brian M. Carr
>> Identity and Access Management
>> ITS Applications
>> University of Texas at Austin
>> V: 512-232-6419
>> F: 512-471-5746
>> [hidden email]
>>
>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>
>>> Hi there,
>>>
>>> It's hard to say whether or not this is a bug, and which component is
>>> causing it without some more information.  I'll need to ask a few
>>> questions first:
>>>
>>> 1. What version of Groovy are you using in Eclipse?
>>> 2. What about in maven?
>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>> 4. I copied your snippet into Eclipse and I am getting a different
>>> error (it's likely that the snippet above just doesn't reflect what
>>> you really have in your code).  Apparently, groovy doesn't like it if
>>> there is no statement between the last label and the switch's close
>>> bracket.  This shows up on the command line, too.
>>> 5. What happens when you compile the snippet on the command line?
>>>
>>>
>>>
>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>> <[hidden email]> wrote:
>>>> switch(affUpdt.getActionSwitch()) {
>>>>    case ADD:
>>>>        //do something
>>>>         break;
>>>>     case DELETE:
>>>>        //do something
>>>>         break;
>>>>     case UPDATE:
>>>>        //do something
>>>>          break;
>>>>     default:
>>>>        //do something
>>>> }
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Andrew Eisenberg
Thanks.  Please keep me posted.  And I'll let you know when a new
groovy-eclipse-compiler is available.

On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
<[hidden email]> wrote:

> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>
> --b
> ______________________________
> Brian M. Carr
> Identity and Access Management
> ITS Applications
> University of Texas at Austin
> V: 512-232-6419
> F: 512-471-5746
> [hidden email]
>
> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>
>> Can you create a stand alone snippet that recreates the problem?
>>
>> One thing is that the groovy-eclipse-compiler for maven is based off
>> of 1.7.5 and we have included a few fixes for enums since then, so
>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>> running inside of Eclipse.
>>
>> I am planning on doing a refresh of the packages soon so that they are
>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>> I hope to get this done in the next week or so.  In the meantime, it
>> would be good to know if this is reproducible on the command line.
>>
>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>> <[hidden email]> wrote:
>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>> 3.) groovy-eclipse-compiler
>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>
>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>
>>>
>>> ______________________________
>>> Brian M. Carr
>>> Identity and Access Management
>>> ITS Applications
>>> University of Texas at Austin
>>> V: 512-232-6419
>>> F: 512-471-5746
>>> [hidden email]
>>>
>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>
>>>> Hi there,
>>>>
>>>> It's hard to say whether or not this is a bug, and which component is
>>>> causing it without some more information.  I'll need to ask a few
>>>> questions first:
>>>>
>>>> 1. What version of Groovy are you using in Eclipse?
>>>> 2. What about in maven?
>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>> error (it's likely that the snippet above just doesn't reflect what
>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>> there is no statement between the last label and the switch's close
>>>> bracket.  This shows up on the command line, too.
>>>> 5. What happens when you compile the snippet on the command line?
>>>>
>>>>
>>>>
>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>> <[hidden email]> wrote:
>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>    case ADD:
>>>>>        //do something
>>>>>         break;
>>>>>     case DELETE:
>>>>>        //do something
>>>>>         break;
>>>>>     case UPDATE:
>>>>>        //do something
>>>>>          break;
>>>>>     default:
>>>>>        //do something
>>>>> }
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Carr, Brian M
Hi Andrew,

I figure that attempting to send a tarball via the mailing list will fail, so I've posted it to my webspace.  This little example has 2 classes, a groovy enum and a java class which uses the groovy enum in a switch statement, and one test.  Opening the project in eclipse and running the test works fine, executing the gradle build works fine, but running the test via maven fails with the error posted earlier.  I've included the output of gradle and maven for you.

Please let me know if I can provide any additional information.

https://webspace.utexas.edu/carrbm1/pub/enumtest.tgz
______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
[hidden email]

On May 10, 2011, at 1:28 PM, Andrew Eisenberg wrote:

> Thanks.  Please keep me posted.  And I'll let you know when a new
> groovy-eclipse-compiler is available.
>
> On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
> <[hidden email]> wrote:
>> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>>
>> --b
>> ______________________________
>> Brian M. Carr
>> Identity and Access Management
>> ITS Applications
>> University of Texas at Austin
>> V: 512-232-6419
>> F: 512-471-5746
>> [hidden email]
>>
>> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>>
>>> Can you create a stand alone snippet that recreates the problem?
>>>
>>> One thing is that the groovy-eclipse-compiler for maven is based off
>>> of 1.7.5 and we have included a few fixes for enums since then, so
>>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>>> running inside of Eclipse.
>>>
>>> I am planning on doing a refresh of the packages soon so that they are
>>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>>> I hope to get this done in the next week or so.  In the meantime, it
>>> would be good to know if this is reproducible on the command line.
>>>
>>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>>> <[hidden email]> wrote:
>>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>>> 3.) groovy-eclipse-compiler
>>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>>
>>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>>
>>>>
>>>> ______________________________
>>>> Brian M. Carr
>>>> Identity and Access Management
>>>> ITS Applications
>>>> University of Texas at Austin
>>>> V: 512-232-6419
>>>> F: 512-471-5746
>>>> [hidden email]
>>>>
>>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>>
>>>>> Hi there,
>>>>>
>>>>> It's hard to say whether or not this is a bug, and which component is
>>>>> causing it without some more information.  I'll need to ask a few
>>>>> questions first:
>>>>>
>>>>> 1. What version of Groovy are you using in Eclipse?
>>>>> 2. What about in maven?
>>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>>> error (it's likely that the snippet above just doesn't reflect what
>>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>>> there is no statement between the last label and the switch's close
>>>>> bracket.  This shows up on the command line, too.
>>>>> 5. What happens when you compile the snippet on the command line?
>>>>>
>>>>>
>>>>>
>>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>>> <[hidden email]> wrote:
>>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>>    case ADD:
>>>>>>        //do something
>>>>>>         break;
>>>>>>     case DELETE:
>>>>>>        //do something
>>>>>>         break;
>>>>>>     case UPDATE:
>>>>>>        //do something
>>>>>>          break;
>>>>>>     default:
>>>>>>        //do something
>>>>>> }
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list, please visit:
>>>>>
>>>>>    http://xircles.codehaus.org/manage_email
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Andrew Eisenberg
Hi,

Thanks for the tarball.  I am fairly certain now that you are hitting
an enum bug in the groovy-eclipse-compiler that is now fixed.  This
seems serious enough to me that I should fix this right now.  I
recreated the groovy-eclipse-batch jar and uploaded it to the
springsource maven repo: http://maven.springframework.org/snapshot

Make sure to refresh the snapshots and you should be compiling against
the most recent snapshot of groovy-eclipse and Groovy 1.7.10.

This is not a long term solution.  I really need to automate this
process as well as provide a groovy 1.8 solution.  Also, there needs
to be an "official" release of this compiler, but this will have to
come later.  Let me know if this new snapshot works for you.

On Tue, May 10, 2011 at 1:45 PM, Carr, Brian M
<[hidden email]> wrote:

> Hi Andrew,
>
> I figure that attempting to send a tarball via the mailing list will fail, so I've posted it to my webspace.  This little example has 2 classes, a groovy enum and a java class which uses the groovy enum in a switch statement, and one test.  Opening the project in eclipse and running the test works fine, executing the gradle build works fine, but running the test via maven fails with the error posted earlier.  I've included the output of gradle and maven for you.
>
> Please let me know if I can provide any additional information.
>
> https://webspace.utexas.edu/carrbm1/pub/enumtest.tgz
> ______________________________
> Brian M. Carr
> Identity and Access Management
> ITS Applications
> University of Texas at Austin
> V: 512-232-6419
> F: 512-471-5746
> [hidden email]
>
> On May 10, 2011, at 1:28 PM, Andrew Eisenberg wrote:
>
>> Thanks.  Please keep me posted.  And I'll let you know when a new
>> groovy-eclipse-compiler is available.
>>
>> On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
>> <[hidden email]> wrote:
>>> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>>>
>>> --b
>>> ______________________________
>>> Brian M. Carr
>>> Identity and Access Management
>>> ITS Applications
>>> University of Texas at Austin
>>> V: 512-232-6419
>>> F: 512-471-5746
>>> [hidden email]
>>>
>>> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>>>
>>>> Can you create a stand alone snippet that recreates the problem?
>>>>
>>>> One thing is that the groovy-eclipse-compiler for maven is based off
>>>> of 1.7.5 and we have included a few fixes for enums since then, so
>>>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>>>> running inside of Eclipse.
>>>>
>>>> I am planning on doing a refresh of the packages soon so that they are
>>>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>>>> I hope to get this done in the next week or so.  In the meantime, it
>>>> would be good to know if this is reproducible on the command line.
>>>>
>>>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>>>> <[hidden email]> wrote:
>>>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>>>> 3.) groovy-eclipse-compiler
>>>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>>>
>>>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>>>
>>>>>
>>>>> ______________________________
>>>>> Brian M. Carr
>>>>> Identity and Access Management
>>>>> ITS Applications
>>>>> University of Texas at Austin
>>>>> V: 512-232-6419
>>>>> F: 512-471-5746
>>>>> [hidden email]
>>>>>
>>>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>>>
>>>>>> Hi there,
>>>>>>
>>>>>> It's hard to say whether or not this is a bug, and which component is
>>>>>> causing it without some more information.  I'll need to ask a few
>>>>>> questions first:
>>>>>>
>>>>>> 1. What version of Groovy are you using in Eclipse?
>>>>>> 2. What about in maven?
>>>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>>>> error (it's likely that the snippet above just doesn't reflect what
>>>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>>>> there is no statement between the last label and the switch's close
>>>>>> bracket.  This shows up on the command line, too.
>>>>>> 5. What happens when you compile the snippet on the command line?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>>>> <[hidden email]> wrote:
>>>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>>>    case ADD:
>>>>>>>        //do something
>>>>>>>         break;
>>>>>>>     case DELETE:
>>>>>>>        //do something
>>>>>>>         break;
>>>>>>>     case UPDATE:
>>>>>>>        //do something
>>>>>>>          break;
>>>>>>>     default:
>>>>>>>        //do something
>>>>>>> }
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe from this list, please visit:
>>>>>>
>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Carr, Brian M
Andrew, thanks for the response and the updated snapshot.  I have a lot of interest in the compiler plugin for maven since gmaven mangles the stub generation.  Is the code for this plugin available to provide patches?  Is there a Jira project instance for the maven plugin, or will it share with the eclipse plugin?
______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
[hidden email]

On May 10, 2011, at 4:30 PM, Andrew Eisenberg wrote:

> Hi,
>
> Thanks for the tarball.  I am fairly certain now that you are hitting
> an enum bug in the groovy-eclipse-compiler that is now fixed.  This
> seems serious enough to me that I should fix this right now.  I
> recreated the groovy-eclipse-batch jar and uploaded it to the
> springsource maven repo: http://maven.springframework.org/snapshot
>
> Make sure to refresh the snapshots and you should be compiling against
> the most recent snapshot of groovy-eclipse and Groovy 1.7.10.
>
> This is not a long term solution.  I really need to automate this
> process as well as provide a groovy 1.8 solution.  Also, there needs
> to be an "official" release of this compiler, but this will have to
> come later.  Let me know if this new snapshot works for you.
>
> On Tue, May 10, 2011 at 1:45 PM, Carr, Brian M
> <[hidden email]> wrote:
>> Hi Andrew,
>>
>> I figure that attempting to send a tarball via the mailing list will fail, so I've posted it to my webspace.  This little example has 2 classes, a groovy enum and a java class which uses the groovy enum in a switch statement, and one test.  Opening the project in eclipse and running the test works fine, executing the gradle build works fine, but running the test via maven fails with the error posted earlier.  I've included the output of gradle and maven for you.
>>
>> Please let me know if I can provide any additional information.
>>
>> https://webspace.utexas.edu/carrbm1/pub/enumtest.tgz
>> ______________________________
>> Brian M. Carr
>> Identity and Access Management
>> ITS Applications
>> University of Texas at Austin
>> V: 512-232-6419
>> F: 512-471-5746
>> [hidden email]
>>
>> On May 10, 2011, at 1:28 PM, Andrew Eisenberg wrote:
>>
>>> Thanks.  Please keep me posted.  And I'll let you know when a new
>>> groovy-eclipse-compiler is available.
>>>
>>> On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
>>> <[hidden email]> wrote:
>>>> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>>>>
>>>> --b
>>>> ______________________________
>>>> Brian M. Carr
>>>> Identity and Access Management
>>>> ITS Applications
>>>> University of Texas at Austin
>>>> V: 512-232-6419
>>>> F: 512-471-5746
>>>> [hidden email]
>>>>
>>>> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>>>>
>>>>> Can you create a stand alone snippet that recreates the problem?
>>>>>
>>>>> One thing is that the groovy-eclipse-compiler for maven is based off
>>>>> of 1.7.5 and we have included a few fixes for enums since then, so
>>>>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>>>>> running inside of Eclipse.
>>>>>
>>>>> I am planning on doing a refresh of the packages soon so that they are
>>>>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>>>>> I hope to get this done in the next week or so.  In the meantime, it
>>>>> would be good to know if this is reproducible on the command line.
>>>>>
>>>>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>>>>> <[hidden email]> wrote:
>>>>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>>>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>>>>> 3.) groovy-eclipse-compiler
>>>>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>>>>
>>>>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>>>>
>>>>>>
>>>>>> ______________________________
>>>>>> Brian M. Carr
>>>>>> Identity and Access Management
>>>>>> ITS Applications
>>>>>> University of Texas at Austin
>>>>>> V: 512-232-6419
>>>>>> F: 512-471-5746
>>>>>> [hidden email]
>>>>>>
>>>>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>>>>
>>>>>>> Hi there,
>>>>>>>
>>>>>>> It's hard to say whether or not this is a bug, and which component is
>>>>>>> causing it without some more information.  I'll need to ask a few
>>>>>>> questions first:
>>>>>>>
>>>>>>> 1. What version of Groovy are you using in Eclipse?
>>>>>>> 2. What about in maven?
>>>>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>>>>> error (it's likely that the snippet above just doesn't reflect what
>>>>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>>>>> there is no statement between the last label and the switch's close
>>>>>>> bracket.  This shows up on the command line, too.
>>>>>>> 5. What happens when you compile the snippet on the command line?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>>>>> <[hidden email]> wrote:
>>>>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>>>>    case ADD:
>>>>>>>>        //do something
>>>>>>>>         break;
>>>>>>>>     case DELETE:
>>>>>>>>        //do something
>>>>>>>>         break;
>>>>>>>>     case UPDATE:
>>>>>>>>        //do something
>>>>>>>>          break;
>>>>>>>>     default:
>>>>>>>>        //do something
>>>>>>>> }
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe from this list, please visit:
>>>>>>>
>>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list, please visit:
>>>>>
>>>>>    http://xircles.codehaus.org/manage_email
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Carr, Brian M
In reply to this post by Andrew Eisenberg
Andrew,  It seems there is a dependency missing in the new build.  Upon mvn compile, I get:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project enumtest: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile: org/apache/xbean/classloader/NonLockingJarFileClassLoader
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/bcarr/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.1/maven-compiler-plugin-2.3.1.jar
[ERROR] urls[1] = file:/Users/bcarr/.m2/repository/org/codehaus/groovy/groovy-eclipse-compiler/0.5.1-SNAPSHOT/groovy-eclipse-compiler-0.5.1-SNAPSHOT.jar
[ERROR] urls[2] = file:/Users/bcarr/.m2/repository/org/codehaus/groovy/groovy-eclipse-batch/0.5.1-SNAPSHOT/groovy-eclipse-batch-0.5.1-SNAPSHOT.jar
[ERROR] urls[3] = file:/Users/bcarr/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[4] = file:/Users/bcarr/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
[ERROR] urls[5] = file:/Users/bcarr/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
[ERROR] urls[6] = file:/Users/bcarr/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[7] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[8] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] urls[9] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.8/plexus-compiler-api-1.8.jar
[ERROR] urls[10] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/1.8/plexus-compiler-manager-1.8.jar
[ERROR] urls[11] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.8/plexus-compiler-javac-1.8.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.xbean.classloader.NonLockingJarFileClassLoader


I tried manually adding org.apache.xbean:xbean-classloader:3.7 as a dependency to the compiler plugin, but that doesn't seem to be enough.

--b
______________________________
Brian M. Carr
Identity and Access Management
ITS Applications
University of Texas at Austin
V: 512-232-6419
F: 512-471-5746
[hidden email]

On May 10, 2011, at 4:30 PM, Andrew Eisenberg wrote:

> Hi,
>
> Thanks for the tarball.  I am fairly certain now that you are hitting
> an enum bug in the groovy-eclipse-compiler that is now fixed.  This
> seems serious enough to me that I should fix this right now.  I
> recreated the groovy-eclipse-batch jar and uploaded it to the
> springsource maven repo: http://maven.springframework.org/snapshot
>
> Make sure to refresh the snapshots and you should be compiling against
> the most recent snapshot of groovy-eclipse and Groovy 1.7.10.
>
> This is not a long term solution.  I really need to automate this
> process as well as provide a groovy 1.8 solution.  Also, there needs
> to be an "official" release of this compiler, but this will have to
> come later.  Let me know if this new snapshot works for you.
>
> On Tue, May 10, 2011 at 1:45 PM, Carr, Brian M
> <[hidden email]> wrote:
>> Hi Andrew,
>>
>> I figure that attempting to send a tarball via the mailing list will fail, so I've posted it to my webspace.  This little example has 2 classes, a groovy enum and a java class which uses the groovy enum in a switch statement, and one test.  Opening the project in eclipse and running the test works fine, executing the gradle build works fine, but running the test via maven fails with the error posted earlier.  I've included the output of gradle and maven for you.
>>
>> Please let me know if I can provide any additional information.
>>
>> https://webspace.utexas.edu/carrbm1/pub/enumtest.tgz
>> ______________________________
>> Brian M. Carr
>> Identity and Access Management
>> ITS Applications
>> University of Texas at Austin
>> V: 512-232-6419
>> F: 512-471-5746
>> [hidden email]
>>
>> On May 10, 2011, at 1:28 PM, Andrew Eisenberg wrote:
>>
>>> Thanks.  Please keep me posted.  And I'll let you know when a new
>>> groovy-eclipse-compiler is available.
>>>
>>> On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
>>> <[hidden email]> wrote:
>>>> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>>>>
>>>> --b
>>>> ______________________________
>>>> Brian M. Carr
>>>> Identity and Access Management
>>>> ITS Applications
>>>> University of Texas at Austin
>>>> V: 512-232-6419
>>>> F: 512-471-5746
>>>> [hidden email]
>>>>
>>>> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>>>>
>>>>> Can you create a stand alone snippet that recreates the problem?
>>>>>
>>>>> One thing is that the groovy-eclipse-compiler for maven is based off
>>>>> of 1.7.5 and we have included a few fixes for enums since then, so
>>>>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>>>>> running inside of Eclipse.
>>>>>
>>>>> I am planning on doing a refresh of the packages soon so that they are
>>>>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>>>>> I hope to get this done in the next week or so.  In the meantime, it
>>>>> would be good to know if this is reproducible on the command line.
>>>>>
>>>>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>>>>> <[hidden email]> wrote:
>>>>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>>>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>>>>> 3.) groovy-eclipse-compiler
>>>>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>>>>
>>>>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>>>>
>>>>>>
>>>>>> ______________________________
>>>>>> Brian M. Carr
>>>>>> Identity and Access Management
>>>>>> ITS Applications
>>>>>> University of Texas at Austin
>>>>>> V: 512-232-6419
>>>>>> F: 512-471-5746
>>>>>> [hidden email]
>>>>>>
>>>>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>>>>
>>>>>>> Hi there,
>>>>>>>
>>>>>>> It's hard to say whether or not this is a bug, and which component is
>>>>>>> causing it without some more information.  I'll need to ask a few
>>>>>>> questions first:
>>>>>>>
>>>>>>> 1. What version of Groovy are you using in Eclipse?
>>>>>>> 2. What about in maven?
>>>>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>>>>> error (it's likely that the snippet above just doesn't reflect what
>>>>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>>>>> there is no statement between the last label and the switch's close
>>>>>>> bracket.  This shows up on the command line, too.
>>>>>>> 5. What happens when you compile the snippet on the command line?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>>>>> <[hidden email]> wrote:
>>>>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>>>>    case ADD:
>>>>>>>>        //do something
>>>>>>>>         break;
>>>>>>>>     case DELETE:
>>>>>>>>        //do something
>>>>>>>>         break;
>>>>>>>>     case UPDATE:
>>>>>>>>        //do something
>>>>>>>>          break;
>>>>>>>>     default:
>>>>>>>>        //do something
>>>>>>>> }
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe from this list, please visit:
>>>>>>>
>>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list, please visit:
>>>>>
>>>>>    http://xircles.codehaus.org/manage_email
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Andrew Eisenberg
In reply to this post by Carr, Brian M
Hi,

There's some documentation on the integration here:

http://docs.codehaus.org/display/GROOVY/Groovy-Eclipse+compiler+plugin+for+Maven

As described in the docs, the source code is available here:

https://svn.codehaus.org/groovy/eclipse/trunk/extras

The source code available here is just the sample project and the
compiler plugin.   It doesn't include the scripts that I used to
create the groovy-eclipse-batch jar.

On Wed, May 11, 2011 at 7:57 AM, Carr, Brian M
<[hidden email]> wrote:

> Andrew, thanks for the response and the updated snapshot.  I have a lot of interest in the compiler plugin for maven since gmaven mangles the stub generation.  Is the code for this plugin available to provide patches?  Is there a Jira project instance for the maven plugin, or will it share with the eclipse plugin?
> ______________________________
> Brian M. Carr
> Identity and Access Management
> ITS Applications
> University of Texas at Austin
> V: 512-232-6419
> F: 512-471-5746
> [hidden email]
>
> On May 10, 2011, at 4:30 PM, Andrew Eisenberg wrote:
>
>> Hi,
>>
>> Thanks for the tarball.  I am fairly certain now that you are hitting
>> an enum bug in the groovy-eclipse-compiler that is now fixed.  This
>> seems serious enough to me that I should fix this right now.  I
>> recreated the groovy-eclipse-batch jar and uploaded it to the
>> springsource maven repo: http://maven.springframework.org/snapshot
>>
>> Make sure to refresh the snapshots and you should be compiling against
>> the most recent snapshot of groovy-eclipse and Groovy 1.7.10.
>>
>> This is not a long term solution.  I really need to automate this
>> process as well as provide a groovy 1.8 solution.  Also, there needs
>> to be an "official" release of this compiler, but this will have to
>> come later.  Let me know if this new snapshot works for you.
>>
>> On Tue, May 10, 2011 at 1:45 PM, Carr, Brian M
>> <[hidden email]> wrote:
>>> Hi Andrew,
>>>
>>> I figure that attempting to send a tarball via the mailing list will fail, so I've posted it to my webspace.  This little example has 2 classes, a groovy enum and a java class which uses the groovy enum in a switch statement, and one test.  Opening the project in eclipse and running the test works fine, executing the gradle build works fine, but running the test via maven fails with the error posted earlier.  I've included the output of gradle and maven for you.
>>>
>>> Please let me know if I can provide any additional information.
>>>
>>> https://webspace.utexas.edu/carrbm1/pub/enumtest.tgz
>>> ______________________________
>>> Brian M. Carr
>>> Identity and Access Management
>>> ITS Applications
>>> University of Texas at Austin
>>> V: 512-232-6419
>>> F: 512-471-5746
>>> [hidden email]
>>>
>>> On May 10, 2011, at 1:28 PM, Andrew Eisenberg wrote:
>>>
>>>> Thanks.  Please keep me posted.  And I'll let you know when a new
>>>> groovy-eclipse-compiler is available.
>>>>
>>>> On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
>>>> <[hidden email]> wrote:
>>>>> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>>>>>
>>>>> --b
>>>>> ______________________________
>>>>> Brian M. Carr
>>>>> Identity and Access Management
>>>>> ITS Applications
>>>>> University of Texas at Austin
>>>>> V: 512-232-6419
>>>>> F: 512-471-5746
>>>>> [hidden email]
>>>>>
>>>>> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>>>>>
>>>>>> Can you create a stand alone snippet that recreates the problem?
>>>>>>
>>>>>> One thing is that the groovy-eclipse-compiler for maven is based off
>>>>>> of 1.7.5 and we have included a few fixes for enums since then, so
>>>>>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>>>>>> running inside of Eclipse.
>>>>>>
>>>>>> I am planning on doing a refresh of the packages soon so that they are
>>>>>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>>>>>> I hope to get this done in the next week or so.  In the meantime, it
>>>>>> would be good to know if this is reproducible on the command line.
>>>>>>
>>>>>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>>>>>> <[hidden email]> wrote:
>>>>>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>>>>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>>>>>> 3.) groovy-eclipse-compiler
>>>>>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>>>>>
>>>>>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>>>>>
>>>>>>>
>>>>>>> ______________________________
>>>>>>> Brian M. Carr
>>>>>>> Identity and Access Management
>>>>>>> ITS Applications
>>>>>>> University of Texas at Austin
>>>>>>> V: 512-232-6419
>>>>>>> F: 512-471-5746
>>>>>>> [hidden email]
>>>>>>>
>>>>>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>>>>>
>>>>>>>> Hi there,
>>>>>>>>
>>>>>>>> It's hard to say whether or not this is a bug, and which component is
>>>>>>>> causing it without some more information.  I'll need to ask a few
>>>>>>>> questions first:
>>>>>>>>
>>>>>>>> 1. What version of Groovy are you using in Eclipse?
>>>>>>>> 2. What about in maven?
>>>>>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>>>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>>>>>> error (it's likely that the snippet above just doesn't reflect what
>>>>>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>>>>>> there is no statement between the last label and the switch's close
>>>>>>>> bracket.  This shows up on the command line, too.
>>>>>>>> 5. What happens when you compile the snippet on the command line?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>>>>>> <[hidden email]> wrote:
>>>>>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>>>>>    case ADD:
>>>>>>>>>        //do something
>>>>>>>>>         break;
>>>>>>>>>     case DELETE:
>>>>>>>>>        //do something
>>>>>>>>>         break;
>>>>>>>>>     case UPDATE:
>>>>>>>>>        //do something
>>>>>>>>>          break;
>>>>>>>>>     default:
>>>>>>>>>        //do something
>>>>>>>>> }
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe from this list, please visit:
>>>>>>>>
>>>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe from this list, please visit:
>>>>>>
>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with enum in groovy-eclipse-plugin which does not occur in eclipse itself

Andrew Eisenberg
In reply to this post by Carr, Brian M
I think I know what the problem is.  With Groovy-Eclipse 2.1.2, we
introduced a non-locking jar classloader.  It should be optional, but
I guess that maven doesn't consider it so.  Let me see what i can do.

On Wed, May 11, 2011 at 8:18 AM, Carr, Brian M
<[hidden email]> wrote:

> Andrew,  It seems there is a dependency missing in the new build.  Upon mvn compile, I get:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project enumtest: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile: org/apache/xbean/classloader/NonLockingJarFileClassLoader
> [ERROR] -----------------------------------------------------
> [ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.1
> [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
> [ERROR] urls[0] = file:/Users/bcarr/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.1/maven-compiler-plugin-2.3.1.jar
> [ERROR] urls[1] = file:/Users/bcarr/.m2/repository/org/codehaus/groovy/groovy-eclipse-compiler/0.5.1-SNAPSHOT/groovy-eclipse-compiler-0.5.1-SNAPSHOT.jar
> [ERROR] urls[2] = file:/Users/bcarr/.m2/repository/org/codehaus/groovy/groovy-eclipse-batch/0.5.1-SNAPSHOT/groovy-eclipse-batch-0.5.1-SNAPSHOT.jar
> [ERROR] urls[3] = file:/Users/bcarr/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
> [ERROR] urls[4] = file:/Users/bcarr/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
> [ERROR] urls[5] = file:/Users/bcarr/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
> [ERROR] urls[6] = file:/Users/bcarr/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
> [ERROR] urls[7] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
> [ERROR] urls[8] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
> [ERROR] urls[9] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.8/plexus-compiler-api-1.8.jar
> [ERROR] urls[10] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/1.8/plexus-compiler-manager-1.8.jar
> [ERROR] urls[11] = file:/Users/bcarr/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.8/plexus-compiler-javac-1.8.jar
> [ERROR] Number of foreign imports: 1
> [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
> [ERROR]
> [ERROR] -----------------------------------------------------: org.apache.xbean.classloader.NonLockingJarFileClassLoader
>
>
> I tried manually adding org.apache.xbean:xbean-classloader:3.7 as a dependency to the compiler plugin, but that doesn't seem to be enough.
>
> --b
> ______________________________
> Brian M. Carr
> Identity and Access Management
> ITS Applications
> University of Texas at Austin
> V: 512-232-6419
> F: 512-471-5746
> [hidden email]
>
> On May 10, 2011, at 4:30 PM, Andrew Eisenberg wrote:
>
>> Hi,
>>
>> Thanks for the tarball.  I am fairly certain now that you are hitting
>> an enum bug in the groovy-eclipse-compiler that is now fixed.  This
>> seems serious enough to me that I should fix this right now.  I
>> recreated the groovy-eclipse-batch jar and uploaded it to the
>> springsource maven repo: http://maven.springframework.org/snapshot
>>
>> Make sure to refresh the snapshots and you should be compiling against
>> the most recent snapshot of groovy-eclipse and Groovy 1.7.10.
>>
>> This is not a long term solution.  I really need to automate this
>> process as well as provide a groovy 1.8 solution.  Also, there needs
>> to be an "official" release of this compiler, but this will have to
>> come later.  Let me know if this new snapshot works for you.
>>
>> On Tue, May 10, 2011 at 1:45 PM, Carr, Brian M
>> <[hidden email]> wrote:
>>> Hi Andrew,
>>>
>>> I figure that attempting to send a tarball via the mailing list will fail, so I've posted it to my webspace.  This little example has 2 classes, a groovy enum and a java class which uses the groovy enum in a switch statement, and one test.  Opening the project in eclipse and running the test works fine, executing the gradle build works fine, but running the test via maven fails with the error posted earlier.  I've included the output of gradle and maven for you.
>>>
>>> Please let me know if I can provide any additional information.
>>>
>>> https://webspace.utexas.edu/carrbm1/pub/enumtest.tgz
>>> ______________________________
>>> Brian M. Carr
>>> Identity and Access Management
>>> ITS Applications
>>> University of Texas at Austin
>>> V: 512-232-6419
>>> F: 512-471-5746
>>> [hidden email]
>>>
>>> On May 10, 2011, at 1:28 PM, Andrew Eisenberg wrote:
>>>
>>>> Thanks.  Please keep me posted.  And I'll let you know when a new
>>>> groovy-eclipse-compiler is available.
>>>>
>>>> On Tue, May 10, 2011 at 11:21 AM, Carr, Brian M
>>>> <[hidden email]> wrote:
>>>>> I've coded around the problem with if/else statements for now.  I'll try to put together a gradle build that works and a maven build using groovy-eclipse-compiler that doesn't.  If i'm able to do that, i'll tar it up and send it your way.
>>>>>
>>>>> --b
>>>>> ______________________________
>>>>> Brian M. Carr
>>>>> Identity and Access Management
>>>>> ITS Applications
>>>>> University of Texas at Austin
>>>>> V: 512-232-6419
>>>>> F: 512-471-5746
>>>>> [hidden email]
>>>>>
>>>>> On May 10, 2011, at 1:04 PM, Andrew Eisenberg wrote:
>>>>>
>>>>>> Can you create a stand alone snippet that recreates the problem?
>>>>>>
>>>>>> One thing is that the groovy-eclipse-compiler for maven is based off
>>>>>> of 1.7.5 and we have included a few fixes for enums since then, so
>>>>>> there may be a bug in the groovy-eclipse-compiler that is fixed when
>>>>>> running inside of Eclipse.
>>>>>>
>>>>>> I am planning on doing a refresh of the packages soon so that they are
>>>>>> updated to 1.7.10 and 1.8.0, but I just don't have time at the moment.
>>>>>> I hope to get this done in the next week or so.  In the meantime, it
>>>>>> would be good to know if this is reproducible on the command line.
>>>>>>
>>>>>> On Tue, May 10, 2011 at 9:43 AM, Carr, Brian M
>>>>>> <[hidden email]> wrote:
>>>>>>> 1.) Preferences/Groovy/Compiler : 1.7.10.xx-20110509-1400-e36
>>>>>>> 2.) org.codehaus.groovy:groovy-eclipse-compile:0.5.1-SNAPSHOT and org.codehaus.groovy:groovy:1.7.7
>>>>>>> 3.) groovy-eclipse-compiler
>>>>>>> 4.) yes, this appears to be bug due to not parsing the : correctly if there is nothing after it. i have an actual statement there in the code
>>>>>>>
>>>>>>> 5.) i have no way to compile this project from the CLI without maven.  since i'm using src/main/java and src/main/groovy, i'd have to completely re-organize the project to get it to build with gradle or gant
>>>>>>>
>>>>>>>
>>>>>>> ______________________________
>>>>>>> Brian M. Carr
>>>>>>> Identity and Access Management
>>>>>>> ITS Applications
>>>>>>> University of Texas at Austin
>>>>>>> V: 512-232-6419
>>>>>>> F: 512-471-5746
>>>>>>> [hidden email]
>>>>>>>
>>>>>>> On May 10, 2011, at 11:04 AM, Andrew Eisenberg wrote:
>>>>>>>
>>>>>>>> Hi there,
>>>>>>>>
>>>>>>>> It's hard to say whether or not this is a bug, and which component is
>>>>>>>> causing it without some more information.  I'll need to ask a few
>>>>>>>> questions first:
>>>>>>>>
>>>>>>>> 1. What version of Groovy are you using in Eclipse?
>>>>>>>> 2. What about in maven?
>>>>>>>> 3. Are you using gmaven or the groovy-eclipse-compiler for maven?
>>>>>>>> 4. I copied your snippet into Eclipse and I am getting a different
>>>>>>>> error (it's likely that the snippet above just doesn't reflect what
>>>>>>>> you really have in your code).  Apparently, groovy doesn't like it if
>>>>>>>> there is no statement between the last label and the switch's close
>>>>>>>> bracket.  This shows up on the command line, too.
>>>>>>>> 5. What happens when you compile the snippet on the command line?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, May 10, 2011 at 7:15 AM, Carr, Brian M
>>>>>>>> <[hidden email]> wrote:
>>>>>>>>> switch(affUpdt.getActionSwitch()) {
>>>>>>>>>    case ADD:
>>>>>>>>>        //do something
>>>>>>>>>         break;
>>>>>>>>>     case DELETE:
>>>>>>>>>        //do something
>>>>>>>>>         break;
>>>>>>>>>     case UPDATE:
>>>>>>>>>        //do something
>>>>>>>>>          break;
>>>>>>>>>     default:
>>>>>>>>>        //do something
>>>>>>>>> }
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe from this list, please visit:
>>>>>>>>
>>>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe from this list, please visit:
>>>>>>
>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email