commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <>
Subject Re: StringUtils constructor is private
Date Mon, 12 Aug 2002 23:19:58 GMT
"Juozas Baliuka" <> writes:

> Object newInstance(Class clasz){
>  try{
>        Constructor constructor = clasz.getDeclaredConstructor( new Class[]
> {});
>        constructor.setAccessible(true);
>        return constructor.newInstance( new Object[]{});

No offense intended, but seeing private ctors used like that makes me
wince.  Does anyone have a serious problem with providing a protected
ctor?  There is clearly a valid use case for introspection, and though
we don't want to promote this as the suggested mode of operation, is
there really enough value in explicitly dis-allowing it (by preventing

Daniel Rall <>

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

View raw message