Hi Simo,

2013/2/24 Simone Tripodi <simonetrip...@apache.org>

> Hi there Bene,
>
> > @@ -82,6 +82,9 @@ public class ConstructorUtils {
> >              InstantiationException {
> >
> >          Object[] args = { arg };
> > +        if (arg == null) {
> > +            args = null;
> > +        }
> >          return invokeConstructor(klass, args);
> >      }
>
> I'd invert the logic to
>
>         Object[] args = null;
>         if (arg != null) {
>             args = { arg };
>         }
>         return invokeConstructor(klass, args);
>

In fact this is what I implemented first but the compiler won't let you do
this:
Array constants can only be used in initializers.

I don't like my solution to much, because it is a bit counter intuitive.
But as the compile tells you why this is implemented this why, I think it
can stay like this. WDYT?

Thanks!
Benedikt


>
> HTH,
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Reply via email to