You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Paul Benedict <pb...@apache.org> on 2009/11/25 01:22:29 UTC

[Lang 3] #isTrue()

I understand why this method exists:
public static void isTrue(boolean expression, String message, Object value)

But why do these variants exist?
public static void isTrue(boolean expression, String message, double value)
public static void isTrue(boolean expression, String message, long value)

Java 5 can autobox primitives so really only the Object variant should
be needed. I understand this can instantiate objects just for the sake
of validation, but then why doesn't int/char/byte/short variants exist
too? What do we want here: all primitives or none? I lean towards all.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Lang 3] #isTrue()

Posted by Henri Yandell <fl...@gmail.com>.
+1 to removing the overloaded variants now that autoboxing is available.

Hen

On Tue, Nov 24, 2009 at 4:22 PM, Paul Benedict <pb...@apache.org> wrote:
> I understand why this method exists:
> public static void isTrue(boolean expression, String message, Object value)
>
> But why do these variants exist?
> public static void isTrue(boolean expression, String message, double value)
> public static void isTrue(boolean expression, String message, long value)
>
> Java 5 can autobox primitives so really only the Object variant should
> be needed. I understand this can instantiate objects just for the sake
> of validation, but then why doesn't int/char/byte/short variants exist
> too? What do we want here: all primitives or none? I lean towards all.
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org