Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-11413

[findbugs] RV: Negating the result of compareTo()/compare()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 0.99.0, 0.98.4
    • None
    • None

    Description

      Finbugs warns that CatalogJanitor.java, NamespaceUpgrade.java and FSTableDescriptors.java have the following warning:

      RV: Negating the result of compareTo()/compare() (RV_NEGATING_RESULT_OF_COMPARETO)

      This code negatives the return value of a compareTo or compare method. This is a questionable or bad programming practice, since if the return value is Integer.MIN_VALUE, negating the return value won't negate the sign of the result. You can achieve the same intended result by reversing the order of the operands rather than by negating the results.

      Attachments

        1. HBASE-11413.patch
          2 kB
          Mike Drob
        2. HBASE-11413.patch
          2 kB
          Michael Stack

        Activity

          People

            mdrob Mike Drob
            mdrob Mike Drob
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: