[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939480#comment-13939480
 ] 

Bill Havanki commented on ACCUMULO-2490:
----------------------------------------

Reverting is a good idea. Both Effective Java and Angelika Langer's FAQ say to 
not use wildcards for return types.

This item is relevant to the discussion: 
http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeParameters.html#FAQ107

Basically you can't use "super" for type parameters of methods, which is such a 
pain here. The best bet may be to supply a static method; see the "addToMap" 
workaround in the item for the idea.

> Pair.fromEntry should accept bounded wild card parameters
> ---------------------------------------------------------
>
>                 Key: ACCUMULO-2490
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: client
>            Reporter: Mike Drob
>            Assignee: Christopher Tubbs
>            Priority: Minor
>              Labels: API, newbie
>             Fix For: 1.7.0
>
>
> The following \[psuedo-]code should be legal:
> {code}
> Entry<Integer, String> entry = new Entry(10, "IO")
> Pair<Object,Object> pair = Pair.fromEntry(entry)
> {code}
> This is possible if we replace the generic parameters with bounded wild cards.
> (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to