[ https://issues.apache.org/jira/browse/GROOVY-11678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17953877#comment-17953877 ]
ASF GitHub Bot commented on GROOVY-11678: ----------------------------------------- codecov-commenter commented on PR #2234: URL: https://github.com/apache/groovy/pull/2234#issuecomment-2907564904 ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2234?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report All modified and coverable lines are covered by tests :white_check_mark: > Project coverage is 69.0354%. Comparing base [(`d7afb87`)](https://app.codecov.io/gh/apache/groovy/commit/d7afb87d94341f8a91696cd0a6fc3e6240f24b9f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`373a583`)](https://app.codecov.io/gh/apache/groovy/commit/373a5839ad20d5180b40df8e6ad2adebbf033140?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> [](https://app.codecov.io/gh/apache/groovy/pull/2234?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #2234 +/- ## ================================================== - Coverage 69.0430% 69.0354% -0.0077% + Complexity 29704 29702 -2 ================================================== Files 1423 1423 Lines 114404 114408 +4 Branches 19852 19852 ================================================== - Hits 78988 78982 -6 - Misses 28781 28788 +7 - Partials 6635 6638 +3 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2234?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2234?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==) | `74.7359% <100.0000%> (+0.0297%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2234/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> > Create DGM#subList(IntRange) method > ----------------------------------- > > Key: GROOVY-11678 > URL: https://issues.apache.org/jira/browse/GROOVY-11678 > Project: Groovy > Issue Type: New Feature > Reporter: Paul King > Assignee: Paul King > Priority: Major > > We recently added some DGM variants on Lists which take an IntRange. Rather > than keep adding such variants, it makes more sense to piggy-back of JDK > subList functionality and provide a subList method that takes a range. > {code:groovy} > def list = [1, 2, 3, 3, 4, 4, 5, 6, 7] > assert list.partitionPoint(0..<4) { it <= 20 } == 4 // alt1 > assert list.subList(0..<4).partitionPoint { it <= 20 } == 4 // alt2 > {code} > It would allow us to offer the second alternative instead of the first, > potentially removing the need for one variant. > Another example: > {code:groovy} > def nums = [5, 9, 1, 7, 3, 4, 8, 6, 0, 2] > nums.sort(0..4) // alt1 > nums.subList(0..4).sort() // alt2 > assert nums == [1, 3, 5, 7, 9, 4, 8, 6, 0, 2] > {code} > The other mutating methods, e.g. {{shuffle}}, {{unique}}, {{clear}}, could > also be used and we don't need more variants. > It would still make sense to keep some variants, e.g.: > {code:groovy} > assert nums.toSorted(0..4) == [1, 3, 5, 7, 9, 4, 8, 6, 0, 2] > {code} > Since we sort on the int range but return the whole list. > It may also make sense to keep variants where we want to offer the same > functionality with index selection across more aggregates, e.g. lists and > arrays. -- This message was sent by Atlassian Jira (v8.20.10#820010)