commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: StringUtils constructor is private
Date Mon, 12 Aug 2002 14:14:57 GMT
On 8/12/02 9:37 AM, "Jason van Zyl" <> wrote:

> On Mon, 2002-08-12 at 01:44, Henri Yandell wrote:
>> I don't see many reasons why not. I should be able to easily sneak out a
>> replacement jar for the beta without making a song and dance about it,
>> it's not something that will break on anyone.
>> A bigger question, is why does it break things?
> We many tools that use velocity that specify a set of tools in
> properties file. The tools (texen, dvsl, torque) simply instantiate
> objects for the toolbox based on the contents of a properties file:
> toolbox.tool.strings = org.apache.commons.lang.StringUtils
> Which doesn't work with a private constructor.
>> I'm not a proponent of
>> privatising constructors without something to protect so am the easiest
>> person to convince, however if there's some kind of common tool which can
>> only handle instance methods [and statics by pretending they're instance]
>> then we should modify all Utils to have constructors unless absolutely
>> necessary.
>> Is it a velocity thing?
> Well people often put utility classes into a velocity context to perform
> basic string, number manipulation. So in this case, yes, it's a velocity
> thing.

In a sense it's a velocity thing, as Jason is using Velocity and coming
across the problem.

On the other hand, its a general thing :  I think that for general utility
classes that can be instantiated with an argless constructor, having it
public makes it easy for any 'tool using' code that want to instantiate

Geir Magnusson Jr. 
Research & Development, Adeptra Inc.

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

View raw message