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

Minor copy/paste issue in BasicScrollBarUI

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b05
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      OpenJDK 14, but according to Swing developer's mailing list "This code snippet is part of the enhancement that has been added to support Nimbus L&F. It seems to be a bug as it is like this from initial commit for the enhancement."

      A DESCRIPTION OF THE PROBLEM :
      I came across the following code in javax.swing.plaf.basic.BasicScrollBarUI.installDefaults() :

                 if ("large".equals(scaleKey)){
                      scrollBarWidth *= 1.15;
                      incrGap *= 1.15;
                      decrGap *= 1.15;
                  } else if ("small".equals(scaleKey)){
                      scrollBarWidth *= 0.857;
                      incrGap *= 0.857;
                      decrGap *= 0.714;
                  } else if ("mini".equals(scaleKey)){
                      scrollBarWidth *= 0.714;
                      incrGap *= 0.714;
                      decrGap *= 0.714;
                  }

      In the "small" case, decrGap is multiplied by 0.714 instead of 0.857.
      Probably a copy/paste error.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Check code :-)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      decrGap *= 0.857;
      ACTUAL -
      decrGap *= 0.714;

      FREQUENCY : always


        Attachments

          Activity

            People

            Assignee:
            psadhukhan Prasanta Sadhukhan
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: