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

java.awt.Component can't work normally after deserialization

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b27
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      JCK : JCK-runtime-6b b24
      J2SE : FAIL - jdk6u10 build 23, jdk 7 b26
      Platform[s] : FAIL - All
      switch/Mode : FAIL - any

      Changes in java.awt.Component near line 635:

          private transient final Object changeSupportLock = new Object();
          private Object getChangeSupportLock() {
              return changeSupportLock;
          }

      cause every call to synchronized (getChangeSupportLock()) for deserialized component to throw NPE, since changeSupportLock is transient and null for deserialized object.

      Affected JCK 6b tests:

      api/java_awt/serialization/descriptions.html#Component[testRead]
      api/java_awt/serialization/descriptions.html#Container[testRead]
      api/java_awt/serialization/descriptions.html#TextArea[testRead]
      api/java_awt/serialization/descriptions.html#TextComponent[testRead]



      Tests report:

      java.lang.NullPointerException
      at java.awt.Component.firePropertyChange(Component.java:8011)
      at java.awt.Component.setFocusTraversalKeys_NoIDCheck(Component.java:6895)
      at java.awt.Component.setFocusTraversalKeys(Component.java:6807)
      at java.awt.TextArea.readObject(TextArea.java:655)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:623)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:991)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1866)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
      at javasoft.sqe.javatest.lib.SerializeTest.read(SerializeTest.java:413)
      at javasoft.sqe.javatest.lib.SerializeTest.testRead(SerializeTest.java:308)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:623)
      at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:406)
      at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
      at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
      at javasoft.sqe.tests.api.java.awt.serialization.ComponentTests.main(ComponentTests.java:256)
      testRead: Failed. Test case throws exception: java.lang.NullPointerException

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dav Andrei Dmitriev (Inactive)
              Reporter:
              pastepan Pavel Stepanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: