Index: src/java/org/apache/lucene/index/IndexReader.java =================================================================== --- src/java/org/apache/lucene/index/IndexReader.java (revision 510617) +++ src/java/org/apache/lucene/index/IndexReader.java (working copy) @@ -157,7 +157,7 @@ return (IndexReader) new SegmentInfos.FindSegmentsFile(directory) { - public Object doBody(String segmentFileName) throws CorruptIndexException, IOException { + Object doBody(String segmentFileName) throws CorruptIndexException, IOException { SegmentInfos infos = new SegmentInfos(); infos.read(directory, segmentFileName); Index: src/java/org/apache/lucene/index/IndexFileNames.java =================================================================== --- src/java/org/apache/lucene/index/IndexFileNames.java (revision 510617) +++ src/java/org/apache/lucene/index/IndexFileNames.java (working copy) @@ -71,7 +71,7 @@ * @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) { Index: src/java/org/apache/lucene/index/SegmentInfos.java =================================================================== --- src/java/org/apache/lucene/index/SegmentInfos.java (revision 510617) +++ src/java/org/apache/lucene/index/SegmentInfos.java (working copy) @@ -27,7 +27,7 @@ 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 */ @@ -42,16 +42,16 @@ * href="http://lucene.apache.org/java/docs/fileformats.html">file * formats for details. */ - public static final int FORMAT_LOCKLESS = -2; + static final int FORMAT_LOCKLESS = -2; /** This is the current file format written. It adds a * "hasSingleNormFile" flag into each segment info. * See LUCENE-756 * for details. */ - public static final int FORMAT_SINGLE_NORM_FILE = -3; + static final int FORMAT_SINGLE_NORM_FILE = -3; - public int counter = 0; // used to name new segments + int counter = 0; // used to name new segments /** * counts how often the index has been changed by adding or deleting docs. * starting with the current time in milliseconds forces to create unique version numbers. @@ -69,7 +69,7 @@ */ private static PrintStream infoStream; - public final SegmentInfo info(int i) { + final SegmentInfo info(int i) { return (SegmentInfo) elementAt(i); } @@ -79,7 +79,7 @@ * * @param files -- array of file names to check */ - public static long getCurrentSegmentGeneration(String[] files) { + static long getCurrentSegmentGeneration(String[] files) { if (files == null) { return -1; } @@ -110,7 +110,7 @@ * * @param directory -- directory to search for the latest segments_N file */ - public static long getCurrentSegmentGeneration(Directory directory) throws IOException { + static long getCurrentSegmentGeneration(Directory directory) throws IOException { String[] files = directory.list(); if (files == null) throw new IOException("Cannot read directory " + directory); @@ -124,7 +124,7 @@ * @param files -- array of file names to check */ - public static String getCurrentSegmentFileName(String[] files) throws IOException { + static String getCurrentSegmentFileName(String[] files) throws IOException { return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", getCurrentSegmentGeneration(files)); @@ -136,7 +136,7 @@ * * @param directory -- directory to search for the latest segments_N file */ - public static String getCurrentSegmentFileName(Directory directory) throws IOException { + static String getCurrentSegmentFileName(Directory directory) throws IOException { return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", getCurrentSegmentGeneration(directory)); @@ -145,7 +145,7 @@ /** * Get the segments_N filename in use by this segment infos. */ - public String getCurrentSegmentFileName() { + String getCurrentSegmentFileName() { return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", lastGeneration); @@ -154,7 +154,7 @@ /** * Get the next segments_N filename that will be written. */ - public String getNextSegmentFileName() { + String getNextSegmentFileName() { long nextGeneration; if (generation == -1) { @@ -176,7 +176,7 @@ * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ - public final void read(Directory directory, String segmentFileName) throws CorruptIndexException, IOException { + final void read(Directory directory, String segmentFileName) throws CorruptIndexException, IOException { boolean success = false; IndexInput input = directory.openInput(segmentFileName); @@ -229,20 +229,20 @@ * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ - public final void read(Directory directory) throws CorruptIndexException, IOException { + final void read(Directory directory) throws CorruptIndexException, IOException { generation = lastGeneration = -1; new FindSegmentsFile(directory) { - public Object doBody(String segmentFileName) throws CorruptIndexException, IOException { + Object doBody(String segmentFileName) throws CorruptIndexException, IOException { read(directory, segmentFileName); return null; } }.run(); } - public final void write(Directory directory) throws IOException { + final void write(Directory directory) throws IOException { String segmentFileName = getNextSegmentFileName(); @@ -302,7 +302,7 @@ /** * version number when this SegmentInfos was generated. */ - public long getVersion() { + long getVersion() { return version; } @@ -311,11 +311,11 @@ * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ - public static long readCurrentVersion(Directory directory) + static long readCurrentVersion(Directory directory) throws CorruptIndexException, IOException { return ((Long) new FindSegmentsFile(directory) { - public Object doBody(String segmentFileName) throws CorruptIndexException, IOException { + Object doBody(String segmentFileName) throws CorruptIndexException, IOException { IndexInput input = directory.openInput(segmentFileName); @@ -348,7 +348,7 @@ /** If non-null, information about retries when loading * the segments file will be printed to this. */ - public static void setInfoStream(PrintStream infoStream) { + static void setInfoStream(PrintStream infoStream) { SegmentInfos.infoStream = infoStream; } @@ -364,14 +364,14 @@ * generation. This file is only referenced when the * primary method (listing the directory) fails. */ - public static void setDefaultGenFileRetryCount(int count) { + static void setDefaultGenFileRetryCount(int count) { defaultGenFileRetryCount = count; } /** * @see #setDefaultGenFileRetryCount */ - public static int getDefaultGenFileRetryCount() { + static int getDefaultGenFileRetryCount() { return defaultGenFileRetryCount; } @@ -379,14 +379,14 @@ * Advanced: set how many milliseconds to pause in between * attempts to load the segments.gen file. */ - public static void setDefaultGenFileRetryPauseMsec(int msec) { + static void setDefaultGenFileRetryPauseMsec(int msec) { defaultGenFileRetryPauseMsec = msec; } /** * @see #setDefaultGenFileRetryPauseMsec */ - public static int getDefaultGenFileRetryPauseMsec() { + static int getDefaultGenFileRetryPauseMsec() { return defaultGenFileRetryPauseMsec; } @@ -397,20 +397,20 @@ * segments.gen file) methods fail to find the segments * file. */ - public static void setDefaultGenLookaheadCount(int count) { + static void setDefaultGenLookaheadCount(int count) { defaultGenLookaheadCount = count; } /** * @see #setDefaultGenLookaheadCount */ - public static int getDefaultGenLookahedCount() { + static int getDefaultGenLookahedCount() { return defaultGenLookaheadCount; } /** * @see #setInfoStream */ - public static PrintStream getInfoStream() { + static PrintStream getInfoStream() { return infoStream; } @@ -429,20 +429,20 @@ * time, etc., it could have been deleted due to a writer * commit finishing. */ - public abstract static class FindSegmentsFile { + abstract static class FindSegmentsFile { File fileDirectory; Directory directory; - public FindSegmentsFile(File directory) { + FindSegmentsFile(File directory) { this.fileDirectory = directory; } - public FindSegmentsFile(Directory directory) { + FindSegmentsFile(Directory directory) { this.directory = directory; } - public Object run() throws CorruptIndexException, IOException { + Object run() throws CorruptIndexException, IOException { String segmentFileName = null; long lastGen = -1; long gen = 0; @@ -630,5 +630,5 @@ * during the processing that could have been caused by * a writer committing. */ - protected abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;} + abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;} } Index: src/java/org/apache/lucene/index/SegmentInfo.java =================================================================== --- src/java/org/apache/lucene/index/SegmentInfo.java (revision 510617) +++ src/java/org/apache/lucene/index/SegmentInfo.java (working copy) @@ -60,7 +60,7 @@ hasSingleNormFile = false; } - public SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, boolean hasSingleNormFile) { + SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, boolean hasSingleNormFile) { this(name, docCount, dir); this.isCompoundFile = (byte) (isCompoundFile ? 1 : -1); this.hasSingleNormFile = hasSingleNormFile; @@ -94,7 +94,7 @@ * @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(); Index: src/java/org/apache/lucene/index/IndexFileNameFilter.java =================================================================== --- src/java/org/apache/lucene/index/IndexFileNameFilter.java (revision 510617) +++ src/java/org/apache/lucene/index/IndexFileNameFilter.java (working copy) @@ -68,7 +68,7 @@ * files that pass the above "accept" (ie, are already * known to be a Lucene index file). */ - public boolean isCFSFile(String name) { + boolean isCFSFile(String name) { int i = name.lastIndexOf('.'); if (i != -1) { String extension = name.substring(1+i);