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

JProgressBar.getString() return incorrect progress string value



      Name: ooR10001 Date: 06/18/2001


      By default, javax.swing.JProgressBar has null progress string value. But
      getString() method does not return null. It contradicts with current JavaDoc.

      Javadoc for JProgressBar says:

      -------------------------------------------
      getString

      public String getString()

            Returns the current value of the progress string.
            ........... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ---------------------------------------------------
      setString

      public void setString(String s)

            Sets the value of the progress string. By default, this string is null.
            .......... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      -------------------------------------------

      This test shows a bug:

      ----------- test.java ------------
      import javax.swing.JProgressBar;

      public class test {

        public static void main(String[] args) {
            JProgressBar c = new JProgressBar();
            if (c.getString() == null) {
                System.out.println("OKAY");
            } else {
                System.out.println("FAILED");
            }
        }

      }
      ----------------------------------

      Output:
      -----------------------------
      % java -version

      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

      % java test

      FAILED
      -----------------------------

      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            oovsunw Oov Oov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: