Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C1D27555 for ; Tue, 1 Nov 2011 17:09:59 +0000 (UTC) Received: (qmail 66428 invoked by uid 500); 1 Nov 2011 17:09:59 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 66419 invoked by uid 99); 1 Nov 2011 17:09:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 17:09:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Tue, 01 Nov 2011 17:09:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D7BAD2388A02; Tue, 1 Nov 2011 17:09:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1196146 - /lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java Date: Tue, 01 Nov 2011 17:09:37 -0000 To: commits@lucene.apache.org From: mikemccand@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111101170937.D7BAD2388A02@eris.apache.org> Author: mikemccand Date: Tue Nov 1 17:09:37 2011 New Revision: 1196146 URL: http://svn.apache.org/viewvc?rev=1196146&view=rev Log: PFPF: FNFE in .files() means there are no files Modified: lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java Modified: lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java?rev=1196146&r1=1196145&r2=1196146&view=diff ============================================================================== --- lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java (original) +++ lucene/dev/branches/lucene2621/lucene/src/java/org/apache/lucene/index/codecs/perfield/PerFieldPostingsFormat.java Tue Nov 1 17:09:37 2011 @@ -18,6 +18,7 @@ package org.apache.lucene.index.codecs.p */ import java.io.Closeable; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.HashMap; import java.util.IdentityHashMap; @@ -363,16 +364,23 @@ public abstract class PerFieldPostingsFo final String mapFileName = IndexFileNames.segmentFileName(info.name, formatId, PER_FIELD_EXTENSION); files.add(mapFileName); - new VisitPerFieldFile(dir, info.name) { - @Override - protected void visitOneFormat(int formatID, PostingsFormat format) throws IOException { - format.files(dir, info, formatID, files); - } - - @Override - protected void visitOneField(String field, PostingsFormat format) { - } - }; + try { + new VisitPerFieldFile(dir, info.name) { + @Override + protected void visitOneFormat(int formatID, PostingsFormat format) throws IOException { + format.files(dir, info, formatID, files); + } + + @Override + protected void visitOneField(String field, PostingsFormat format) { + } + }; + } catch (FileNotFoundException fnfe) { + // nocommit this is shady: + // Don't add any files (if the _X.per file has been + // deleted then no files for this segment are + // "available"). + } } // nocommit: do we really need to pass fieldInfo here?