Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7100007

FindBugs: Comparison of String parameter using == or !=

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • jt4.4.1
    • jt4.4.1
    • tools
    • b06
    • b06
    • generic
    • generic
    • Verified

    Description

      Comparison of String parameter using == or !=

      This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead.
      ======================================
      Comparison of String parameter using == or != in com.sun.interview.Interview.setResourceBundle(String, File)

      In file Interview.java, line 322
      In class com.sun.interview.Interview
      In method com.sun.interview.Interview.setResourceBundle(String, File)
      Actual type String
      At Interview.java:[line 322]
      ======================================
      Comparison of String parameter using == or != in com.sun.javatest.TestResultTable.findNode(TestResultTable$TreeNode, String)


      In file TestResultTable.java, line 1154
      In class com.sun.javatest.TestResultTable
      In method com.sun.javatest.TestResultTable.findNode(TestResultTable$TreeNode, String)
      Actual type String
      At TestResultTable.java:[line 1154]

      Attachments

        Activity

          People

            ersh Mikhail Ershov (Inactive)
            ersh Mikhail Ershov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: