You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Olve Sæther Hansen (Commented JIRA)" <ji...@apache.org> on 2011/10/10 10:30:29 UTC

[jira] [Commented] (AXIOM-333) getFirstChildWithName should not read the next element.

    [ https://issues.apache.org/jira/browse/AXIOM-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13123947#comment-13123947 ] 

Olve Sæther Hansen commented on AXIOM-333:
------------------------------------------

I see that this issue is long-fixed. It is not the issue I want to discuss, but the fix. Isn't removing protected variables from the iterator in the API-part of axiom considered an API-change? I use Abdera, which subclasses some iterators. I am forced to upgrade from 1.2.10 to 1.2.12 version of Axiom, and Abdera breaks.
I have reported a bug in Abdera  ABDERA-290, but now I am unsure whether it should be reported here instead. 

                
> getFirstChildWithName should not read the next element.
> -------------------------------------------------------
>
>                 Key: AXIOM-333
>                 URL: https://issues.apache.org/jira/browse/AXIOM-333
>             Project: Axiom
>          Issue Type: Improvement
>          Components: DOOM, LLOM
>            Reporter: Jose Antonio
>            Assignee: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.2.11
>
>
> When calling getFirstChildWithName operation over an element, it reads not only the first element, but the next also. I think that could be improved since the operation name semantics specifies that the caller is only interested in the first element and not the rest of them, so a iterator (the reason to read the next element) is useless here. Suppose the following scenario.
> <root-element>
>   <chlid-element att="value">
>      <sub-child-element>
>           -- very big content --
>      </sub-child-element>
>   </child-element>
> </root-element>
> I want to read the sub-child-element only in some cases depending on the 'value' attribute. If I call to getFirstElement I get the behaviour I want, since only the header is readed and I can skip and discard the message if it doesn't match. I get the behaviour that I would expect from a StaX parser and a getFirst* method, so I can discard the message quickly. Instead, getFirstElementWithName seems to call internally to getElementsWithName and returns the first occurence, which forces the parser to read the next element and (in this case) the complete big message.
> I think that the efficiency of that method could be improved since, for a StaX model, one expects that the parser only reads the minimal information needed to serve the request. Instead of calling to getElementsWithName, it would be better an implementation based on getFirstElement and then going through getNextOMSibling.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org