atom feed12 messages in org.codehaus.groovy.dev[groovy-dev] I am thinking there is a...
FromSent OnAttachments
Russel WinderSep 6, 2011 9:17 am 
Roshan DawraniSep 6, 2011 9:57 am 
Russel WinderSep 6, 2011 10:08 am 
Guillaume LaforgeSep 6, 2011 10:14 am 
Russel WinderSep 6, 2011 10:42 am.groovy, .groovy, .groovy
Roshan DawraniSep 6, 2011 11:19 am 
Jochen TheodorouSep 7, 2011 2:16 am 
Russel WinderSep 7, 2011 2:44 am 
Jochen TheodorouSep 7, 2011 2:49 am 
Russel WinderSep 7, 2011 2:52 am 
Roshan DawraniSep 7, 2011 8:55 am 
Russel WinderSep 7, 2011 12:34 pm 
Subject:[groovy-dev] I am thinking there is a bug here, but . . .
From:Russel Winder (rus@russel.org.uk)
Date:Sep 6, 2011 9:17:25 am
List:org.codehaus.groovy.dev

I have three variants on the same progam/algorithm.

final Future<Double>[] futures = new Future<Double> [ numberOfTasks ] for ( int i in 0i ..< numberOfTasks ) { final taskId = i futures[i] = executor.submit ( new Callable<Double> ( ) { @Override public Double call ( ) { . . . } } ) }

works fine.

final List<Future<Double>> futures = ( 0 ..< numberOfTasks ).collect { taskId
-> executor.submit ( { . . . } as Callable ) }

works fine.

final List<Future<Double>> futures = ( 0 ..< numberOfTasks ).collect { taskId -> executor.submit ( new Callable<Double> ( ) { @Override public Double call ( ) { . . . } } ) }

Gives me the error:

Caught: groovy.lang.GroovyRuntimeException: Could not find matching constructor
for: pi_groovy_futures_listNew$1(pi_groovy_futures_listNew,
groovy.lang.Reference, java.lang.Double, java.math.BigDecimal) groovy.lang.GroovyRuntimeException: Could not find matching constructor for:
pi_groovy_futures_listNew$1(pi_groovy_futures_listNew, groovy.lang.Reference,
java.lang.Double, java.math.BigDecimal) at
pi_groovy_futures_listNew$_execute_closure1.doCall(pi_groovy_futures_listNew.groovy:25) at pi_groovy_futures_listNew.execute(pi_groovy_futures_listNew.groovy:24) at pi_groovy_futures_listNew.run(pi_groovy_futures_listNew.groovy:49)

So the question is: Why? with a subsidiary: Is it a bug?

There is also the question of course "How the $$$$ to interpret the error message so as to obtain useful information?" :-((