commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <pj...@sfaf.org>
Subject RE: [lang][collections] Utils having a public constructor
Date Mon, 12 Aug 2002 21:37:37 GMT
> > Actually, I've been thinking for a while now that I'd like to see
> > the utility constructors in [collections] be, at least, protected.
> 
> +1 Paul, my thoughts exactly.

Well, not exactly. :)

In my ideal universe, the protected constructors throw RuntimeExceptions.
So you wouldn't actually be able to create an instance.

Actually, even with a protected constructor, Class.newInstance() will 
still raise an IllegalAccessException and thus Velocity couldn't use it.

I really do think Velocity should be modified to allow static invocations
without an instance.  There are other APIs not under our control that 
use private constructors for their utility classes:

   java.util.Collections
   java.util.Arrays
   java.nio.channel.Channels

and so on.  So I really do believe that Velocity would benefit more from
allowing statics without instances, rather than having us change all the
commons utility classes.

But I'd still like to see protected constructors, it's a nice thing to
do for users.

-Paul



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message