[
https://issues.apache.org/jira/browse/GROOVY-12669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137488#comment-18137488
]
ASF GitHub Bot commented on GROOVY-12669:
-----------------------------------------
codecov-commenter commented on PR #3190:
URL: https://github.com/apache/groovy/pull/3190#issuecomment-6612004966
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3190?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.1629%. 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
([`6350e38`](https://app.codecov.io/gh/apache/groovy/commit/6350e385b1d76d42331d3d89170288622b0f559b?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>
[](https://app.codecov.io/gh/apache/groovy/pull/3190?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3190 +/- ##
==================================================
+ Coverage 74.1533% 74.1629% +0.0096%
- Complexity 43751 43759 +8
==================================================
Files 1692 1692
Lines 149516 149529 +13
Branches 28366 28369 +3
==================================================
+ Hits 110871 110895 +24
+ Misses 28448 28440 -8
+ Partials 10197 10194 -3
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3190?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/3190?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.4348% <100.0000%> (+0.4675%)` | :arrow_up: |
|
[...a/org/codehaus/groovy/runtime/memoize/Memoize.java](https://app.codecov.io/gh/apache/groovy/pull/3190?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2Fmemoize%2FMemoize.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvbWVtb2l6ZS9NZW1vaXplLmphdmE=)
| `82.7586% <100.0000%> (+4.4977%)` | :arrow_up: |
... and [12 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3190/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>
> Rehydrating or dehydrating a memoized closure keeps calling the original
> closure with its old owner and delegate
> ----------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12669
> URL: https://issues.apache.org/jira/browse/GROOVY-12669
> 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 P { def foo() { 'p' } }
> def c = new O().with { o -> { x -> foo() + x } }
> assert c.rehydrate(null, new P(), new P()).memoize()(1) == 'p1'
> println c.memoize().rehydrate(null, new P(), new P())(1) // prints o1
> println c.memoizeAtMost(5).rehydrate(null, new P(), new P())(1) // prints o1
> new ObjectOutputStream(new
> ByteArrayOutputStream()).writeObject(c.memoize().dehydrate())
> {code}
> *Actual:* a rehydrated copy of {{memoize()}}, {{memoizeAtMost}},
> {{memoizeAtLeast}} or {{memoizeBetween}} prints {{o1}}. Serializing the
> dehydrated memoized closure fails with {{java.io.NotSerializableException:
> O}}.
> *Expected:* {{p1}}, as for rehydrate followed by memoize. The dehydrated
> memoized closure serializes.
> Cause: the memoized closure forwards calls to the closure it wraps, held in a
> separate field. The inherited {{rehydrate}} and {{dehydrate}} replace only
> the wrapper's own owner, delegate and this object, so the wrapped closure
> keeps the old ones. The copy also shares the original's cache. Related:
> GROOVY-12665 (the same for curried, writable, composed and trampolined
> closures).
> Verified on 4.0.33, 5.0.8, 6.0.0 and master.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)