Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4823

groovy.lang.MissingMethodException if using class extending BigDecimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.10
    • 1.8.3, 1.9-beta-4, 1.7.11
    • None
    • None
    • Windows XP SP3, Groovy 1.7.10

    Description

      We have a class extending java.math.BigDecimal, also a method having a BigDecimal argument
      The method works fine if we call it with a BigDecimal object. If the method is called with an instance of the extending class, a MissingMethodException is thrown.

      groovy.lang.MissingMethodException: No signature of method: ConsoleScript16.f() is applicable for argument types: (ExtendedBigDecimal) values: [1]
      Possible solutions: f(java.math.BigDecimal), is(java.lang.Object), run(), run(), any(), any(groovy.lang.Closure)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
      at ConsoleScript16.run(ConsoleScript16:14)
      at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:266)
      at groovy.lang.GroovyShell.run(GroovyShell.java:517)
      at groovy.lang.GroovyShell.run(GroovyShell.java:172)
      at groovy.lang.GroovyShell$run.call(Unknown Source)
      at groovy.ui.Console$_runScriptImpl_closure16.doCall(Console.groovy:904)
      at sun.reflect.GeneratedMethodAccessor227.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
      at groovy.ui.Console$_runScriptImpl_closure16.doCall(Console.groovy)
      at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
      at groovy.lang.Closure.call(Closure.java:282)
      at groovy.lang.Closure.call(Closure.java:277)
      at groovy.lang.Closure.run(Closure.java:360)
      at java.lang.Thread.run(Thread.java:619)

      Attachments

        1. bug.groovy
          0.3 kB
          Uwe Kirsch

        Activity

          People

            blackdrag Jochen Theodorou
            uwekirsch Uwe Kirsch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: