You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2012/07/04 02:43:04 UTC

svn commit: r1357026 - in /lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor: ForFactory.java PForFactory.java

Author: mikemccand
Date: Wed Jul  4 00:43:04 2012
New Revision: 1357026

URL: http://svn.apache.org/viewvc?rev=1357026&view=rev
Log:
make some fields private/final; add whitespace

Modified:
    lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java
    lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java

Modified: lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java?rev=1357026&r1=1357025&r2=1357026&view=diff
==============================================================================
--- lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java (original)
+++ lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/ForFactory.java Wed Jul  4 00:43:04 2012
@@ -67,21 +67,27 @@ public final class ForFactory extends In
 
   // wrap input and output with buffer support
   private 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 In
         ForUtil.decompress(encodedBuffer,buffer);
       }
     }
+
     @Override
     protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {
       return new ForBlockReader(in,buffer);

Modified: lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java?rev=1357026&r1=1357025&r2=1357026&view=diff
==============================================================================
--- lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java (original)
+++ lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/pfor/PForFactory.java Wed Jul  4 00:43:04 2012
@@ -67,21 +67,27 @@ public final class PForFactory extends I
 
   // wrap input and output with buffer support
   private 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 I
         PForUtil.decompress(encodedBuffer,buffer);
       }
     }
+
     @Override
     protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {
       return new PForBlockReader(in,buffer);