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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2960?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 71.6096%. 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 
([`2641ef0`](https://app.codecov.io/gh/apache/groovy/commit/2641ef015bdb313a8fdc7363dc418ad1fec3051f?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.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2960/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/2960?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2960        +/-   ##
   ==================================================
   + Coverage     71.6089%   71.6096%   +0.0007%     
     Complexity      38061      38061                
   ==================================================
     Files            1588       1588                
     Lines          137078     137078                
     Branches        25507      25507                
   ==================================================
   + Hits            98160      98161         +1     
     Misses          30011      30011                
   + Partials         8907       8906         -1     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2960?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...codehaus/groovy/tools/javac/JavaStubGenerator.java](https://app.codecov.io/gh/apache/groovy/pull/2960?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftools%2Fjavac%2FJavaStubGenerator.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3Rvb2xzL2phdmFjL0phdmFTdHViR2VuZXJhdG9yLmphdmE=)
 | `86.4011% <100.0000%> (ø)` | |
   
   ... and [8 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2960/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>




> Joint compilation stub declares a precompiled trait's static methods "static 
> abstract" on implementing classes
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12427
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12427
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 6.0.0
>            Reporter: Mattias Reichel
>            Priority: Major
>
> When a Groovy class implements a trait that comes precompiled (from a jar or 
> another module), and a Java source in the same joint compilation references 
> that class, the Java stub generated for the class declares the trait's static 
> methods as {{static abstract}} with a body. javac rejects the stub.
> This compiles on Groovy 5.0.6, 5.1.2 and 5.1.3 and fails on 6.0.0. It does 
> not happen when the trait is compiled in the same joint compilation.
> h3. Steps to reproduce
> {code:title=trait/Named.groovy}
> trait Named {
>     static String describe() { 'named' }
> }
> {code}
> {code:title=src/Person.groovy}
> class Person implements Named { }
> {code}
> {code:title=src/UsesPerson.java}
> public class UsesPerson {
>     Person person = new Person();
> }
> {code}
> {noformat}
> mkdir lib out
> java -cp groovy-6.0.0.jar org.codehaus.groovy.tools.FileSystemCompiler -d lib 
> trait/Named.groovy
> java -cp groovy-6.0.0.jar org.codehaus.groovy.tools.FileSystemCompiler -cp 
> lib -d out -j src/Person.groovy src/UsesPerson.java
> {noformat}
> h3. Expected
> Compilation succeeds, as on Groovy 5.1.3.
> h3. Actual
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> Compile error during compilation with javac.
> <stub dir>/Person.java:8: error: illegal combination of modifiers: abstract 
> and static
> @org.codehaus.groovy.transform.trait.Traits.Implemented() public static 
> abstract  java.lang.String describe() { return null; }
>                                                                               
>                      ^
> <stub dir>/Person.java:2: error: Person is not abstract and does not override 
> abstract method describe() in Person
> public class Person
>        ^
> 2 errors
> {noformat}
> h3. Notes
> The stubs, kept with {{jointCompilationOptions = [stubDir: ..., keepStubs: 
> true]}}, differ only in that method. On 5.1.3 the stub for {{Person}} has no 
> {{describe()}}. On 6.0.0 it contains:
> {code:java}
> @org.codehaus.groovy.transform.trait.Traits.Implemented() public static 
> abstract  java.lang.String describe() { return null; }
> {code}
> The method seems to be copied from the precompiled trait with its 
> {{abstract}} modifier kept. This may be related to the stub changes in 
> GROOVY-11976, and to GROOVY-11899, which covered a Java source referencing 
> the trait itself.
> Found while moving Apache Grails to Groovy 6: a Java source that references a 
> Groovy class implementing {{grails.validation.Validateable}} or a GORM entity 
> trait no longer compiles. The workaround is to implement the static methods 
> on the class explicitly.



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

Reply via email to