[
https://issues.apache.org/jira/browse/GROOVY-12793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18148272#comment-18148272
]
ASF GitHub Bot commented on GROOVY-12793:
-----------------------------------------
codecov-commenter commented on PR #3316:
URL: https://github.com/apache/groovy/pull/3316#issuecomment-7044801941
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3316?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 `80.00000%` with `4 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 74.5930%. Comparing base
([`88b30dd`](https://app.codecov.io/gh/apache/groovy/commit/88b30ddf6679cfa0e38b416fffd7677d764138ba?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`0275617`](https://app.codecov.io/gh/apache/groovy/commit/0275617e7024b69d0490e26219948989fba25ae7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 12 commits behind head on master.
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3316?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...aus/groovy/ast/decompiled/TypeSignatureParser.java](https://app.codecov.io/gh/apache/groovy/pull/3316?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FTypeSignatureParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL1R5cGVTaWduYXR1cmVQYXJzZXIuamF2YQ==)
| 80.0000% | [0 Missing and 2 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
|
|
[...in/java/org/codehaus/groovy/vmplugin/v8/Java8.java](https://app.codecov.io/gh/apache/groovy/pull/3316?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=)
| 80.0000% | [0 Missing and 2 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3316?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>
[](https://app.codecov.io/gh/apache/groovy/pull/3316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3316 +/- ##
==================================================
+ Coverage 74.5879% 74.5930% +0.0051%
- Complexity 45361 45403 +42
==================================================
Files 1707 1707
Lines 153183 153261 +78
Branches 29442 29474 +32
==================================================
+ Hits 114256 114322 +66
- Misses 28418 28420 +2
- Partials 10509 10519 +10
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3316?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...aus/groovy/ast/decompiled/TypeSignatureParser.java](https://app.codecov.io/gh/apache/groovy/pull/3316?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FTypeSignatureParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL1R5cGVTaWduYXR1cmVQYXJzZXIuamF2YQ==)
| `95.2381% <80.0000%> (-1.1905%)` | :arrow_down: |
|
[...in/java/org/codehaus/groovy/vmplugin/v8/Java8.java](https://app.codecov.io/gh/apache/groovy/pull/3316?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=)
| `77.8068% <80.0000%> (+0.0588%)` | :arrow_up: |
... and [22 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3316/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>
> SC: a call to a method returning or taking an array of a bounded type
> variable, such as Class#getAnnotationsByType, fails with NoSuchMethodError
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12793
> URL: https://issues.apache.org/jira/browse/GROOVY-12793
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.33, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> A statically compiled call to a JDK method declared with an array of a
> bounded type variable is written with Object[] in the method descriptor, and
> fails at run time:
> {code:groovy}
> @groovy.transform.CompileStatic
> void test() {
> Class<?> type = String
> Deprecated[] annotations = type.getAnnotationsByType(Deprecated)
> }
> test()
> {code}
> {noformat}
> java.lang.NoSuchMethodError: 'java.lang.Object[]
> java.lang.Class.getAnnotationsByType(java.lang.Class)'
> {noformat}
> {{Class#getAnnotationsByType}} is declared {{<A extends Annotation> A[]
> getAnnotationsByType(Class<A>)}}, whose descriptor returns
> {{[Ljava/lang/annotation/Annotation;}}. The same happens for
> {{getDeclaredAnnotationsByType}}, and for any method of a precompiled class
> that returns or takes {{T[]}} or {{T[][]}} with {{T extends X}}, such as
> {{static <T extends Number> T[] array(Class<T>)}}. Reproduced with 4.0.33,
> 5.1.3, 6.0.0, 6.0.1-SNAPSHOT and 7.0.0-SNAPSHOT. Methods of a class compiled
> in the same unit are fine.
> Cause: the JVM descriptor of an array is built from its innermost component
> type ({{TypeUtil.getDescriptionByType}} walks {{getComponentType()}}). For
> {{A[]}} that component is the type-variable placeholder. Only the array node
> is redirected to the erasure; the placeholder keeps {{Object}} as its
> redirect.
> * {{Java8#makeClassNode}}, the reflection path (the predefined types of
> {{ClassHelper}} such as {{java.lang.Class}}, and every class when
> asmResolving is off), never redirects the component, for return and parameter
> types of any dimension.
> * {{TypeSignatureParser#applyErasure}}, the class-file path, redirects the
> component for one dimension only, so {{T[][]}} from a jar is written as
> {{Object[][]}}.
> Fix: redirect every component level of an array of a type variable to the
> matching level of its erasure, in both places.
> Workaround: call the method from dynamic code ({{@CompileDynamic}}) or from
> Java, or use {{getAnnotation}} on the annotation and its container.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)