Author: bcarothers
Date: 2010-01-06 23:05:33 -0500 (Wed, 06 Jan 2010)
New Revision: 1546
Modified:
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java
Log:
DNA-617 NPE while updating indexes (during integration tests)
Applied the patch to correct an issue in the connector that caused it calculate an SNS
index of 2 for all nodes whose SNS index was not supposed to be 1. The expanded TCK test
data exposed this.
Modified:
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java
===================================================================
---
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java 2010-01-07
02:59:55 UTC (rev 1545)
+++
trunk/extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/basic/BasicRequestProcessor.java 2010-01-07
04:05:33 UTC (rev 1546)
@@ -363,9 +363,13 @@
while (iter.hasPrevious()) {
Location existing = iter.previous();
Path.Segment segment = existing.getPath().getLastSegment();
- if (!segment.getName().equals(childName)) continue;
- // Otherwise the name matched, so get the indexes ...
- nextSnsIndex = segment.getIndex() + 1;
+ if (segment.getName().equals(childName)) {
+ // Otherwise the name matched, so get the indexes ...
+ nextSnsIndex = segment.getIndex() + 1;
+
+ // We've found the last match, so no need to loop
further
+ break;
+ }
}
}
} else {
Show replies by date