Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
MissingMethodException in 0.13.0 when setting input field value with value() #422
I get this exception when trying to set an input field's value with the .value() method in a company project I'm working on. I tried to reproduce the issue in a public project to give a reproducible example but it works fine in the public project, which is inconvenient.
NonEmptyNavigator.groovy line 704 is
In the past I've been bitten by HashMap.values() not being a normal collection type (List, Set, etc.) - it's a special class Values inside HashMap that doesn't have all the same collection methods as some of the more common collection classes.
From looking at what methods the Values class does have, it looks like it has the removeAll() method which could be a good substitute in this case.
I think I know why I'm getting this exception in my Grails2 apps but can't recreate in Geb core - different Groovy versions.
I added a test to the geb-grails plugin that calls .value() and messed around with specifying different Groovy versions in geb-grails.gradle. Currently project.groovyVersion is in there, which is 2.4.5. When I changed the Groovy version to what ships with Grails 2.4.2 (Groovy 2.3.7), then I got the exception. I tried some different versions and any Groovy version >= 2.4.0 works fine so they must have added more methods for that HashMap.Values class in Groovy 2.4.0
Now that I have a way to reproduce and test the fix I will work on a PR to fix it to work with Groovy < 2.4