You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/11 03:01:41 UTC
[jira] [Commented] (GROOVY-8144) Invoking a public method declared
in a non-public class result in a IllegalAccessError
[ https://issues.apache.org/jira/browse/GROOVY-8144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15963770#comment-15963770 ]
ASF GitHub Bot commented on GROOVY-8144:
----------------------------------------
GitHub user jwagenleitner opened a pull request:
https://github.com/apache/groovy/pull/522
GROOVY-8144: Invoking a public method declared in a non-public class …
…result in a IllegalAccessError
Commit 1a4c9918a4f12e64 introduced the DecompiledClassNode as part of
enabling the ASM class resolver.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jwagenleitner/groovy groovy8144
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/522.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #522
----
commit 3b6c2a504119e99d86de76019f48e0059b8fcf9e
Author: John Wagenleitner <jw...@apache.org>
Date: 2017-04-10T20:10:25Z
GROOVY-8144: Invoking a public method declared in a non-public class result in a IllegalAccessError
Commit 1a4c9918a4f12e64 introduced the DecompiledClassNode as part of
enabling the ASM class resolver.
----
> Invoking a public method declared in a non-public class result in a IllegalAccessError
> --------------------------------------------------------------------------------------
>
> Key: GROOVY-8144
> URL: https://issues.apache.org/jira/browse/GROOVY-8144
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.5.0-alpha-1
> Reporter: paolo di tommaso
>
> For example:
> {code}
> 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)
> {code}
> 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
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)