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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3173?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.1543%. 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 
([`e4fcc24`](https://app.codecov.io/gh/apache/groovy/commit/e4fcc24c57ccf55e9602faa473975b5b0fa13ba3?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/3173/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/3173?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3173        +/-   ##
   ==================================================
   + Coverage     74.1533%   74.1543%   +0.0010%     
   + Complexity      43751      43749         -2     
   ==================================================
     Files            1692       1692                
     Lines          149516     149518         +2     
     Branches        28366      28367         +1     
   ==================================================
   + Hits           110871     110874         +3     
   + Misses          28448      28443         -5     
   - Partials        10197      10201         +4     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3173?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/3173?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/3173?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 [18 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3173/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 ignores constructors and instance initializer blocks: 
> escaping closures are packed
> --------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12652
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12652
>             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 closure literal in a constructor or an instance 
> initializer block bypasses the escape gate, the serialization gate and the 
> per-method packing mode:
> {code:groovy}
> class P { P(List<Closure> s) { s << { x -> x } } }
> class Q { Closure f; { f = { x -> x } } }
> def s = []; new P(s)
> [s[0].getClass().name, new Q().f.getClass().name]
> {code}
> *Actual* (dynamic, @TypeChecked and @CompileStatic): 
> {{[org.codehaus.groovy.runtime.PackedClosure$Fixed1, 
> org.codehaus.groovy.runtime.PackedClosure$Fixed1]}}. Under 
> {{@PackedClosures}}, setting a delegate on the escaped closure then throws 
> UnsupportedOperationException. {{@PackedClosures}} cannot be placed on a 
> constructor ("not allowed on element CONSTRUCTOR").
> *Expected:* {{[P$_closure1, Q$_closure1]}}, the same result as for a method: 
> escaping closures keep their class.
> Cause: {{WriterController.getMethodNode()}} is null while a constructor is 
> written, so the escape walk, the serialization walk and the annotation lookup 
> in ClosureWriter see no enclosing method. Instance initializer blocks are 
> inlined into constructors by the Verifier, so they are affected too.



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

Reply via email to