[
https://issues.apache.org/jira/browse/GROOVY-12146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095406#comment-18095406
]
ASF GitHub Bot commented on GROOVY-12146:
-----------------------------------------
codecov-commenter commented on PR #2687:
URL: https://github.com/apache/groovy/pull/2687#issuecomment-4938908642
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2687?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.2403%. Comparing base
([`ee772e0`](https://app.codecov.io/gh/apache/groovy/commit/ee772e01f546b3961020581bb064a1f4e3df40fc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`89f59f9`](https://app.codecov.io/gh/apache/groovy/commit/89f59f9eebe036fcdfcc2ef017d0c0137fe738da?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2687?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## GROOVY_5_0_X #2687 +/- ##
======================================================
- Coverage 67.2477% 67.2403% -0.0074%
+ Complexity 29571 29568 -3
======================================================
Files 1382 1382
Lines 116972 116973 +1
Branches 20539 20539
======================================================
- Hits 78661 78653 -8
- Misses 31788 31795 +7
- Partials 6523 6525 +2
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2687?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...in/java/org/codehaus/groovy/vmplugin/v8/Java8.java](https://app.codecov.io/gh/apache/groovy/pull/2687?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fvmplugin%2Fv8%2FJava8.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3ZtcGx1Z2luL3Y4L0phdmE4LmphdmE=)
| `78.5100% <100.0000%> (+0.0618%)` | :arrow_up: |
... and [3 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2687/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>
> Regression of GROOVY-11715 - Unordered Annotation members
> ----------------------------------------------------------
>
> Key: GROOVY-12146
> URL: https://issues.apache.org/jira/browse/GROOVY-12146
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.7
> Reporter: James Daugherty
> Priority: Major
>
> When a class is compiled against a precompiled trait (or any code path where
> an annotation is materialized from a loaded Class rather than from source),
> the annotation's members are written to the class file in
> Class.getDeclaredMethods() order. That order is unspecified: HotSpot sorts
> methods by internal Symbol address, so it varies across JDK builds — even
> patch releases of the same vendor — and across JVM runs with different
> class-loading histories. Identical sources therefore produce different
> class-file bytes in different environments.
> The member map is populated in
> org.codehaus.groovy.vmplugin.v8.Java8#configureAnnotation(AnnotationNode,
> Annotation), which iterates type.getDeclaredMethods() (also materializing
> default values), and AsmClassGenerator#visitAnnotationAttributes then emits
> the members in map order.
> Observed getDeclaredMethods() orders for groovy.lang.DelegatesTo:
> - liberica 17.0.15: type,value,target,strategy,genericTypeIndex
> - liberica 17.0.16: genericTypeIndex,type,value,target,strategy
> - zulu 11.0.19: strategy,type,value,target,genericTypeIndex
> Impact: Apache Grails 8 (Groovy 5) release artifacts fail reproducible-build
> verification because of this; every jar containing a class that implements a
> precompiled trait carrying @DelegatesTo (controllers via the Controller
> trait, GORM entities via GormEntity#withCriteria, @Delegated command classes,
> ...) differs byte-for-byte between the release build and an independent
> rebuild. Grails 7 (Groovy 4) is not affected because 4.0.x canonicalizes
> attribute order at emission (GROOVY-11715, TreeMap in
> visitAnnotationAttributes). That fix was reverted on master in 6e3737dd24
> ("revert GROOVY-11715 and try a different approach") and no replacement
> landed, so 5.x emits raw reflection order.
> *Reproducer:
> [https://github.com/jdaugherty/groovy-annotation-order-reproducer]*
> compiles a trait whose method parameter carries @DelegatesTo(value = String,
> strategy = Closure.DELEGATE_FIRST, genericTypeIndex = -1), then compiles an
> implementing class against the precompiled trait. The trait's own class file
> preserves source member order (deterministic), but the woven class contains
> all five members (defaults materialized) in the JVM's reflection order.
> Running it on two different JDK builds yields different bytes for identical
> sources.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)