Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.1.2
-
Patch
Description
My action has a property of type List<Integer> (same for other non-string types). The action will later iterate over this property, and it gets a ClassCastException, because the list (of type List<Integer>) contains a String.
It is because XWorkBasicConverter.doConvertToCollection() converts the input string array into an integer list. But if the input coming from the browser contains a value that cannot be converted to a string, then the string "ognl.NoConversionPossible" is put into the list. It is wrong, we should pay attention to the type of the list.
I have attached a patch that does not put elements into the list that cannot be converted.
I have also attached a file that contains a simple example for this bug.