jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r767597 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java
Date Wed, 22 Apr 2009 18:04:24 GMT
Author: mduerig
Date: Wed Apr 22 18:04:24 2009
New Revision: 767597

URL: http://svn.apache.org/viewvc?rev=767597&view=rev
Log:
JCR-2016: ChildNodeEntriesImpl.update logs incorrect errors

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java?rev=767597&r1=767596&r2=767597&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java
Wed Apr 22 18:04:24 2009
@@ -472,12 +472,9 @@
                     position = 0;
                     for (Iterator it = entries.linkNodeIterator(); it.hasNext(); ) {
                         LinkedEntries.LinkNode ln = (LinkedEntries.LinkNode) it.next();
-                        if (!insertName.equals(ln.qName)) {
-                            continue; // not a SNS -> not relevant for position count
-                        }
-                        if (ln != insertLN) {
+                        if (insertName.equals(ln.qName) && (ln != insertLN)) {
                             position++;
-                        } // ln == inserLN -> not relevant for position count
+                        }
                         if (ln == afterLN) {
                             break;
                         }
@@ -555,7 +552,7 @@
             if (insertAfter == null) {
                 // insert at the beginning
                 newNode = new LinkedEntries.LinkNode(cne, index);
-                addFirst(cne);
+                addNode(newNode, header);
             } else if (insertAfter.getNextLinkNode() == null) {
                 newNode = add(cne, index);
             } else {
@@ -699,7 +696,7 @@
         private class LinkNodeIterator implements Iterator {
 
             private LinkedEntries.LinkNode next = ((LinkedEntries.LinkNode) header).getNextLinkNode();
-            private int expectedModCount = modCount;
+            private final int expectedModCount = modCount;
 
             public boolean hasNext() {
                 checkModCount();
@@ -736,8 +733,8 @@
      */
     private static class NameMap {
 
-        private Map snsMap = new HashMap();
-        private Map nameMap = new HashMap();
+        private final Map snsMap = new HashMap();
+        private final Map nameMap = new HashMap();
 
         /**
          * Return true if more than one NodeEnty with the given name exists.



Mime
View raw message