You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Timothy Ward (JIRA)" <ji...@apache.org> on 2019/02/20 15:00:00 UTC

[jira] [Created] (FELIX-6065) The Converter doesn't support Wildcard types

Timothy Ward created FELIX-6065:
-----------------------------------

             Summary: The Converter doesn't support Wildcard types
                 Key: FELIX-6065
                 URL: https://issues.apache.org/jira/browse/FELIX-6065
             Project: Felix
          Issue Type: Improvement
          Components: Converter
    Affects Versions: converter-1.0.2
            Reporter: Timothy Ward
             Fix For: converter-1.0.6


If you pass a wildcard type to the converter then it fails to do the conversion. This is an odd thing to do, but it is definitely possible to work out what the type is.

 

For example:

    to(new TypeReference<Map<String, ?>>(){});

 

can be converted to a Map<String, Object>, and 

    to(new TypeReference<Map<String, ? extends List<String>>>(){});

can be converted to a Map<String, List<String>>

 

It is unclear what it would mean to use

{{ to(new TypeReference<Map<String, ? super Integer>(){});}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)