You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2004/10/14 20:50:17 UTC

cvs commit: ws-axis/java/src/org/apache/axis/message MessageElement.java NodeImpl.java

dims        2004/10/14 11:50:17

  Modified:    java/src/org/apache/axis/message MessageElement.java
                        NodeImpl.java
  Log:
  2 patches from nishant kumar (knishant@postmark.net) as part of
  AXIS-1497 - AXIS2: performance improvements
  
  Revision  Changes    Path
  1.184     +6 -0      ws-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.183
  retrieving revision 1.184
  diff -u -r1.183 -r1.184
  --- MessageElement.java	12 Oct 2004 13:52:13 -0000	1.183
  +++ MessageElement.java	14 Oct 2004 18:50:16 -0000	1.184
  @@ -1985,6 +1985,12 @@
           if (obj == null || !(obj instanceof MessageElement)) {
               return false;
           }
  +        if (this == obj) {
  +            return true;
  +        }
  +        if (!this.getLocalName().equals(((MessageElement) obj).getLocalName())) {
  +            return false;
  +        }
           return toString().equals(obj.toString());
       }
   
  
  
  
  1.5       +10 -11    ws-axis/java/src/org/apache/axis/message/NodeImpl.java
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/NodeImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NodeImpl.java	7 Sep 2004 09:32:48 -0000	1.4
  +++ NodeImpl.java	14 Oct 2004 18:50:17 -0000	1.5
  @@ -478,21 +478,20 @@
       public Node removeChild(Node oldChild) throws DOMException {
           boolean removed = false;
           initializeChildren();
  -        int position = children.indexOf(oldChild);
  -        if (position < 0) {
  +        final Iterator itr = children.iterator();
  +        while (itr.hasNext()) {
  +            final Node node = (Node) itr.next();
  +            if (node.equals(oldChild)) {
  +                removed = true;
  +                itr.remove();
  +            }
  +        }
  +        if (!removed) {
               throw new DOMException(DOMException.NOT_FOUND_ERR,
                       "NodeImpl Not found");
  -        }
  -        
  -        while (position != -1) {
  -            children.remove(position);
  -            removed = true;
  -            position = children.indexOf(oldChild);
  -        }
  -        if (removed) {
  +        } else {
               setDirty(removed);
           }
  -        
           return oldChild;
       }