-
Notifications
You must be signed in to change notification settings - Fork 471
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
Add NamedParam support for groovy-2.5 with backport to 2.4 #921
Add NamedParam support for groovy-2.5 with backport to 2.4 #921
Conversation
Codecov Report
@@ Coverage Diff @@
## master #921 +/- ##
========================================
Coverage 75.9% 75.9%
Complexity 3517 3517
========================================
Files 372 372
Lines 10687 10687
Branches 1356 1356
========================================
Hits 8112 8112
Misses 2104 2104
Partials 471 471
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @leonard84 and @marcphilipp)
spock-core/src/main/java/spock/mock/MockingApi.java, line 175 at r1 (raw file):
@NamedParam(value = "verified", type = Boolean.class), @NamedParam(value = "useObjenesis", type = Boolean.class) })
Am I right that it will be just ignored on Groovy 2.4 (no extra check is done)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @leonard84 and @marcphilipp)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @szpak and @marcphilipp)
spock-core/src/main/java/spock/mock/MockingApi.java, line 175 at r1 (raw file):
Previously, szpak (Marcin Zajączkowski) wrote…
Am I right that it will be just ignored on Groovy 2.4 (no extra check is done)?
Yes, the JVM ignores all unknown annotations at runtime (JSR-175) so we have this compileOnly internal-backports project that provides these annotations so that we can compile on 2.4.
In any case the NamedParam annotations are just hints for the IDE, there are no additional checks. At least that is the current status, maybe groovy will add better checking capabilities later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @marcphilipp)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention that the backported annotations are just there so the code compiles and will not actually work?
@marcphilipp how and where would you add this mention? |
In the Javadoc of the classes so it's at least clear to contributors and maintainers. 😉 |
internal-backport/src/main/java/groovy/transform/NamedParam.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙂
This change is