[
https://issues.apache.org/jira/browse/GROOVY-12310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-12310.
--------------------------------
Fix Version/s: 6.0.0
Assignee: Paul King
Resolution: Fixed
> Accessing enum constant of package-private enum under static compile fails at
> runtime
> -------------------------------------------------------------------------------------
>
> Key: GROOVY-12310
> URL: https://issues.apache.org/jira/browse/GROOVY-12310
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 6.0.0-alpha-1, 5.0.3, 4.0.31
> Reporter: Björn Kautler
> Assignee: Paul King
> Priority: Major
> Fix For: 6.0.0
>
>
> Given this snippet:
> {code:java}
> @Grab('jakarta.faces:jakarta.faces-api:4.0.1')
> import [email protected]
> class Foo {
> def foo() {
> println(UIInput.PropertyKeys)
> println(UIInput.PropertyKeys.localValueSet)
> }
> }
> new Foo().foo() {code}
> The {{PropertyKeys}} enum is package-private.
> The whole script successfully runs through STC and static-compilation.
> At runtime the first {{println}} is successful, while the second one fails
> with
> {code:java}
> java.lang.IllegalAccessError: failed to access class
> jakarta.faces.component.UIInput$PropertyKeys from class Foo {code}
> at runtime.
> The STC should probably already recognize this and complain.
> What I also wonder is, that the class-access worked at runtime while the
> constant access failed, shouldn't the class access fail already?
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)