is there a difference between the bundled groovy.jar and the official groovy.jar

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

is there a difference between the bundled groovy.jar and the official groovy.jar

Sebastien Blanc
Hi !

Since a couple of weeks for my plugins I'm using the groovy.jar provided by the plugin and it was working so fare. But last week we discovered a difference, code that was compiling with an external groovy.jar (the maven artifact from the groovy team) did not compile with the groovy.jar provided by the plugin. It concerns a very specific use case which is a bit complicated to explain :
We compile groovy scripts in Java using the scripting JSR and we have our custom security compilation customizer and we are getting a : 

java.lang.AbstractMethodError
at org.codehaus.groovy.ast.expr.EmptyExpression.visit(EmptyExpression.java:39)
at  GroovyInternalSecurityCodeVisitor.visitBinaryExpression(GroovyInternalSecurityCodeVisitor.java:591)

GroovyInternalSecurityCodeVisitor is our Custom Security checker which has been modified since we switched from a groovy jar to another.


When I check the manifest of both groovy.jar I can notice some minor differences (JDK used for instance).

Do you have some idea on what is going on ? 

Seb


Reply | Threaded
Open this post in threaded view
|

Re: is there a difference between the bundled groovy.jar and the official groovy.jar

Andy Clement
In terms of eclipse plugins, the groovy jars in the
eclipse/plugins/org.codehaus.groovy_*****/lib folder match the real
distributions of groovy.

On top of those the Groovy-Eclipse plugin ships a 'groovy-eclipse.jar'
- this provides replacements for some of the types in groovy to give
us better error handling (recoverable parsing) and more consistency.
One thing it does is add a small EmptyExpression class and related
visitor methods.  If you write a visitor against the standard groovy
compiler and yet run it using the eclipse jars, you wont have the
EmptyExpression visit method in your code (and you'll get the
AbstractMethodError).

So, that's why you are seeing what you are seeing.  I'm thinking you
should raise a jira and we can decide what to do - that bit of code is
Andrew's but if we don't have a good reason to keep that
EmptyExpression thing around, we should probably get rid of it as it
introduces this incompatibility in a relatively public interface (our
other patches try to only be against pure internals).

cheers,
Andy

On 10 April 2012 01:34, Sebastien Blanc <[hidden email]> wrote:

> Hi !
>
> Since a couple of weeks for my plugins I'm using the groovy.jar provided by
> the plugin and it was working so fare. But last week we discovered a
> difference, code that was compiling with an external groovy.jar (the
> maven artifact from the groovy team) did not compile with the groovy.jar
> provided by the plugin. It concerns a very specific use case which is a bit
> complicated to explain :
> We compile groovy scripts in Java using the scripting JSR and we have our
> custom security compilation customizer and we are getting a :
>
> java.lang.AbstractMethodError
> at
> org.codehaus.groovy.ast.expr.EmptyExpression.visit(EmptyExpression.java:39)
> at
>  GroovyInternalSecurityCodeVisitor.visitBinaryExpression(GroovyInternalSecurityCodeVisitor.java:591)
>
> GroovyInternalSecurityCodeVisitor is our Custom Security checker which has
> been modified since we switched from a groovy jar to another.
>
>
> When I check the manifest of both groovy.jar I can notice some minor
> differences (JDK used for instance).
>
> Do you have some idea on what is going on ?
>
> Seb
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: is there a difference between the bundled groovy.jar and the official groovy.jar

Sebastien Blanc
Andy,
Thanks to have spotted the exact origin of the issue ! I understand know why it was falling.
I will raise a jira and discuss with Andrew on the best solution.
Seb


Envoyé de mon iPhone

Le Apr 10, 2012 à 17:40, Andy Clement <[hidden email]> a écrit :

> In terms of eclipse plugins, the groovy jars in the
> eclipse/plugins/org.codehaus.groovy_*****/lib folder match the real
> distributions of groovy.
>
> On top of those the Groovy-Eclipse plugin ships a 'groovy-eclipse.jar'
> - this provides replacements for some of the types in groovy to give
> us better error handling (recoverable parsing) and more consistency.
> One thing it does is add a small EmptyExpression class and related
> visitor methods.  If you write a visitor against the standard groovy
> compiler and yet run it using the eclipse jars, you wont have the
> EmptyExpression visit method in your code (and you'll get the
> AbstractMethodError).
>
> So, that's why you are seeing what you are seeing.  I'm thinking you
> should raise a jira and we can decide what to do - that bit of code is
> Andrew's but if we don't have a good reason to keep that
> EmptyExpression thing around, we should probably get rid of it as it
> introduces this incompatibility in a relatively public interface (our
> other patches try to only be against pure internals).
>
> cheers,
> Andy
>
> On 10 April 2012 01:34, Sebastien Blanc <[hidden email]> wrote:
>> Hi !
>>
>> Since a couple of weeks for my plugins I'm using the groovy.jar provided by
>> the plugin and it was working so fare. But last week we discovered a
>> difference, code that was compiling with an external groovy.jar (the
>> maven artifact from the groovy team) did not compile with the groovy.jar
>> provided by the plugin. It concerns a very specific use case which is a bit
>> complicated to explain :
>> We compile groovy scripts in Java using the scripting JSR and we have our
>> custom security compilation customizer and we are getting a :
>>
>> java.lang.AbstractMethodError
>> at
>> org.codehaus.groovy.ast.expr.EmptyExpression.visit(EmptyExpression.java:39)
>> at
>>  GroovyInternalSecurityCodeVisitor.visitBinaryExpression(GroovyInternalSecurityCodeVisitor.java:591)
>>
>> GroovyInternalSecurityCodeVisitor is our Custom Security checker which has
>> been modified since we switched from a groovy jar to another.
>>
>>
>> When I check the manifest of both groovy.jar I can notice some minor
>> differences (JDK used for instance).
>>
>> Do you have some idea on what is going on ?
>>
>> Seb
>>
>>
>
> ---------------------------------------------------------------------
> 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