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

Solaris: Toolkit.getSystemClipboard().setContents(null, null) should throw NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.1
    • 1.4.0
    • client-libs
    • None
    • ladybird
    • sparc
    • solaris_8

        I use the following test:

        ----------------------------------------------------------------------------
        import java.awt.Toolkit;

        public class Test {
            public static void main(String[] args) {
                Toolkit.getDefaultToolkit().getSystemClipboard().setContents(null, null);
            }
        }
        -----------------------------------------------------------------------------

        To test the following builds:

        Solaris:

          java version "1.2.2"
          Classic VM (build JDK-1.2.2-W, green threads, sunwjit)

          java version "1.3.0"
          Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
          Classic VM (build 1.3.0-C, native threads, nojit)

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

        Win32:

          java version "1.2.2"
          Classic VM (build JDK-1.2.2-W, native threads, symcjit)

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

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

        Here are the results of testing:

                 Win32 Solaris
        1.2.2 NPE no NPE
        1.3 NPE NPE
        1.4 NPE no NPE

        On Solaris NPE is introduced with the fix for 4285236 and then
        eliminated with Roger's rewrite for 4289735. Currently it doesn't
        throw NPE when setting null contents, but it throws NPE when the
        contents is requested by another application after that.

        The Solaris behavior should be changed to throw an NPE just like Windows does.

              dmendenhsunw David Mendenhall (Inactive)
              dmendenhsunw David Mendenhall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: