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

Redundant Math.ceil in StyleSheet.ListPainter#drawShape

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 24
    • 12, 24
    • client-libs
    • 12
    • b09

    Description

      There is a suspicious to the Math.ceil method with integer argument. Calling Math.ceil with integer argument is useless - it will just return the same passed value.

      https://github.com/openjdk/jdk/blob/d10afa26e5c59475e49b353ed34e8e85d0615d92/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java#L2394

      javax.swing.text.html.StyleSheet.ListPainter#drawShape

          int y = Math.max(ay, ay + (int)Math.ceil(ah/2));

      'ah' is 'int'

      Seems we should remove it.

      Attachments

        Issue Links

          Activity

            People

              psadhukhan Prasanta Sadhukhan
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: