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

Add NamedParam support for groovy-2.5 with backport to 2.4 #921

Merged
merged 3 commits into from
Oct 7, 2018

Conversation

leonard84
Copy link
Member

@leonard84 leonard84 commented Sep 26, 2018

This change is Reviewable

@codecov
Copy link

codecov bot commented Sep 26, 2018

Codecov Report

Merging #921 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ Complexity Δ
...pock-core/src/main/java/spock/mock/MockingApi.java 2.94% <ø> (ø) 2 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0886296...424a003. Read the comment docs.

Copy link
Member

@szpak szpak left a 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)?

Copy link
Member

@szpak szpak left a 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)

Copy link
Member Author

@leonard84 leonard84 left a 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.

szpak
szpak previously approved these changes Sep 26, 2018
Copy link
Member

@szpak szpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @marcphilipp)

marcphilipp
marcphilipp previously approved these changes Sep 27, 2018
Copy link
Member

@marcphilipp marcphilipp left a 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?

@leonard84
Copy link
Member Author

@marcphilipp how and where would you add this mention?

@marcphilipp
Copy link
Member

In the Javadoc of the classes so it's at least clear to contributors and maintainers. 😉

@leonard84 leonard84 dismissed stale reviews from marcphilipp and szpak via 1118f38 September 28, 2018 17:50
Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙂

@leonard84 leonard84 merged commit 9afec6f into spockframework:master Oct 7, 2018
@leonard84 leonard84 deleted the add-NamedParam-support branch October 7, 2018 13:14
@szpak szpak changed the title Add NamedParam support for gradle-2.5 with backport to 2.4 Add NamedParam support for groovy-2.5 with backport to 2.4 Jan 23, 2019
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