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

Wrong exception is thrown while trying to set a Null or invalid Display mode

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Resolved In Build:
      tiger
    • CPU:
      x86
    • OS:
      windows_2000
    • Verification:
      Verified

      Description

      Java -version

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


      Try to set a display mode which is not available in the system it should throw IllegalArguementException(according to API doc).Instead,it throws an AWT Error which is as follows

      Exception in thread "main" java.lang.InternalError: Could not set display mode
       at sun.awt.Win32GraphicsDevice.configDisplayMode(Native Method)
       at sun.awt.Win32GraphicsDevice.setDisplayMode(Win32GraphicsDevice.java:300)
       at Test1.main(Test1.java:20)

      Please try running the attached program "Test1.java".

      Similarly ,if we Try to set a "null"display mode,it should throw IllegalArguementException.Instead,it throws Null Pointer Exception which is as follows:

      java.lang.NullPointerException
      at sun.awt.Win32GraphicsDevice.isDisplayModeAvailable(Win32GraphicsDevice.java:345)
      at sun.awt.Win32GraphicsDevice.setDisplayMode(Win32GraphicsDevice.java:296)
      at Test.main(Test.java:20)

      Please try running the attached program "Test.java".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chaasesunw Chet Haase (Inactive)
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: