commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [QUESTION] Is switching from array parameter to varargs binary compatible?
Date Mon, 05 May 2014 20:20:30 GMT
On 5 May 2014 18:40, Benedikt Ritter <britter@apache.org> wrote:
> Hi,
>
> we have a pull request at github for [lang] which proposes to introduce new
> methods in NumberUtils that take varargs as input parameters instead of
> arrays [1]. I think a better solution would be to change those old methods
> to use varargs instead of introducing new methods. Since I'm not sure how
> this affects binary compatibility, I'd like to here what others thing about
> this.
>
> Clirr doesn't even create an info for a change like this, so I'm assuming
> it can be changed without affecting clients.

In most cases, the effect is the same, but there are some edge cases
according to

http://stackoverflow.com/questions/5405673/java-varags-method-param-list-vs-array

However, I don't like the proposed solution which needs new names.
One way round this might be to extend the existing methods as follows:

max(a,b,c,...)

I think this was already done in some Commons code?

> Benedikt
>
>
> [1] https://github.com/apache/commons-lang/pull/23
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter

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


Mime
View raw message