[ 
https://issues.apache.org/jira/browse/GROOVY-12568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18141747#comment-18141747
 ] 

ASF GitHub Bot commented on GROOVY-12568:
-----------------------------------------

codecov-commenter commented on PR #3288:
URL: https://github.com/apache/groovy/pull/3288#issuecomment-6759974453

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3288?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 74.4369%. Comparing base 
([`2896afd`](https://app.codecov.io/gh/apache/groovy/commit/2896afde807d7b0328431fbb46b0fb04288dcebc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`12d895e`](https://app.codecov.io/gh/apache/groovy/commit/12d895e7caadc18cc5eb9039b1824e07e27cb999?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 13 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3288/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/3288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3288        +/-   ##
   ==================================================
   + Coverage     74.4180%   74.4369%   +0.0189%     
   - Complexity      44722      44773        +51     
   ==================================================
     Files            1701       1702         +1     
     Lines          151845     151891        +46     
     Branches        29080      29091        +11     
   ==================================================
   + Hits           113000     113063        +63     
   + Misses          28434      28420        -14     
   + Partials        10411      10408         -3     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3288?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...codehaus/groovy/control/CompilerConfiguration.java](https://app.codecov.io/gh/apache/groovy/pull/3288?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fcontrol%2FCompilerConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NvbnRyb2wvQ29tcGlsZXJDb25maWd1cmF0aW9uLmphdmE=)
 | `75.4875% <100.0000%> (ø)` | |
   
   ... and [24 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3288/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> SC: protected and package-private members of a class defined by another 
> GroovyClassLoader compilation fail with IllegalAccessError
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12568
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12568
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 7.0.0-alpha-1
>
>
> The JVM allows access to a protected or package-private member only within 
> the same run-time package, which is the package name and the class loader. A 
> {{GroovyClassLoader}} defines each compilation in memory with a class loader 
> of its own: a {{GroovyShell}} script, {{parseClass}}, a script run with 
> {{groovy}}, JSR-223. So a class of an earlier parse, or a precompiled class 
> used by such a script, is in another run-time package even with the same 
> package name. Statically compiled code calls such members directly and fails; 
> dynamic code goes through the meta-class and works.
> {code:groovy}
> def shell = new GroovyShell()
> shell.evaluate '''package p
>     class A {
>         @groovy.transform.PackageScope A(String s) { }
>         @groovy.transform.PackageScope String name() { 'a' }
>         @groovy.transform.PackageScope String tag = 't'
>     }
>     true
> '''
> shell.evaluate '''package p
>     @groovy.transform.CompileStatic
>     List make() { def a = new A('x'); [a.name(), a.tag] }
>     make()
> ''' // IllegalAccessError; without @CompileStatic: ['a', 't']
> {code}
> The same happens for map-style construction, instance and static methods, 
> getters and setters used as properties, method references such as 
> {{a::name}}, and field reads and writes including {{.@}}, {{+=}} and {{++}}.
> Expected: with the option {{CompilerConfiguration.RUNTIME_PACKAGE_CHECK}}, 
> which {{GroovyShell}} turns on for the class loader it creates, such an 
> access is reported when the class is generated. With it off, the bytecode and 
> the {{IllegalAccessError}} stay as they are. Code compiled to class files is 
> not affected. Statically compiled code does not go through the meta-class for 
> these members: compile time and run time may see different classes, and the 
> meta-class can influence the call.
> Split out: GROOVY-12717 (protected members of another package), GROOVY-12718 
> (dynamic {{super.f}}, {{super.@f}} and {{this.@f}} of such a field), 
> GROOVY-12719 (the invokedynamic {{GroovyBugError}} for a constructor the JVM 
> refuses). {{super.m()}} of such a method is GROOVY-12570.
> PR: https://github.com/apache/groovy/pull/3097



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to