commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Bug in StringUtils.equals()
Date Tue, 30 Aug 2011 20:59:27 GMT
On 30 August 2011 19:08,  <e_reinus@web.de> wrote:
> Hi All,
>
> i found a Bug in lang3. This tests are failed:
>
> Assert.assertTrue(org.apache.commons.lang3.StringUtils.equals(new StringBuffer(""), new
StringBuffer("")));
> Assert.assertTrue(org.apache.commons.lang3.StringUtils.equals(new StringBuffer("123"),
new StringBuffer("123")));

The CharSequence interface does not define equals(), so only concrete
implementations that provide one (such as String) will use anything
other than Object.equals().

I don't think this is a bug though perhaps the Javadoc could be clearer.

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


Mime
View raw message