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

BasicSpinnerUI.SpinnerLayout implementation of removeLayoutComponent() incorrect

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.4.2_03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
      Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
      and
      java version "1.5.0_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Linux daisy.home.lan 2.4.22-26mdk #1 Wed Jan 7 10:47:21 MST 2004 i686 unknown unknown GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      The removeLayoutComponent() method in the BasicSpinnerUI.SpinnerLayout class contains the following implementation:

      public void removeLayoutComponent(Component c) {
      if (c == nextButton) {
      c = null;
      }
      else if (c == previousButton) {
      previousButton = null;
      }
      else if (c == editor) {
      editor = null;
      }
      }

      Note that the 'true' condition for the first 'if' clause is a no-op. The statement should be:

      nextButton = null;


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Problem is self-evident in source code.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            shickeysunw Shannon Hickey (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: