Uploaded image for project: 'Axiom'
  1. Axiom
  2. AXIOM-110

Careless exception handling needs to be fixed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.9
    • None
    • None

    Description

      org.apache.axiom.om.impl.builder.StAXOMBuilder.next() catches all exceptions and rethrows them as OMExceptions (line 199) while other code assumes any OMExceptions just mean that the end of the document has been reached (for example, org.apache.axiom.om.impl.traverse.next(), line 117, which just sets a flag). This means that any coding errors which result in runtime exceptions will be masked.

      In the case I've been tracking, an error in org.apache.axiom.soap.impl.builder.SOAPBuilderHelper.processAttributes (not checking for a null namespace uri) resulted in a NullPointerException, which was masked by this code and led to an element being missing from Fault details.

      If this code needs to catch particular exceptions these exceptions should be individually checked. If this is impractical, at an absolute minimum this should check for a RuntimeException subclass and just rethrow it rather than masking it as an OMException.

      Attachments

        1. axis2-test-report.txt
          12 kB
          Andreas Veithen

        Issue Links

          Activity

            People

              veithen Andreas Veithen
              dsosnoski Dennis M. Sosnoski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: