You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Michael Gottschalk (JIRA)" <ji...@apache.org> on 2010/09/22 11:22:33 UTC

[jira] Created: (WICKET-3070) Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken

Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken
----------------------------------------------------------------------------------------

                 Key: WICKET-3070
                 URL: https://issues.apache.org/jira/browse/WICKET-3070
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.7
            Reporter: Michael Gottschalk
            Priority: Critical


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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WICKET-3070) Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken

Posted by "Michael Gottschalk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913474#action_12913474 ] 

Michael Gottschalk edited comment on WICKET-3070 at 9/22/10 5:24 AM:
---------------------------------------------------------------------

The issue WICKET-524 fixed the ClassCastException in getParameter, but did not fix getParameterMap

      was (Author: mgottschalk):
    The issue # WICKET-524 fixed the ClassCastException in getParameter, but did not fix getParameterMap
  
> Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-3070
>                 URL: https://issues.apache.org/jira/browse/WICKET-3070
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Michael Gottschalk
>            Priority: Critical
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-3070) Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-3070.
-----------------------------------

         Assignee: Igor Vaynberg
    Fix Version/s: 1.5-M3
       Resolution: Fixed

we cannot change this in 1.4.x because it would cascade down and change a lot of existing functionality. this should all be properly handled in the 1.5.x branch.

> Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-3070
>                 URL: https://issues.apache.org/jira/browse/WICKET-3070
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Michael Gottschalk
>            Assignee: Igor Vaynberg
>            Priority: Critical
>             Fix For: 1.5-M3
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WICKET-3070) Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken

Posted by "Michael Gottschalk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913474#action_12913474 ] 

Michael Gottschalk edited comment on WICKET-3070 at 9/22/10 5:24 AM:
---------------------------------------------------------------------

The issue # WICKET-524 fixed the ClassCastException in getParameter, but did not fix getParameterMap

      was (Author: mgottschalk):
    This issue fixed the ClassCastException in getParameter, but did not fix getParameterMap
  
> Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-3070
>                 URL: https://issues.apache.org/jira/browse/WICKET-3070
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>            Reporter: Michael Gottschalk
>            Priority: Critical
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.