Jason Dillon | 7 Sep 14:33

[groovy-user] GMaven 1.0-rc-4-SNAPSHOT

Folks a new snapshot of GMaven is out, this one mainly fixes problems  
with Maven 2.1 usage, and IDE integration which uses the Maven 2.1  
embedder.

Give it a whirl and report any issues, will release in a few days if I  
don't hear of any problems.  This should sort out the last of the  
major issues before 1.0.

--jason

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

    http://xircles.codehaus.org/manage_email

adrianp | 7 Sep 04:14

[groovy-user] Groovy SQL problem with "in" parameters


I've been struggling with this problem and have tried a lot of different
things but I just can't seem to get it to work.  I can't find anyone asking
the problem on the intrawebs so I'm hoping I'm doing something so boneheaded
that I'm the first person to be confused by it.

I want to query a temporary MySQL table to get back some rows whose value is
in a given array.  I can get this working using GORM's Criteria Builder
using standard tables but I don't have any mappings defined for temp tables
so I'm doing this manually, using groovy.sql.Sql.

The query I want to run is: "select t.id, t.val1 from test1 t where t.val1
in ?" where the last argument is an array of Strings.  Running it just as
"... in (?)" gives me zero rows no matter what arguments I pass.  If I run
"... in ?" then I get:

Error with SQL: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You
have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near
'_binary'¬í\0ur\0[Ljava.lang.String;­ÒVçé
{G\0\0xp\0\0\0t\0oranget\0carrot'' at line 1

It looks like its doing something very strange with my parameters.  I would
convert them into a comma-delimited string and insert them directly into the
SQL but they're all user-entered parameters and I would rather not deal with
the security problems that raises.

I'd be grateful for any insight anyone has.  It's really got me foozled.

Here is a test application:
(Continue reading)

Setya | 6 Sep 19:42

[groovy-user] Adding method as GString expression to per-instance metaclass


Hi all,

I tried to add dynamic method to per-instance metaclass, the method itself
is in the form of GString expression as follows:

def emc = new ExpandoMetaClass(Expando);
def methodName = 'getTest';
emc."$methodName" = {-> println 'Hello World';};
emc.initialize();

def expando = new Expando();
expando.metaClass = emc;

Than I call the method :

expando.test;

No error was thrown but the closure within 'getTest' is never called

Any ideas ?

Regards,

Setya
--

-- 
View this message in context: http://www.nabble.com/Adding-method-as-GString-expression-to-per-instance-metaclass-tp19349186p19349186.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
(Continue reading)

Sergey Bondarenko | 6 Sep 18:55

[groovy-user] possible bug/regression in GroovyConsole

It seems like there is a minor regression in GroovyConsole.
In previous versions it was possible to run several pieces of code,
and binging variables were preserved between invocations.
Now binding seams to be empty for each next invocation. I tried using
snapshot 20080906095551.

Steps to reproduce:
open groovyConsole, and paste this script:
x = 1
println x

Select and execute first line, then select and execute second line.
You will get groovy.lang.MissingPropertyException.
In all previous GroovyConsole versions you would get "1".

Is it a bug or intended behaviour?

Best regards,
Sergey Bondarenko.

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

    http://xircles.codehaus.org/manage_email

Russel Winder | 6 Sep 18:12

[groovy-user] Groovy Eclipse Plugin

And on the good news front:  I just updated my Eclipse 3.4 and got a new
Groovy Plugin -- 1.5.6.200809041515 -- and Gant just compiled without
any hassle at all.  :-)

Some of the Gant tests still fail but that is because Eclipse (and
IntelliJ IDEA) use forkmode="once" instead of forkmode="perTest" when
spawning JUnit.  I still have little idea why this difference of fork
mode makes such a difference.  Clearly it must be something to do with
static data somewhere, but I have no idea where.  If anyone has a chance
to investigate and sort this out, that would be really great.

--

-- 
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077
Russel Winder | 6 Sep 18:00

[groovy-user] Eclipse and plugins

I just started Eclipse to deal with rearrangements of my filestore.  As
ever I check for plugin updates and install them.  With 3.3 I then used
to go and delete old plugins in order to keep disc space use to a
reasonable level.  In 3.4 I cannot find a way to do the deletion -- am I
missing something obvious?  What is actually worrying is that it seems
to make a virtue of keeping the entire update history so it can revert
to any previous state -- i.e. it is assuming I have infinite disc space
and thinks I want to keep the entire update history.  This is seriously
worrying.

Thanks.

--

-- 
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077
Sergey Bondarenko | 6 Sep 16:43

[groovy-user] Eclipse plugin for Groovy 1.6 ?

Hi all!

Does anybody know if there is any way to change underlying groovy in
Eclipse plugin to Groovy 1.6 ?
If I replace groovy libraries manually, new 1.6 groovy syntax is not available.
It seems like Groovy Eclipse plugin uses grammar from 1.5.

Is there any possible workaround for this problem&

Regards,
Sergey Bondarenko.

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

    http://xircles.codehaus.org/manage_email

Johnny Jian | 6 Sep 12:31

[groovy-user] Re: Support for unless / if expressions

Why not provide a method instead of a keyword, like the "use" method?
So the unless expression can be written as:
unless(x > 10) { doSomething() }
Then no grammar is needed to add.
And of course it cannot support something like:
unless(x > 10) { doSomething() } else { doAnother() }
But this can keep things simple, and I think the else clause will make the unless statement hard to understand.

On Sep 5, 3:34 am, "Julien Ponge" <julien.po...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi everyone,
>
> I have filled a JIRA issue
> (http://jira.codehaus.org/browse/GROOVY-2892) a few weeks backs with
> the idea of adding support for unless / if expressions to Groovy,
> like:
>
> doSomething() unless (x > 10)
> (...)
> triggerSomethingNasty() if (x < 10)
>
> Jochen suggested discussing this with the Groovy users community.
>
> What do you think?
>
> --http://izpack.org/http://jpz-log.info/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email

Luke Daley | 6 Sep 11:48

[groovy-user] Support for 'unless'

The previous thread about unless was a bit complex as it combined the  
concept of 'unless' and having conditions after statements. I am bit  
worried that 'unless' by itself got a bit lost in that.

The consensus seemed to me to be that almost everyone who had used  
'unless', sees it's value.

To be clear,

unless (condition) {
	// stuff
} else unless (otherCondition) {
	// other stuff
}

which is equivalent to…

if (!condition) {
	// stuff
} else if (!otherCondition) {
	// other stuff
}

I didn't see the point of unless until it was available to me, now I  
am a big fan. It seemed very foreign to me when I started using perl  
and ruby and at that point I did question it's usefulness. Now though,  
it seems such an obvious win to aid readability.

Just wanted to get some people's opinions on this (and only this).

--

LD.

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

    http://xircles.codehaus.org/manage_email

kiml | 6 Sep 10:06

[groovy-user] =~ and Assert.assertTrue -> invokeStaticMissingMethod


Hello,

  I am beginner to groovy. I did some experiments with =~
I have problem with following code:

// runs well without problems
assert '12345' =~ /\d+/
boolean Fb_val = '12345' =~ /\d+/
Assert.assertTrue(Fb_val)

// throws MissingMethodException
Assert.assertTrue('12345' =~ /\d+/)

What is wrong ?

Greetings, Jiri
--

-- 
View this message in context: http://www.nabble.com/%3D%7E-and-Assert.assertTrue--%3E-invokeStaticMissingMethod-tp19344086p19344086.html
Sent from the groovy - user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email

Paul King | 6 Sep 08:11

[Fwd: Re: [groovy-user] Support for unless / if expressions]


Not sure if this came through ...

From: Paul King <paulk@...>
Subject: Re: [groovy-user] Support for unless / if expressions
Date: 2008-09-05 23:12:40 GMT

I propose that instead of "else unless" we introduce
the "useless" operator and instead of "otherwise unless"
the "unwise" operator! :-)

Paul.

TrnsltLife wrote:
> I'm OK with the idea of unless(condition){block}, but what would be the
> syntax comparable to if(...){...} else if(...){...}?  
> 
> unless(...){...} else unless(...){...} else if(...){...}
> 
> Maybe we should allow
> unless(...){...} otherwise unless(...){...} otherwise if(...){...}
> otherwise{...}
> 
> Because I really don't like the sound of "else unless". On the other hand,
> "else if" doesn't sound right until you're used to it, so maybe it doesn't
> matter.
> 
> Jeremy

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

    http://xircles.codehaus.org/manage_email

Gmane