Apache Lucene open-source search software
make some fields private/final; add whitespace
Michael McCandless21a6450e8330
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java b/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.javaindex 11eb65009bb..fcdaea29cd8 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java@@ -67,21 +67,27 @@ public final class ForFactory extends IntStreamFactory {// wrap input and output with buffer supportprivate class ForIndexInput extends FixedIntBlockIndexInput {+ForIndexInput(final IndexInput in) throws IOException {super(in);}+class ForBlockReader implements FixedIntBlockIndexInput.BlockReader {- byte[] encoded;- int[] buffer;- IndexInput in;- IntBuffer encodedBuffer;+ private final byte[] encoded;+ private final int[] buffer;+ private final IndexInput in;+ private final IntBuffer encodedBuffer;+ForBlockReader(final IndexInput in, final int[] buffer) {this.encoded = new byte[blockSize*8+4];- this.in=in;- this.buffer=buffer;- this.encodedBuffer=ByteBuffer.wrap(encoded).asIntBuffer();+ this.in = in;+ this.buffer = buffer;+ this.encodedBuffer = ByteBuffer.wrap(encoded).asIntBuffer();}- public void seek(long pos) {}++ public void seek(long pos) {+ }+// TODO: implement public void skipBlock() {} ?public void readBlock() throws IOException {final int numBytes = in.readInt();@@ -90,6 +96,7 @@ public final class ForFactory extends IntStreamFactory {ForUtil.decompress(encodedBuffer,buffer);}}+@Overrideprotected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {return new ForBlockReader(in,buffer);diff --git a/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java b/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.javaindex b6c990662ce..9ba2e71463d 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java@@ -67,21 +67,27 @@ public final class PForFactory extends IntStreamFactory {// wrap input and output with buffer supportprivate class PForIndexInput extends FixedIntBlockIndexInput {+PForIndexInput(final IndexInput in) throws IOException {super(in);}+class PForBlockReader implements FixedIntBlockIndexInput.BlockReader {- byte[] encoded;- int[] buffer;- IndexInput in;- IntBuffer encodedBuffer;+ private final byte[] encoded;+ private final int[] buffer;+ private final IndexInput in;+ private final IntBuffer encodedBuffer;+PForBlockReader(final IndexInput in, final int[] buffer) {this.encoded = new byte[blockSize*8+4];- this.in=in;- this.buffer=buffer;- this.encodedBuffer=ByteBuffer.wrap(encoded).asIntBuffer();+ this.in = in;+ this.buffer = buffer;+ this.encodedBuffer = ByteBuffer.wrap(encoded).asIntBuffer();}- public void seek(long pos) {}++ public void seek(long pos) {+ }+// TODO: implement public void skipBlock() {} ?public void readBlock() throws IOException {final int numBytes = in.readInt();@@ -90,6 +96,7 @@ public final class PForFactory extends IntStreamFactory {PForUtil.decompress(encodedBuffer,buffer);}}+@Overrideprotected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {return new PForBlockReader(in,buffer);