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

NoSuchMethodError because static method is tried to be invoked on super class bug method signature does not match

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.0-RC-1
    • class generator
    • None
    • invoking Java code from Groovy on both Linux and MS Windows

    Description

      We have two Java classes: ChildClass and its super class ParentClass. Both have a static method get(). The get() method of ParentClass returns of course a parent class and the one of ChildClass a ChildClass. As static methods are not inherited this is ok with the java specification.

      Trying to invoke ChildClass.get() in groovy, however, throws a NoSuchMethodError: games.stendhal.test.groovy.ParentClass.get()Lgames/stendhal/test/groovy/ChildClass;
      For some strange reason groovy tries to invoke ParentClass.get() instead of ChildClass.get() but with the method signature of ChildClass.

      Exspected result invoking of ChildClass.get()

      Please see attached simplyfied test case.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            blackdrag Jochen Theodorou
            nhb_web@nexgo.de Hendrik Brummermann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment