Commons Digester
  1. Commons Digester
  2. DIGESTER-38

Digester#parse() throws NullPointerException if unable to instantiate SAX parser

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      This was detected in Digester 1.1.1.
      The method "public XMLReader getReader()" returns null if it cannot instantiate
      a SAX parser. This is fine, but the public "parse" methods all contain
      variations of "getReader().parse(...)". If a SAX parser cannot be instantiated
      (which could happen if an incompatible SAX jar were in the classpath, for
      example), then the parse methods will throw NullPointerException.

      Suggested fixes:
      Either
      1) Change the public getReader() and getParser() methods to throw SAXException,
      instead of returning null, or
      2) Change the implementations of the parse methods to throw SAXException if
      getReader() returns null.

        Activity

        David H. Martin created issue -
        Hide
        Craig McClanahan added a comment -

        Fixed (finally).

        There is now a new getXMLReader() method that throws SAXException if the reader
        cannot be created, and the parse() methods use this instead of getReader().

        Show
        Craig McClanahan added a comment - Fixed (finally). There is now a new getXMLReader() method that throws SAXException if the reader cannot be created, and the parse() methods use this instead of getReader().
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 4519 12340160
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Digester [ 12310471 ]
        Component/s Digester [ 12311111 ]
        Key COM-9 DIGESTER-38
        Assignee Craig McClanahan [ craig.mcclanahan@sun.com ]
        Affects Version/s unspecified [ 12311647 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        1956d 1h 35m 1 Henri Yandell 09/Mar/07 20:39

          People

          • Assignee:
            Unassigned
            Reporter:
            David H. Martin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development