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

Cleanup redundant Math.max/min calls in DefaultHighlighter

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P5
    • Resolution: Fixed
    • 17, 18
    • 18
    • client-libs
    • None

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: