commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <>
Subject Re: svn commit: r983137 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/
Date Sun, 08 Aug 2010 20:28:59 GMT
On Sun, Aug 8, 2010 at 1:25 PM, sebb <> wrote:
> As it stands, the code allows calls of the form:
> Map<Integer,Integer> map = ArrayUtils.toMap(new String[][] {{"foo",
> "bar"}, {"hello", "world"}});
> without complaining.
> Failing to check the types of the array entries on creation means that
> the error may lie undetected until much later, making it potentially
> much harder to debug.

I am not against checking against the type arguments, but this change
assumes the user won't do something stupid.  It'd be a
ClassCastException later, yes.  Having the type arguments only allows
the user not to have to cast the return type.  They can use type

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

View raw message