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

Can not call static method of parent class from child class.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-RC-1
    • 1.5
    • groovy-jdk
    • None
    • OS: Mac OS X 10.4.8, Java: 1.5.0_06, Groovy: 1.0-RC-1

    Description

      I have two Java classes: Parent Class has a static method get() and ChildClass does not.
      When I call ChildClass.get() in Java Class, It success to execute method.
      When I call ChildClass.get() in groovy, It causes a Exception like bellow.

      I think GROOVY-1484 issue, which is fixed in RC-1, is a relative problem.

      Please see attached test case.

      Caused by: groovy.lang.MissingMethodException: No signature of method: static test.ChildClass.aStaticMethod() is applicable for argument types: () values: {}
      at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:672)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:111)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:211)
      at test.script1000001.search(script1000001.groovy:17)
      at gjdk.test.script1000001_GroovyReflector.invoke(Unknown Source)
      at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
      ... 29 more

      Attachments

        1. static-method-error.zip
          4 kB
          MAKINO Hisanaga

        Activity

          People

            paulk Paul King
            hisaboh MAKINO Hisanaga
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: