You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2009/09/08 18:53:57 UTC

[jira] Commented: (AXIS2-4463) Unreachable code in JAXBAttachmentUnmarshaller

    [ https://issues.apache.org/jira/browse/AXIS2-4463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752603#action_12752603 ] 

Rich Scheuerle commented on AXIS2-4463:
---------------------------------------

I agree that the code is dead code.  

The purpose of the JAXBAttachmentUnmarshaller is to access the DataHandler for the MTOM attachment so that it can be handed to the JAXB unmarshaling engine.

The purpose of the dead code was to ensure that the underlying reader used inlining (thus avoiding the JAXBAttachmentUnmarshaller work) in some cases.  I see that a code mistake was made, and the best solution right now is to remove the dead code.  

I am finishing my testing and then I will commit.

> Unreachable code in JAXBAttachmentUnmarshaller
> ----------------------------------------------
>
>                 Key: AXIS2-4463
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4463
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: jaxws
>            Reporter: Andreas Veithen
>            Assignee: Rich Scheuerle
>            Priority: Minor
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.