commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <>
Subject Re: [lang] Action-taken [Was: StringUtils constructor is private]
Date Mon, 12 Aug 2002 21:29:31 GMT
"Stephen Colebourne" <> writes:

> I actually quite strongly dislike making the constructor public. Its
> basically a flaw in Velocity that we're coding for.

It is not a flaw.  As I explained in my last message, a private
constructor hides features of Java which Velocity (any many, many
other pieces of code I've seen) take advantage of.

> However, in the spirit of cooperation, I am willing to see a public
> constructor. However, I want it to be deprecated. The deprecation won't
> affect tools like Velocity that instantiate it by Class.newInstance(), but
> will cause ordinary programmers to realise that they are using the class
> wrongly.

+1 on deprecation.  I would also like to add a protected constructor
to allow usage of exotic Java language features (via sub-classing)
without directly encouraging instantiation of the utility classes.

> Also, if we do this to one static utility class, we do it to all. That means
> changing the [lang] developers guide and making the changes. It also affects
> [collections] and [pattern]

Indeed.  +1 on protected constructors for all utility class.

Daniel Rall <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message