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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3256?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.4058%. Comparing base 
([`d020012`](https://app.codecov.io/gh/apache/groovy/commit/d02001286af335c8777fb9f5770e48ec4d07119f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`e4b9a48`](https://app.codecov.io/gh/apache/groovy/commit/e4b9a484b8a13974e9ba26a10ffc761321cccc1a?dropdown=coverage&el=desc&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/3256/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/3256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3256        +/-   ##
   ==================================================
   + Coverage     74.4010%   74.4058%   +0.0049%     
   - Complexity      44345      44353         +8     
   ==================================================
     Files            1699       1699                
     Lines          150998     151011        +13     
     Branches        28770      28773         +3     
   ==================================================
   + Hits           112344     112361        +17     
   + Misses          28380      28378         -2     
   + Partials        10274      10272         -2     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3256?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...s/groovy/runtime/ParallelCollectionExtensions.java](https://app.codecov.io/gh/apache/groovy/pull/3256?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FParallelCollectionExtensions.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvUGFyYWxsZWxDb2xsZWN0aW9uRXh0ZW5zaW9ucy5qYXZh)
 | `99.3056% <100.0000%> (+0.0574%)` | :arrow_up: |
   | 
[.../groovy/groovy/typecheckers/CombinerChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/3256?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FCombinerChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9Db21iaW5lckNoZWNrZXIuZ3Jvb3Z5)
 | `68.6441% <100.0000%> (+1.4027%)` | :arrow_up: |
   
   ... and [4 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3256/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>




> sumParallel: add the no-argument and transform forms of sum(); the combiner 
> form reads as inject
> ------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12722
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12722
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {{Collection.sum()}} adds the elements, and {{sum(Closure)}} adds the 
> transformed elements. 
> {{ParallelCollectionExtensions.sumParallel(Collection<T>, 
> BinaryOperator<T>)}} is a reduction with a required two-argument combiner 
> (GPars' {{sumParallel()}} took no argument; the migration guide maps it to 
> the two-parameter closure form, sumParallel { a, b -> a + b }, and notes that 
> the accumulator is required). Code written by analogy with {{sum}} fails:
> {code:groovy}
> @CompileStatic
> int total(List<Integer> numbers) {
>     numbers.sumParallel { Integer n -> n }
> }
> {code}
> {noformat}
> [Static type checking] - Wrong number of parameters for method target: 
> apply(java.lang.Integer, java.lang.Integer)
> {noformat}
> and in dynamic code items.sumParallel { it.price } calls the one-parameter 
> closure with two arguments.
> Proposal, additive:
> * {{sumParallel(Collection<?> self)}}: the elements added with the left 
> operand's {{plus}}, as {{sum()}} does; an empty collection gives null.
> * {{<T, R> R sumParallel(Collection<T> self, Closure<R> closure)}} with 
> {{@ClosureParams(value = FromString, options = ["T", "T,T"])}}: a 
> one-parameter closure is a transform and the transformed elements are added, 
> the {{sum(Closure)}} contract; a two-parameter closure stays the combiner, so 
> existing calls keep working and, under static compilation, keep their result 
> type. The {{BinaryOperator}} overload stays for method references and Java 
> callers.
> * {{CombinerChecker}} (GROOVY-12013) leaves a one-parameter closure alone: it 
> is not a combiner.
> * core-parallel-collections.adoc and the GPars migration table show the three 
> forms.
> Found while scoring Groovy 6.0.0 code written by language models: with the 
> parallel-collections skill text in front of it, GPT-6 still wrote the 
> one-parameter form.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to