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

Invoking a public method declared in a non-public class result in a IllegalAccessError

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0-alpha-1
    • Fix Version/s: 2.5.0-beta-1
    • Component/s: Static compilation
    • Labels:
      None

      Description

      For example:

      import groovyx.gpars.agent.Agent
      import groovy.transform.CompileStatic
      
      @CompileStatic
      class Dummy {
      
        def void foo() {
           def x = new Agent<List>( [] )
           x.send { List it -> it.add(1) }
           x.await()
        }
      
      }
      
      
      new Dummy().foo()
      
      
      java.lang.IllegalAccessError: tried to access class groovyx.gpars.agent.AgentBase from class Dummy
          at Dummy.foo(ConsoleScript15:10)
          at Dummy$foo.call(Unknown Source)
          at ConsoleScript15.run(ConsoleScript15:16)
      

      I guess the problem is that AgentBase class is not declared public
      https://github.com/GPars/GPars/blob/master/src/main/groovy/groovyx/gpars/agent/AgentBase.java#L34

      This is a regression, see also this thread https://groups.google.com/d/msg/groovy-user/0Ig9mhRLnKk/LWsx1EQbu_4J

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jwagenleitner John Wagenleitner
                Reporter:
                pablo72 paolo di tommaso
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: