Uploaded image for project: 'Webservices REST Module'
  1. Webservices REST Module
  2. RESTWS-791 Search and fix minor errors
  3. RESTWS-813

Strings should not be compared by using == or !=

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Could
    • Resolution: Fixed
    • None
    • 2.40.0
    • None
    • Low

    Description

      SonarQube:

      This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead.

      Problem:
      Using == or != to compare String objects.

      Solution:
      Use the equals() method for this.

      Where the problem occurs:

      Support materials:

      Gliffy Diagrams

        Attachments

          Activity

            People

              dhanraj23 Dhanraj Patil
              sacull Lukasz Debicki
              Daniel Kayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1 hour Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h