norricorp | 1 Sep 10:35 2014

[groovy-user] when to define a variable

I am a bit confused by when to use def.
I have some code where I def an empty map (def branch_map = [:]) which I use
in both the main part of the code and in methods. This works.
But when I use def on a list in the same way (define empty list, use in main
and methods) I get 
Caught: groovy.lang.MissingPropertyException: No such property: commitList
for class: xyz
when the list is used in a method.
If I do not define the list but just use it then I get the result I want.

Can someone explain what I am not understanding here?


View this message in context:
Sent from the groovy - user mailing list archive at

To unsubscribe from this list, please visit:

sterg | 31 Aug 14:34 2014

[groovy-user] JavaFX based plots

Hi all,

it seems that JavaFX can produce plots of better quality than Java2D.

I interfaced some routines in GroovyLab,

The plots look very nice!!

.. also can JavaFX be used for 3-D graphics, as OpenGL?


To unsubscribe from this list, please visit:

Thibault Kruse | 31 Aug 12:32 2014

[groovy-user] ==~ operator performance


should the ==~ operator be used sparingly?

In such a class:

class FooMatch {
  private static final String PATTERN = '[a-Z]+[0-9]'

  boolean matches(String value) {
    return value ==~ PATTERN

I assume that a new Pattern matcher is created every time the method
runs, which seems a waste of resources compared to having a static
final matcher.


To unsubscribe from this list, please visit:

Thibault Kruse | 31 Aug 12:09 2014

[groovy-user] implicit accessors and <at> Override


what is the opinion about implementing an interfacte that defined def
getFoo(); with a class like this:

class SubFoo extends Foo {
   def foo

The problem I see here is that the  <at> Override notation cannot be used
without explicitly adding the getter method.

I did not see any codenarc rule for this yet, but I think I would
prefer code to use an explicit method in the subclass here having
 <at> Override.



To unsubscribe from this list, please visit:

jim northrop | 29 Aug 15:38 2014

[groovy-user] Live update of Groovy Documentation

My understanding at the moment is that groovy documentation is
generated as static content with no persistance store behind it. Does
anyone know if we have any plans to make our groovy docs more
wiki-like in that they can be edited/amended by the reader ?

several other sites offer this feature. It just seems a little
dangerous to me as some potential changes might not reflect reality or
be reviewed by people who know more and might lead future readers

what do ya think ?


To unsubscribe from this list, please visit:

efim | 27 Aug 18:17 2014

[groovy-user] Eclipse-Groovy plugin refactor questions

Hello guys,

* For some reason the CTRL mouse over does not work always in eclipse,
instead of highlighting   and jumping to the deceleration nothing happens
* How can I create a new method from method declaration, for example ctrl-1
on foo("test") will create a new method with a string as a parameter.

I'm using Kepler with Eclipse-Groovy plugin version 2.9

View this message in context:
Sent from the groovy - user mailing list archive at

To unsubscribe from this list, please visit:

Maarten Boekhold | 26 Aug 13:01 2014

[groovy-user] Groovy-Eclipse and non-custom .groovy file extension

Hi all,
I'm working with an internal framework that uses groovy scripts to implement custom behaviour. For some reason, the developer of this framework has decided that the file extension of these scripts should be ".box". This makes editing the scripts inside Eclipse a bit hard, because they are not recognized as groovy scripts/classes, and as such we don't get syntax highlighting, auto-complete etc.
Is there a way to register "custom file extensions" in Eclipse/Groovy-Eclipse so that they are actually treated as groovy scripts inside Eclipse?

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

Tomas Salazar | 26 Aug 04:29 2014

[groovy-user] Spock mocking class with annotated methods

I am trying to create a Mock on an interface that have annotated methods, but when getParameterAnnotations() is invoked over the Mock it's returning and empty nested array of length zero.

interface SongsService {
  String get( <at> ApiQueryParam("query") String query)

class RamlApiHandlerTest extends Specification {
  def "Handle with service"() {
      SongsService songsService = Mock(SongsService)
      songsService.get(_) >> { args -> "hola ${args}" }
      def annotations = methods.first().getParameterAnnotations()
      annotations.[0].size() == 1



Todd Bradley | 26 Aug 00:12 2014

[groovy-user] help me stop myself from shooting my coworker in the foot

I'm working on a project that is mixed Java and Groovy. I'm still a Groovy neophyte, but some of the Java code I'm responsible for is used by some Groovy code my coworker Tom wrote. We use the latest Eclipse and the latest Groovy.

Over the weekend, I changed some of my Java code, including changing a method signature for a method that Tom's Groovy code is using. Normally, in an all Java project, I'd know what I needed to fix by looking for red X's in Eclipse. Once everything compiles, I know I fixed all references to that method. But in this case, due to Groovy not being strongly typed, the Groovy code still compiled. It just didn't run anymore, as I found out this morning.

So a few questions:

Is there a name for this type of problem?

Short of running all Groovy code that uses the Java code, what's the best way to learn that I broke the contract that Tom's Groovy code was depending on, so I can fix it before committing my changes?

Does Eclipse provide any tools to make our life easier in this regard?


Batman | 25 Aug 12:06 2014

[groovy-user] Adding features to the Old Java code base using Groovy MetaProgramming

This is the problem we have in our hand. 

We have our own framework, which allows running test cases parallel. Its an
legacy Java code base. Now there is a requirement needed for getting logs
for the parallel running cases. Rather than touching the code base, we
thought we will add some additional features to the classes using
MetaProgramming so that they log properly .

We need the logs like:

1. Entering the method calls. 
2. Leaving the method calls. 
3. And custom user logs too. 

Any Groovy ideas from community can help us doing this. 

View this message in context:
Sent from the groovy - user mailing list archive at

To unsubscribe from this list, please visit:

sterg | 23 Aug 15:23 2014

[groovy-user] Apache Common Maths integrated with GroovyLab

Hi all,

I liked much the Apache Common Maths open source library, it covers a 
wide range
of numerical software.

Thus, I embedded its source within the GroovyLab sources and I perform
automatically imports of the Apache Common Maths classes,
using the Groovy compilationCustomizer.

.. I think such an approach is much convenient,
but I like to consider other opinions ...

Best Regards


To unsubscribe from this list, please visit: