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

Reg. ClassCastException thrown in JInternalFrame constructor in headless mode

    Details

    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, solaris_8

      Description

      JInternalFrame constructor throws ClassCastException, in headless mode. This is a regression in mustang b32. The exception is not thrown till b31.

      To reproduce, run the code below in headless mode (-Djava.awt.headless=true):

      import javax.swing.*;

      public class Test {

          public static void main(String[] args) {
              try {
                  JInternalFrame jif = new JInternalFrame("TEST");
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }

      The exception thrown is as follows:
      java.lang.ClassCastException: sun.awt.HeadlessToolkit cannot be cast to sun.awt.SunToolkit
              at javax.swing.RepaintManager.getPaintManager(RepaintManager.java:1147)
              at javax.swing.RepaintManager.doubleBufferingChanged(RepaintManager.java:1116)
              at javax.swing.JRootPane.setDoubleBuffered(JRootPane.java:329)
              at javax.swing.JRootPane.<init>(JRootPane.java:318)
              at javax.swing.JInternalFrame.createRootPane(JInternalFrame.java:300)
              at javax.swing.JInternalFrame.<init>(JInternalFrame.java:277)
              at javax.swing.JInternalFrame.<init>(JInternalFrame.java:220)

      The bug is caught by AWT Headless_BAT testsuite. The full testsuite error log also attached.
      ###@###.### 2005-04-21 06:57:43 GMT

      ==============================
      Many JCK 1.5a Runtime tests fail in headless mode in the same way.

      api/javax_swing/JInternalFrame/JDesktopIcon/AccessibleJDesktopIcon/index.html#AccessibleValue
      api/javax_swing/JInternalFrame/AccessibleJInternalFrame/index.html#AccessibleValue
      api/javax_swing/JRootPane/index.html#protected
      api/javax_swing/JRootPane/RootLayout/index.html#preferred
      api/javax_swing/JRootPane/RootLayout/index.html#minimum
      api/javax_swing/JRootPane/RootLayout/index.html#maximum
      api/javax_swing/JButton/index.html#misc
      api/javax_swing/JLayeredPane/descriptions.html#protected
      api/javax_swing/JRootPane/index.html#decoration
      api/javax_swing/event/InternalFrameEvent/index.html#Ctor
      api/javax_swing/DefaultDesktopManager/descriptions.html#xxxFrame



      ###@###.### 2005-05-03 00:30:27 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                svioletsunw Scott Violet (Inactive)
                Reporter:
                gramachasunw Girish Ramachandran (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: