-
Notifications
You must be signed in to change notification settings - Fork 476
Move spec internals methods to be static method calls #2209
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
What are the implications of using a |
|
The question is why the mock integration tests work differently. But the intention of this is to prepare for the Groovy 5 PR. By using the mixin (or a trait but there the method overload resolution is buggy unless we name the methods uniquely), we can bring in the spec internals methods at runtime. Up to now this was done by ensuring the methods are package-private, but Groovy 5 lost the ability to call them in that case. Except that it for some reason does not yet work in the mock integration tests and I have no idea yet why. |
|
Couldn't/Shouldn't we just generate static method calls to |
|
Actually, that was my first try. Afair the main problem was how to properly transform the instance method call to a static method call. Another alternative would be to generate all those |
|
Yeah, I think the main problem was how to replace the method call expression with a static method call expression. |
|
I have no idea which minor detail I did differently this time, but trying again it worked just fine to simply use a class expression as object expression for the method call expression to get a static call as result. 🤷♂️ So now no MOP, but static calls. |
21bbf96 to
e84ff52
Compare
4f2ad96 to
74371ac
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2209 +/- ##
=========================================
Coverage 81.92% 81.93%
+ Complexity 4732 4728 -4
=========================================
Files 463 463
Lines 14764 14768 +4
Branches 1869 1869
=========================================
+ Hits 12096 12100 +4
Misses 1980 1980
Partials 688 688
🚀 New features to boost your workflow:
|
spock-core/src/main/java/org/spockframework/runtime/SpecialMethodCallTarget.java
Outdated
Show resolved
Hide resolved
spock-core/src/main/java/org/spockframework/lang/SpecInternals.java
Outdated
Show resolved
Hide resolved
spock-core/src/main/java/org/spockframework/runtime/SpecialMethodCallTarget.java
Outdated
Show resolved
Hide resolved
74371ac to
098924f
Compare
spock-core/src/main/java/org/spockframework/runtime/SpecInternals.java
Outdated
Show resolved
Hide resolved
098924f to
5288e91
Compare
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.
LGTM.
Thank you!
ae5de84 to
10be65b
Compare

This removes relying on Groovy being able to call package-private methods in other-package subclasses, which does not work anymore with Groovy 5.