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

ArrayList.subList() does not return a serializable object

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.0, 5.0, 6u10
    • core-libs



      Name: rmT116609 Date: 11/21/2002


      DESCRIPTION OF THE PROBLEM :
      subList() of array list return an non serializable object. It causes us problems when we tried to pass a sub list of array list to an ejb session bean method. By studying the source code of JDK, we found that return object is of an
      internal class called SubList which extends AbstractList. And AbstractList does not implement serializable.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I understand we can have a workround for this simply new an new array list. However, I believe JDK should perserve the serializblablity by checking it and return it accordingly.

      CUSTOMER WORKAROUND :
      new an array list of the result of subList()
      (Review ID: 166754)
      ======================================================================

            jjb Josh Bloch (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: