[ 
https://issues.apache.org/jira/browse/COLLECTIONS-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481971
 ] 

Stephen Kestle commented on COLLECTIONS-243:
--------------------------------------------

Remember, Sun's implementation of generics is limited in it's expressive power, 
and this is a good thing (because it's confusing enough as it is!).  Trying to 
make generics specify everything is a path to the mad side (I've been on that 
path myself)...

Edwin:
I believe your "potentially useful transformations" could be accomplished by 
using a Collection<Object> with the widened transformer.  While it'd be nice to 
specify more with generics, don't.  You [should] have better things to do with 
your time.

Stephen S:
There's nothing wrong with Transformer's interface.  It has an Input and an 
Output, as it should.  Those types are mapped by classes that use the 
interface, and it's at all those points where the generic types can be widened 
(or rather, not limited as aggressively as <I,O>).  From Narrow to Wide: <I,O>, 
<? super I, ? extends O>, <?,?>.  This decision of use is not for Transformer 
itself to make.

> Generic versions of Predicated, Syncronized and Unmodifiable classes
> --------------------------------------------------------------------
>
>                 Key: COLLECTIONS-243
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-243
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Bag, Collection, List, Set
>    Affects Versions: Generics
>         Environment: OS X
>            Reporter: Edwin Tellman
>            Priority: Minor
>             Fix For: Generics
>
>         Attachments: collections_06_03_11.patch
>
>
> I added generics to some more classes and fixed some compilation problems.
> The generic version of Transformer required the input and output types to be 
> identical.  This seemed to me to reduce the usefulness of transformed 
> collections, as transforming one type into another seems like it would be a 
> fairly common operation.  I'm not sure how to fix this, however, as it also 
> doesn't seem feasible to have a generic TransformedCollection with different 
> input and output types that implements Collection<E>.  Anyway, this patch 
> de-generifies TransformedCollection, which also fixes some compilation 
> problems.  Please disregard this change if you disagree and have a better 
> solution.
> The modified collection classes are:
> Bags: PredicatedSortedBag, AbstractBagDecorator, SynchronizedBag, 
> UnmodifiableSortedBag, SynchronizedSortedBag, PredicatedBag
> Lists: PredicatedList, SynchronizedList
> Sets: PredicatedSortedSet, SynchronizedSortedSet, PredicatedSet, 
> UnmodifiableSortedSet, SynchronizedSet
> Miscellaneous: PredicatedBuffer

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to