Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8263981

java.awt.image.ComponentSampleModel equals/hashcode use numBands twice

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: client-libs
    • Subcomponent:
      2d
    • Resolved In Build:
      b15

      Description

      SonarCloud reports the problem in ComponentSampleModel.equals:
        Correct one of the identical sub-expressions on both sides of operator "&&"

      ...near "this.numBands == that.numBands". It is checked twice. hashCode also processes it twice.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: