Groovy Eclipse 2.1.2, Groovy 1.7.5 and Groovy++

58 views
Skip to first unread message

Daniel Henrique

unread,
May 26, 2011, 5:13:30 PM5/26/11
to Groovy++

Alex Tkachman

unread,
May 26, 2011, 5:32:35 PM5/26/11
to groovyp...@googlegroups.com
Just for beginning please take groovy 1.7.10 (1.7.8 should probably be
OK as well) and g++ 0.4.246

Daniel Henrique

unread,
May 26, 2011, 6:21:22 PM5/26/11
to Groovy++
Hi, Alex. I think I can't do it. I'm using Grails 1.3.6 and it uses
Groovy 1.7.5...

Daniel Henrique Alves Lima

unread,
May 26, 2011, 7:46:59 PM5/26/11
to groovyp...@googlegroups.com
Ok, but I'm using Grails 1.3.6, which uses Groovy 1.7.5.

I'll try Grails 1.3.7 (Groovy 1.7.8) and g++ 0.4.246 to see what
happens. 1.3.7 & g++ 0.4.215 don't work:
http://markmail.org/message/jc7xbhtufnmolxao

Thanks.


Daniel Henrique

unread,
May 27, 2011, 3:26:43 PM5/27/11
to Groovy++
The newer version of groovy++ is complaining about switch/case/break
using labeled blocks. The following code works using an older version
of groovy++ or without groovy++:

class SwitchCase {

@Typed(TypePolicy.MIXED)
public static void main(String [] args) {
int x = 10;

switch (x) {
case 1:
println 'A'
break
case 2: L:{
println 'B'
x = x + 1
break
}
}
}

}


[groovyc]
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:
[groovyc] SwitchCase.groovy: 14: Illegal break label 'null'
[groovyc] @ line 14, column 13.
[groovyc] break


The label seems required because of the ambiguity of the anonymous
block:

[groovyc] SwitchCase.groovy: 11: Ambiguous expression could be
either a parameterless closure expression or an isolated open code
block;
[groovyc] solution: Add an explicit closure parameter list, e.g.
{it -> ...}, or force it to be treated as an open block by giving it a
label, e.g. L:{...} @ line 11, column 17.
[groovyc] case 2: {


Thanks in advance.

Alex Tkachman

unread,
May 27, 2011, 4:28:16 PM5/27/11
to groovyp...@googlegroups.com
Well, g++ treats labeled closures in very special way -
http://code.google.com/p/groovypptest/wiki/LabeledClosures

Theoretically we can change logic, so that it applies only if ->
present. But truly speaking I don't know why block used here at all

Daniel Henrique

unread,
May 27, 2011, 4:54:53 PM5/27/11
to Groovy++
Hi, Alex. Thanks for your answers.

The previous source code was just an example. The source code "for
real" is more complex than that. It wasn't my intention to define/
declare a closure or a named closure. In the original source code it
was just an anonymous block, used to create an isolated variable
scope. It belongs to an old Java app that I'm migrating to Groovy.

Best regards.

Daniel.

On May 27, 5:28 pm, Alex Tkachman <alex.tkach...@gmail.com> wrote:
> Well, g++ treats labeled closures in very special way -http://code.google.com/p/groovypptest/wiki/LabeledClosures

Daniel Henrique

unread,
May 28, 2011, 7:47:07 PM5/28/11
to Groovy++
Alex, I have one last question related (?) to this issue: Until Groovy+
+ to achieve version 1.0, should I expect some *minor* breaking
changes between minor or patch versions? For instance, 0.4.113 vs.
0.4.246.
Please, don't get me wrong. I'm just worried because I'm using Groovy
and Groovy++ to replace old Java code in a stable application (already
in production) and I'm doing it because I want to make the application
easier to evolve later. I prefer avoiding some maintenance headaches
because version x.y.a works in one way and x.y.b works in a different
way. It really is a legitimate question. Like I've said before, I do
like Groovy++. I just want to know what to expect.

Thanks!

Best regards.

Daniel.

Alex Tkachman

unread,
May 29, 2011, 12:47:46 AM5/29/11
to groovyp...@googlegroups.com
Well, the one with labels is not minor and I intentionally did it
before 0.5. In fact, the plan is to be a bit slower with breaking
changes after 0.5 The only big change I foresee for now right after
0.5 is re-implementation of traits based on scala-like linearization
approach

Daniel Henrique Alves Lima

unread,
May 30, 2011, 12:39:04 PM5/30/11
to eclipse-p...@groovy.codehaus.org, groovyp...@googlegroups.com
Ok. I'm sorry for the crosspost.

I'm now using Eclipse 3.6.2 (M20110210-1200), Groovy Eclipse
2.5.0.xx-20110511-1600-e36-RELEASE (which uses Groovy 1.7.10) and
groovypp-all-0.4.246_1.7.10.jar. It still doesn't work:

Description Resource Path Location Type
Internal compiler error: java.lang.AbstractMethodError:
org.codehaus.groovy.classgen.BytecodeInstruction.visit(Lorg/objectweb/asm/MethodVisitor;)V
at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:596)
Test.groovy /grprj/src line 0 Java Problem


The test project is here:

http://grails-batch-launcher-plugin.googlecode.com/files/grprj.zip


Does it work for anyone? Am I doing something wrong or am I
missing something?

There is also this message:

http://groups.google.com/group/groovyplusplus/browse_thread/thread/3cf3983270f98519/12feed8025b2bbd7?#12feed8025b2bbd7


Should I assume that Groovy Eclipse and Groovy++ don't work together?


Thanks in advance.


Best regards.

Daniel.

Read these in the context:
http://groups.google.com/group/groovyplusplus/browse_thread/thread/433122df4f3adce3
http://markmail.org/thread/re25ir34d7xbkkuu

Alex Tkachman

unread,
May 30, 2011, 12:51:44 PM5/30/11
to eclipse-p...@groovy.codehaus.org, groovyp...@googlegroups.com
Most probably you need groovypp.jar instead of groovypp-all.jar

> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Daniel Henrique Alves Lima

unread,
May 30, 2011, 1:43:46 PM5/30/11
to eclipse-p...@groovy.codehaus.org, groovyp...@googlegroups.com
Hi, Alex.

Using groovypp.jar instead of groovypp-all.jar did the trick.
I was using groovypp-all because Groovy Eclipse sets/uses
groovy-all.jar as one of the "Groovy Libraries". But I think Andy said
that these libraries are only used at runtime (they aren't used by the
Groovy Eclipse compiler), so the solution makes sense.

Thanks!

Reply all
Reply to author
Forward
0 new messages