Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 4055 invoked from network); 16 Feb 2007 14:56:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2007 14:56:02 -0000 Received: (qmail 80685 invoked by uid 500); 16 Feb 2007 14:56:10 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 80650 invoked by uid 500); 16 Feb 2007 14:56:09 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 80641 invoked by uid 99); 16 Feb 2007 14:56:09 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Feb 2007 06:56:09 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Feb 2007 06:56:01 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 7F7101A981D; Fri, 16 Feb 2007 06:55:41 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r508431 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java Date: Fri, 16 Feb 2007 14:55:41 -0000 To: commits@jackrabbit.apache.org From: angela@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070216145541.7F7101A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: angela Date: Fri Feb 16 06:55:40 2007 New Revision: 508431 URL: http://svn.apache.org/viewvc?view=rev&rev=508431 Log: #0000 - avoid NPE upon Restore.persisted in case of a Workspace.restore. Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java?view=diff&rev=508431&r1=508430&r2=508431 ============================================================================== --- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java (original) +++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java Fri Feb 16 06:55:40 2007 @@ -68,16 +68,19 @@ */ public void persisted(CacheBehaviour cacheBehaviour) { if (cacheBehaviour == CacheBehaviour.INVALIDATE) { + NodeEntry entry; if (nodeState == null || removeExisting) { // invalidate the complete tree - NodeEntry root = nodeState.getNodeEntry(); - while (root.getParent() != null) { - root = root.getParent(); + // -> start searching root-entry from any version-entry or + // from the given nodestate + entry = (nodeState == null) ? versionStates[0].getNodeEntry() : nodeState.getNodeEntry(); + while (entry.getParent() != null) { + entry = entry.getParent(); } - root.invalidate(true); } else { - nodeState.getHierarchyEntry().invalidate(true); + entry = nodeState.getNodeEntry(); } + entry.invalidate(true); } } //----------------------------------------< Access Operation Parameters >---