[
https://issues.apache.org/jira/browse/GROOVY-9848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092256#comment-18092256
] ASF GitHub Bot commented on GROOVY-9848: ---------------------------------------- codecov-commenter commented on PR #2642: URL: https://github.com/apache/groovy/pull/2642#issuecomment-4829829812 ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2642?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 `96.55172%` with `1 line` in your changes missing coverage. Please review. :white_check_mark: Project coverage is 68.5462%. Comparing base ([`a7d75a5`](https://app.codecov.io/gh/apache/groovy/commit/a7d75a57117601c17687f0724ccd2f73016f4ebe?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7920823`](https://app.codecov.io/gh/apache/groovy/commit/7920823865c83f4f191b232272350e06fbf97323?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)). :warning: Report is 5 commits behind head on master. | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2642?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [...codehaus/groovy/runtime/ScriptBytecodeAdapter.java](https://app.codecov.io/gh/apache/groovy/pull/2642?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FScriptBytecodeAdapter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvU2NyaXB0Qnl0ZWNvZGVBZGFwdGVyLmphdmE=) | 87.5000% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2642?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> [](https://app.codecov.io/gh/apache/groovy/pull/2642?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #2642 +/- ## ================================================== + Coverage 68.5420% 68.5462% +0.0042% - Complexity 33730 33751 +21 ================================================== Files 1523 1523 Lines 127923 127959 +36 Branches 23251 23261 +10 ================================================== + Hits 87681 87711 +30 - Misses 32464 32465 +1 - Partials 7778 7783 +5 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2642?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...us/groovy/classgen/asm/BinaryExpressionHelper.java](https://app.codecov.io/gh/apache/groovy/pull/2642?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FBinaryExpressionHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9CaW5hcnlFeHByZXNzaW9uSGVscGVyLmphdmE=) | `88.9368% <100.0000%> (+0.0319%)` | :arrow_up: | | [.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2642?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.9533% <100.0000%> (ø)` | | | [...ovy/transform/OperatorRenameASTTransformation.java](https://app.codecov.io/gh/apache/groovy/pull/2642?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FOperatorRenameASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9PcGVyYXRvclJlbmFtZUFTVFRyYW5zZm9ybWF0aW9uLmphdmE=) | `67.5676% <100.0000%> (+3.2111%)` | :arrow_up: | | [...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2642?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh) | `87.4584% <100.0000%> (+0.0161%)` | :arrow_up: | | [...codehaus/groovy/runtime/ScriptBytecodeAdapter.java](https://app.codecov.io/gh/apache/groovy/pull/2642?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FScriptBytecodeAdapter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvU2NyaXB0Qnl0ZWNvZGVBZGFwdGVyLmphdmE=) | `65.6542% <87.5000%> (+0.1780%)` | :arrow_up: | ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2642/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> > Allow membership operator to work on maps > ----------------------------------------- > > Key: GROOVY-9848 > URL: https://issues.apache.org/jira/browse/GROOVY-9848 > Project: Groovy > Issue Type: Improvement > Reporter: Keegan Witt > Assignee: Eric Milles > Priority: Major > Labels: breaking, breaking_change > > {code:groovy}def map = [a:1,b:2,z:0].withDefault{3}{code} > Options: > # do nothing > {code:groovy} > assert 'a' in map > assert 'b' in map > assert 'x' in map // mutates! > assert 'z' !in map > assert 4 === map.size() > {code} > # change mutation of {{isCase}} -- guard with {{containsKey}}: > {code:groovy} > assert 'a' in map > assert 'b' in map > assert 'x' !in map > assert 'z' !in map > assert 3 === map.size() > {code} > # change {{isCase}} to {{containsKey}}: > {code:groovy} > assert 'a' in map > assert 'b' in map > assert 'x' !in map > assert 'z' in map > assert 3 === map.size() > // grep and switch behavior change (see below) > {code} > # ask user to test key set > {code:groovy} > assert 'a' in map.keySet() > assert 'b' in map.keySet() > assert 'x' !in map.keySet() > assert 'z' !in map.keySet() > assert 3 === map.size() > {code} > # provide {{@OperatorRename}} support: > {code:groovy} > @OperatorRename(isCase='containsKey') > void test() { > assert 'a' in map > assert 'b' in map > assert 'x' !in map > assert 'z' !in map > assert 3 === map.size() > } > {code} > # remap operator {{in}} to {{isIn}} (or some such): > {code:groovy} > // DGMs: > boolean isIn(Map map, Object key) { > return map != null && map.containsKey(key); > } > boolean isIn(Object obj, Object value) { > return InvokerHelper.invokeMethod(obj, "isCase", new Object[]{value}); > } > assert 'a' in map > assert 'b' in map > assert 'x' !in map > assert 'z' in map > assert 3 === map.size() > // behavior change for any type that provides "isIn" > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
