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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2965?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 71.6068%. Comparing base 
([`23e5e69`](https://app.codecov.io/gh/apache/groovy/commit/23e5e69dc72f31643457a40c8ec79bed19c30608?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`0e4a02c`](https://app.codecov.io/gh/apache/groovy/commit/0e4a02c5086d7218b08fdaa5f623154ae0b90330?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/2965?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/transform/DelegateASTStubber.java](https://app.codecov.io/gh/apache/groovy/pull/2965?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FDelegateASTStubber.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9EZWxlZ2F0ZUFTVFN0dWJiZXIuamF2YQ==)
 | 50.0000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2965?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/2965/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/2965?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2965        +/-   ##
   ==================================================
   - Coverage     71.6089%   71.6068%   -0.0021%     
   - Complexity      38061      38063         +2     
   ==================================================
     Files            1588       1588                
     Lines          137078     137082         +4     
     Branches        25507      25507                
   ==================================================
     Hits            98160      98160                
   - Misses          30011      30015         +4     
     Partials         8907       8907                
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2965?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...va/org/codehaus/groovy/control/ResolveVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2965?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fcontrol%2FResolveVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NvbnRyb2wvUmVzb2x2ZVZpc2l0b3IuamF2YQ==)
 | `90.9198% <100.0000%> (+0.0107%)` | :arrow_up: |
   | 
[...us/groovy/transform/DelegateASTTransformation.java](https://app.codecov.io/gh/apache/groovy/pull/2965?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FDelegateASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9EZWxlZ2F0ZUFTVFRyYW5zZm9ybWF0aW9uLmphdmE=)
 | `87.3984% <100.0000%> (+0.1033%)` | :arrow_up: |
   | 
[.../codehaus/groovy/transform/DelegateASTStubber.java](https://app.codecov.io/gh/apache/groovy/pull/2965?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FDelegateASTStubber.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9EZWxlZ2F0ZUFTVFN0dWJiZXIuamF2YQ==)
 | `51.1450% <50.0000%> (+0.3758%)` | :arrow_up: |
   
   ... and [9 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2965/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>




> @Delegate generates no methods returning a nested class of a joint-compiled 
> Java source, and breaks other implementors of the interface
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12426
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12426
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 6.0.0
>            Reporter: Mattias Reichel
>            Priority: Major
>
> In a joint compilation, if a Groovy interface declares methods whose return 
> type is a static nested class of a Java source in the same compilation, 
> {{@Delegate}} of that interface generates no delegate methods for them. The 
> class then fails the abstract-method check.
> After {{@Delegate}} has processed the interface, other classes in the same 
> compilation that implement the interface directly also fail the 
> abstract-method check, even though they implement the method.
> This compiles on Groovy 5.1.3 and fails on 6.0.0. {{@CompileStatic}} is not 
> needed. A top-level Java class, or a nested class declared in Groovy, works.
> h3. Steps to reproduce
> {code:title=src/Payload.java}
> public class Payload {
>     public static abstract class Result {
>         public abstract String text();
>     }
> }
> {code}
> {code:title=src/Renderer.groovy}
> interface Renderer {
>     Payload.Result render(Map arguments)
> }
> {code}
> {code:title=src/DelegatingRenderer.groovy}
> class DelegatingRenderer {
>     @Delegate final Renderer renderer
>     DelegatingRenderer(Renderer renderer) { this.renderer = renderer }
> }
> {code}
> {noformat}
> mkdir out
> java -cp groovy-6.0.0.jar org.codehaus.groovy.tools.FileSystemCompiler -d out 
> -j src/Payload.java src/Renderer.groovy src/DelegatingRenderer.groovy
> {noformat}
> h4. Expected
> Compilation succeeds, as on Groovy 5.1.3.
> h4. Actual
> {noformat}
> src/DelegatingRenderer.groovy: 1: Can't have an abstract method in a 
> non-abstract class. The class 'DelegatingRenderer' must be declared abstract 
> or the method 'Payload$Result render(java.util.Map)' must be implemented.
>  @ line 1, column 1.
>    class DelegatingRenderer {
>    ^
> 1 error
> {noformat}
> h3. Effect on other implementors of the interface
> When the {{@Delegate}} class declares the affected method itself, it 
> compiles, but a class that implements the interface directly then fails:
> {code:title=src/ForwardingRenderer.groovy}
> class ForwardingRenderer {
>     @Delegate final Renderer renderer
>     ForwardingRenderer(Renderer renderer) { this.renderer = renderer }
>     Payload.Result render(Map arguments) { renderer.render(arguments) }
> }
> {code}
> {code:title=src/DirectRenderer.groovy}
> class DirectRenderer implements Renderer {
>     Payload.Result render(Map arguments) { null }
> }
> {code}
> {noformat}
> mkdir out
> java -cp groovy-6.0.0.jar org.codehaus.groovy.tools.FileSystemCompiler -d out 
> -j src/Payload.java src/Renderer.groovy src/ForwardingRenderer.groovy 
> src/DirectRenderer.groovy
> {noformat}
> {noformat}
> src/DirectRenderer.groovy: 1: Can't have an abstract method in a non-abstract 
> class. The class 'DirectRenderer' must be declared abstract or the method 
> 'Payload$Result render(java.util.Map)' must be implemented.
> {noformat}
> {{DirectRenderer}} compiles on its own, and both files compile together on 
> 5.1.3.
> h3. Notes
> Found while moving Apache Grails to Groovy 6: {{grails-views-gson}} has 
> {{@Delegate GrailsJsonViewHelper}} in {{TemplateRenderer}}, and the 
> interface's {{render(...)}} methods return {{JsonOutput.JsonWritable}}, a 
> nested class of a Java source in the same module. That failed first in 
> {{TemplateRenderer}}, then in {{DefaultGrailsJsonViewHelper}}, which 
> implements the interface directly. The workaround is to write all forwarding 
> methods explicitly instead of using {{@Delegate}}.



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

Reply via email to