commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Benedict <pbened...@apache.org>
Subject Re: Comments on Commons Lang 3.0-SNAPSHOT
Date Wed, 18 Nov 2009 13:07:28 GMT
Probably because both compile down into max(Object[]). But when I read
Joshua Bloch's Effective Java, he recommends doing something like
this:

max(double, double)
max(double, double, double)
max(double, double, double, double...)

That would be nice. The behind-the-sceneds Object[] creation only
happens if you inline 4. Is it worth the effort?

Paul

On Wed, Nov 18, 2009 at 12:37 AM, Henri Yandell <flamefew@gmail.com> wrote:
> On Mon, Nov 16, 2009 at 11:48 PM, Henri Yandell <flamefew@gmail.com> wrote:
>> On Mon, Nov 16, 2009 at 10:16 AM, Paul Benedict <pbenedict@apache.org> wrote:
>>> * Is there any benefit to making NumberUtils.min/max accept a variable
>>> arguments over a single array?
>>
>> Seems good.
>
> From LANG-396:
>
> NumberUtils.min, NumberUtils.max varargs runs into the no overloading
> recommendation:
>
> src/test/org/apache/commons/lang/math/NumberUtilsTest.java:[1175,42]
> reference to max is ambiguous, both method max(double...) in
> org.apache.commons.lang.math.NumberUtils and method max(float...) in
> org.apache.commons.lang.math.NumberUtils match
>
> So - tried that, had problems.
>
> Hen
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message