-
Notifications
You must be signed in to change notification settings - Fork 469
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
MissingMethodException when accessing fields without explicit @
#1452
Labels
Comments
Looking at the example code, I see that the fields are https://groovy-lang.org/objectorientation.html#properties
|
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Jul 31, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
#1729 would fix this issue. |
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 3, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 3, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
leonard84
pushed a commit
to AndreasTu/spock
that referenced
this issue
Aug 4, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 6, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 9, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 21, 2023
The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1452
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 25, 2023
The Groovy 3 & 4 runtime expects to have the @internal annotation on the MOP methods from GroovyObject. That AbstractCallSite.createGroovyObjectGetPropertySite() processes it as GroovyObject. So the ByteBuddyMockFactory now adds the @internal annotation to the intercepted MOP methods. After that the "Unable to access protected constant when spying instances" problems are gone, because we take the normal Groovy route. Also some strange inconsistencies for Groovy 2 <=> 3,4 are now gone, but a new inconsistency appeared Groovy 4 prefers is over get for boolean. But this is not a Spock issue, because in Groovy only code the same thing happens. See tests in JavaMocksForGroovyClasses. The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1145, spockframework#1452, spockframework#1501, spockframework#1608 Co-authored-by: Björn Kautler <[email protected]>
AndreasTu
added a commit
to AndreasTu/spock
that referenced
this issue
Aug 25, 2023
The Groovy 3 & 4 runtime expects to have the @internal annotation on the MOP methods from GroovyObject. That AbstractCallSite.createGroovyObjectGetPropertySite() processes it as GroovyObject. So the ByteBuddyMockFactory now adds the @internal annotation to the intercepted MOP methods. After that the "Unable to access protected constant when spying instances" problems are gone, because we take the normal Groovy route. Also some strange inconsistencies for Groovy 2 <=> 3,4 are now gone, but a new inconsistency appeared Groovy 4 prefers is over get for boolean. But this is not a Spock issue, because in Groovy only code the same thing happens. See tests in JavaMocksForGroovyClasses. The test "Access protected fields Issue spockframework#1452" covers the "MissingMethodException when accessing fields without explicit @" issue. This fixes spockframework#1145, spockframework#1452, spockframework#1501, spockframework#1608 Co-authored-by: Björn Kautler <[email protected]>
leonard84
added a commit
that referenced
this issue
Sep 15, 2023
#1729) The Groovy 3 & 4 runtime expects to have the `@Internal` annotation on the MOP methods from `GroovyObject`. That `AbstractCallSite.createGroovyObjectGetPropertySite()` processes it as `GroovyObject`. So the `ByteBuddyMockFactory` now adds the `@Internal` annotation to the intercepted MOP methods. After that the "Unable to access protected constant when spying instances" problems are gone, because we take the normal Groovy route. Also some strange inconsistencies for Groovy 2 <=> 3,4 are now gone, but a new inconsistency appeared Groovy 4 prefers is over get for boolean. But this is not a Spock issue, because in Groovy only code the same thing happens. See tests in JavaMocksForGroovyClasses. This fixes #1501, #1452, #1608 and #1145. Co-authored-by: Björn Kautler <[email protected]> Co-authored-by: Leonard Brünings <[email protected]>
Was fixed by #1729 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In order write this Stack Overflow answer, I implemented a test demonstrating data pipes. It works nicely on Spock 1.3. Then I copied it into GWC, and it started failing, complaining about missing getters in lines using field access. Then same happens locally in the latest Spock version:
To Reproduce
This GWC example works. Now simply remove the
@
characters.Expected behavior
The test passes without the
.@id
field access notation under Spock 2.x, just like under 1.3.Actual behavior
Spock complains about missing getters.
Java version
17
Buildtool version
Maven
What operating system are you using
Windows
Dependencies
x
Additional context
x
The text was updated successfully, but these errors were encountered: