[ https://issues.apache.org/jira/browse/GROOVY-9542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17108413#comment-17108413 ]
Daniel Sun commented on GROOVY-9542: ------------------------------------ {{AssertionError}} has two constructors to match the argument of {{String}} type: [[private AssertionError(java.lang.String)]] and [[public AssertionError(java.lang.Object)]] The calculated distance of the former constructor is 0, so it is chosen and warning is emitted... But it's dangerous to change the logic of choosing constructor, because constructors may have different logic even if they have compatible parameter types. However we have to change the logic... because the illegal acess will be forbidden in some futher Java release. > Illegal reflective access java.lang.AssertionError(java.lang.String) > -------------------------------------------------------------------- > > Key: GROOVY-9542 > URL: https://issues.apache.org/jira/browse/GROOVY-9542 > Project: Groovy > Issue Type: Bug > Reporter: Daniel Sun > Priority: Major > > ([https://github.com/apache/groovy/runs/647840451?check_suite_focus=true]) > > WARNING: Illegal reflective access by > org.codehaus.groovy.reflection.ReflectionUtils > ([file:/home/runner/work/groovy/groovy/target/libs/groovy-raw-4.0.0-SNAPSHOT.jar|file://home/runner/work/groovy/groovy/target/libs/groovy-raw-4.0.0-SNAPSHOT.jar]) > to constructor java.lang.AssertionError(java.lang.String) > [397|https://github.com/apache/groovy/runs/647840451#step:5:397]> Task > :groovy-test:test > [398|https://github.com/apache/groovy/runs/647840451#step:5:398]WARNING: > Please consider reporting this to the maintainers of > org.codehaus.groovy.reflection.ReflectionUtils > [399|https://github.com/apache/groovy/runs/647840451#step:5:399]WARNING: Use > --illegal-access=warn to enable warnings of further illegal reflective access > operations > [400|https://github.com/apache/groovy/runs/647840451#step:5:400]WARNING: All > illegal access operations will be denied in a future release -- This message was sent by Atlassian Jira (v8.3.4#803005)