JDK-4935607 : RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE.
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-10-10
  • Updated: 2017-05-16
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b27Fixed
Related Reports
Relates :  
Description
Name: rmT116609			Date: 10/09/2003


A DESCRIPTION OF THE REQUEST :
The XMLEncoder currently uses the BeanInfo of a
class to decide whether or not a property should
be considered transient.

The property, as the value of a FeatureDescriptor
has three states Boolean.TRUE, Boolean.FALSE and null.
Currently they each behave as follows:

1. TRUE:  Property is transient.

2. FALSE: Same as null.

3. Null:  Defer to superclass. If all superclasses
          are null, the property is transient iff it
          doesn't have both a setter and getter.


I've recently implemented the following and found it
much more useful - and backward compatible:

2. FALSE:  Property is not transient.



JUSTIFICATION :
This let's the user fully control the extent to which
the XMLEncoder penetrates an object graph. If, for example,
there were no setContentPane() method in JFrame we would
not be able to use the XMLEncoder to archive JFrame even
though archives rarely (if ever) use the setContentPane()
method. In practice, archives of JFrames work by effectively
calling the getContentPane() method and modifying the resulting
component - which is the conventional programatic idiom too.

If the setContentPane() method did no exist, however, we'd
have no way to archive JFrame's using the XMLEncoder. The
fix above would allow a user to simply override the assumption
that the "contentPane" of a JFrame is transient and make it
non-transient instead.

The setContentPane() does exist in swing's JFrame - but this
is an example - it is very common for settters to be missing
in application classes.
(Incident Review ID: 207872) 
======================================================================

Comments
EVALUATION We can use the Transient annotation from JSR 273.
17-09-2007

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
14-06-2004

EVALUATION Making transient FALSE explicit to mean that the property is not transient is a good idea. Not too difficult. Commit to Dragonfly. ###@###.### 2003-10-31
31-10-2003