Skip to content

Apache Lucene open-source search software

LUCENE-811: make SegmentInfos class package-private again

Michael McCandless1486b19a4fcb
diff --git a/CHANGES.txt b/CHANGES.txt
index b997c4ba6dc..1dd539ceed6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,10 @@ API Changes
This was done to better call out the possible root causes of an
IOException from these methods. (Mike McCandless)
+ 2. LUCENE-811: make SegmentInfos class, plus a few methods from related
+ classes, package-private again (they were unnecessarily made public
+ as part of LUCENE-701). (Mike McCandless)
+
Bug fixes
1. LUCENE-804: Fixed build.xml to pack a fully compilable src dist. (Doron Cohen)
diff --git a/src/java/org/apache/lucene/index/IndexFileNames.java b/src/java/org/apache/lucene/index/IndexFileNames.java
index d3fcb3f2223..1379ca5a374 100644
--- a/src/java/org/apache/lucene/index/IndexFileNames.java
+++ b/src/java/org/apache/lucene/index/IndexFileNames.java
@@ -71,7 +71,7 @@ final class IndexFileNames {
* @param extension -- extension of the filename (including .)
* @param gen -- generation
*/
- public static final String fileNameFromGeneration(String base, String extension, long gen) {
+ static final String fileNameFromGeneration(String base, String extension, long gen) {
if (gen == -1) {
return null;
} else if (gen == 0) {
diff --git a/src/java/org/apache/lucene/index/IndexReader.java b/src/java/org/apache/lucene/index/IndexReader.java
index f92a58c6613..141a6bdbff9 100644
--- a/src/java/org/apache/lucene/index/IndexReader.java
+++ b/src/java/org/apache/lucene/index/IndexReader.java
@@ -157,7 +157,7 @@ public abstract class IndexReader {
return (IndexReader) new SegmentInfos.FindSegmentsFile(directory) {
- public Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
+ protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
SegmentInfos infos = new SegmentInfos();
infos.read(directory, segmentFileName);
diff --git a/src/java/org/apache/lucene/index/SegmentInfo.java b/src/java/org/apache/lucene/index/SegmentInfo.java
index 402fce57e7c..c521999e7ea 100644
--- a/src/java/org/apache/lucene/index/SegmentInfo.java
+++ b/src/java/org/apache/lucene/index/SegmentInfo.java
@@ -94,7 +94,7 @@ final class SegmentInfo {
* @param format format of the segments info file
* @param input input handle to read segment info from
*/
- public SegmentInfo(Directory dir, int format, IndexInput input) throws IOException {
+ SegmentInfo(Directory dir, int format, IndexInput input) throws IOException {
this.dir = dir;
name = input.readString();
docCount = input.readInt();
diff --git a/src/java/org/apache/lucene/index/SegmentInfos.java b/src/java/org/apache/lucene/index/SegmentInfos.java
index fcb6c1c0481..ad34782aa69 100644
--- a/src/java/org/apache/lucene/index/SegmentInfos.java
+++ b/src/java/org/apache/lucene/index/SegmentInfos.java
@@ -27,7 +27,7 @@ import java.io.IOException;
import java.io.PrintStream;
import java.util.Vector;
-public final class SegmentInfos extends Vector {
+final class SegmentInfos extends Vector {
/** The file format version, a negative number. */
/* Works since counter, the old 1st entry, is always >= 0 */
@@ -235,7 +235,7 @@ public final class SegmentInfos extends Vector {
new FindSegmentsFile(directory) {
- public Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
+ protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
read(directory, segmentFileName);
return null;
}
@@ -315,7 +315,7 @@ public final class SegmentInfos extends Vector {
throws CorruptIndexException, IOException {
return ((Long) new FindSegmentsFile(directory) {
- public Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
+ protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
IndexInput input = directory.openInput(segmentFileName);
@@ -630,5 +630,6 @@ public final class SegmentInfos extends Vector {
* during the processing that could have been caused by
* a writer committing.
*/
- protected abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;}
+ protected abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;
+ }
}