Cleanup redundant Math.max/min calls in DefaultHighlighter

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 18
    • Affects Version/s: 17, 18
    • Component/s: client-libs
    • None

      Method javax.swing.text.DefaultHighlighter#changeHighlight
      ```
              if (p1 < p0) {
                  throw new BadLocationException("Invalid end of the range", p1);
              }
              ...
              safeDamageRange(Math.min(p0, p1), Math.max(p0, p1));
      ```
      This Math.max and Math.min calls are redundant, because order of p0 and p1 is checked in method pre-conditions.
      Checks were added under JDK-6771184

            Assignee:
            Andrey Turbanov
            Reporter:
            Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: