[
https://issues.apache.org/jira/browse/GROOVY-12575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134637#comment-18134637
]
ASF GitHub Bot commented on GROOVY-12575:
-----------------------------------------
codecov-commenter commented on PR #3108:
URL: https://github.com/apache/groovy/pull/3108#issuecomment-6514053250
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3108?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 73.6780%. Comparing base
([`5b077f9`](https://app.codecov.io/gh/apache/groovy/commit/5b077f9dcf610898e3415f1f1cebbaab8eecab61?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`62b8141`](https://app.codecov.io/gh/apache/groovy/commit/62b8141103f870dfc3892eff66077c2f8127d25e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/3108?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3108 +/- ##
==================================================
+ Coverage 73.6711% 73.6780% +0.0069%
- Complexity 42584 42593 +9
==================================================
Files 1678 1678
Lines 146907 146915 +8
Branches 27790 27792 +2
==================================================
+ Hits 108228 108244 +16
+ Misses 28528 28524 -4
+ Partials 10151 10147 -4
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3108?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/3108?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.4384% <100.0000%> (+0.0373%)` | :arrow_up: |
... and [12 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3108/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>
> A trait's instance initializer blocks run twice under joint compilation
> -----------------------------------------------------------------------
>
> Key: GROOVY-12575
> URL: https://issues.apache.org/jira/browse/GROOVY-12575
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Stub generator / Joint compiler
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> When Groovy and Java sources are compiled together, each instance initializer
> block of a trait runs twice per instance:
> {code:groovy}
> trait T { List<String> log = []; { log << 'block' } }
> class C implements T {}
> {code}
> {code:java}
> public class J { public static void main(String[] a) { System.out.println(new
> C().getLog()); } }
> {code}
> {{groovyc -j T.groovy J.java}}, then {{java J}}, prints {{[block, block]}};
> compiled without {{-j}}, {{new C().log}} is {{[block]}}. Dynamic and
> {{@CompileStatic}} implementing classes behave alike.
> The stub generator runs a {{Verifier}} over each class.
> {{Verifier.visitClass}} clears the object initializer statements of a class
> after copying them into its constructors, so {{JavaStubGenerator}} saves them
> first and adds them back afterwards. For an interface or a trait,
> {{visitClass}} returns before that point and keeps them, so adding them back
> doubles them, and the trait transformation copies every block into the
> helper's {{$init$}} twice. Field initializers and static initializer blocks
> of traits are not affected.
> PR: https://github.com/apache/groovy/pull/3108
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)