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

AWT spec for Frame.setState(int state)/Frame.getState() are reversed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0, 1.2.1
    • docs
    • generic, sparc
    • generic, solaris_2.5



      Name: dsC58869 Date: 09/21/98



      SRC:
      ...
       * @(#)Frame.java 1.94 98/09/09
      ...
          /**
           * Sets the state of this frame.
           * @return state <code>Frame.ICONIFIED</code> if frame in iconic state;
           * <code>Frame.NORMAL</code> if frame is in normal state.
           * @see java.awt.Frame#getState
           */
          public synchronized void setState(int state) {
              this.state = state;
              FramePeer peer = (FramePeer)this.peer;
              if (peer != null) {
                  peer.setState(state);
              }
          }
      ...

      But the method returns void.
      Besides, the documentation for the setState(int state) method doesn't
      describe it's behaviour if state is neither Frame.NORMAL nor Frame.ICONIFIED.

      ======================================================================
      similar to (IncidentManager ID): 42492

      The Java source of awt/Frame.setState(..)
      resp. Frame.getState has a wrong description in its javadoc api:
      /**
           * Sets the state of this frame.
           * @return state <code>Frame.ICONIFIED</code> if frame in iconic state;
           * <code>Frame.NORMAL</code> if frame is in normal state.
           * @see java.awt.Frame#getState
           */
          public synchronized void setState(int state) {
              this.state = state;
              FramePeer peer = (FramePeer)this.peer;
              if (peer != null) {
                  peer.setState(state);
              }
          }

          /**
           * Gets the state of this frame.
           * @param <code>Frame.ICONIFIED</code> if this frame is in iconic state;
           * <code>Frame.NORMAL</code> if this frame is in normal state.
           * @see java.awt.Frame#setState
           */

      There is a wrong @return/@param description and the
      parameter/return value description of setState and getState is
      the same.

      ======================================================================
       Justification:
      Wrong specification.

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

            shainessunw Suzette Haines (Inactive)
            dsilaev Dmitri Silaev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: