[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    RE: cvs commit: xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2 DomImpl.java
From:       "Eric Vasilik" <ericvas () bea ! com>
Date:       2004-02-26 20:03:27
Message-ID: 4B2B4C417991364996F035E1EE39E2E1DCE0DE () uskiex01 ! amer ! bea ! com
[Download RAW message or body]



-----Original Message-----
From: ericvas@apache.org [mailto:ericvas@apache.org] 
Sent: Thursday, February 26, 2004 12:03 PM
To: xml-xmlbeans-cvs@apache.org
Subject: cvs commit:
xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
DomImpl.java

ericvas     2004/02/26 12:03:04

  Modified:    v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
                        DomImpl.java
  Log:
  added asserts for validity
  
  Revision  Changes    Path
  1.13      +15 -0
xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/DomImpl
.java
  
  Index: DomImpl.java
  ===================================================================
  RCS file:
/home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstor
e2/DomImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DomImpl.java	25 Feb 2004 22:20:22 -0000	1.12
  +++ DomImpl.java	26 Feb 2004 20:03:04 -0000	1.13
  @@ -3256,8 +3256,21 @@
               return c;
           }
   
  +        public static boolean isOnList ( CharNode nodes, CharNode
node )
  +        {
  +            assert node != null;
  +            
  +            for ( CharNode cn = nodes ; cn != null ; cn = cn._next )
  +                if (cn == node)
  +                    return true;
  +
  +            return false;
  +        }
  +
           public static CharNode remove ( CharNode nodes, CharNode node
)
           {
  +            assert isOnList( nodes, node );
  +            
               if (nodes == node)
                   nodes = node._next;
               else
  @@ -3273,6 +3286,8 @@
   
           public static CharNode insertNode ( CharNode nodes, CharNode
newNode, CharNode before )
           {
  +            assert !isOnList( nodes, newNode );
  +            assert before == null || isOnList( nodes, before );
               assert newNode != null;
               assert newNode._prev == null && newNode._next == null;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic