Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 38680 invoked from network); 4 Oct 2008 19:45:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Oct 2008 19:45:45 -0000 Received: (qmail 32489 invoked by uid 500); 4 Oct 2008 19:45:44 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 32433 invoked by uid 500); 4 Oct 2008 19:45:44 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 32424 invoked by uid 99); 4 Oct 2008 19:45:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Oct 2008 12:45:44 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Oct 2008 19:44:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EB587238887A; Sat, 4 Oct 2008 12:45:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r701701 - /geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileDataRegistryImpl.java Date: Sat, 04 Oct 2008 19:45:24 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081004194524.EB587238887A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Sat Oct 4 12:45:24 2008 New Revision: 701701 URL: http://svn.apache.org/viewvc?rev=701701&view=rev Log: Fixed case when parent file is null Modified: geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileDataRegistryImpl.java Modified: geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileDataRegistryImpl.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileDataRegistryImpl.java?rev=701701&r1=701700&r2=701701&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileDataRegistryImpl.java (original) +++ geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileDataRegistryImpl.java Sat Oct 4 12:45:24 2008 @@ -64,25 +64,27 @@ if (name.getDepth() > 0) { FileName parentName = name.getParent(); - if (containsData(parentName)) { - MetaFileData parent = lookupData(parentName); - - if (!parent.hasChild(data)) { - try { - parent.addChild(data); - } - catch (FileSystemException ignore) { - throw new Error(ignore); + if (parentName != null) { + if (containsData(parentName)) { + MetaFileData parent = lookupData(parentName); + + if (!parent.hasChild(data)) { + try { + parent.addChild(data); + } + catch (FileSystemException ignore) { + throw new Error(ignore); + } } } - } - else { - // - // TODO: Consider auto-creating parents, this will work well - // if we switch to all files as FileType.FILE_OR_FOLDER - // - - log.warn("Missing parent folder: " + parentName); + else { + // + // TODO: Consider auto-creating parents, this will work well + // if we switch to all files as FileType.FILE_OR_FOLDER + // + + log.warn("Missing parent folder: " + parentName); + } } } @@ -97,7 +99,7 @@ MetaFileData data = getNodes().remove(name); FileName parentName = name.getParent(); - if (containsData(parentName)) { + if (parentName != null && containsData(parentName)) { MetaFileData parent = lookupData(parentName); try { parent.removeChild(data);