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

        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
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development