...
*developing custom implementations of the writeObject()
, writeReplace()
, and writeExternal()
methods that prevent sensitive fields from being written to the serialized stream.
*defining the serialPersistentFields
array field and ensuring that sensitive fields are omitted from the array. (See rule SER00-J. Maintain Enable serialization compatibility during class evolution.)
Noncompliant Code Example
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e2043fa3ca20731d-cdf6be83-43d9426a-8e678d94-27257a1180a5af955a4486ef"><ac:plain-text-body><![CDATA[ | [[Bloch 2005 | AA. References#Bloch 05]] | Puzzle 83. Dyslexic monotheism | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5ea952d4eec9a4cd-cb86ede7-4a414c39-b2c4bedf-eea3b23d5292e4cee8d5271d"><ac:plain-text-body><![CDATA[ | [[Bloch 2001 | AA. References#Bloch 01]] | Item 1. Enforce the singleton property with a private constructor | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5958a5ac7f60d41c-8c9511c1-4128464e-b8f9a02c-8af61115a38c6fdd08e89091"><ac:plain-text-body><![CDATA[ | [[Greanier 2000 | AA. References#Greanier 00]] | [Discover the Secrets of the Java Serialization API | http://java.sun.com/developer/technicalArticles/Programming/serialization/] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6e7f914cbd8c3acf-0fd1343b-4cf547f0-a0d5bf55-eddb0d2c7b995b8cd2ef1a20"><ac:plain-text-body><![CDATA[ | [[Harold 1999 | AA. References#Harold 99]] |
| ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="335aeed75de575fd-b873aac2-48744bec-85ffb9ef-9d304e26cb7c7f8c97ea5d19"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. References#JLS 05]] | [Transient Modifier | http://java.sun.com/docs/books/jls/third_edition/html/classes.html#37020] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="390900fd6b04703b-705ba74f-4e344818-9447a356-4b69a50718f5de307c2f7632"><ac:plain-text-body><![CDATA[ | [[Long 2005 | AA. References#Long 05]] | Section 2.4, Serialization | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="613cd9fe96a461a1-70eec054-46254c87-83ebbdb3-d3daa0cdd69846cb69f6913f"><ac:plain-text-body><![CDATA[ | [[Sun 2006 | AA. References#Sun 06]] | Serialization Specification, A.4, Preventing Serialization of Sensitive Data | ]]></ac:plain-text-body></ac:structured-macro> |
...