Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4935607
Votes 0
Synopsis RFE: LTP: Should be possible to set the TRANSIENT attribute of propertiies to FALSE.
Category java:classes_beans
Reported Against 1.4.2
Release Fixed 7(b27)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 6381469 , 6608180
Submit Date 10-OCT-2003
Description


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  customer  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) 
======================================================================
Posted Date : 2005-10-24 08:41:55.0
Work Around
N/A
Evaluation
Making transient FALSE explicit to mean that the property is not transient is a good idea. Not too difficult. Commit to Dragonfly.
  xxxxx@xxxxx   2003-10-31
We can use the Transient annotation from JSR 273.
Posted Date : 2007-09-17 16:19:34.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang