LUCENE-2733: Removed public constructors of utility classes with only static methods to prevent instantiation

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1030754 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2010-11-03 23:15:01 +00:00
parent 73e0464160
commit f6f1961e46
9 changed files with 27 additions and 8 deletions

View File

@ -380,7 +380,10 @@ Changes in backwards compatibility policy
CREATE*, IndexWriter would make a first empty commit. If you need that
behavior you can call writer.commit()/close() immediately after you create it.
(Shai Erera, Mike McCandless)
* LUCENE-2733: Removed public constructors of utility classes with only static
methods to prevent instantiation. (Uwe Schindler)
Changes in runtime behavior
* LUCENE-1923: Made IndexReader.toString() produce something

View File

@ -20,7 +20,9 @@ package org.apache.lucene.util; // from org.apache.solr.util rev 555343
/** A variety of high efficiency bit twiddling routines.
* @lucene.internal
*/
public class BitUtil {
public final class BitUtil {
private BitUtil() {} // no instance
/** Returns the number of bits set in the long */
public static int pop(long x) {

View File

@ -31,6 +31,8 @@ import java.io.IOException;
*/
public final class CodecUtil {
private CodecUtil() {} // no instance
private final static int CODEC_MAGIC = 0x3fd76c17;
public static IndexOutput writeHeader(IndexOutput out, String codec, int version)

View File

@ -20,7 +20,9 @@ package org.apache.lucene.util;
/**
* @lucene.internal
*/
public class English {
public final class English {
private English() {} // no instance
public static String longToEnglish(long i) {
StringBuilder result = new StringBuilder();

View File

@ -21,7 +21,10 @@ import java.io.Closeable;
import java.io.IOException;
/** @lucene.internal */
public class IOUtils {
public final class IOUtils {
private IOUtils() {} // no instance
/**
* <p>Closes all given <tt>Closeable</tt>s, suppressing all thrown exceptions. Some of the <tt>Closeable</tt>s
* may be null, they are ignored. After everything is closed, method either throws <tt>priorException</tt>,

View File

@ -53,7 +53,7 @@ import java.nio.ByteBuffer;
*
* @lucene.experimental
*/
public class IndexableBinaryStringTools {
public final class IndexableBinaryStringTools {
private static final CodingCase[] CODING_CASES = {
// CodingCase(int initialShift, int finalShift)

View File

@ -28,7 +28,9 @@ import org.apache.lucene.index.IndexReader;
*
* @lucene.internal
*/
public class ReaderUtil {
public final class ReaderUtil {
private ReaderUtil() {} // no instance
public static class Slice {
public static final Slice[] EMPTY_ARRAY = new Slice[0];

View File

@ -20,7 +20,10 @@ package org.apache.lucene.util;
/**
* Helper methods to ease implementing {@link Object#toString()}.
*/
public class ToStringUtils {
public final class ToStringUtils {
private ToStringUtils() {} // no instance
/**
* for printing boost only if not 1.0
*/

View File

@ -93,7 +93,9 @@ package org.apache.lucene.util;
* @lucene.internal
*/
final public class UnicodeUtil {
public final class UnicodeUtil {
private UnicodeUtil() {} // no instance
public static final int UNI_SUR_HIGH_START = 0xD800;
public static final int UNI_SUR_HIGH_END = 0xDBFF;