[
https://issues.apache.org/jira/browse/GROOVY-12719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140069#comment-18140069
]
ASF GitHub Bot commented on GROOVY-12719:
-----------------------------------------
testlens-app[bot] commented on PR #3253:
URL: https://github.com/apache/groovy/pull/3253#issuecomment-6701152263
## ✅ All tests passed ✅
🏷️ Commit: 8e115f876a5b36d936bc85f29443396decda163f
▶️ Tests: 126160 executed
⚪️ Checks: 27/27 completed
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> 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
> Priority: Major
>
> {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)