[ http://issues.apache.org/jira/browse/AXIS2-241?page=comments#action_12330323 ]
Eran Chinthaka commented on AXIS2-241: -------------------------------------- Hacking OM !!! Yeah, I agree on this. The methods you have mentioned are being used by the builders, which are in a separate package. And if you try to validate the stuff within the methods, we definitely lose the perf stuff as those are frequently invoked by our "fast" builders I agree that we have a prolem and think we need to think abt this carefully. Do you have any suggestions. Good point anyway. > AXIOM exposes interface functions that should be implementation details > ----------------------------------------------------------------------- > > Key: AXIS2-241 > URL: http://issues.apache.org/jira/browse/AXIS2-241 > Project: Apache Axis 2.0 (Axis2) > Type: Improvement > Components: om > Versions: 0.91 > Reporter: Eric Johnson > > The OMNode interface includes functions like: > public void setNextSibling(OMNode node); > public void setPreviousSibling(OMNode previousSibling); > public void setParent(OMContainer element); > public void setComplete(boolean state); > public void setType(int nodeType) throws OMException; > OMContainer includes: > public void setComplete(boolean state); > public void setFirstChild(OMNode omNode); > The availability of these functions in the interface means that clients can > accidentally or intentionally misbehave and corrupt the data structures. > For example, intentional corruption: > OMNode next = om.getNextSibling(); > om.detach(); > next.setPreviousSibling(om); > Or the accidental: > OMElement parent = theParent; > OMNode lastChild = parent.getLastChild(); > lastChild.setNextSibling(theNewSibling); // you might reasonably think that > this will insert into parent! > Where possible, these functions ought to be defined in a package visible > interface particular to the implementation package, so that only the > implementation can alter crucial details that affect the integrity of the > tree structure. -- 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
