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

JWindow(Window [, *]) does not comply to CCC

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description



      Name: sdR10048 Date: 11/09/2000


      Two constructors
        javax.swing.JWindow(Window owner) and
        javax.swing.JWindow(Window owner, GraphicsConficuration gc)
      have headless behaviour different from CCC #4281163.
      In CCC both constructors should throw IllegalArgumentException (in
      headless implementation).
      But according to JDK1.4 javadoc 1st constructor throws
      HeadlessException, second one - IllegalArgumentException (and at the
      same time "throws HeadlessException" is noted):

      public JWindow(Window owner,
                     GraphicsConfiguration gc)
              throws HeadlessException
                     ^ ^

      Here is spec from CCC #4281163,
      http://javaweb.eng/~martak/headless/javax_swing_JWindow.html:

          /**
           * Creates a window with the owner and the specified
           * <code>GraphicsConfiguration</code> of a screen device.
           * @param owner the window to act as owner
           * @exception IllegalArgumentException if owner is <code>null</code>.
           * This exception is always thrown when
           * GraphicsEnvironment.isHeadless() returns true.
           *
           * @see java.awt.GraphicsEnvironment#isHeadless
           * @since 1.3
           */
          public JWindow(Window owner);

          /**
           * Creates a window with the owner and the specified
           * <code>GraphicsConfiguration</code> of a screen device.
           * @param owner the window to act as owner
           * @param gc the <code>GraphicsConfiguration</code> that is used
           * to construct the new <code>Window</code>;
           * if <code>gc</code> is <code>null</code>, the system
           * default <code>GraphicsConfiguration</code> is assumed
           * @exception IllegalArgumentException if owner is <code>null</code>
           * @exception IllegalArgumentException if <code>gc</code> is not from
           * a screen device. This exception is always thrown when
           * GraphicsEnvironment.isHeadless() returns true.
           *
           * @see java.awt.GraphicsEnvironment#isHeadless
           * @since 1.3
           */
          public JWindow(Window owner, GraphicsConfiguration gc);



      JDK1.4 javadoc says:

      public JWindow(Window owner)
              throws HeadlessException

           Creates a window with the specified owner window. If owner is null, the
           shared owner will be used and this window will not be focusable.
           Parameters:
                owner - the window from which the window is displayed
           Throws:
                HeadlessException - if GraphicsEnvironment.isHeadless() returns
                true.
           See Also:
                GraphicsEnvironment.isHeadless(), isFocusableWindow()



      public JWindow(Window owner,
                     GraphicsConfiguration gc)
              throws HeadlessException

           Creates a window with the specified owner window and
           GraphicsConfiguration of a screen device. If owner is null, the shared
           owner will be used and this window will not be focusable.
           Parameters:
                owner - the window from which the window is displayed
                gc - the GraphicsConfiguration that is used to construct the new
                window with; if gc is null, the system default GraphicsConfiguration
                is assumed
           Throws:
                IllegalArgumentException - if gc is not from a screen device. This
                exception is always thrown when GraphicsEnvironment.isHeadless()
                returns true
           Since:
                1.3
           See Also:
                GraphicsEnvironment.isHeadless(), isFocusableWindow()

      --------------------------------------------------
      Note: http://javaweb.eng/~martak/headless/javax_swing_JWindow.html
      declares two different exceptions (HeadlessException &
      IllegalArgumentException) for constructors of one class. Some sort of
      inconsistency.

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

        Attachments

          Activity

            People

            • Assignee:
              mmartaksunw Michael Martak (Inactive)
              Reporter:
              dsvsunw Dsv Dsv (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: