Commons Digester
  1. Commons Digester
  2. DIGESTER-118

ObjectCreateRule shouldn't keep className as a field

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      Currently ObjectCreateRule refers to the class by using the name, but this is highly undesirable.

      1. "begin" uses the classloader that loaded Digester to resolve this class name, but this won't work in multi-classloader environment (like IDE, Maven, etc.)
      2. "begin" invokes the loadClass method each time a new object is created. This is unnecessary performance hit.

      The proper thing to do is to retain the Class object, and convert String to Class in the constructor.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1420d 10h 13m 1 Simone Tripodi 23/Jun/11 15:09
        Resolved Resolved Closed Closed
        12d 20h 40m 1 Simone Tripodi 06/Jul/11 11:50
        Simone Tripodi made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Simone Tripodi added a comment -

        included in Apache Commons Digester 3.0 release

        Show
        Simone Tripodi added a comment - included in Apache Commons Digester 3.0 release
        Simone Tripodi made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Simone Tripodi [ simone.tripodi ]
        Fix Version/s 3.0 [ 12316679 ]
        Resolution Fixed [ 1 ]
        Hide
        Simone Tripodi added a comment -

        The fix contains a little variant respect to the proposed suggestion: users can still create classes by specifying just the class name, but when passed the Class object in the constructor, it doesn't need to be load dynamically.
        See org.apache.commons.digester3.ObjectCreateRule r1138914

        Show
        Simone Tripodi added a comment - The fix contains a little variant respect to the proposed suggestion: users can still create classes by specifying just the class name, but when passed the Class object in the constructor, it doesn't need to be load dynamically. See org.apache.commons.digester3.ObjectCreateRule r1138914
        Kohsuke Kawaguchi created issue -

          People

          • Assignee:
            Simone Tripodi
            Reporter:
            Kohsuke Kawaguchi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development