Description
The original Method in class org.apache.wicket.Request defines getParameterMap as
public abstract Map<String, String[]> getParameterMap()
In DecodedUrlRequest, the method just returns an untyped Map. This map, however, does not always conform to the specification:
In the constructor, the following code can be found:
// Add ALL of the params from the decoded 'x' param
ValueMap params = new ValueMap();
RequestUtils.decodeParameters(decodedParamReplacement, params);
parameterMap.putAll(params);
The method decodeParameters adds Strings (not String Arrays!) to the ValueMap, which are then just copied to the parameterMap.
This is incorrect, it should add String Arrays instead.
The method getParameter apparently knows about the problem, since it is checked whether the parameter values are Strings or String Arrays (via instanceof).
External users of the method getParameterMap, however, cannot know about the problem and must expect that a correctly typed map is returned.
Attachments
Issue Links
- is related to
-
WICKET-524 ClassCastException in WebRequestCodingStrategy
- Resolved
-
WICKET-291 return immutable parameter map or a copy of parameters
- Resolved