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

SuperWord::fix_commutative_inputs checks in_bb(fin1) instead of in_bb(fin2)

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b66
    • Introduced In Version:
      9
    • Resolved In Build:
      b08

      Description

      SonarCloud instance reports a problem here:
      "Identical sub-expressions on both sides of operator "&&"."

        bool swapped = false;

        if (in_bb(gin1) && in_bb(gin2) && in_bb(fin1) && in_bb(fin1)) { // <----
          if (same_origin_idx(gin1, fin1) &&
              same_origin_idx(gin2, fin2)) {
            return true; // nothing to fix
          }

      I believe it should have been "in_bb(fin1) && in_bb(fin2)".

      Seems to be that way since JDK-8076284.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kvn Vladimir Kozlov
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: