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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3192?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 `88.88889%` with `1 line` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.1620%. Comparing base 
([`0941dba`](https://app.codecov.io/gh/apache/groovy/commit/0941dbacf496a1667c27681c6fe76deee59bfb57?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`6c29d89`](https://app.codecov.io/gh/apache/groovy/commit/6c29d899c8c64811e851b94af40a1e89b619115c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 11 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3192?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[src/main/java/groovy/lang/Closure.java](https://app.codecov.io/gh/apache/groovy/pull/3192?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9DbG9zdXJlLmphdmE=)
 | 88.8889% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3192?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/3192/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/3192?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3192        +/-   ##
   ==================================================
   + Coverage     74.1533%   74.1620%   +0.0087%     
   - Complexity      43751      43763        +12     
   ==================================================
     Files            1692       1692                
     Lines          149516     149516                
     Branches        28366      28364         -2     
   ==================================================
   + Hits           110871     110884        +13     
   + Misses          28448      28441         -7     
   + Partials        10197      10191         -6     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3192?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[src/main/java/groovy/lang/Closure.java](https://app.codecov.io/gh/apache/groovy/pull/3192?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FClosure.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9DbG9zdXJlLmphdmE=)
 | `85.4030% <88.8889%> (+0.4357%)` | :arrow_up: |
   
   ... and [10 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3192/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>




> Closure property access throws NullPointerException instead of falling 
> through to the delegate when the owner is null
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12671
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12671
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.33, 5.0.8, 7.0.0-alpha-1, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> class D { def bar = 'delegate' }
> def c = { -> bar }.dehydrate()
> c.delegate = new D()
> assert c() == 'delegate'
> {code}
> *Actual:* {{java.lang.NullPointerException: Cannot get property 'bar' on null 
> object}}. A write ({{bar = 1}}) throws {{Cannot set property 'bar' on null 
> object}}, and so does {{rehydrate(d, null, null)}}.
> *Expected:* with OWNER_FIRST (the default) a null owner is skipped and the 
> delegate supplies the property, the same as for method calls (GROOVY-12667). 
> When no non-null candidate remains (both null, or a null target under 
> OWNER_ONLY or DELEGATE_ONLY), MissingPropertyException is thrown, matching 
> the MissingMethodException that method calls give.
> {{Closure.resolveGetProperty}} and {{resolveSetProperty}} skip a null 
> receiver only for DELEGATE_FIRST with a null delegate (GROOVY-1974). Every 
> other null receiver reaches {{NullObject}}. Separately, 
> {{setPropertyTryThese}} tests {{o1 != null}} where it should test {{o2 != 
> null}}, so a missing property on the owner with a null delegate also throws 
> NPE instead of MissingPropertyException.
> Verified on 2.4.15, 3.0.25, 4.0.33, 5.0.8, 6.0.0 and master.



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

Reply via email to