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

ArrayIndexOutOfBoundsException occurs when Container with overridden getComponents() is deserialized

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b38

      Backports

        Description

        If a subclass of java.awt.Container overrides getComponents(), and the object with overridden getComponents() is serialized and then deserialized, ArrayIndexOutOfBoundsException occurs.

        Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
                at java.awt.Container.readObject(Container.java:3733)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:483)
                at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
                at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
                at a.main(a.java:17)

        This problem does not occur in jdk6u81. This seems to be a regression.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                aivanov Alexey Ivanov
                Reporter:
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: