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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2747?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 `70.21277%` with `14 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 69.8933%. Comparing base 
([`ab94313`](https://app.codecov.io/gh/apache/groovy/commit/ab94313eb012baf52722dae51f4575808a5b4315?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`800dc27`](https://app.codecov.io/gh/apache/groovy/commit/800dc2716f42b210c5b0055e7860a22911262abc?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/2747?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/2747?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=)
 | 70.2128% | [1 Missing and 13 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2747?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/2747/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/2747?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2747        +/-   ##
   ==================================================
   + Coverage     69.8905%   69.8933%   +0.0028%     
   - Complexity      35210      35227        +17     
   ==================================================
     Files            1554       1554                
     Lines          130922     131004        +82     
     Branches        23970      24009        +39     
   ==================================================
   + Hits            91502      91563        +61     
   - Misses          31159      31161         +2     
   - Partials         8261       8280        +19     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2747?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/2747?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=)
 | `78.1818% <70.2128%> (-0.5747%)` | :arrow_down: |
   
   ... and [5 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2747/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: track nullness through ?., ?:, and ternary results
> ---------------------------------------------------------------
>
>                 Key: GROOVY-12209
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12209
>             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}} tracks nullability per 
> *variable*, and already handles several expression forms: dereferencing a 
> {{@Nullable}}-returning method call is flagged, strict mode merges 
> null-literal branches of ternaries, and elvis assignments over null-literal 
> fallbacks are tracked (see {{testNullableMethodReturnDereference}}, 
> {{testStrictTernary*}}, {{testStrictElvis*}}).
> However, nullness of expression *results* is not propagated in general — the 
> null-literal flows work while nullable-expression flows don't. Confirmed gaps:
> * Safe-navigation results: the documented behaviour is unchanged — 
> {{input?.length()}} stays OK, since {{?.}} guards the receiver it is applied 
> to. The gap is the *result* of a safe navigation used as an unguarded 
> receiver afterwards: {{a?.b.c}} parses as {{(a?.b).c}} and throws NPE at 
> runtime when {{a}} is null, so it should be flagged ({{a?.b}} is nullable by 
> definition, even when {{b}} is {{@NonNull}}), while {{a?.b?.c}} is fine. 
> Currently only {{VariableExpression}} and {{MethodCallExpression}} receivers 
> are checked in {{checkDereference}}, so a {{PropertyExpression}} receiver 
> passes silently.
> * Nullable expressions as arguments: {{isKnownNullable}} recognizes variables 
> only, so passing a {{@Nullable}}-returning call or a safe-navigation result 
> directly to a {{@NonNull}} parameter (e.g. {{process(repo.findById(id))}}) is 
> not caught — only when first assigned to a variable.
> * Ternary/elvis over nullable non-literals: {{cond ? maybeNull : other}} and 
> {{x ?: maybeNullCall()}} where a branch is a nullable *variable or call* 
> (rather than a null literal) are not merged into the result's nullness.
> * {{@Nullable}} getters dereferenced via property syntax mid-chain: {{x.a.b}} 
> where {{getA()}} is {{@Nullable}} is caught when written as {{x.getA().b}} 
> but not in property form.
> * Cast and parenthesized expressions should be transparent to nullness in 
> {{isKnownNullable}} (they already are in {{isNullExpr}}).
> Together with broadened guard recognition (companion issue), this moves the 
> checker from "annotated variables" coverage to "annotated APIs used 
> idiomatically" coverage — values obtained from framework calls and used 
> inline, which is where most real null-mishandling occurs.



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

Reply via email to