[lworld] InvalidObjectException should be thrown when --enable-preview

XMLWordPrintable

      Java.time classes use a serialization proxy for the serialized form.
      Several classes have been migrated to value classes when --enable-preview.
      The java.time classes themselves are not serialized and cannot be deserialized.
      A test that artificially creates a stream with a serialized object and tries to de-serialize it, expecting `InvalidObjectException`.

      The normal deserialization sequence creates an instance and invokes `readObject`. The `readObject` method for classes with this kind of proxy explicitly throws `InvalidObjectException` if it is invoked.

      For a migrated value class, the instance is not/can not be created and its `readObject` method cannot be invoked.

      Attempts to deserialize a value class should generally result in an `InvalidClassException`.
      Tests that attempt to deserialize a value class that is using a serialization proxy should expect to see an `InvalidClassException`.

            Assignee:
            Roger Riggs
            Reporter:
            Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: