ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Scheuerle (JIRA)" <j...@apache.org>
Subject [jira] Work started: (WSCOMMONS-286) getChildrenWithQName.next throws ClassCastException, OMChildrenQNameIterator implements Iterator but does not satisfy published interface behavior
Date Thu, 06 Mar 2008 18:14:58 GMT

     [ https://issues.apache.org/jira/browse/WSCOMMONS-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Work on WSCOMMONS-286 started by Rich Scheuerle.

> getChildrenWithQName.next throws ClassCastException, OMChildrenQNameIterator implements
Iterator but does not satisfy published interface behavior
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-286
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-286
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: OS : Any
> Axiom Version 1.2.5
> Java Runtime version : 1.5
>            Reporter: Bhaskar Maddala
>            Assignee: Rich Scheuerle
>            Priority: Blocker
>         Attachments: _286.diff
>
>
> Given the following xml fragment
>         <ns1:BOSettings xmlns:ns1="http://a.b.c/pro">
>                 <ns1:ObjectType>X</ns1:ObjectType>
>         </ns1:BOSettings>
> Iterator objectTypeIt = bosettings.getChildrenWithName(helper.createQNameForField("ObjectType"));
> invoking 
> OMElement element = objectTypeIt.next();
>  throws a ClassCastException
> the OMChildrenQNameIterator return the first child which in this case is of type OMText
> the issue can be fixed by first calling hasNext and then next, the hasNext method has
a side effect which allows the next to proceed correctly.
> This behavior does not obey the published Iterator documentation, the following is expected
Iterator behavior
> Iterator<Integer> it = Arrays.asList(new Integer[] { Integer.valueOf(1), Integer.valueOf(2),});
> do
> {
>    it.next();
> } while(it.hasNext());
> will work correctly and is the expected behavior.
> Whereas calling it.next on an Iterator instance of type OMChildrenQNameIterator will
result in a ClassCastException

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


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


Mime
View raw message