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

Thomas Neidhart commented on COLLECTIONS-502:
---------------------------------------------

Also applies to the following classes / fields:

 * ComparableComparator.INSTANCE
 * CloneTransformer.INSTANCE
 * ConstantFactory.NULL_INSTANCE
 * ConstantTransformer.NULL_INSTANCE
 * DefaultEquator.INSTANCE
 * ExceptionClosure.INSTANCE
 * ExceptionFactory.INSTANCE
 * ExceptionPredicate.INSTANCE
 * ExceptionTransformer.INSTANCE
 * FalsePredicate.INSTANCE
 * NOPClosure.INSTANCE
 * NOPTransformer.INSTANCE
 * NotNullPredicate.INSTANCE
 * NullPredicate.INSTANCE
 * TruePredicate.INSTANCE

> Generic parameter inconsistency on various INSTANCE fields
> ----------------------------------------------------------
>
>                 Key: COLLECTIONS-502
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-502
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Functor
>    Affects Versions: 4.0
>            Reporter: Emmanuel Bourg
>            Priority: Trivial
>
> In {{FalsePredicate}} the {{INSTANCE}} singleton is defined as 
> {{Predicate<Object>}}. In other predicates such as {{TruePredicate}} it's
> defined as {{Predicate<?>}}. In both cases this prevents the declaration of:
> {code}
> Predicate<Foo> predicate = FalsePredicate.INSTANCE;
> {code}
> This will fail to compile.
> I suggest declaring the INSTANCE fields as an ungenerified {{Predicate}}, 
> such that the above example compiles with an unchecked warning.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to