Skip to content

Commit f408864

Browse files
committed
Declare the type of the list being bound
listValue is assigned from two branches and read a few lines later, and being declared def left its element type to inference. IntelliJ gives up and reports the item as `?`, which makes item.getClass() in the loop below look unresolved even though it compiles. Declaring it List answers that where the value is introduced, rather than casting at the point of use — the array and Map branches ask the same question of their items with no cast, and matching them is the point of this change.
1 parent cf5c82d commit f408864

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

grails-web-databinding/src/main/groovy/grails/web/databinding/GrailsWebDataBinder.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ class GrailsWebDataBinder extends SimpleDataBinder {
505505
} else if (Collection.isAssignableFrom(metaProperty.type)) {
506506
def referencedType = getReferencedTypeForCollection(propName, obj)
507507
if (referencedType) {
508-
def listValue
508+
List listValue
509509
if (val instanceof List) {
510510
listValue = (List) val
511511
} else if (val instanceof GPathResultMap && ((GPathResultMap) val).size() == 1) {

0 commit comments

Comments
 (0)