From c2047945cb91f18c75c6158eaaf1dd705726810a Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 22 May 2012 21:23:56 +0000 Subject: [PATCH] LUCENE-4055: rename method git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1341639 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/core/src/java/org/apache/lucene/codecs/Codec.java | 5 ++--- .../apache/lucene/codecs/appending/AppendingCodec.java | 2 +- .../org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java | 2 +- .../org/apache/lucene/codecs/lucene40/Lucene40Codec.java | 2 +- .../apache/lucene/codecs/simpletext/SimpleTextCodec.java | 2 +- .../src/java/org/apache/lucene/index/IndexWriter.java | 8 ++++---- .../src/java/org/apache/lucene/index/SegmentInfos.java | 2 +- .../src/test/org/apache/lucene/index/TestAddIndexes.java | 2 +- .../org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java | 4 ++-- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/codecs/Codec.java b/lucene/core/src/java/org/apache/lucene/codecs/Codec.java index 5f6c84de2a6..06da755d8ec 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/Codec.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/Codec.java @@ -70,9 +70,8 @@ public abstract class Codec implements NamedSPILoader.NamedSPI { /** Encodes/decodes field infos file */ public abstract FieldInfosFormat fieldInfosFormat(); - /** Encodes/decodes segments file */ - // nocommit rename - public abstract SegmentInfoFormat segmentInfosFormat(); + /** Encodes/decodes segment info file */ + public abstract SegmentInfoFormat segmentInfoFormat(); /** Encodes/decodes document normalization values */ public abstract NormsFormat normsFormat(); diff --git a/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java b/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java index 9a6ccb92076..99846403904 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/appending/AppendingCodec.java @@ -76,7 +76,7 @@ public class AppendingCodec extends Codec { } @Override - public SegmentInfoFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfoFormat() { return infos; } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java index a29c83ee42e..bc443365503 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java @@ -113,7 +113,7 @@ public class Lucene3xCodec extends Codec { } @Override - public SegmentInfoFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfoFormat() { return infosFormat; } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java index 2838582d92d..00d02577020 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java @@ -83,7 +83,7 @@ public class Lucene40Codec extends Codec { } @Override - public SegmentInfoFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfoFormat() { return infosFormat; } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java index 7981d775993..478a41355d7 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java @@ -75,7 +75,7 @@ public final class SimpleTextCodec extends Codec { } @Override - public SegmentInfoFormat segmentInfosFormat() { + public SegmentInfoFormat segmentInfoFormat() { return segmentInfos; } diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java index 527c14ea9a3..1d7bd8565cf 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -2044,7 +2044,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { // creating CFS so that 1) .si isn't slurped into CFS, // and 2) .si reflects useCompoundFile=true change // above: - codec.segmentInfosFormat().getSegmentInfosWriter().write(directory, newSegment.info, flushedSegment.fieldInfos, context); + codec.segmentInfoFormat().getSegmentInfosWriter().write(directory, newSegment.info, flushedSegment.fieldInfos, context); // nocommit ideally we would freeze newSegment here!! // because any changes after writing the .si will be @@ -2334,7 +2334,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { // creating CFS so that 1) .si isn't slurped into CFS, // and 2) .si reflects useCompoundFile=true change // above: - codec.segmentInfosFormat().getSegmentInfosWriter().write(trackingDir, info, mergeState.fieldInfos, context); + codec.segmentInfoFormat().getSegmentInfosWriter().write(trackingDir, info, mergeState.fieldInfos, context); info.getFiles().addAll(trackingDir.getCreatedFiles()); // Register the new segment @@ -2420,7 +2420,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { // segment name (its own name, if its 3.x, and doc // store segment name): try { - newInfo.getCodec().segmentInfosFormat().getSegmentInfosWriter().write(directory, newInfo, null, context); + newInfo.getCodec().segmentInfoFormat().getSegmentInfosWriter().write(directory, newInfo, null, context); } catch (UnsupportedOperationException uoe) { // OK: 3x codec cannot write a new SI file; // SegmentInfos will write this on commit @@ -3579,7 +3579,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit { // above: boolean success2 = false; try { - codec.segmentInfosFormat().getSegmentInfosWriter().write(directory, merge.info.info, mergeState.fieldInfos, context); + codec.segmentInfoFormat().getSegmentInfosWriter().write(directory, merge.info.info, mergeState.fieldInfos, context); success2 = true; } finally { if (!success2) { diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java b/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java index b96823f3b0d..f5075d8bfb6 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java +++ b/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java @@ -284,7 +284,7 @@ public final class SegmentInfos implements Cloneable, Iterable