[ 
https://issues.apache.org/jira/browse/LANG-1106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14394338#comment-14394338
 ] 

Benedikt Ritter commented on LANG-1106:
---------------------------------------

Please have a look at 
[StringUtilsEqualsIndexOfTest|http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java?view=markup],
 line 543:

{code}
assertFalse(StringUtils.equals(fooCs, null));
{code}

Where fooCs is initialized with the value {{"foo"}}. The test succeeds, so I 
think this issue is invalid. The Code you've posted with the wrong logic 
doesn't look like the logic from {{org.apache.commons.lang3.StringUtils}}. 
Maybe you're talking about a different class with the same name?

> StringUtils equals() method produces wrong result for the below scenario
> ------------------------------------------------------------------------
>
>                 Key: LANG-1106
>                 URL: https://issues.apache.org/jira/browse/LANG-1106
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 2.6, 3.3.2
>         Environment: java version "1.7.0_02"
> Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
> windows 7
>            Reporter: Narendhiran K
>              Labels: bug
>
> When we use StringUtils equals() method with below scenario, it returns wrong 
> results.
> Scenario : StringUtils.equals("someStr", null);
> Result : true
> Expected result : false
> Explanation:
> Some logical / typo mistake on the below line.
> return ((str1 == null) ? false : (str2 == null) ? true : str1.equals(str2));
> Instead of "true" it should be "false", when str2 is checked.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to