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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2675?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `80.00000%` with `1 line` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 68.6889%. Comparing base 
([`c6fa475`](https://app.codecov.io/gh/apache/groovy/commit/c6fa475e9eef061c186d88e0fc3079241ff50ed2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`2d46893`](https://app.codecov.io/gh/apache/groovy/commit/2d468935b3c1e4a87527c04cfe27fc46ae591359?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 3 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2675?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...org/codehaus/groovy/reflection/ParameterTypes.java](https://app.codecov.io/gh/apache/groovy/pull/2675?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Freflection%2FParameterTypes.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3JlZmxlY3Rpb24vUGFyYW1ldGVyVHlwZXMuamF2YQ==)
 | 80.0000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2675?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2675/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/2675?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2675        +/-   ##
   ==================================================
   + Coverage     68.5934%   68.6889%   +0.0955%     
   - Complexity      33951      34106       +155     
   ==================================================
     Files            1535       1536         +1     
     Lines          128543     128903       +360     
     Branches        23335      23363        +28     
   ==================================================
   + Hits            88172      88542       +370     
   + Misses          32555      32530        -25     
   - Partials         7816       7831        +15     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2675?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...org/codehaus/groovy/reflection/ParameterTypes.java](https://app.codecov.io/gh/apache/groovy/pull/2675?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Freflection%2FParameterTypes.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3JlZmxlY3Rpb24vUGFyYW1ldGVyVHlwZXMuamF2YQ==)
 | `70.8108% <80.0000%> (+0.4811%)` | :arrow_up: |
   
   ... and [10 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2675/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>




> Primitive array Varargs Java incompatibility (fix needed also for classic 
> bytecode)
> -----------------------------------------------------------------------------------
>
>                 Key: GROOVY-12139
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12139
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 6.0.0-alpha-2, 5.0.7
>            Reporter: Steve Eady
>            Assignee: Eric Milles
>            Priority: Major
>
> Groovy is not parsing primitive arrays sent into a varargs parameter the same 
> way it is being parsed in Java 17.0.7
> If the input value is a byte array of the string "test"...
> Groovy is slicing it up into a 2d array of dimensions [4][1]
> an array of size 4 each containing an array of size 1
> In java, the value is being slide up into a 2d array of dimensions [1][4]
> an array of size 1 containing an array of size 4.
> This was detected when trying to pass in a byte[] value into a varargs of 
> (byte[]... args)
> in a Spring library.
> Here are the test cases for Groovy vs Java
> {code:groovy}
> class VarArgsTestGroovy {
>   static void main(String[] args) {
>     byte[] bytes = "test".bytes
>     test(bytes)
>   }
>   static test(byte[]... byteArrays) {
>     assert byteArrays.length == 4
>     (0..3).each {
>       assert byteArrays[it].length == 1
>     }
> }
> {code}
> {code:java}
> public class VarArgsTestJava {
>   public static void main(String[] args) {
>     byte[] bytes = "test".getBytes();
>     test(bytes);
>     }
>   static void test(byte[]... byteArrays) {
>     assert byteArrays.length == 1;
>     assert byteArrays[0].length == 4;
>   }
> }
> {code}
> My current workaround is to pre-create a 2 dimensional array of size[1][value]
> and pass that into the varargs method instead of the original byte array



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to