You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Ryan Baxter (JIRA)" <ji...@apache.org> on 2013/07/16 01:42:53 UTC

[jira] [Updated] (SHINDIG-1495) BaseRequestItem.getTypedParameter() does not work with parameterized types

     [ https://issues.apache.org/jira/browse/SHINDIG-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan Baxter updated SHINDIG-1495:
---------------------------------

    Fix Version/s:     (was: 2.5.0)
                   2.5.1
    
> BaseRequestItem.getTypedParameter() does not work with parameterized types
> --------------------------------------------------------------------------
>
>                 Key: SHINDIG-1495
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1495
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 1.1-BETA5, 2.0.0-RC2, 2.0.0, 2.0.2
>            Reporter: Michael Young
>             Fix For: 2.5.1
>
>
> For example in AppDataHandler.create() there is code like this:
> Map<String, String> values = request.getTypedParameter("data", Map.class);
> Obviously there will be no way for the underlying BeanConvertor to know what the parameterized type is. 
> One way I can see to solve this is to add a new method to the BeanConvertor interface:
> public <T> T convertToObject(String json, Type type);
> So that in AppDataHandler you can do something like:
> Map<String, String> values = request.getTypedParameter("data", new TypeLiteral<Map<String, String>>);
> If this is acceptable, I will start working on a patch. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira