Details
-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0
-
Component/s: Converters
-
Labels:None
Description
(Suggested by Brian Slesinsky for XSTR-14).
I was sort of thinking that an XML file originally written using PureJavaReflectionProvider might be read with Sun14ReflectionProvider (for example, on a different machine), so it doesn't hurt to have the fields present, but perhaps that doesn't make sense.
I don't like the current behavior without the patch (skipping final instance fields). That means xstream silently creates a bad file that results in incorrect objects when the file is deserialized. Maybe PureJavaReflectionProvider should throw an exception if a final instance field is encountered during serialization, since it won't be able to correctly restore the object? If it turns out that the final field really doesn't need to be serialized, it should marked as transient.