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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3195?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.1709%. 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 
([`2a73ac9`](https://app.codecov.io/gh/apache/groovy/commit/2a73ac9b70bd4ddafd83aab20b87fcacc70d1ee7?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/3195/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/3195?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3195        +/-   ##
   ==================================================
   + Coverage     74.1533%   74.1709%   +0.0176%     
   + Complexity      43751      43745         -6     
   ==================================================
     Files            1692       1692                
     Lines          149516     149525         +9     
     Branches        28366      28367         +1     
   ==================================================
   + Hits           110871     110904        +33     
   + Misses          28448      28420        -28     
   - Partials        10197      10201         +4     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3195?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/3195?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=)
 | `84.9673% <ø> (ø)` | |
   | 
[.../org/codehaus/groovy/runtime/memoize/LRUCache.java](https://app.codecov.io/gh/apache/groovy/pull/3195?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2Fmemoize%2FLRUCache.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvbWVtb2l6ZS9MUlVDYWNoZS5qYXZh)
 | `94.4444% <ø> (ø)` | |
   | 
[...a/org/codehaus/groovy/runtime/memoize/Memoize.java](https://app.codecov.io/gh/apache/groovy/pull/3195?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=)
 | `89.0909% <100.0000%> (+10.8300%)` | :arrow_up: |
   
   ... and [15 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3195/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>




> memoizeAtMost, memoizeAtLeast and memoizeBetween closures cannot be 
> serialized, unlike memoize closures
> -------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12674
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12674
>             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 roundTrip(Closure c) {
>     def bytes = new ByteArrayOutputStream()
>     bytes.withObjectOutputStream { it.writeObject(c) }
>     new 
> ByteArrayInputStream(bytes.toByteArray()).withObjectInputStream(getClass().classLoader)
>  { it.readObject() }
> }
> def base = { x -> x * 2 }.dehydrate()
> assert roundTrip(base.memoize())(4) == 8      // works
> roundTrip(base.memoizeAtMost(2))               // NotSerializableException: 
> org.codehaus.groovy.runtime.memoize.LRUCache
> roundTrip(base.memoizeAtLeast(0))              // NotSerializableException: 
> org.codehaus.groovy.runtime.memoize.NullProtectionStorage
> roundTrip(base.memoizeAtLeast(2))              // NotSerializableException: 
> java.lang.ref.ReferenceQueue
> def between = base.memoizeBetween(1, 3)
> between(1)
> roundTrip(between)                             // NotSerializableException: 
> java.lang.ref.SoftReference
> {code}
> *Actual:* every variant except memoize() throws NotSerializableException, 
> whether or not it has been called.
> *Expected:* they serialize like memoize() does and still memoize after 
> deserialization, with the same limits.
> Cause: LRUCache is not Serializable. The soft reference variants hold a 
> ReferenceQueue, a NullProtectionStorage or LRUProtectionStorage, and 
> SoftReference cache values, none of which can be serialized.
> 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