commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject Re: [io][vote] FileUtils: decision on style
Date Tue, 29 Jul 2003 12:54:47 GMT

On Tue, 29 Jul 2003 wrote:

> Hey thanks for the heads up!
> being one of the original authors/contributor of this class, I do
> have some comments (mostly in favour of your proposal)...
> 1rst: you seem to have added a private constructor to prevent
> instantiation, which hurts usage as in velocity, where you need
> an instance of a class to allow the introspection to work. I'm
> -1 for that change in CVS.

Yep. This is a Lang-lesson. Have an empty constructor in every 'Utils'
class which mentions in a javadoc that this is not intended to be used:

     * <p><code>ObjectUtils</code> instances should NOT be constructed in
     * standard programming. Instead, the class should be used as
     * <code>ObjectUtils.defaultIfNull("a","b");</code>.</p>
     * <p>This constructor is public to permit tools that require a JavaBean instance
     * to operate.</p>

Also worth looking at and maybe adopting the relatively simple:
DEVELOPERS-GUIDE.html in Lang. Mainly it just outlines the XxxUtils

Also don't make XxxUtils a final class.


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

View raw message