[groovy-user] Confusing Exception

15 views
Skip to first unread message

Andrew Kennedy

unread,
Jan 30, 2012, 11:07:13 AM1/30/12
to us...@groovy.codehaus.org, Development
Hi.

Can anyone explain the following Groovy exception. It seems to suggest
that the code is trying to call a method called 'isCase' on a Map, and
is failing because it is static, but this method is never called by my
code. The exception starts like this:

2012-01-30 15:53:54,387 ERROR <Error in listener
monterey.brooklyn.KarafVenue$_postStart_closure3_closure12@636d9fe1
handling notification
javax.management.Notification[source=monterey:type=Venue,id=gRmBIzi2][type=monterey.event.metrics.actors][message=metricsActorsReport]>
groovy.lang.MissingMethodException: No signature of method: static
java.util.Map.isCase() is applicable for argument types:
(java.util.LinkedHashMap) values: [[monterey:[actor:[status:RUNNING,
plannedTerminating:false, ...]]]]
Possible solutions: isCase(java.lang.Object), isCase(java.lang.Object),
asType(java.lang.Class), is(java.lang.Object), asType(java.lang.Class),
take(int)
at
groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1350)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1336)
at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:767)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.isCase(ScriptBytecodeAdapter.java:667)
at
brooklyn.event.basic.AttributeMap$_update_closure1.doCall(AttributeMap.groovy:41)

Line 41 of AttributeMap is the seond line in the following snippet:

path.each {
if (!(val in Map)) {
if (val!=null)

So, I can't understand how Groovy manages to call this 'isCase' method,
unless it is somehow triggered by the 'in' operator?

Any help appreciated.

Thanks,
Andrew.
--
-- andrew kennedy ? engineer : http://cloudsoftcorp.com/developers/ ;

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

http://xircles.codehaus.org/manage_email


Jochen Theodorou

unread,
Jan 30, 2012, 2:03:02 PM1/30/12
to us...@groovy.codehaus.org
Am 30.01.2012 17:07, schrieb Andrew Kennedy:
[...]

> So, I can't understand how Groovy manages to call this 'isCase' method,
> unless it is somehow triggered by the 'in' operator?

The in operator is compiled to a call with isCase. In your case it is
compiled to Map.isCase(val), which explains why it complains about a
static method not being there

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

Reply all
Reply to author
Forward
0 new messages