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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2780?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 `66.66667%` with `1 line` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 70.0677%. Comparing base 
([`3d96c39`](https://app.codecov.io/gh/apache/groovy/commit/3d96c3956240f776b03a8c2fb9db6b7efebb0acb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`445d0ff`](https://app.codecov.io/gh/apache/groovy/commit/445d0ff1bb75dceab4c17db13b97b49f3d4205d6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2780?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/MetaClassImpl.java](https://app.codecov.io/gh/apache/groovy/pull/2780?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FMetaClassImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9NZXRhQ2xhc3NJbXBsLmphdmE=)
 | 66.6667% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2780?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/2780/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/2780?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2780        +/-   ##
   ==================================================
   + Coverage     70.0642%   70.0677%   +0.0036%     
   - Complexity      35699      35704         +5     
   ==================================================
     Files            1561       1561                
     Lines          131979     131978         -1     
     Branches        24231      24230         -1     
   ==================================================
   + Hits            92470      92474         +4     
   + Misses          31149      31146         -3     
   + Partials         8360       8358         -2     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2780?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/MetaClassImpl.java](https://app.codecov.io/gh/apache/groovy/pull/2780?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FMetaClassImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9NZXRhQ2xhc3NJbXBsLmphdmE=)
 | `79.3026% <66.6667%> (-0.0116%)` | :arrow_down: |
   
   ... and [8 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2780/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>




> NPE "Cannot invoke MetaMethod.isAbstract() because method is null" on super 
> call to inherited generic method with default parameter
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12247
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12247
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 5.0.8, 6.0.0-beta-1
>            Reporter: Sean Fitts
>            Assignee: Paul King
>            Priority: Major
>
> A dynamic super. call throws:
> {quote}java.lang.NullPointerException: Cannot invoke 
> "groovy.lang.MetaMethod.isAbstract()" because "method" is null
> at 
> groovy.lang.MetaClassImpl.getSuperMethodWithCaching(MetaClassImpl.java:1423)
> at groovy.lang.MetaClassImpl.getMethodWithCaching(MetaClassImpl.java:1368)
> at groovy.lang.MetaClassImpl.getMetaMethod(MetaClassImpl.java:1263)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1117)
> at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:143)
> {quote}
> when all of the following hold:
>  # The super method is declared in a generic class, uses the type variable as 
> a parameter type, and has a default parameter value (which generates a 
> short-form overload). Declaring two explicit overloads instead of using a 
> default parameter fails the same way.
>  # An intermediate class binds the type parameter, so the overriding class 
> sits two levels below the generic declaration. (If the overriding class 
> extends the generic class directly, it works.)
>  # A subclass overrides the short-form overload with the concrete type 
> argument (producing a bridge method) and invokes it via super. with the 
> optional argument omitted.
> Reproducer (tried attaching file, but that failed):
>  
> abstract class Base<T extends Number> {
> protected String process(T value, String extra = null) {
> return "base(${value}, ${extra})"
> }
> }
> abstract class Mid extends Base<Integer> {}
> class Sub extends Mid {
> @Override
> protected String process(Integer value) {
> return 'sub->' + super.process(value)
> }
> }
> // Expected (Groovy 3/4): sub->base(42, null)
> // Groovy 5.0.8 / 6.0.0-beta-1: NPE "Cannot invoke 
> groovy.lang.MetaMethod.isAbstract() because method is null"
> println new Sub().process(42)
>  
> Expected output sub->base(42, null), as produced by Groovy 3 and 4).
> Removing any one ingredient avoids the failure: dropping the default 
> parameter (so the method is not overloaded), removing the intermediate class 
> Mid, or calling the full-arity form explicitly (super.process(value, null)), 
> which is a usable workaround.



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

Reply via email to