castor

remove bean-* property methods from *.types.* classes

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1.2
  • Component/s: XML code generator
  • Labels:
    None
  • Number of attachments :
    2

Description

The classes in the .types. hierarchy have addPropertyChangeListener, removePropertyChangeListener, etc. methods.

These methods are unnecessary, because those objects are essentially immutable.

If those methods are there, code may mistake those objects for Java beans. Applications that automatically add listeners for objects they consider Java beans may then suffer from memory leaks because each object is also referred to from a static variable.

Related, the _type field should be final for better documentation.

See also http://www.mail-archive.com/user@castor.codehaus.org/msg04278.html

  1. patch.c1921.20070425.txt
    25/Apr/07 7:27 AM
    0.8 kB
    Werner Guttmann
  2. patch.cprop.20070424.txt
    25/Apr/07 5:43 AM
    1 kB
    Werner Guttmann

Activity

Hide
Werner Guttmann added a comment -

Initial patch for review.

Show
Werner Guttmann added a comment - Initial patch for review.
Hide
Werner Guttmann added a comment -

Attached patch changes '_type' to be final, and removes all *PropertyChangeListener() methods for classes generated for enumerations.

Show
Werner Guttmann added a comment - Attached patch changes '_type' to be final, and removes all *PropertyChangeListener() methods for classes generated for enumerations.
Hide
Werner Guttmann added a comment -

Are you in a position to build the binaries yourself, or would you want me to upload a snapshot release for 1.1.2 to the Codehaus snapshot repository ?

Show
Werner Guttmann added a comment - Are you in a position to build the binaries yourself, or would you want me to upload a snapshot release for 1.1.2 to the Codehaus snapshot repository ?
Hide
Werner Guttmann added a comment -

Patch for review.

Show
Werner Guttmann added a comment - Patch for review.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: