class LockableList { @Delegate private List list = [] } assert new LockableList() instanceof Listcauses:
java.lang.NullPointerException at com.sun.beans.TypeResolver.resolve(TypeResolver.java:321) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:303) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:351) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:172) at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:93) at Script1.run(Script1.groovy:6)If I comment out an
assert
then I get:
java.lang.NullPointerException at com.sun.beans.TypeResolver.resolve(TypeResolver.java:321) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:303) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:351) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:172) at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:93) at LockableList.$getStaticMetaClass(Script1.groovy) at LockableList.(Script1.groovy:3)Can it be Groovy 1.8 beta issue? It works fine in GroovyConsole
v1.7.5
.
---------------------------------------------------
Sent from BlackBerry
I've updated the Groovy Web Console with Groovy 1.8-beta-3-SNAPSHOT.
The @Delegate issue disapeared :-)
Guillaume
On Wed, Oct 13, 2010 at 04:38, <roshan...@gmail.com> wrote:
--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
http://groovyconsole.appspot.com/edit/275001
And if you want to use 1.7.5, where it's failing:
http://175.latest.groovyconsole.appspot.com/edit/275001
You'll notice that we now have a version of the console with Groovy
1.8-beta-3 snapshot, and one with Groovy 1.7.5 :-)
Guillaume
Script1.groovy: 83: unexpected token: else @ line 83, column 67. 1).type == type2 ) token += 2 else falseTim
Thanks.
> It's only a minor thing, but could be indicative of a change that wasn't
> meant to occur?
I think so too :-)
Number.metaClass.m = { amount -> ( delegate.multiply( amount )) }
Number.metaClass.d = { amount -> ( delegate.div( amount )) }
assert 15 == 3.m( 5 )
assert 5.3333333333 == 16.d( 3 )
The exception is
groovy.lang.MissingMethodException: No signature of method:
java.lang.Integer.times() is applicable for argument types:
(java.lang.Integer) values: [3]
Possible solutions: times(groovy.lang.Closure), power(java.lang.Integer),
is(java.lang.Object), minus(java.lang.Number), minus(java.lang.Character),
abs()
at Script1$_run_closure1.doCall(Script1.groovy:1)
at Script1$_run_closure1.doCall(Script1.groovy:1)
at Script1.run(Script1.groovy:5)
-----
Best regards,
Evgeny
http://evgeny-goldin.com/
--
View this message in context: http://groovy.329449.n5.nabble.com/NPE-for-correct-code-in-Groovy-web-console-1-8-issue-tp3209754p3214925.html
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------