You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/07/23 11:58:08 UTC

DO NOT REPLY [Bug 51546] New: Usage of equals instead of ==

https://issues.apache.org/bugzilla/show_bug.cgi?id=51546

             Bug #: 51546
           Summary: Usage of equals instead of ==
           Product: Tomcat 7
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: felix.schumacher@internetallee.de
    Classification: Unclassified


Created attachment 27310
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27310
replace ==/!= with equals in case of string compare

Findbugs found two places where ==/!= is used instead of equals for comparing
strings.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 51546] Usage of equals instead of ==

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51546

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-07-23 16:27:14 UTC ---
That is deliberate and is covered in the Tomcat 7 Findbugs configuration. See
/res/findbugs/filter-false-positives.xml

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 51546] Usage of equals instead of ==

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51546

--- Comment #2 from Felix Schumacher <fe...@internetallee.de> 2011-07-23 17:19:22 UTC ---
Sorry for overlooking that findbugs configuration.

But I still wonder, why you are testing for object identity rather than
equality. If the strings are the same, than why bother to create a new
StringBuilder or update the attributes?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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