Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GROOVY-11432: Support method references/method pointers in annotation… #2097

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

paulk-asert
Copy link
Contributor

… attributes

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.6557%. Comparing base (6cd477b) to head (f6cdc41).
Report is 185 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2097        +/-   ##
==================================================
+ Coverage     68.5957%   68.6557%   +0.0600%     
- Complexity      29233      29390       +157     
==================================================
  Files            1426       1426                
  Lines          113494     113641       +147     
  Branches        19548      19597        +49     
==================================================
+ Hits            77852      78021       +169     
+ Misses          29088      29067        -21     
+ Partials         6554       6553         -1     
Files Coverage Δ
...va/org/apache/groovy/parser/antlr4/AstBuilder.java 86.6075% <100.0000%> (-0.0235%) ⬇️
...rg/codehaus/groovy/classgen/AnnotationVisitor.java 88.6667% <100.0000%> (ø)
.../codehaus/groovy/runtime/DefaultGroovyMethods.java 73.4788% <100.0000%> (+0.0088%) ⬆️

... and 49 files with indirect coverage changes

@daniellansun
Copy link
Contributor

+1

@paulk-asert
Copy link
Contributor Author

I'll write an email to the dev list shortly and await feedback before merging. As currently designed, it works for dynamic Groovy and fails when using static compilation. This is kind of as I'd expect since we have a "dangling" method reference not associated with a functional interface. But we could also make some assumptions and use a Consumer and make it work for statically compiled code.

@paulk-asert
Copy link
Contributor Author

Update: the current PR now uses withMethodClosure instead of the previous version which used with. This means that it works with static compilation and static type checking.

@paulk-asert paulk-asert merged commit a16f1a9 into apache:master Jul 23, 2024
19 checks passed
@paulk-asert paulk-asert deleted the groovy11432 branch July 23, 2024 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants