commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COLLECTIONS-276) *Utils methods should not be extensible or able to be instantiated.
Date Sun, 11 Nov 2007 21:56:50 GMT

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

Stephen Colebourne commented on COLLECTIONS-276:
------------------------------------------------

I disagree. Not everyone turns on the compiler warning you mention, and the technique of using
the subclass to access the static methods of the superclass is perfectly reasonable.

One of the things that I find about open source is not closing down options unless you have
to. You never know what a user will choose to do with our classes. In this case, subclassing
causes us no harm, so we should allow it.


> *Utils methods should not be extensible or able to be instantiated.
> -------------------------------------------------------------------
>
>                 Key: COLLECTIONS-276
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-276
>             Project: Commons Collections
>          Issue Type: Improvement
>    Affects Versions: Generics
>            Reporter: Stephen Kestle
>            Priority: Minor
>             Fix For: Generics
>
>
> I don't see any good reason why this CollectionUtils (and others) isn't final with a
private constructor.  There are no non-static methods, and any extension of them is going
to have to call through to the super to avoid compiler warnings.
> e.g. MyCollectionUtils.select() will provoke the warning that "static methods should
be called directly" (on CollectionUtils).
> Which would mean
> MyCollectionUtils{
> public static Collection select(){
>     return CollectionUtils.select();
> }
> Which really defeats the purpose.  In Java5, we have static imports now -  these provide
more benefit than previous extension did anyhow.

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


Mime
View raw message