Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2503 MOP 2.0 design inflluencing issues
  3. GROOVY-3073

Private inheritance bug: Closure accessing private method

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.6
    • None
    • class generator
    • None
    • Windows XP SP 2
      Eclipse 3.3 & groovy-all-1.5.6.jar

    Description

      Even the inheritance is correct - the following sample returns a:

      Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: test.Child.parentMethodB() is applicable for argument types: () values: {}

      Parent.java
      package test
      public class Parent{
      	private String parentMethodB(){
      		return "parentMethodB";
      	}
      	protected String parentMethodC(){
      		def closure={
      				return parentMethodB()}
      		return closure()
      	}
      }
      
      Child.java
      package test
      public class Child extends Parent{
      	public static void main(def args){
      		Child c = new Child();
      		println(c.parentMethodC())
      	}	
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rbecke Raoul Becke
              Votes:
              8 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated: