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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3191?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `75.00000%` with `1 line` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.1540%. Comparing base 
([`0941dba`](https://app.codecov.io/gh/apache/groovy/commit/0941dbacf496a1667c27681c6fe76deee59bfb57?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`ca56aa8`](https://app.codecov.io/gh/apache/groovy/commit/ca56aa83529dd6fd42b614a5b3e9823275661fea?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 11 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3191?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...rg/codehaus/groovy/classgen/asm/ClosureWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3191?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FClosureWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9DbG9zdXJlV3JpdGVyLmphdmE=)
 | 75.0000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3191/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/3191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3191        +/-   ##
   ==================================================
   + Coverage     74.1533%   74.1540%   +0.0007%     
   - Complexity      43751      43755         +4     
   ==================================================
     Files            1692       1692                
     Lines          149516     149520         +4     
     Branches        28366      28368         +2     
   ==================================================
   + Hits           110871     110875         +4     
   + Misses          28448      28447         -1     
   - Partials        10197      10198         +1     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3191?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...rg/codehaus/groovy/classgen/asm/ClosureWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3191?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FClosureWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9DbG9zdXJlV3JpdGVyLmphdmE=)
 | `90.2276% <75.0000%> (+0.0526%)` | :arrow_up: |
   
   ... and [10 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3191/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>




> Closure packing (groovy.target.closure.pack) packs a dynamic closure that 
> names this, so a rehydrated copy still answers for the original owner
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12670
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12670
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 7.0.0-alpha-1, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> With {{-Dgroovy.target.closure.pack=true}}, dynamic code (no annotation) 
> packs a closure literal whose body has no free name. The check accepts an 
> explicit this, a method call on this, this.@field, this.&method, Outer.this 
> and Outer.super.
> {code:groovy}
> class D { String foo() { 'D.foo' }; String toString() { 'D' } }
> class O {
>     String name
>     String foo() { 'foo ' + name }
>     String toString() { 'O:' + name }
>     List run(O b, D d) {
>         Closure c = { -> this }
>         Closure e = { -> this.foo() }
>         [c.rehydrate(null, b, b)(), c.rehydrate(null, d, d)(), 
> e.rehydrate(null, b, b)(), e.rehydrate(null, d, d)()]
>     }
> }
> println new O(name: 'a').run(new O(name: 'b'), new D())
> {code}
> *Actual* (with the flag): {{[O:a, O:a, foo a, foo a]}}
> *Expected* (as without the flag): {{[O:b, D, foo b, D.foo]}}
> A closure class reads an explicit this from getThisObject(), which rehydrate 
> replaces. The packed closure's body is hoisted into a method of the owner 
> class and keeps the instance it was created on. The syntactic no-free-name 
> check ({{ClosureWriter.isSyntacticallyDelegateIndependent}}) should treat a 
> body that names this as not packable.
> Verified on 6.0.0 and master.



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

Reply via email to