Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5866

Create @AutoSerialize as an addition to @AutoExternalize

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.0.5, 2.0.6
    • None
    • None

    Description

      After playing with @AutoExternalize, I found out the hard way I cannot use Externalizable (due to XStream, long story), but using Serializable is possible.

      So, if Groovy has @AutoExternalize, why not have @AutoSerialize?

      The code would be pretty identical. Here are the changes:

      • no explicit no-argument constructor needed
      • private void readObject(ObjectInputStream) instead of public void readExternal(ObjectInput)
      • private void writeObject(ObjectOutputStream) instead of public void writeExternal(ObjectOutput)
      • no need to call super. {readObject|writeObject}

        FWIK, contrary to Externalizable.

      Attachments

        Activity

          People

            Unassigned Unassigned
            johann Johann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: