Groovy
  1. Groovy
  2. GROOVY-2565

Exception with inheritance and private method calls from a closure

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The test 'testClosureCallWithPrivateMethod' fails with Groovy 1.5.1 and 1.5.2 (I don't know about the other versions). It should not fail.

      class Parent {
          void publicMethod1() {
              privateMethod()
          }
      
          void publicMethod2() {
              [''].each { privateMethod()}
          }
      
          void publicMethod3() {
              [''].each { protectedMethod()} 
          }
      
          private void privateMethod() {}
      
          protected void protectedMethod() {}
      }
      
      class Child extends Parent {}
      
      class ClosureMethodCallTest extends GroovyTestCase {
          void testDirectCall() {
              // No exceptions means the test passes
              new Child().publicMethod1()
          }
          
          void testClosureCallWithPrivateMethod() {
              // No exceptions means the test passes
              new Child().publicMethod2()
          }
      
          void testClosureCallWithProtectedMethod() {
              // No exceptions means the test passes
              new Child().publicMethod3()
          }
      }
      

        Issue Links

          Activity

          Hans Dockter created issue -
          Guillaume Delcroix made changes -
          Field Original Value New Value
          Fix Version/s 1.5.4 [ 14026 ]
          Fix Version/s 1.5.3 [ 14013 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.5.5 [ 14028 ]
          Fix Version/s 1.5.4 [ 14026 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6-beta-1 [ 14008 ]
          Fix Version/s 1.5.6 [ 14189 ]
          Fix Version/s 1.5.5 [ 14028 ]
          Jochen Theodorou made changes -
          Fix Version/s 1.5.7 [ 14242 ]
          Fix Version/s 1.5.6 [ 14189 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6-beta-1 [ 14008 ]
          Fix Version/s 1.5.7 [ 14242 ]
          Fix Version/s 1.6-beta-2 [ 14261 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6-beta-2 [ 14261 ]
          Fix Version/s 1.6-rc-1 [ 14009 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6-rc-1 [ 14009 ]
          Fix Version/s 1.5.8 [ 14630 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.5.8 [ 14630 ]
          Fix Version/s 1.6.2 [ 15151 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.6.2 [ 15151 ]
          Fix Version/s 1.6.3 [ 15251 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.7-beta-1 [ 14014 ]
          Fix Version/s 1.6.3 [ 15251 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.7-beta-1 [ 14014 ]
          Fix Version/s 1.7-beta-x [ 15538 ]
          Jochen Theodorou made changes -
          Link This issue duplicates GROOVY-3073 [ GROOVY-3073 ]
          Jochen Theodorou made changes -
          Assignee Jochen Theodorou [ blackdrag ]
          Resolution Duplicate [ 3 ]
          Fix Version/s 1.7.x [ 15538 ]
          Status Open [ 1 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12731604 ] Default workflow, editable Closed status [ 12743353 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12969560 ] Default workflow, editable Closed status [ 12977268 ]

            People

            • Assignee:
              Jochen Theodorou
              Reporter:
              Hans Dockter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development