[
https://issues.apache.org/jira/browse/GROOVY-12208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100040#comment-18100040
]
ASF GitHub Bot commented on GROOVY-12208:
-----------------------------------------
codecov-commenter commented on PR #2746:
URL: https://github.com/apache/groovy/pull/2746#issuecomment-5117099520
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2746?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 `83.69565%` with `15 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 69.8981%. Comparing base
([`1743a30`](https://app.codecov.io/gh/apache/groovy/commit/1743a3037976a2344fa41c8c3ddb3d439dfad3f4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`e6a6289`](https://app.codecov.io/gh/apache/groovy/commit/e6a6289c2ade65fc7542cf5e6742d264361396f1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2746?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...main/groovy/groovy/typecheckers/NullChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/2746?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FNullChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9OdWxsQ2hlY2tlci5ncm9vdnk=)
| 83.6956% | [0 Missing and 15 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/2746?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/2746?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2746 +/- ##
==================================================
+ Coverage 69.8923% 69.8981% +0.0057%
- Complexity 35198 35213 +15
==================================================
Files 1554 1554
Lines 130877 130975 +98
Branches 23958 23989 +31
==================================================
+ Hits 91473 91549 +76
- Misses 31151 31158 +7
- Partials 8253 8268 +15
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2746?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...main/groovy/groovy/typecheckers/NullChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/2746?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FNullChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9OdWxsQ2hlY2tlci5ncm9vdnk=)
| `80.8943% <83.6956%> (+1.5465%)` | :arrow_up: |
... and [10 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2746/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>
> NullChecker: broaden null-guard recognition
> -------------------------------------------
>
> Key: GROOVY-12208
> URL: https://issues.apache.org/jira/browse/GROOVY-12208
> Project: Groovy
> Issue Type: Improvement
> Components: groovy-typecheckers
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 6.0.0-beta-1
>
>
> The incubating {{groovy.typecheckers.NullChecker}} currently recognizes a
> limited in-body guard vocabulary: single {{x != null}} / {{x == null}} binary
> comparisons (including identity forms) as {{if}} conditions, and early-exit
> patterns ({{if (x == null) return/throw}}), plus safe navigation.
> (Separately, the groovy-contracts bridge already infers non-nullness from
> {{@Requires}} conditions including conjunctions, via
> {{StaticTypesMarker.INFERRED_NON_NULL}} — this issue is about guard
> recognition inside method bodies, where conjunctions and other idiomatic
> forms are not yet recognized.)
> Idiomatic Groovy uses several other null-guard forms, each currently
> producing false positives that discourage adoption:
> * Groovy-truth guards: {{if (x) { x.foo() } }} — for reference types,
> truthiness implies non-null within the guarded block (Groovy truth being
> false for empty strings/collections does not affect nullness soundness).
> * Boolean conjunctions in conditions: {{if (x != null && x.foo())}}, and
> short-circuit dereferences {{x != null && x.foo()}} in expression position;
> Groovy-truth conjuncts {{x && x.foo()}}.
> * {{instanceof}} checks: {{if (x instanceof Foo)}} implies {{x}} is non-null
> (aligns with the flow typing the static type checker already performs for
> {{instanceof}}).
> * {{Objects.nonNull(x)}} / {{Objects.isNull(x)}} in the positions the binary
> forms are recognized today.
> * {{assert x}} and {{assert x != null}} statements.
> * Guard conditions in {{while}} loops and ternary conditions, mirroring the
> {{if}} handling.
> Each addition removes a class of false positives without changing the
> checker's architecture. Test coverage should include the negated forms and
> else-branch behaviour for each new guard shape, following the existing
> patterns in {{NullCheckerTest}} (cf. {{testNullableWithNotNullGuard}} et al.).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)