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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3174?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.1623%. 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 
([`765c503`](https://app.codecov.io/gh/apache/groovy/commit/765c503ce7e6be6aa0da332e771e1f804015cf3e?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.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3174/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/3174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3174        +/-   ##
   ==================================================
   + Coverage     74.1533%   74.1623%   +0.0090%     
   - Complexity      43751      43757         +6     
   ==================================================
     Files            1692       1692                
     Lines          149516     149518         +2     
     Branches        28366      28367         +1     
   ==================================================
   + Hits           110871     110886        +15     
   + Misses          28448      28438        -10     
   + Partials        10197      10194         -3     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3174?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[src/main/java/groovy/transform/PackedClosures.java](https://app.codecov.io/gh/apache/groovy/pull/3174?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Ftransform%2FPackedClosures.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvdHJhbnNmb3JtL1BhY2tlZENsb3N1cmVzLmphdmE=)
 | `100.0000% <ø> (ø)` | |
   | 
[...rg/codehaus/groovy/classgen/asm/ClosureWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3174?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.3356% <100.0000%> (+0.1606%)` | :arrow_up: |
   
   ... and [15 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3174/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 copies a local written after the literal by value in a 
> constructor or instance initializer block
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12653
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12653
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 7.0.0-alpha-1, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> With closure packing enabled ({{-Dgroovy.target.closure.pack=true}} or 
> {{@PackedClosures}}), a local captured by a closure literal in a constructor 
> or an instance initializer block, and written after the literal, is copied 
> into the packed closure by value instead of shared:
> {code:groovy}
> class R { def r; R() { def c; c = { x -> c == null ? 'stale' : 'set' }; r = 
> c(1) }
>           def m() { def c; c = { x -> c == null ? 'stale' : 'set' }; c(1) } }
> class I { def r; { def c; c = { x -> c == null ? 'stale' : 'set' }; r = c(1) 
> } }
> [new R().r, new R().m(), new I().r]
> {code}
> *Actual* (dynamic and @CompileStatic, packing on): {{[stale, set, stale]}}.
> *Expected:* {{[set, set, set]}}, as without packing and as in a method.
> Cause: the lookup of names written after the literal 
> ({{ClosureWriter.holderCaptureNames}}) uses 
> {{WriterController.getMethodNode()}}, which is null while a constructor is 
> written, so no capture is threaded as a shared Reference.



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

Reply via email to