The title says it all: if I specify bound properties in my castor
options, Castor will generate bean property change support, despite
the fact that these classes have no changeable fields, and since their
constructor is private, they also cannot (and should not) be
subclassed.

I believe that these methods (addPropertyChangeListener,
removePropertyChangeListener, and notifyPropertyChangeListener) should
not be added to these classes. (Related, I also believe that the
internal field "_type" should be declared final.)

Why am I complaining about this?

I have code that examines Castor-generated code via reflection to see
whether a particular property is itself a Java bean. It does this by
looking for the "addPropertyChangeListener" method. If this method is
found, a property change listener is added.

Unfortunately, my code mistakes the Castor-generated "types" constants
for changeable Java beans. Since these constants are also referred to
by static member variables, adding a listener to them results in a
humongous memory leak that quickly leads to out-of-memory errors.

- Godmar

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to