axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Shahi (JIRA)" <>
Subject [jira] Commented: (AXIS-1419) bug in getElementsByTagName of MessageElement
Date Tue, 26 Oct 2004 10:47:45 GMT
     [ ]
Ashutosh Shahi commented on AXIS-1419:

Jongjin, Dims

I am posting a new patch for the issue. The changes and observations on the same:
1. implemented processing of "*" for MessageElement.getElementsByTagName / MessageElement.getElementsByTagNameNS
2. implemented the preorder traversal in Element.getElementsByTagName . getElementByTagNameNS
is already implementing preorder traversal. But I am still doing it using recursive implementation
as opposed to iterative one used in 'DeepNodeImpl' of xerces implementation as that would
have meant too much of code change. Hope thats fine.
3. The above methods in SOAPDocumentImpl call the MessageElement metods in turn. So these
issue are automatically taken care for them.
4. Think i found a bug in getElementByTagName and getElementByTagNameNS methods of SOAPDocumentImpl
class. The header and body parts call the above methods of MessageElement, but the result
is never combined, we just have separate return statements for header and body parts. Shoudn't
the result from both of them be combined and then returned? Am posting the relevant code:

if (soapPart != null) {
                SOAPEnvelope soapEnv =
                    (org.apache.axis.message.SOAPEnvelope) soapPart
                SOAPHeader header =
                    (org.apache.axis.message.SOAPHeader) soapEnv.getHeader();
                if (header != null) {
                    return header.getElementsByTagName(localName);
                SOAPBody body =
                    (org.apache.axis.message.SOAPBody) soapEnv.getBody();
                if (body != null) {
                    return body.getElementsByTagName(localName);
            return null;


> bug in getElementsByTagName of MessageElement
> ---------------------------------------------
>          Key: AXIS-1419
>          URL:
>      Project: Axis
>         Type: Bug
>   Components: SAAJ
>     Versions: 1.2 Beta
>     Reporter: nishant kumar
>     Assignee: Davanum Srinivas
>  Attachments:, patch_1419.txt
> there is bug in the following method of MessageElement
> public NodeList getElementsByTagName(String name) {
> .....
>   // add 2nd Generation
>   for(int i =0; i < children.size(); i++){
>     nodelist.addChild((MessageElement)children.get(i));
>   }
> ....
> }
> first of all why should all the children be blindly added to the nodelist without making
any checks for the name.
> secondly why does one think that all the children will be instance of MessageElement
that one has once again blindly casted the children into MessageElement

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message