Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: "a static inner class" contradicts to the definition of "inner classes". changed to "a static member class".

...

Code Block
bgColor#ccccff
public class OuterSer implements Serializable {
  private int rank;
  class InnerSer {
    protected String name;
    //...
  }
}

Compliant Solution

The inner member class may be declared static to prevent its serialization. A static inner member class may also implement Serializable.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1c3d430983fdd371-83e6c613-4a3941b0-abddbbb4-c6775fa0558011208de2b125"><ac:plain-text-body><![CDATA[

[[API 2006

AA. References#API 06]]

[Interface Externalizable

http://download.oracle.com/javase/6/docs/api/java/io/Externalizable.html]

]]></ac:plain-text-body></ac:structured-macro>

 

Interface Serializable

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9db3a70869b52716-c134c842-474a446d-b04492c8-354ec14a45732e68722cfdf6"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. References#Bloch 08]]

Item 74: "Implement serialization judiciously"

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="deda21cbe3387083-a5b83f27-4ab14272-ac2b835c-9b0b24070e51e598f27dc0a9"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. References#JLS 05]]

[Section 8.1.3, Inner Classes and Enclosing Instances

http://java.sun.com/docs/books/jls/third_edition/html/classes.html]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="87b65fb07cdc35c6-64bf555c-48d74bdd-8e43ae4c-03f8f69c8f7bb8ac3d86d30f"><ac:plain-text-body><![CDATA[

[[Sun 2006

AA. References#Sun 06]]

"Serialization specification", [Section 1.10 The Serializable Interface

http://download.oracle.com/javase/6/docs/platform/serialization/spec/serial-arch.html#4539]

]]></ac:plain-text-body></ac:structured-macro>

...