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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3186?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.1533%. 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 
([`f47448d`](https://app.codecov.io/gh/apache/groovy/commit/f47448daf1669657c0ca72fd4ade678c6116dd46?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/3186/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/3186?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@              Coverage Diff              @@
   ##               master      #3186   +/-   ##
   =============================================
     Coverage     74.1533%   74.1533%           
   - Complexity      43751      43756    +5     
   =============================================
     Files            1692       1692           
     Lines          149516     149524    +8     
     Branches        28366      28366           
   =============================================
   + Hits           110871     110877    +6     
     Misses          28448      28448           
   - Partials        10197      10199    +2     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3186?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/lang/Closure.java](https://app.codecov.io/gh/apache/groovy/pull/3186?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9DbG9zdXJlLmphdmE=)
 | `85.2495% <100.0000%> (+0.2821%)` | :arrow_up: |
   | 
[src/main/java/groovy/lang/TrampolineClosure.java](https://app.codecov.io/gh/apache/groovy/pull/3186?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FTrampolineClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9UcmFtcG9saW5lQ2xvc3VyZS5qYXZh)
 | `84.2105% <100.0000%> (+1.8576%)` | :arrow_up: |
   | 
[...a/org/codehaus/groovy/runtime/ComposedClosure.java](https://app.codecov.io/gh/apache/groovy/pull/3186?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FComposedClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvQ29tcG9zZWRDbG9zdXJlLmphdmE=)
 | `91.6667% <100.0000%> (+14.3939%)` | :arrow_up: |
   | 
[...va/org/codehaus/groovy/runtime/CurriedClosure.java](https://app.codecov.io/gh/apache/groovy/pull/3186?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FCurriedClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvQ3VycmllZENsb3N1cmUuamF2YQ==)
 | `91.3978% <100.0000%> (+0.1891%)` | :arrow_up: |
   
   ... and [15 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3186/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>




> rehydrate() on a curried, writable, composed or trampolined closure throws 
> ClassCastException or ignores the new owner and delegate
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12665
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12665
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.33, 5.0.8, 7.0.0-alpha-1, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> class O { def foo() { 'o' } }
> class D { def foo() { 'd' } }
> def c = { x, y -> foo() + x + y }
> assert c.rehydrate(new D(), new O(), new O()).curry(1)(2) == 'o12'   // passes
> assert c.curry(1).rehydrate(new D(), new O(), new O())(2) == 'o12'   // fails
> {code}
> *Actual:* {{java.lang.ClassCastException: class O cannot be cast to class 
> groovy.lang.Closure}}, thrown at {{CurriedClosure.getOwner}} from 
> {{CurriedClosure.call}} (on 4.0.33 a MissingMethodException for O.doCall()).
> * {{c.curry(1).dehydrate()}} throws NullPointerException when called.
> * {{c.asWritable().rehydrate(...)}} throws the same ClassCastException.
> * For {{(c >> g).rehydrate(...)}} and {{c.trampoline().rehydrate(...)}} the 
> new owner and delegate are ignored: {{foo()}} still resolves against the 
> original owner.
> * {{dehydrate()}} on a composed or trampolined closure still holds the 
> original owner, so the result cannot be serialized.
> *Expected:* rehydrating or dehydrating a wrapper closure behaves like 
> rehydrating or dehydrating the closure it wraps and wrapping the copy.
> Cause: {{Closure.rehydrate}} and {{Closure.dehydrate}} replace only the 
> wrapper's own owner, delegate and thisObject fields. {{CurriedClosure}} and 
> {{Closure.WritableClosure}} keep the wrapped closure in owner, so it is 
> overwritten. {{ComposedClosure}} and {{TrampolineClosure}} call through 
> separate fields, so the wrapped closures are never rehydrated or dehydrated.
> Verified on 4.0.33, 5.0.8, 6.0.0 and master.



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

Reply via email to