[
https://issues.apache.org/jira/browse/GROOVY-12676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137504#comment-18137504
]
ASF GitHub Bot commented on GROOVY-12676:
-----------------------------------------
codecov-commenter commented on PR #3197:
URL: https://github.com/apache/groovy/pull/3197#issuecomment-6612405437
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3197?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.1717%. 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
([`5a0ae7b`](https://app.codecov.io/gh/apache/groovy/commit/5a0ae7bdaad57011ab918347eb1a815e660eb725?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/3197?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3197 +/- ##
==================================================
+ Coverage 74.1533% 74.1717% +0.0184%
- Complexity 43751 43757 +6
==================================================
Files 1692 1692
Lines 149516 149522 +6
Branches 28366 28367 +1
==================================================
+ Hits 110871 110903 +32
+ Misses 28448 28421 -27
- Partials 10197 10198 +1
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3197?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/IOGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/3197?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FIOGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvSU9Hcm9vdnlNZXRob2RzLmphdmE=)
| `90.1554% <100.0000%> (+0.1554%)` | :arrow_up: |
... and [15 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3197/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>
> withObjectInputStream(ClassLoader) fails with ClassNotFoundException for
> serialized primitive classes such as int.class
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12676
> URL: https://issues.apache.org/jira/browse/GROOVY-12676
> 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 bytes = new ByteArrayOutputStream()
> bytes.withObjectOutputStream { it.writeObject([int.class, void.class]) }
> new
> ByteArrayInputStream(bytes.toByteArray()).withObjectInputStream(getClass().classLoader)
> { it.readObject() }
> // also: a dehydrated closure with a primitive parameter, whose
> parameterTypes holds int.class
> bytes = new ByteArrayOutputStream()
> bytes.withObjectOutputStream { it.writeObject({ int x -> x + 1 }.dehydrate())
> }
> new
> ByteArrayInputStream(bytes.toByteArray()).withObjectInputStream(getClass().classLoader)
> { it.readObject() }
> {code}
> *Actual:* {{java.lang.ClassNotFoundException: int}}. The same applies to the
> File and Path variants, and to the {{clone()}} generated by
> {{@AutoClone(style=SERIALIZATION)}} for a class holding a primitive Class or
> such a closure.
> *Expected:* {{[int, void]}} and a working closure, as with
> {{withObjectInputStream}} without a class loader.
> Cause: {{IOGroovyMethods.newObjectInputStream(InputStream, ClassLoader)}}
> overrides {{ObjectInputStream.resolveClass}} with {{Class.forName}}, which
> cannot load primitive types. The JDK implementation falls back to a table of
> primitive types when {{Class.forName}} fails; the override has no such
> fallback.
> Verified on 4.0.33, 5.0.8, 6.0.0 and master.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)