Uploaded image for project: 'Commons Digester'
  1. Commons Digester
  2. DIGESTER-38

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 4519

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dmartin@altoweb.com David H. Martin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: