Details
-
Test
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
None
-
None
-
None
Description
class MainClass { List<MSID> MainList = [].withLazyDefault { return new MSID() } } class MSID{ List<Item> subList = [].withLazyDefault { return new Item() } }
And in controller when I say
MainClass mainObj;
.....
List<Item> listWithoutNullValues = mainObj.MainList.subList.grep()
for(Item provision : listWithoutNullValues){
println provision.someValue
}
Cannot cast object 'groovy.lang.ListWithDefault@1d9e316' with class 'groovy.lang.ListWithDefault' to class 'com.abc.Item' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor