groovy
  1. groovy
  2. GROOVY-3353

Category methods are not inherited

    Details

    • Type: Bug Bug
    • Status: Closed 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
    • Number of attachments :
      0

      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

        Hide
        Mingfai Ma added a comment -

        there was no problem in Groovy 1.5.x

        Show
        Mingfai Ma added a comment - there was no problem in Groovy 1.5.x
        Hide
        Jim White added a comment -

        This strikes me as a blocker for 1.6.0 because it is a major regression and surely is not the intended behavior (because as Jochen says, he intends to fix it for the next point release).

        While I realize we're all anxious to get a "real" release out there, an interesting phenomenon is that making the RC releases appears to be what it takes to prompt downstream users/developers/testers to try out the new versions of Groovy.

        So perhaps an RC every week or two until there are no major issues is the way to get to a good final release.

        Show
        Jim White added a comment - This strikes me as a blocker for 1.6.0 because it is a major regression and surely is not the intended behavior (because as Jochen says, he intends to fix it for the next point release). While I realize we're all anxious to get a "real" release out there, an interesting phenomenon is that making the RC releases appears to be what it takes to prompt downstream users/developers/testers to try out the new versions of Groovy. So perhaps an RC every week or two until there are no major issues is the way to get to a good final release.
        Hide
        blackdrag blackdrag added a comment -

        the issue is now fixed in 1.7.x, 1.6.x and I added a testcase for 1.5.x... I did not yet add the change to 1.6.0

        Show
        blackdrag blackdrag added a comment - the issue is now fixed in 1.7.x, 1.6.x and I added a testcase for 1.5.x... I did not yet add the change to 1.6.0

          People

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

            Dates

            • Created:
              Updated:
              Resolved: