You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by le...@locus.apache.org on 2000/07/08 04:20:01 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/dom ParentNode.java ChildAndParentNode.java
lehors 00/07/07 19:20:01
Modified: java/src/org/apache/xerces/dom ParentNode.java
ChildAndParentNode.java
Log:
added code to update the cache (lost in previous change)
Revision Changes Path
1.10 +25 -1 xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java
Index: ParentNode.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ParentNode.java 2000/07/07 20:33:07 1.9
+++ ParentNode.java 2000/07/08 02:20:01 1.10
@@ -1,4 +1,4 @@
-/* $Id: ParentNode.java,v 1.9 2000/07/07 20:33:07 lehors Exp $ */
+/* $Id: ParentNode.java,v 1.10 2000/07/08 02:20:01 lehors Exp $ */
/*
* The Apache Software License, Version 1.1
*
@@ -448,6 +448,21 @@
changed();
+ // update cache if we have any
+ if (nodeListLength != -1) {
+ nodeListLength++;
+ }
+ if (nodeListIndex != -1) {
+ // if the cache happens to be the refNode do the obvious
+ if (nodeListNode == refInternal) {
+ nodeListIndex--;
+ nodeListNode = newInternal;
+ } else {
+ // otherwise just invalidate it
+ nodeListIndex = -1;
+ }
+ }
+
if(MUTATIONEVENTS)
{
// MUTATION POST-EVENTS:
@@ -649,6 +664,15 @@
oldInternal.previousSibling = null;
changed();
+
+ // update cache
+ if (nodeListLength > 0) {
+ nodeListLength--;
+ }
+ if (nodeListIndex != -1 && nodeListNode != null) {
+ nodeListIndex--;
+ nodeListNode = nodeListNode.previousSibling();
+ }
if(MUTATIONEVENTS)
{
1.10 +25 -1 xml-xerces/java/src/org/apache/xerces/dom/ChildAndParentNode.java
Index: ChildAndParentNode.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ChildAndParentNode.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ChildAndParentNode.java 2000/07/07 20:33:07 1.9
+++ ChildAndParentNode.java 2000/07/08 02:20:01 1.10
@@ -1,4 +1,4 @@
-/* $Id: ChildAndParentNode.java,v 1.9 2000/07/07 20:33:07 lehors Exp $ */
+/* $Id: ChildAndParentNode.java,v 1.10 2000/07/08 02:20:01 lehors Exp $ */
/*
* The Apache Software License, Version 1.1
*
@@ -438,6 +438,21 @@
changed();
+ // update cache if we have any
+ if (nodeListLength != -1) {
+ nodeListLength++;
+ }
+ if (nodeListIndex != -1) {
+ // if the cache happens to be the refNode do the obvious
+ if (nodeListNode == refInternal) {
+ nodeListIndex--;
+ nodeListNode = newInternal;
+ } else {
+ // otherwise just invalidate it
+ nodeListIndex = -1;
+ }
+ }
+
if(MUTATIONEVENTS)
{
// MUTATION POST-EVENTS:
@@ -639,6 +654,15 @@
oldInternal.previousSibling = null;
changed();
+
+ // update cache
+ if (nodeListLength > 0) {
+ nodeListLength--;
+ }
+ if (nodeListIndex != -1 && nodeListNode != null) {
+ nodeListIndex--;
+ nodeListNode = nodeListNode.previousSibling();
+ }
if(MUTATIONEVENTS)
{