Russel Winder | 1 Apr 07:27 2012
Picon

[groovy-dev] I suspect I may have found an issue...

I am trying to test some implementation of factorial.  I want to
calculate f(20000) and check the result.  I put what I think is the
right answer (calculated using bc) as a G literal in the code and:

Caught: java.lang.ClassFormatError: Unknown constant tag 54 in class file timingCheck
java.lang.ClassFormatError: Unknown constant tag 54 in class file timingCheck

Is this worth a JIRA?

--

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at> ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Russel Winder | 1 Apr 08:30 2012
Picon

[groovy-dev] Bug or feature?

I can't decide if this is a bug or a feature, hence the dev list rather
than the user list.  Given a tail recursive using a trampoline closure
iterate:

   final factorial = { i -> iterate ( i , 1G ) }
   factorial ( n )

works fine, but

    { i -> iterate ( i , 1G ) } ( n )

fails with a message along the lines of:

Caught: groovy.lang.MissingMethodException: No signature of method:
Factorial$_tailRecursive_closure2.call() is applicable for argument types: (java.lang.Integer,
Factorial$_tailRecursive_closure3) values: [100, Factorial$_tailRecursive_closure3 <at> d11151a]
Possible solutions: any(), any(), dump(), grep(), find(), collect()

which rather  caught me by surprise.  What is it about assigning and
using an explicit reference to the object rather than just an implicit
one? 

--

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at> ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Guillaume Laforge | 1 Apr 21:44 2012

Re: [groovy-dev] I suspect I may have found an issue...

On Sun, Apr 1, 2012 at 07:27, Russel Winder <russel-URxFuvIByzQdnm+yROfE0A@public.gmane.org.uk> wrote:
I am trying to test some implementation of factorial.  I want to
calculate f(20000) and check the result.  I put what I think is the
right answer (calculated using bc) as a G literal in the code and:

Caught: java.lang.ClassFormatError: Unknown constant tag 54 in class file timingCheck
java.lang.ClassFormatError: Unknown constant tag 54 in class file timingCheck

Is this worth a JIRA?

Without even showing us the actual script?
Not a full stack trace?

Good discussions on potential issues start with enough details!
 
--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
Jochen Theodorou | 2 Apr 11:23 2012
Picon

Re: [groovy-dev] I suspect I may have found an issue...

Am 01.04.2012 07:27, schrieb Russel Winder:
> I am trying to test some implementation of factorial.  I want to
> calculate f(20000) and check the result.  I put what I think is the
> right answer (calculated using bc) as a G literal in the code and:
>
> Caught: java.lang.ClassFormatError: Unknown constant tag 54 in class file timingCheck
> java.lang.ClassFormatError: Unknown constant tag 54 in class file timingCheck

We need the script and how your run/compile it and the branch. Because a 
bit googling found nothing on this constant number. I was thinking it 
might be related to indy, but afaik 54 is not a constant the JVM uses 
for indy constant tags. A G literal constant entry is normally made as 
String. As such maybe GROOVY-2382 is relataed. Maybe the check in there 
is not working well enough for your case. Actually I am not sure we 
check the number literal on that limit. Obvious test would be to make 
the number from a String, and get a compilation error, because th string 
is too big.

> Is this worth a JIRA?

yes, please

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

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

    http://xircles.codehaus.org/manage_email

Jochen Theodorou | 2 Apr 11:37 2012
Picon

Re: [groovy-dev] Bug or feature?

Am 01.04.2012 08:30, schrieb Russel Winder:
> I can't decide if this is a bug or a feature, hence the dev list rather
> than the user list.  Given a tail recursive using a trampoline closure
> iterate:
>
>     final factorial = { i ->  iterate ( i , 1G ) }
>     factorial ( n )
>
> works fine, but
>
>      { i ->  iterate ( i , 1G ) } ( n )
>
> fails with a message along the lines of:
>
> Caught: groovy.lang.MissingMethodException: No signature of method:
Factorial$_tailRecursive_closure2.call() is applicable for argument types: (java.lang.Integer,
Factorial$_tailRecursive_closure3) values: [100, Factorial$_tailRecursive_closure3 <at> d11151a]
> Possible solutions: any(), any(), dump(), grep(), find(), collect()
>
> which rather  caught me by surprise.  What is it about assigning and
> using an explicit reference to the object rather than just an implicit
> one?

I think this is a newline problem. I guess the script above is 
incomplete and I also guess what happens is that the parser thinks the 
block actually belongs to the line before. An example of this is:

def i=1
{}

Here the parser will assume, that the block belongs to the def and makes 
this out of it: "def i=1 {}", which becomes "def i=1.call({})" and of 
course then fails with a MissingMethodException similiar to above, about 
not being able to do a call()

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

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

    http://xircles.codehaus.org/manage_email

David Durham | 4 Apr 21:27 2012
Picon

Re: [groovy-dev] SqlBuilder

I started a project for something similar, but mine is focused on data warehouse reporting.


David Durham | 4 Apr 23:22 2012
Picon

Re: [groovy-dev] SqlBuilder

On Thu, Mar 15, 2012 at 7:10 PM, Russel Winder <russel-URxFuvIByzTe9xe1eoZjHA@public.gmane.org> wrote:

On Thu, 2012-03-15 at 23:47 +0000, Russel Winder wrote:
[...]
> So yes I can prepare the pull request once there is a go ahead. But it
> will have to be next week.
[...]

I think the crucial factor here will, in fact, not be the code per se,
but putting together an acceptable test suite.

I haven't checked the codebase recently I'm afraid but I am assuming
mocks are allowed in unit tests and there are no integration tests
(which would require a test database of some sort -- almost certainly
SQLite3).


The project I linked to has unit tests that generally make assertions about the SQL being generated, but there are some tests that actually execute against an in-memory hsql db that we created, and populated with test data on the fly.

-Dave
David Durham | 4 Apr 23:23 2012
Picon

Re: [groovy-dev] SqlBuilder

The project I linked to has unit tests that generally make assertions about the SQL being generated, but there are some tests that actually execute against an in-memory hsql db that we created, and populated with test data on the fly.

Umm.. when I say "we" I mean "me".  I'm the author and copyright holder of this work.

Russel Winder | 7 Apr 14:07 2012
Picon

[groovy-dev] I think this is a bug...

... if it is (and I haven't missed something obvious) I'll file a JIRA.

        number = 27

        println Integer.toHexString ( number )

        println number.toHexString()

results in:

1b
Caught: groovy.lang.MissingMethodException: No signature of method:
java.lang.Integer.toHexString() is applicable for argument types: ()
values: []
Possible solutions: toHexString(int), toString(), toString(),
toString(), toString(int), toString(int, int)
groovy.lang.MissingMethodException: No signature of method:
java.lang.Integer.toHexString() is applicable for argument types: ()
values: []
Possible solutions: toHexString(int), toString(), toString(),
toString(), toString(int), toString(int, int)
	at toHexString_Problem.run(toHexString_Problem.groovy:7)

To put not too fine a point on it, this sucks. I should be able to call
this method as an instance method to avoid having to know the value is
Integer/Long/BigInteger...

--

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at> ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Russel Winder | 7 Apr 15:11 2012
Picon

[groovy-dev] Using NIO

Currently Groovy IO is founded on traditional Java IO. Is anyone working
on a parallel system for NIO?

Interesting thing of the moment is Groovy eachDirRecurse /
eachFileRecurse vs NIO's walkFileTree.

--

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at> ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Gmane