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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3198?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.1541%. 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 
([`ead2ca7`](https://app.codecov.io/gh/apache/groovy/commit/ead2ca7d673fa201fe79b74cf24777e16268b3c3?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/3198/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/3198?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3198        +/-   ##
   ==================================================
   + Coverage     74.1533%   74.1541%   +0.0008%     
   - Complexity      43751      43753         +2     
   ==================================================
     Files            1692       1692                
     Lines          149516     149517         +1     
     Branches        28366      28366                
   ==================================================
   + Hits           110871     110873         +2     
   - Misses          28448      28449         +1     
   + Partials        10197      10195         -2     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3198?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...a/org/codehaus/groovy/runtime/memoize/Memoize.java](https://app.codecov.io/gh/apache/groovy/pull/3198?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=)
 | `78.7234% <100.0000%> (+0.4625%)` | :arrow_up: |
   
   ... and [12 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3198/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>




> A memoize() closure that has cached a null result cannot be serialized
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-12677
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12677
>             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}
> def m = { x -> null }.dehydrate().memoize()
> assert m(1) == null
> def bytes = new ByteArrayOutputStream()
> bytes.withObjectOutputStream { it.writeObject(m) }   // fails here
> def copy = new 
> ByteArrayInputStream(bytes.toByteArray()).withObjectInputStream(getClass().classLoader)
>  { it.readObject() }
> assert copy(1) == null
> {code}
> *Actual:* {{java.io.NotSerializableException: 
> org.codehaus.groovy.runtime.memoize.Memoize$MemoizeNullValue}}. The same 
> closure serializes when its cached results are not null.
> *Expected:* the memoized closure serializes. The copy returns null for the 
> cached arguments without calling the wrapped closure again.
> The memoizing closure stores a null result as a private place-holder, 
> {{Memoize.MemoizeNullValue}}, which is not {{Serializable}}. The closure 
> recognises the place-holder by identity, so a deserialized copy must also 
> resolve back to the shared instance.
> 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