Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4463

Unreachable code in JAXBAttachmentUnmarshaller

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • jaxws
    • None

    Description

      While reviewing some code, I noticed that org.apache.axis2.datasource.jaxb.JAXBAttachmentUnmarshaller contains unreachable code. There are two places where the following if statement is used:

      if (xmlStreamReader instanceof OMXMLStreamReader) {
      ...
      }

      "xmlStreamReader" is an attribute of JAXBAttachmentUnmarshaller, but this attribute is never initialized and remains null (this is obviously a bug; see code in the constructor). Since "null instanceof X" is always false, the code inside the if statement is unreachable.

      Since this code is related to XOP/MTOM processing, I'm wondering how it is possible that MTOM actually works in JAX-WS (does it?). Also it would be interesting to analyze why this issue doesn't trigger any test failure.

      Attachments

        Issue Links

          Activity

            People

              scheu@us.ibm.com Rich Scheuerle
              veithen Andreas Veithen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: