[
https://issues.apache.org/jira/browse/GROOVY-11982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18077860#comment-18077860
]
ASF GitHub Bot commented on GROOVY-11982:
-----------------------------------------
codecov-commenter commented on PR #2507:
URL: https://github.com/apache/groovy/pull/2507#issuecomment-4364966900
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2507?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 67.3211%. Comparing base
([`ced726c`](https://app.codecov.io/gh/apache/groovy/commit/ced726ce38d8830ba35ca1f07c132998b4303738?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`e74384d`](https://app.codecov.io/gh/apache/groovy/commit/e74384d940c9de852a949f51f31c0fffbcca8329?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>
[](https://app.codecov.io/gh/apache/groovy/pull/2507?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2507 +/- ##
==================================================
+ Coverage 67.3060% 67.3211% +0.0151%
- Complexity 32213 32253 +40
==================================================
Files 1489 1490 +1
Lines 124867 125044 +177
Branches 22485 22505 +20
==================================================
+ Hits 84043 84181 +138
- Misses 33512 33537 +25
- Partials 7312 7326 +14
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2507?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...rg/codehaus/groovy/classgen/AsmClassGenerator.java](https://app.codecov.io/gh/apache/groovy/pull/2507?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FAsmClassGenerator.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0FzbUNsYXNzR2VuZXJhdG9yLmphdmE=)
| `84.9224% <100.0000%> (+0.0111%)` | :arrow_up: |
|
[...g/codehaus/groovy/classgen/asm/CallSiteWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2507?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FCallSiteWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9DYWxsU2l0ZVdyaXRlci5qYXZh)
| `80.0971% <100.0000%> (+0.4854%)` | :arrow_up: |
... and [22 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2507/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>
> Default methods in interface throw IncompatibleClassChangeError under
> indy=false
> --------------------------------------------------------------------------------
>
> Key: GROOVY-11982
> URL: https://issues.apache.org/jira/browse/GROOVY-11982
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
> A Groovy interface with default methods whose bodies use dynamic Groovy
> features (e.g. GString interpolation) fails at runtime with
> {{IncompatibleClassChangeError}} when compiled with {{indy=false}}.
> h3. Symptom
> {noformat}
> java.lang.IncompatibleClassChangeError: Method
> 'org.codehaus.groovy.runtime.callsite.CallSite[]
> IConfig.$getCallSiteArray()'
> must be InterfaceMethodref constant
> at IConfig.getDescription(IConfig.groovy)
> {noformat}
> h3. Reproducer
> {code:groovy}
> interface IConfig {
> String getName()
> default String getDescription() { "config[name=${getName()}]" }
> }
> class ConfigImpl implements IConfig { String getName() { 'impl' } }
> new ConfigImpl().description // throws under indy=false
> {code}
> Compile with {{-Dgroovy.target.indy=false}} and invoke any default method.
> h3. Root cause
> {{CallSiteWriter.makeSiteEntry()}} emits {{INVOKESTATIC
> <interface>.$getCallSiteArray}} as a {{CONSTANT_Methodref_info}} entry. JVMS
> §5.4.3.3 requires {{CONSTANT_InterfaceMethodref_info}} when the owner is an
> interface, so resolution throws {{IncompatibleClassChangeError}}.
> * {{CallSiteWriter.java:118}} uses {{controller.getInternalClassName()}} with
> {{isInterface=false}} instead of redirecting to the
> {{InterfaceHelperClassNode}} (cf. {{prepareCallSite()}} at line 233 which
> uses {{controller.getClassName()}}).
> * {{AsmClassGenerator.createInterfaceSyntheticStaticFields()}} only
> materialises the helper inner class when {{referencedClasses}} is non-empty,
> so an interface with call sites but no class literals has no helper to
> redirect to.
> h3. Workaround
> Convert the interface to a {{trait}} — trait helper bodies live in a regular
> {{$Trait$Helper}} class where {{Methodref}} encoding is valid. Or compile
> with {{indy=true}} ({{IndyCallSiteWriter.makeSiteEntry()}} is a no-op).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)