Groovy
  1. Groovy
  2. GROOVY-3353

Category methods are not inherited

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6-rc-2, 1.6-rc-3
    • Fix Version/s: 1.6.1, 1.7-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      JDK 1.6, Windows

      Description

      see the example:

      public class Foo {
        static Object foo(Object obj) {
          println "Foo.foo()"
          return obj;
        }
      }
      
      public class Bar extends Foo{
        static Object bar(Object obj) {
          println "Bar.bar()"
          return obj;
        }
      }
      
      def obj = new Object()
      
      use(Foo){
        obj.foo()
      }
      
      use(Bar){
        obj.bar()
        obj.foo() // Caught: groovy.lang.MissingMethodException: 
      }
      

      Exception

      Caught: groovy.lang.MissingMethodException: No signature of method: java.lang.Object.foo() is applicable for argument types: () values: []
      	at test$_run_closure2.doCall(test.groovy:10)
      	at test$_run_closure2.doCall(test.groovy)
      	at test.run(test.groovy:8)
      

        Activity

        Mingfai Ma created issue -
        Jochen Theodorou made changes -
        Field Original Value New Value
        Assignee Jochen Theodorou [ blackdrag ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.6.1 [ 14852 ]
        Fix Version/s 1.6 [ 14981 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Jochen Theodorou made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12732348 ] Default workflow, editable Closed status [ 12744159 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12970170 ] Default workflow, editable Closed status [ 12977950 ]

          People

          • Assignee:
            Jochen Theodorou
            Reporter:
            Mingfai Ma
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development