jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r540492 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene: NodeIndexer.java SearchIndex.java
Date Tue, 22 May 2007 08:48:57 GMT
Author: mreutegg
Date: Tue May 22 01:48:56 2007
New Revision: 540492

URL: http://svn.apache.org/viewvc?view=rev&rev=540492
Log:
JCR-931: cluster synchronization NPE

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java?view=diff&rev=540492&r1=540491&r2=540492
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
Tue May 22 01:48:56 2007
@@ -164,6 +164,12 @@
                 doc.add(new Field(FieldNames.PARENT, node.getParentId().toString(), Field.Store.YES,
Field.Index.UN_TOKENIZED, Field.TermVector.NO));
                 NodeState parent = (NodeState) stateProvider.getItemState(node.getParentId());
                 NodeState.ChildNodeEntry child = parent.getChildNodeEntry(node.getNodeId());
+                if (child == null) {
+                    // this can only happen when jackrabbit
+                    // is running in a cluster.
+                    throw new RepositoryException("Missing child node entry " +
+                            "for node with id: " + node.getNodeId());
+                }
                 String name = NameFormat.format(child.getName(), mappings);
                 doc.add(new Field(FieldNames.LABEL, name, Field.Store.NO, Field.Index.UN_TOKENIZED,
Field.TermVector.NO));
             }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?view=diff&rev=540492&r1=540491&r2=540492
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Tue May 22 01:48:56 2007
@@ -422,11 +422,11 @@
                 Document doc = null;
                 try {
                     doc = createDocument(state, getNamespaceMappings());
+                    retrieveAggregateRoot(state, aggregateRoots);
                 } catch (RepositoryException e) {
-                    log.error("Exception while creating document for node: "
+                    log.warn("Exception while creating document for node: "
                             + state.getNodeId() + ": " + e.toString());
                 }
-                retrieveAggregateRoot(state, aggregateRoots);
                 return doc;
             }
         });
@@ -451,7 +451,7 @@
                     try {
                         return createDocument(state, getNamespaceMappings());
                     } catch (RepositoryException e) {
-                        log.error("Exception while creating document for node: "
+                        log.warn("Exception while creating document for node: "
                                 + state.getNodeId() + ": " + e.toString());
                     }
                     return null;



Mime
View raw message