Expected Behavior
No incorrect cast should be performed on a controller action that takes a String parameter.
Actual Behaviour
In the example project attached to this ticket you can see that the exampleController
defines an echo
action, this action takes a String
parameter named person
. When another action in the same controller defines a local variable with the same name (person
) and a different type (type Person
in the example), an incorrect cast in being performed. The person
parameter, which should be received as String
is being converted to the type Person
and a GroovyCastException
is thrown.
This issue is similar to #13486
Steps To Reproduce
Details in README.md
- Launch grails app
- Visit http://localhost:8080/example/echo?person=George+Doe
Environment Information
Windows 11 Home
Version 24H2
OS build 26100.4652
Experience Windows Feature Experience Pack 1000.26100.128.0
java 17.0.9 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)
Example Application
https://github.com/solaechea/grails-broken-binding
Version
6.2.3