[
https://issues.apache.org/jira/browse/GROOVY-12719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun reassigned GROOVY-12719:
-----------------------------------
Fix Version/s: 7.0.0-alpha-1
6.0.1
Assignee: Daniel Sun
> A dynamic new of a constructor the JVM refuses fails with GroovyBugError
> under invokedynamic
> --------------------------------------------------------------------------------------------
>
> Key: GROOVY-12719
> URL: https://issues.apache.org/jira/browse/GROOVY-12719
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 7.0.0-alpha-1, 6.0.1
>
>
> {code:groovy}
> class C extends ObjectInputStream {
> static ObjectInputStream make() {
> new ObjectInputStream()
> }
> }
> C.make()
> {code}
> *Actual:* {{org.codehaus.groovy.GroovyBugError: BUG! UNCAUGHT EXCEPTION:
> member is protected: java.io.ObjectInputStream.<init>}}
> *Expected:* {{GroovyRuntimeException: could not access constructor: protected
> java.io.ObjectInputStream()}}, as without invokedynamic.
> Cause: the constructor selector in {{Selector}} unreflects the selected
> constructor with the lookup of the calling class and turns an
> {{IllegalAccessException}} into {{GroovyBugError}}. The property selectors
> treat that as an access-control outcome since GROOVY-12314.
> Verified on 5.0.8, 6.0.0 and master, on JDK 21.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)