Community
Participate
Working Groups
Starting with JDK1.2, it is possible to declare explicitely which fields you want to see serialized by defining an array of ObjectStreamField objects describing these fields. The prototype for this special field is: private static final ObjectStreamField[] serialPersistentFields = { ... }; If you specify as a Java compiler option that you want to flag unused private types as a warning, this field is invariably flagged. I believe the behavior should be similar to the one for the 'serialVersionUID' field, which is not flagged even if it is never explicitely read by the code.
Agreed. We did not know about this special one. We will add it to the list of special cases. Thanks for the info.
Added NegativeTest#test410
Verified in I200403230010.