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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2743?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 `88.27160%` with `19 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 69.8855%. Comparing base 
([`023b9f5`](https://app.codecov.io/gh/apache/groovy/commit/023b9f5e319d1ecf12d89fb7fb5491a0f56e5fd1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`7e103e6`](https://app.codecov.io/gh/apache/groovy/commit/7e103e6d9c2014d3496d27193b347d7bc87b99a6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2743?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...rg/codehaus/groovy/ast/decompiled/Annotations.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FAnnotations.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL0Fubm90YXRpb25zLmphdmE=)
 | 82.0000% | [2 Missing and 7 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2743?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/2743?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=)
 | 87.5000% | [3 Missing and 5 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[.../org/codehaus/groovy/ast/decompiled/ClassStub.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FClassStub.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL0NsYXNzU3R1Yi5qYXZh)
 | 88.8889% | [1 Missing :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...main/groovy/groovy/typecheckers/NullChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FNullChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9OdWxsQ2hlY2tlci5ncm9vdnk=)
 | 90.0000% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2743?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2743/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/2743?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2743        +/-   ##
   ==================================================
   + Coverage     69.8687%   69.8855%   +0.0169%     
   - Complexity      35137      35190        +53     
   ==================================================
     Files            1554       1554                
     Lines          130731     130864       +133     
     Branches        23916      23955        +39     
   ==================================================
   + Hits            91340      91455       +115     
   - Misses          31145      31154         +9     
   - Partials         8246       8255         +9     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2743?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/ast/decompiled/AsmDecompiler.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FAsmDecompiler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL0FzbURlY29tcGlsZXIuamF2YQ==)
 | `95.8904% <100.0000%> (+0.1761%)` | :arrow_up: |
   | 
[...us/groovy/ast/decompiled/ClassSignatureParser.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FClassSignatureParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL0NsYXNzU2lnbmF0dXJlUGFyc2VyLmphdmE=)
 | `96.6102% <100.0000%> (+0.5317%)` | :arrow_up: |
   | 
[...s/groovy/ast/decompiled/MemberSignatureParser.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FMemberSignatureParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL01lbWJlclNpZ25hdHVyZVBhcnNlci5qYXZh)
 | `97.4684% <100.0000%> (+0.3669%)` | :arrow_up: |
   | 
[.../java/org/codehaus/groovy/vmplugin/v16/Java16.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fvmplugin%2Fv16%2FJava16.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3ZtcGx1Z2luL3YxNi9KYXZhMTYuamF2YQ==)
 | `52.0000% <100.0000%> (ø)` | |
   | 
[.../org/codehaus/groovy/ast/decompiled/ClassStub.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FClassStub.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL0NsYXNzU3R1Yi5qYXZh)
 | `94.9152% <88.8889%> (-1.8061%)` | :arrow_down: |
   | 
[...main/groovy/groovy/typecheckers/NullChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FNullChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9OdWxsQ2hlY2tlci5ncm9vdnk=)
 | `79.3478% <90.0000%> (+3.0766%)` | :arrow_up: |
   | 
[...in/java/org/codehaus/groovy/vmplugin/v8/Java8.java](https://app.codecov.io/gh/apache/groovy/pull/2743?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=)
 | `79.5977% <87.5000%> (+1.7030%)` | :arrow_up: |
   | 
[...rg/codehaus/groovy/ast/decompiled/Annotations.java](https://app.codecov.io/gh/apache/groovy/pull/2743?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fdecompiled%2FAnnotations.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9kZWNvbXBpbGVkL0Fubm90YXRpb25zLmphdmE=)
 | `86.7257% <82.0000%> (-3.1294%)` | :arrow_down: |
   
   ... and [6 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2743/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>




> Ingest type-use annotations when reading compiled classes
> ---------------------------------------------------------
>
>                 Key: GROOVY-12206
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12206
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Priority: Major
>
> Groovy currently discards type-use ({{ElementType.TYPE_USE}}) annotations 
> when reading compiled classes, on both resolution paths:
> * The ASM decompiler ({{org.codehaus.groovy.ast.decompiled.AsmDecompiler}}) 
> only overrides {{visitTypeAnnotation}} for record components, and even there 
> discards the {{typeRef}}/{{TypePath}} information. The class, method, and 
> field visitors do not collect {{RuntimeVisibleTypeAnnotations}} at all, so 
> type annotations on method return types, parameter types, field types, 
> supertypes, and generic-signature components of precompiled classes are 
> dropped.
> * The reflection path 
> ({{org.codehaus.groovy.vmplugin.v8.Java8#configureClassNode}}) never consults 
> {{java.lang.reflect.AnnotatedType}} ({{getAnnotatedReturnType}}, 
> {{getAnnotatedParameterTypes}}, ...), so the same information is lost for 
> already-loaded classes.
> This matters because pure JSpecify annotations 
> ({{org.jspecify.annotations.Nullable}} etc.) are {{@Target(TYPE_USE)}} only: 
> in bytecode they appear exclusively in the type-annotation attributes, 
> including on plain non-generic method returns and parameters. Libraries using 
> declaration-targeted annotations (JSR-305 style, Spring 6's 
> {{org.springframework.lang.Nullable}}) remain visible to Groovy today, but a 
> library annotated with pure JSpecify (e.g. Spring Framework 7) is completely 
> invisible to tools such as the incubating {{groovy.typecheckers.NullChecker}}.
> Proposed scope (behaviour-neutral metadata ingestion; no change to 
> type-checking semantics):
> # Collect type annotations in the decompiler stubs for classes, methods, and 
> fields, retaining {{typeRef}} and {{TypePath}}.
> # Surface annotations for the simple positions first (method return type, 
> parameter types, field types, supertypes) onto the corresponding AST nodes / 
> per-use {{ClassNode}}s.
> # Map {{TypePath}}-addressed annotations onto generic-signature components. 
> This requires annotatable per-use ClassNodes when parsing member signatures 
> in {{DecompiledClassNode}}/{{MemberSignatureParser}} (note {{GenericsType}} 
> extends {{ASTNode}}, not {{AnnotatedNode}}; the annotations attach to the 
> type-argument ClassNode as they do for source).
> # Mirror the same for the reflection path via {{AnnotatedType}}.
> Laziness should be preserved (as for existing decompiled-node attributes) so 
> there is no memory overhead when nobody asks for the annotations.
> This is prerequisite plumbing for JSpecify-aware null checking (NullChecker 
> now, deeper static type checker integration later), but is independently 
> useful to any AST transform or tool that needs to see type annotations of 
> dependencies.



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

Reply via email to