### Eclipse Workspace Patch 1.0 #P jackrabbit-core Index: src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java (revision 949750) +++ src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java (working copy) @@ -66,11 +66,36 @@ } }; + /** + * An handler that simply logs the path of the parent node and the name + * of the missing child node + */ + public static final OnWorkspaceInconsistency LOG = new OnWorkspaceInconsistency("log") { + + public void handleMissingChildNode(NoSuchItemStateException exception, + QueryHandler handler, + Path path, + NodeState node, + ChildNodeEntry child) + throws RepositoryException, ItemStateException { + NamePathResolver resolver = new DefaultNamePathResolver( + handler.getContext().getNamespaceRegistry()); + log.error("Node {} ({}) has missing child '{}' ({})", + new Object[]{ + resolver.getJCRPath(path), + node.getNodeId(), + resolver.getJCRName(child.getName()), + child.getId() + } + ". Please run a consistency check on this workspace!"); + } + }; + protected static final Map INSTANCES = new HashMap(); static { INSTANCES.put(FAIL.name, FAIL); + INSTANCES.put(LOG.name, LOG); } /** Index: src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java (revision 949750) +++ src/main/java/org/apache/jackrabbit/core/query/AbstractQueryHandler.java (working copy) @@ -140,9 +140,10 @@ /** * Sets the {@link OnWorkspaceInconsistency} handler with the given name. - * Currently the only valid name is: + * Currently the valid names are: * * * @param name the name of a {@link OnWorkspaceInconsistency} handler.