You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Toshiro Takase (JIRA)" <ji...@apache.org> on 2006/12/06 16:48:21 UTC

[jira] Created: (WSCOMMONS-136) OMElement.setFirstChild() can break the AXIOM tree

OMElement.setFirstChild() can break the AXIOM tree
--------------------------------------------------

                 Key: WSCOMMONS-136
                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-136
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
         Environment: Windows
            Reporter: Toshiro Takase
            Priority: Critical


It seems that OMElementImpl.setFirstChild has strange behavior.
Let's see,,,
-----
OMElement parent = .....
OMElement a = .....
OMElement b = .....
OMElement c = .....

parent.addChild(a);
parent.addChild(b);
parent.addChild(c);

parent.setFirstChild(b);
-----
Then, what happens?
In current implementation, the first child of "parent" is "b".
The previous sibling of "b" is still "a".
The next sibling of "b" is "c"....

Is this correct behavior?
Or in the setFirstChild method , "b" should be detached before "b" is set as first element?
The original first child "a" should be 2nd child?
What is the correct semantics of setFirstChild method?


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (WSCOMMONS-136) OMElement.setFirstChild() can break the AXIOM tree

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-136?page=all ]

Eran Chinthaka resolved WSCOMMONS-136.
--------------------------------------

    Resolution: Fixed

Resolving as per last user comment

> OMElement.setFirstChild() can break the AXIOM tree
> --------------------------------------------------
>
>                 Key: WSCOMMONS-136
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-136
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Windows
>            Reporter: Toshiro Takase
>            Priority: Critical
>
> It seems that OMElementImpl.setFirstChild has strange behavior.
> Let's see,,,
> -----
> OMElement parent = .....
> OMElement a = .....
> OMElement b = .....
> OMElement c = .....
> parent.addChild(a);
> parent.addChild(b);
> parent.addChild(c);
> parent.setFirstChild(b);
> -----
> Then, what happens?
> In current implementation, the first child of "parent" is "b".
> The previous sibling of "b" is still "a".
> The next sibling of "b" is "c"....
> Is this correct behavior?
> Or in the setFirstChild method , "b" should be detached before "b" is set as first element?
> The original first child "a" should be 2nd child?
> What is the correct semantics of setFirstChild method?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (WSCOMMONS-136) OMElement.setFirstChild() can break the AXIOM tree

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-136?page=comments#action_12457182 ] 
            
Eran Chinthaka commented on WSCOMMONS-136:
------------------------------------------

Hi Toshiro,

You have a valid point, to some extent. Let me explain.

That method is a restrictive method but a required method, when you manipulate the OM structure, knowing what you are doing. We did not want, all the magic to happen behind the scene when you call this method. Meaning we assumed, user is calling that method, and handling the rest of the logic associated with it. 

We didn't want to put that method in the OMElement interface, as that was considered an interface visible, the most, to the user.  So we put that method in to OMContainerEx interface. 

But when I looked at the OMElement interface, I can still see setFirstChild method inside OMElement interface. It is wrong and it should appear only on OMContainerEx interface only.  I will be deprecating the method inside OMElement, to fix the problem. 

> OMElement.setFirstChild() can break the AXIOM tree
> --------------------------------------------------
>
>                 Key: WSCOMMONS-136
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-136
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Windows
>            Reporter: Toshiro Takase
>            Priority: Critical
>
> It seems that OMElementImpl.setFirstChild has strange behavior.
> Let's see,,,
> -----
> OMElement parent = .....
> OMElement a = .....
> OMElement b = .....
> OMElement c = .....
> parent.addChild(a);
> parent.addChild(b);
> parent.addChild(c);
> parent.setFirstChild(b);
> -----
> Then, what happens?
> In current implementation, the first child of "parent" is "b".
> The previous sibling of "b" is still "a".
> The next sibling of "b" is "c"....
> Is this correct behavior?
> Or in the setFirstChild method , "b" should be detached before "b" is set as first element?
> The original first child "a" should be 2nd child?
> What is the correct semantics of setFirstChild method?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (WSCOMMONS-136) OMElement.setFirstChild() can break the AXIOM tree

Posted by "Toshiro Takase (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-136?page=comments#action_12457315 ] 
            
Toshiro Takase commented on WSCOMMONS-136:
------------------------------------------

I understood. And I verified your changes.
Thank you very much for your explanation and fix, Eran.


> OMElement.setFirstChild() can break the AXIOM tree
> --------------------------------------------------
>
>                 Key: WSCOMMONS-136
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-136
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Windows
>            Reporter: Toshiro Takase
>            Priority: Critical
>
> It seems that OMElementImpl.setFirstChild has strange behavior.
> Let's see,,,
> -----
> OMElement parent = .....
> OMElement a = .....
> OMElement b = .....
> OMElement c = .....
> parent.addChild(a);
> parent.addChild(b);
> parent.addChild(c);
> parent.setFirstChild(b);
> -----
> Then, what happens?
> In current implementation, the first child of "parent" is "b".
> The previous sibling of "b" is still "a".
> The next sibling of "b" is "c"....
> Is this correct behavior?
> Or in the setFirstChild method , "b" should be detached before "b" is set as first element?
> The original first child "a" should be 2nd child?
> What is the correct semantics of setFirstChild method?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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