arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [4/5] arrow git commit: ARROW-1304: [Java] Fix Indentation, WhitespaceAround and EmptyLineSeparator checkstyle warnings in Java
Date Mon, 07 Aug 2017 19:05:57 GMT
http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java
index bdd30f8..d8d0964 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/MapVector.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -79,7 +80,7 @@ public class MapVector extends AbstractMapVector {
   transient private MapTransferPair ephPair;
 
   public void copyFromSafe(int fromIndex, int thisIndex, MapVector from) {
-    if(ephPair == null || ephPair.from != from) {
+    if (ephPair == null || ephPair.from != from) {
       ephPair = (MapTransferPair) from.makeTransferPair(this);
     }
     ephPair.copyValueSafe(fromIndex, thisIndex);
@@ -107,7 +108,7 @@ public class MapVector extends AbstractMapVector {
       return 0;
     }
     long buffer = 0;
-    for (final ValueVector v : (Iterable<ValueVector>)this) {
+    for (final ValueVector v : (Iterable<ValueVector>) this) {
       buffer += v.getBufferSize();
     }
 
@@ -148,7 +149,7 @@ public class MapVector extends AbstractMapVector {
     return new MapTransferPair(this, new MapVector(ref, allocator, fieldType, callBack), false);
   }
 
-  protected static class MapTransferPair implements TransferPair{
+  protected static class MapTransferPair implements TransferPair {
     private final TransferPair[] pairs;
     private final MapVector from;
     private final MapVector to;
@@ -165,7 +166,7 @@ public class MapVector extends AbstractMapVector {
 
       int i = 0;
       FieldVector vector;
-      for (String child:from.getChildFieldNames()) {
+      for (String child : from.getChildFieldNames()) {
         int preSize = to.size();
         vector = from.getChild(child);
         if (vector == null) {
@@ -252,7 +253,7 @@ public class MapVector extends AbstractMapVector {
     @Override
     public Object getObject(int index) {
       Map<String, Object> vv = new JsonStringHashMap<>();
-      for (String child:getChildFieldNames()) {
+      for (String child : getChildFieldNames()) {
         ValueVector v = getChild(child);
         if (v != null && index < v.getAccessor().getValueCount()) {
           Object value = v.getAccessor().getObject(index);
@@ -290,10 +291,12 @@ public class MapVector extends AbstractMapVector {
     }
 
     @Override
-    public void reset() { }
+    public void reset() {
+    }
 
     @Override
-    public void generateTestData(int values) { }
+    public void generateTestData(int values) {
+    }
   }
 
   @Override
@@ -329,11 +332,11 @@ public class MapVector extends AbstractMapVector {
     valueCount = 0;
 
     super.close();
- }
+  }
 
   public void initializeChildrenFromFields(List<Field> children) {
     for (Field field : children) {
-      FieldVector vector = (FieldVector)this.add(field.getName(), field.getFieldType());
+      FieldVector vector = (FieldVector) this.add(field.getName(), field.getFieldType());
       vector.initializeChildrenFromFields(field.getChildren());
     }
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
index ee95fde..e70a915 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/NullableMapVector.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -185,7 +186,7 @@ public class NullableMapVector extends MapVector implements FieldVector {
 
 
   @Override
-  public int getBufferSize(){
+  public int getBufferSize() {
     return super.getBufferSize() + bits.getBufferSize();
   }
 
@@ -229,7 +230,7 @@ public class NullableMapVector extends MapVector implements FieldVector {
     super.reAlloc();
   }
 
-  public final class Accessor extends MapVector.Accessor  {
+  public final class Accessor extends MapVector.Accessor {
     final BitVector.Accessor bAccessor = bits.getAccessor();
 
     @Override
@@ -257,7 +258,7 @@ public class NullableMapVector extends MapVector implements FieldVector {
       return isSet(index) == 0;
     }
 
-    public int isSet(int index){
+    public int isSet(int index) {
       return bAccessor.get(index);
     }
 
@@ -265,15 +266,15 @@ public class NullableMapVector extends MapVector implements FieldVector {
 
   public final class Mutator extends MapVector.Mutator implements NullableVectorDefinitionSetter {
 
-    private Mutator(){
+    private Mutator() {
     }
 
     @Override
-    public void setIndexDefined(int index){
+    public void setIndexDefined(int index) {
       bits.getMutator().setSafe(index, 1);
     }
 
-    public void setNull(int index){
+    public void setNull(int index) {
       bits.getMutator().setSafe(index, 0);
     }
 
@@ -285,13 +286,13 @@ public class NullableMapVector extends MapVector implements FieldVector {
     }
 
     @Override
-    public void generateTestData(int valueCount){
+    public void generateTestData(int valueCount) {
       super.generateTestData(valueCount);
       bits.getMutator().generateTestDataAlt(valueCount);
     }
 
     @Override
-    public void reset(){
+    public void reset() {
       bits.getMutator().setValueCount(0);
     }
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/Positionable.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/Positionable.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/Positionable.java
index e1a4f36..f0a5174 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/Positionable.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/Positionable.java
@@ -15,9 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 public interface Positionable {
   public int getPosition();
+
   public void setPosition(int index);
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/PromotableVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/PromotableVector.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/PromotableVector.java
index 8b528b4..4b19b9f 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/PromotableVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/PromotableVector.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.complex;
 
 import org.apache.arrow.vector.AddOrGetResult;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedFixedWidthVectorLike.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedFixedWidthVectorLike.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedFixedWidthVectorLike.java
index 23850bc..866883f 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedFixedWidthVectorLike.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedFixedWidthVectorLike.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 /**
@@ -25,8 +26,8 @@ public interface RepeatedFixedWidthVectorLike {
   /**
    * Allocate a new memory space for this vector.  Must be called prior to using the ValueVector.
    *
-   * @param valueCount   Number of separate repeating groupings.
-   * @param innerValueCount   Number of supported values in the vector.
+   * @param valueCount      Number of separate repeating groupings.
+   * @param innerValueCount Number of supported values in the vector.
    */
   void allocateNew(int valueCount, int innerValueCount);
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedValueVector.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedValueVector.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedValueVector.java
index de58eda..91147c6 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedValueVector.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedValueVector.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 import org.apache.arrow.vector.UInt4Vector;
@@ -26,7 +27,6 @@ import org.apache.arrow.vector.ValueVector;
  * A repeated vector contains values that may either be flat or nested. A value consists of zero or more cells(inner values).
  * Current design maintains data and offsets vectors. Each cell is stored in the data vector. Repeated vector
  * uses the offset vector to determine the sequence of cells pertaining to an individual value.
- *
  */
 public interface RepeatedValueVector extends ValueVector {
 
@@ -51,6 +51,7 @@ public interface RepeatedValueVector extends ValueVector {
   interface RepeatedAccessor extends ValueVector.Accessor {
     /**
      * The result includes empty, null valued cells.
+     *
      * @return total number of cells that vector contains.
      */
     int getInnerValueCount();
@@ -63,7 +64,7 @@ public interface RepeatedValueVector extends ValueVector {
     int getInnerValueCountAt(int index);
 
     /**
-     * @param index  value index
+     * @param index value index
      * @return true if the value at the given index is empty, false otherwise.
      */
     boolean isEmpty(int index);
@@ -74,7 +75,7 @@ public interface RepeatedValueVector extends ValueVector {
     /**
      * Starts a new value that is a container of cells.
      *
-     * @param index  index of new value to start
+     * @param index index of new value to start
      * @return index into the child vector
      */
     int startNewValue(int index);

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedVariableWidthVectorLike.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedVariableWidthVectorLike.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedVariableWidthVectorLike.java
index 29f9d75..1e4f54e 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedVariableWidthVectorLike.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/RepeatedVariableWidthVectorLike.java
@@ -15,20 +15,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 public interface RepeatedVariableWidthVectorLike {
   /**
    * Allocate a new memory space for this vector.  Must be called prior to using the ValueVector.
    *
-   * @param totalBytes   Desired size of the underlying data buffer.
-   * @param parentValueCount   Number of separate repeating groupings.
-   * @param childValueCount   Number of supported values in the vector.
+   * @param totalBytes       Desired size of the underlying data buffer.
+   * @param parentValueCount Number of separate repeating groupings.
+   * @param childValueCount  Number of supported values in the vector.
    */
   void allocateNew(int totalBytes, int parentValueCount, int childValueCount);
 
   /**
    * Provide the maximum amount of variable width bytes that can be stored int his vector.
+   *
    * @return the byte capacity
    */
   int getByteCapacity();

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/StateTool.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/StateTool.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/StateTool.java
index 05a79d2..6279980 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/StateTool.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/StateTool.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 import java.util.Arrays;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/VectorWithOrdinal.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/VectorWithOrdinal.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/VectorWithOrdinal.java
index d04fc1c..1633b3a 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/VectorWithOrdinal.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/VectorWithOrdinal.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex;
 
 import org.apache.arrow.vector.ValueVector;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseReader.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseReader.java
index 7c73c27..1eeced4 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseReader.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.impl;
 
 import java.util.Iterator;
@@ -25,7 +26,7 @@ import org.apache.arrow.vector.complex.writer.FieldWriter;
 import org.apache.arrow.vector.holders.UnionHolder;
 
 
-abstract class AbstractBaseReader implements FieldReader{
+abstract class AbstractBaseReader implements FieldReader {
 
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AbstractBaseReader.class);
 
@@ -40,11 +41,11 @@ abstract class AbstractBaseReader implements FieldReader{
     return index;
   }
 
-  public void setPosition(int index){
+  public void setPosition(int index) {
     this.index = index;
   }
 
-  protected int idx(){
+  protected int idx() {
     return index;
   }
 
@@ -86,6 +87,6 @@ abstract class AbstractBaseReader implements FieldReader{
 
   @Override
   public void copyAsValue(ListWriter writer) {
-    ComplexCopier.copy(this, (FieldWriter)writer);
+    ComplexCopier.copy(this, (FieldWriter) writer);
   }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseWriter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseWriter.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseWriter.java
index 13a0a6b..2f224fe 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseWriter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/AbstractBaseWriter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.complex.writer.FieldWriter;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/ComplexWriterImpl.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/ComplexWriterImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/ComplexWriterImpl.java
index 6851d6d..a696023 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/ComplexWriterImpl.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/ComplexWriterImpl.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.complex.ListVector;
@@ -38,13 +39,15 @@ public class ComplexWriterImpl extends AbstractFieldWriter implements ComplexWri
   private final boolean unionEnabled;
   private final NullableMapWriterFactory nullableMapWriterFactory;
 
-  private enum Mode { INIT, MAP, LIST };
+  private enum Mode {INIT, MAP, LIST}
+
+  ;
 
-  public ComplexWriterImpl(String name, MapVector container, boolean unionEnabled, boolean caseSensitive){
+  public ComplexWriterImpl(String name, MapVector container, boolean unionEnabled, boolean caseSensitive) {
     this.name = name;
     this.container = container;
     this.unionEnabled = unionEnabled;
-    nullableMapWriterFactory = caseSensitive? NullableMapWriterFactory.getNullableCaseSensitiveMapWriterFactoryInstance() :
+    nullableMapWriterFactory = caseSensitive ? NullableMapWriterFactory.getNullableCaseSensitiveMapWriterFactoryInstance() :
         NullableMapWriterFactory.getNullableMapWriterFactoryInstance();
   }
 
@@ -52,7 +55,7 @@ public class ComplexWriterImpl extends AbstractFieldWriter implements ComplexWri
     this(name, container, unionEnabled, false);
   }
 
-  public ComplexWriterImpl(String name, MapVector container){
+  public ComplexWriterImpl(String name, MapVector container) {
     this(name, container, false);
   }
 
@@ -66,12 +69,12 @@ public class ComplexWriterImpl extends AbstractFieldWriter implements ComplexWri
     return container.getValueCapacity();
   }
 
-  private void check(Mode... modes){
+  private void check(Mode... modes) {
     StateTool.check(mode, modes);
   }
 
   @Override
-  public void reset(){
+  public void reset() {
     setPosition(0);
   }
 
@@ -85,58 +88,58 @@ public class ComplexWriterImpl extends AbstractFieldWriter implements ComplexWri
   }
 
   @Override
-  public void clear(){
-    switch(mode){
-    case MAP:
-      mapRoot.clear();
-      break;
-    case LIST:
-      listRoot.clear();
-      break;
+  public void clear() {
+    switch (mode) {
+      case MAP:
+        mapRoot.clear();
+        break;
+      case LIST:
+        listRoot.clear();
+        break;
     }
   }
 
   @Override
-  public void setValueCount(int count){
-    switch(mode){
-    case MAP:
-      mapRoot.setValueCount(count);
-      break;
-    case LIST:
-      listRoot.setValueCount(count);
-      break;
+  public void setValueCount(int count) {
+    switch (mode) {
+      case MAP:
+        mapRoot.setValueCount(count);
+        break;
+      case LIST:
+        listRoot.setValueCount(count);
+        break;
     }
   }
 
   @Override
-  public void setPosition(int index){
+  public void setPosition(int index) {
     super.setPosition(index);
-    switch(mode){
-    case MAP:
-      mapRoot.setPosition(index);
-      break;
-    case LIST:
-      listRoot.setPosition(index);
-      break;
+    switch (mode) {
+      case MAP:
+        mapRoot.setPosition(index);
+        break;
+      case LIST:
+        listRoot.setPosition(index);
+        break;
     }
   }
 
 
-  public MapWriter directMap(){
+  public MapWriter directMap() {
     Preconditions.checkArgument(name == null);
 
-    switch(mode){
+    switch (mode) {
 
-    case INIT:
-      mapRoot = nullableMapWriterFactory.build((NullableMapVector) container);
-      mapRoot.setPosition(idx());
-      mode = Mode.MAP;
-      break;
+      case INIT:
+        mapRoot = nullableMapWriterFactory.build((NullableMapVector) container);
+        mapRoot.setPosition(idx());
+        mode = Mode.MAP;
+        break;
 
-    case MAP:
-      break;
+      case MAP:
+        break;
 
-    default:
+      default:
         check(Mode.INIT, Mode.MAP);
     }
 
@@ -145,20 +148,20 @@ public class ComplexWriterImpl extends AbstractFieldWriter implements ComplexWri
 
   @Override
   public MapWriter rootAsMap() {
-    switch(mode){
+    switch (mode) {
 
-    case INIT:
-      // TODO allow dictionaries in complex types
-      NullableMapVector map = container.addOrGetMap(name);
-      mapRoot = nullableMapWriterFactory.build(map);
-      mapRoot.setPosition(idx());
-      mode = Mode.MAP;
-      break;
+      case INIT:
+        // TODO allow dictionaries in complex types
+        NullableMapVector map = container.addOrGetMap(name);
+        mapRoot = nullableMapWriterFactory.build(map);
+        mapRoot.setPosition(idx());
+        mode = Mode.MAP;
+        break;
 
-    case MAP:
-      break;
+      case MAP:
+        break;
 
-    default:
+      default:
         check(Mode.INIT, Mode.MAP);
     }
 
@@ -167,33 +170,33 @@ public class ComplexWriterImpl extends AbstractFieldWriter implements ComplexWri
 
   @Override
   public void allocate() {
-    if(mapRoot != null) {
+    if (mapRoot != null) {
       mapRoot.allocate();
-    } else if(listRoot != null) {
+    } else if (listRoot != null) {
       listRoot.allocate();
     }
   }
 
   @Override
   public ListWriter rootAsList() {
-    switch(mode){
-
-    case INIT:
-      int vectorCount = container.size();
-      // TODO allow dictionaries in complex types
-      ListVector listVector = container.addOrGetList(name);
-      if (container.size() > vectorCount) {
-        listVector.allocateNew();
-      }
-      listRoot = new UnionListWriter(listVector, nullableMapWriterFactory);
-      listRoot.setPosition(idx());
-      mode = Mode.LIST;
-      break;
-
-    case LIST:
-      break;
-
-    default:
+    switch (mode) {
+
+      case INIT:
+        int vectorCount = container.size();
+        // TODO allow dictionaries in complex types
+        ListVector listVector = container.addOrGetList(name);
+        if (container.size() > vectorCount) {
+          listVector.allocateNew();
+        }
+        listRoot = new UnionListWriter(listVector, nullableMapWriterFactory);
+        listRoot.setPosition(idx());
+        mode = Mode.LIST;
+        break;
+
+      case LIST:
+        break;
+
+      default:
         check(Mode.INIT, Mode.MAP);
     }
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/MapOrListWriterImpl.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/MapOrListWriterImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/MapOrListWriterImpl.java
index f8a9d42..0d860b6 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/MapOrListWriterImpl.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/MapOrListWriterImpl.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.complex.writer.BaseWriter;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java
index 067716e..614c266 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapReaderImpl.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.complex.MapVector;
@@ -28,8 +29,8 @@ public class NullableMapReaderImpl extends SingleMapReaderImpl {
   private NullableMapVector nullableMapVector;
 
   public NullableMapReaderImpl(MapVector vector) {
-    super((NullableMapVector)vector);
-    this.nullableMapVector = (NullableMapVector)vector;
+    super((NullableMapVector) vector);
+    this.nullableMapVector = (NullableMapVector) vector;
   }
 
   @Override
@@ -38,19 +39,19 @@ public class NullableMapReaderImpl extends SingleMapReaderImpl {
   }
 
   @Override
-  public void copyAsValue(MapWriter writer){
+  public void copyAsValue(MapWriter writer) {
     NullableMapWriter impl = (NullableMapWriter) writer;
     impl.container.copyFromSafe(idx(), impl.idx(), nullableMapVector);
   }
 
   @Override
-  public void copyAsField(String name, MapWriter writer){
+  public void copyAsField(String name, MapWriter writer) {
     NullableMapWriter impl = (NullableMapWriter) writer.map(name);
     impl.container.copyFromSafe(idx(), impl.idx(), nullableMapVector);
   }
 
   @Override
-  public boolean isSet(){
+  public boolean isSet() {
     return !nullableMapVector.getAccessor().isNull(idx());
   }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapWriterFactory.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapWriterFactory.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapWriterFactory.java
index d932cfb..d2dcb23 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapWriterFactory.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/NullableMapWriterFactory.java
@@ -15,28 +15,29 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.complex.NullableMapVector;
 
 public class NullableMapWriterFactory {
-    private final boolean caseSensitive;
-    private static final NullableMapWriterFactory nullableMapWriterFactory = new NullableMapWriterFactory(false);
-    private static final NullableMapWriterFactory nullableCaseSensitiveWriterFactory = new NullableMapWriterFactory(true);
+  private final boolean caseSensitive;
+  private static final NullableMapWriterFactory nullableMapWriterFactory = new NullableMapWriterFactory(false);
+  private static final NullableMapWriterFactory nullableCaseSensitiveWriterFactory = new NullableMapWriterFactory(true);
 
-    public NullableMapWriterFactory(boolean caseSensitive) {
-        this.caseSensitive = caseSensitive;
-    }
+  public NullableMapWriterFactory(boolean caseSensitive) {
+    this.caseSensitive = caseSensitive;
+  }
 
-    public NullableMapWriter build(NullableMapVector container) {
-        return this.caseSensitive? new NullableCaseSensitiveMapWriter(container) : new NullableMapWriter(container);
-    }
+  public NullableMapWriter build(NullableMapVector container) {
+    return this.caseSensitive ? new NullableCaseSensitiveMapWriter(container) : new NullableMapWriter(container);
+  }
 
-    public static NullableMapWriterFactory getNullableMapWriterFactoryInstance() {
-        return nullableMapWriterFactory;
-    }
+  public static NullableMapWriterFactory getNullableMapWriterFactoryInstance() {
+    return nullableMapWriterFactory;
+  }
 
-    public static NullableMapWriterFactory getNullableCaseSensitiveMapWriterFactoryInstance() {
-        return nullableCaseSensitiveWriterFactory;
-    }
+  public static NullableMapWriterFactory getNullableCaseSensitiveMapWriterFactoryInstance() {
+    return nullableCaseSensitiveWriterFactory;
+  }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java
index d16718e..9722196 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/PromotableWriter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.FieldVector;
@@ -120,7 +121,7 @@ public class PromotableWriter extends AbstractPromotableFieldWriter {
 
   protected FieldWriter getWriter(MinorType type) {
     if (state == State.UNION) {
-      ((UnionWriter)writer).getWriter(type);
+      ((UnionWriter) writer).getWriter(type);
     } else if (state == State.UNTYPED) {
       if (type == null) {
         // ???
@@ -132,7 +133,7 @@ public class PromotableWriter extends AbstractPromotableFieldWriter {
       writer.setPosition(position);
     } else if (type != this.type) {
       promoteToUnion();
-      ((UnionWriter)writer).getWriter(type);
+      ((UnionWriter) writer).getWriter(type);
     }
     return writer;
   }
@@ -157,7 +158,7 @@ public class PromotableWriter extends AbstractPromotableFieldWriter {
     } else if (listVector != null) {
       unionVector = listVector.promoteToUnion();
     }
-    unionVector.addVector((FieldVector)tp.getTo());
+    unionVector.addVector((FieldVector) tp.getTo());
     writer = new UnionWriter(unionVector, nullableMapWriterFactory);
     writer.setPosition(idx());
     for (int i = 0; i <= idx(); i++) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleListReaderImpl.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleListReaderImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleListReaderImpl.java
index b8f5865..f2b46ab 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleListReaderImpl.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleListReaderImpl.java
@@ -17,6 +17,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.complex.impl;
 
 
@@ -27,7 +28,7 @@ import org.apache.arrow.vector.complex.writer.BaseWriter.MapWriter;
 import org.apache.arrow.vector.types.Types.MinorType;
 
 @SuppressWarnings("unused")
-public class SingleListReaderImpl extends AbstractFieldReader{
+public class SingleListReaderImpl extends AbstractFieldReader {
 
   private final String name;
   private final AbstractContainerVector container;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java
index 4801909..3ebd0cd 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/SingleMapReaderImpl.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.complex.impl;
 
 
@@ -31,7 +32,7 @@ import org.apache.arrow.vector.types.pojo.Field;
 import com.google.common.collect.Maps;
 
 @SuppressWarnings("unused")
-public class SingleMapReaderImpl extends AbstractFieldReader{
+public class SingleMapReaderImpl extends AbstractFieldReader {
 
   private final MapVector vector;
   private final Map<String, FieldReader> fields = Maps.newHashMap();
@@ -40,8 +41,8 @@ public class SingleMapReaderImpl extends AbstractFieldReader{
     this.vector = vector;
   }
 
-  private void setChildrenPosition(int index){
-    for(FieldReader r : fields.values()){
+  private void setChildrenPosition(int index) {
+    for (FieldReader r : fields.values()) {
       r.setPosition(index);
     }
   }
@@ -52,13 +53,13 @@ public class SingleMapReaderImpl extends AbstractFieldReader{
   }
 
   @Override
-  public FieldReader reader(String name){
+  public FieldReader reader(String name) {
     FieldReader reader = fields.get(name);
-    if(reader == null){
+    if (reader == null) {
       ValueVector child = vector.getChild(name);
-      if(child == null){
+      if (child == null) {
         reader = NullReader.INSTANCE;
-      }else{
+      } else {
         reader = child.getReader();
       }
       fields.put(name, reader);
@@ -68,9 +69,9 @@ public class SingleMapReaderImpl extends AbstractFieldReader{
   }
 
   @Override
-  public void setPosition(int index){
+  public void setPosition(int index) {
     super.setPosition(index);
-    for(FieldReader r : fields.values()){
+    for (FieldReader r : fields.values()) {
       r.setPosition(index);
     }
   }
@@ -91,18 +92,18 @@ public class SingleMapReaderImpl extends AbstractFieldReader{
   }
 
   @Override
-  public java.util.Iterator<String> iterator(){
+  public java.util.Iterator<String> iterator() {
     return vector.fieldNameIterator();
   }
 
   @Override
-  public void copyAsValue(MapWriter writer){
+  public void copyAsValue(MapWriter writer) {
     SingleMapWriter impl = (SingleMapWriter) writer;
     impl.container.copyFromSafe(idx(), impl.idx(), vector);
   }
 
   @Override
-  public void copyAsField(String name, MapWriter writer){
+  public void copyAsField(String name, MapWriter writer) {
     SingleMapWriter impl = (SingleMapWriter) writer.map(name);
     impl.container.copyFromSafe(idx(), impl.idx(), vector);
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionFixedSizeListReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionFixedSizeListReader.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionFixedSizeListReader.java
index 515d4ab..f3e9b87 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionFixedSizeListReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionFixedSizeListReader.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.ValueVector;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java
index 2bd0ca8..b98c36d 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/impl/UnionListReader.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.complex.impl;
 
 import org.apache.arrow.vector.UInt4Vector;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/reader/FieldReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/reader/FieldReader.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/reader/FieldReader.java
index c4eb3dc..df142c7 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/reader/FieldReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/reader/FieldReader.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.reader;
 
 import org.apache.arrow.vector.complex.reader.BaseReader.ListReader;
@@ -24,6 +25,5 @@ import org.apache.arrow.vector.complex.reader.BaseReader.RepeatedMapReader;
 import org.apache.arrow.vector.complex.reader.BaseReader.ScalarReader;
 
 
-
 public interface FieldReader extends MapReader, ListReader, ScalarReader, RepeatedMapReader, RepeatedListReader {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/complex/writer/FieldWriter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/complex/writer/FieldWriter.java b/java/vector/src/main/java/org/apache/arrow/vector/complex/writer/FieldWriter.java
index ecffe0b..a2a1f5d 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/complex/writer/FieldWriter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/complex/writer/FieldWriter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.complex.writer;
 
 import org.apache.arrow.vector.complex.writer.BaseWriter.ListWriter;
@@ -23,5 +24,6 @@ import org.apache.arrow.vector.complex.writer.BaseWriter.ScalarWriter;
 
 public interface FieldWriter extends MapWriter, ListWriter, ScalarWriter {
   void allocate();
+
   void clear();
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/dictionary/Dictionary.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/dictionary/Dictionary.java b/java/vector/src/main/java/org/apache/arrow/vector/dictionary/Dictionary.java
index 0c1cadf..c2f6920 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/dictionary/Dictionary.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/dictionary/Dictionary.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.dictionary;
 
 import java.util.Objects;
@@ -53,8 +54,12 @@ public class Dictionary {
 
   @Override
   public boolean equals(Object o) {
-    if (this == o) return true;
-    if (o == null || getClass() != o.getClass()) return false;
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
     Dictionary that = (Dictionary) o;
     return Objects.equals(encoding, that.encoding) && Objects.equals(dictionary, that.dictionary);
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryEncoder.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryEncoder.java b/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryEncoder.java
index 0f49ce6..7e20794 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryEncoder.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryEncoder.java
@@ -16,6 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.dictionary;
 
 import java.lang.reflect.InvocationTargetException;
@@ -39,7 +40,7 @@ public class DictionaryEncoder {
   /**
    * Dictionary encodes a vector with a provided dictionary. The dictionary must contain all values in the vector.
    *
-   * @param vector vector to encode
+   * @param vector     vector to encode
    * @param dictionary dictionary used for encoding
    * @return dictionary encoded vector
    */
@@ -55,7 +56,7 @@ public class DictionaryEncoder {
 
     Field valueField = vector.getField();
     FieldType indexFieldType = new FieldType(valueField.isNullable(), dictionary.getEncoding().getIndexType(),
-      dictionary.getEncoding(), valueField.getMetadata());
+        dictionary.getEncoding(), valueField.getMetadata());
     Field indexField = new Field(valueField.getName(), indexFieldType, null);
 
     // vector to hold our indices (dictionary encoded values)
@@ -65,11 +66,11 @@ public class DictionaryEncoder {
     // use reflection to pull out the set method
     // TODO implement a common interface for int vectors
     Method setter = null;
-    for (Class<?> c: ImmutableList.of(int.class, long.class)) {
+    for (Class<?> c : ImmutableList.of(int.class, long.class)) {
       try {
         setter = mutator.getClass().getMethod("set", int.class, c);
         break;
-      } catch(NoSuchMethodException e) {
+      } catch (NoSuchMethodException e) {
         // ignore
       }
     }
@@ -108,7 +109,7 @@ public class DictionaryEncoder {
   /**
    * Decodes a dictionary encoded array using the provided dictionary.
    *
-   * @param indices dictionary encoded values, must be int type
+   * @param indices    dictionary encoded values, must be int type
    * @param dictionary dictionary used to decode the values
    * @return vector with values restored from dictionary
    */

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryProvider.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryProvider.java b/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryProvider.java
index 87516c9..a170cea 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryProvider.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/dictionary/DictionaryProvider.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.dictionary;
 
 import java.util.HashMap;
@@ -31,7 +32,7 @@ public interface DictionaryProvider {
 
     public MapDictionaryProvider(Dictionary... dictionaries) {
       this.map = new HashMap<>();
-      for (Dictionary dictionary: dictionaries) {
+      for (Dictionary dictionary : dictionaries) {
         put(dictionary);
       }
     }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowBlock.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowBlock.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowBlock.java
index 90fb02b..e1b4d6a 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowBlock.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowBlock.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import org.apache.arrow.flatbuf.Block;
@@ -64,19 +65,25 @@ public class ArrowBlock implements FBSerializable {
 
   @Override
   public boolean equals(Object obj) {
-    if (this == obj)
+    if (this == obj) {
       return true;
-    if (obj == null)
+    }
+    if (obj == null) {
       return false;
-    if (getClass() != obj.getClass())
+    }
+    if (getClass() != obj.getClass()) {
       return false;
+    }
     ArrowBlock other = (ArrowBlock) obj;
-    if (bodyLength != other.bodyLength)
+    if (bodyLength != other.bodyLength) {
       return false;
-    if (metadataLength != other.metadataLength)
+    }
+    if (metadataLength != other.metadataLength) {
       return false;
-    if (offset != other.offset)
+    }
+    if (offset != other.offset) {
       return false;
+    }
     return true;
   }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileReader.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileReader.java
index f4d6ada..d711b9c 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileReader.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -117,7 +118,7 @@ public class ArrowFileReader extends ArrowReader<SeekableReadChannel> {
                                                    ArrowBlock block,
                                                    BufferAllocator allocator) throws IOException {
     LOGGER.debug(String.format("DictionaryRecordBatch at %d, metadata: %d, body: %d",
-       block.getOffset(), block.getMetadataLength(), block.getBodyLength()));
+        block.getOffset(), block.getMetadataLength(), block.getBodyLength()));
     in.setPosition(block.getOffset());
     ArrowDictionaryBatch batch = MessageSerializer.deserializeDictionaryBatch(in, block, allocator);
     if (batch == null) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileWriter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileWriter.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileWriter.java
index 23d210a..06519bc 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileWriter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFileWriter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -47,7 +48,7 @@ public class ArrowFileWriter extends ArrowWriter {
                              List<ArrowBlock> records) throws IOException {
     long footerStart = out.getCurrentPosition();
     out.write(new ArrowFooter(schema, dictionaries, records), false);
-    int footerLength = (int)(out.getCurrentPosition() - footerStart);
+    int footerLength = (int) (out.getCurrentPosition() - footerStart);
     if (footerLength <= 0) {
       throw new InvalidArrowFileException("invalid footer");
     }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFooter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFooter.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFooter.java
index 1c0008a..1e95321 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFooter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowFooter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import static org.apache.arrow.vector.schema.FBSerializables.writeAllStructsToVector;
@@ -48,7 +49,7 @@ public class ArrowFooter implements FBSerializable {
         Schema.convertSchema(footer.schema()),
         dictionaries(footer),
         recordBatches(footer)
-        );
+    );
   }
 
   private static List<ArrowBlock> recordBatches(Footer footer) {
@@ -112,28 +113,37 @@ public class ArrowFooter implements FBSerializable {
 
   @Override
   public boolean equals(Object obj) {
-    if (this == obj)
+    if (this == obj) {
       return true;
-    if (obj == null)
+    }
+    if (obj == null) {
       return false;
-    if (getClass() != obj.getClass())
+    }
+    if (getClass() != obj.getClass()) {
       return false;
+    }
     ArrowFooter other = (ArrowFooter) obj;
     if (dictionaries == null) {
-      if (other.dictionaries != null)
+      if (other.dictionaries != null) {
         return false;
-    } else if (!dictionaries.equals(other.dictionaries))
+      }
+    } else if (!dictionaries.equals(other.dictionaries)) {
       return false;
+    }
     if (recordBatches == null) {
-      if (other.recordBatches != null)
+      if (other.recordBatches != null) {
         return false;
-    } else if (!recordBatches.equals(other.recordBatches))
+      }
+    } else if (!recordBatches.equals(other.recordBatches)) {
       return false;
+    }
     if (schema == null) {
-      if (other.schema != null)
+      if (other.schema != null) {
         return false;
-    } else if (!schema.equals(other.schema))
+      }
+    } else if (!schema.equals(other.schema)) {
       return false;
+    }
     return true;
   }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowMagic.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowMagic.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowMagic.java
index 99ea96b..0d2da37 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowMagic.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowMagic.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowReader.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowReader.java
index f6b1041..646d6fe 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowReader.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -94,12 +95,21 @@ public abstract class ArrowReader<T extends ReadChannel> implements DictionaryPr
     ArrowMessageVisitor<Boolean> visitor = new ArrowMessageVisitor<Boolean>() {
       @Override
       public Boolean visit(ArrowDictionaryBatch message) {
-        try { load(message); } finally { message.close(); }
+        try {
+          load(message);
+        } finally {
+          message.close();
+        }
         return true;
       }
+
       @Override
       public Boolean visit(ArrowRecordBatch message) {
-        try { loader.load(message); } finally { message.close(); }
+        try {
+          loader.load(message);
+        } finally {
+          message.close();
+        }
         return false;
       }
     };
@@ -119,13 +129,15 @@ public abstract class ArrowReader<T extends ReadChannel> implements DictionaryPr
     return readBatch;
   }
 
-  public long bytesRead() { return in.bytesRead(); }
+  public long bytesRead() {
+    return in.bytesRead();
+  }
 
   @Override
   public void close() throws IOException {
     if (initialized) {
       root.close();
-      for (Dictionary dictionary: dictionaries.values()) {
+      for (Dictionary dictionary : dictionaries.values()) {
         dictionary.getVector().close();
       }
     }
@@ -153,7 +165,7 @@ public abstract class ArrowReader<T extends ReadChannel> implements DictionaryPr
     Map<Long, Dictionary> dictionaries = new HashMap<>();
 
     // Convert fields with dictionaries to have the index type
-    for (Field field: originalSchema.getFields()) {
+    for (Field field : originalSchema.getFields()) {
       Field updated = DictionaryUtility.toMemoryFormat(field, allocator, dictionaries);
       fields.add(updated);
       vectors.add(updated.createVector(allocator));

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowWriter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowWriter.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowWriter.java
index 3b37071..b35aba5 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowWriter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ArrowWriter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -60,9 +61,9 @@ public abstract class ArrowWriter implements AutoCloseable {
   /**
    * Note: fields are not closed when the writer is closed
    *
-   * @param root the vectors to write to the output
+   * @param root     the vectors to write to the output
    * @param provider where to find the dictionaries
-   * @param out the output where to write
+   * @param out      the output where to write
    */
   protected ArrowWriter(VectorSchemaRoot root, DictionaryProvider provider, WritableByteChannel out) {
     this.unloader = new VectorUnloader(root);
@@ -72,13 +73,13 @@ public abstract class ArrowWriter implements AutoCloseable {
     Set<Long> dictionaryIdsUsed = new HashSet<>();
 
     // Convert fields with dictionaries to have dictionary type
-    for (Field field: root.getSchema().getFields()) {
+    for (Field field : root.getSchema().getFields()) {
       fields.add(DictionaryUtility.toMessageFormat(field, provider, dictionaryIdsUsed));
     }
 
     // Create a record batch for each dictionary
     this.dictionaries = new ArrayList<>(dictionaryIdsUsed.size());
-    for (long id: dictionaryIdsUsed) {
+    for (long id : dictionaryIdsUsed) {
       Dictionary dictionary = provider.lookup(id);
       FieldVector vector = dictionary.getVector();
       int count = vector.getAccessor().getValueCount();
@@ -105,7 +106,7 @@ public abstract class ArrowWriter implements AutoCloseable {
   protected void writeRecordBatch(ArrowRecordBatch batch) throws IOException {
     ArrowBlock block = MessageSerializer.serialize(out, batch);
     LOGGER.debug(String.format("RecordBatch at %d, metadata: %d, body: %d",
-      block.getOffset(), block.getMetadataLength(), block.getBodyLength()));
+        block.getOffset(), block.getMetadataLength(), block.getBodyLength()));
     recordBlocks.add(block);
   }
 
@@ -114,7 +115,9 @@ public abstract class ArrowWriter implements AutoCloseable {
     ensureEnded();
   }
 
-  public long bytesWritten() { return out.getCurrentPosition(); }
+  public long bytesWritten() {
+    return out.getCurrentPosition();
+  }
 
   private void ensureStarted() throws IOException {
     if (!started) {
@@ -128,7 +131,7 @@ public abstract class ArrowWriter implements AutoCloseable {
         try {
           ArrowBlock block = MessageSerializer.serialize(out, batch);
           LOGGER.debug(String.format("DictionaryRecordBatch at %d, metadata: %d, body: %d",
-            block.getOffset(), block.getMetadataLength(), block.getBodyLength()));
+              block.getOffset(), block.getMetadataLength(), block.getBodyLength()));
           dictionaryBlocks.add(block);
         } finally {
           batch.close();

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/InvalidArrowFileException.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/InvalidArrowFileException.java b/java/vector/src/main/java/org/apache/arrow/vector/file/InvalidArrowFileException.java
index 3ec75dc..607207f 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/InvalidArrowFileException.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/InvalidArrowFileException.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 public class InvalidArrowFileException extends RuntimeException {

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/ReadChannel.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/ReadChannel.java b/java/vector/src/main/java/org/apache/arrow/vector/file/ReadChannel.java
index 87450e3..b0eb8f3 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/ReadChannel.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/ReadChannel.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -37,11 +38,14 @@ public class ReadChannel implements AutoCloseable {
     this.in = in;
   }
 
-  public long bytesRead() { return bytesRead; }
+  public long bytesRead() {
+    return bytesRead;
+  }
 
   /**
    * Reads bytes into buffer until it is full (buffer.remaining() == 0). Returns the
    * number of bytes read which can be less than full if there are no more.
+   *
    * @param buffer The buffer to read to
    * @return the number of byte read
    * @throws IOException if nit enough bytes left to read
@@ -51,9 +55,13 @@ public class ReadChannel implements AutoCloseable {
     int totalRead = 0;
     while (buffer.remaining() != 0) {
       int read = in.read(buffer);
-      if (read < 0) return totalRead;
+      if (read < 0) {
+        return totalRead;
+      }
       totalRead += read;
-      if (read == 0) break;
+      if (read == 0) {
+        break;
+      }
     }
     this.bytesRead += totalRead;
     return totalRead;
@@ -61,8 +69,9 @@ public class ReadChannel implements AutoCloseable {
 
   /**
    * Reads up to len into buffer. Returns bytes read.
+   *
    * @param buffer the buffer to read to
-   * @param l the amount of bytes to read
+   * @param l      the amount of bytes to read
    * @return the number of bytes read
    * @throws IOException if nit enough bytes left to read
    */

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/SeekableReadChannel.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/SeekableReadChannel.java b/java/vector/src/main/java/org/apache/arrow/vector/file/SeekableReadChannel.java
index 914c3cb..46bea13 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/SeekableReadChannel.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/SeekableReadChannel.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -22,18 +23,18 @@ import java.nio.channels.SeekableByteChannel;
 
 public class SeekableReadChannel extends ReadChannel {
 
-    private final SeekableByteChannel in;
+  private final SeekableByteChannel in;
 
-    public SeekableReadChannel(SeekableByteChannel in) {
-        super(in);
-        this.in = in;
-    }
+  public SeekableReadChannel(SeekableByteChannel in) {
+    super(in);
+    this.in = in;
+  }
 
-    public void setPosition(long position) throws IOException {
-        in.position(position);
-    }
+  public void setPosition(long position) throws IOException {
+    in.position(position);
+  }
 
-    public long size() throws IOException {
-        return in.size();
-    }
+  public long size() throws IOException {
+    return in.size();
+  }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/WriteChannel.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/WriteChannel.java b/java/vector/src/main/java/org/apache/arrow/vector/file/WriteChannel.java
index 42104d1..89c9d1f 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/WriteChannel.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/WriteChannel.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.file;
 
 import java.io.IOException;
@@ -62,7 +63,7 @@ public class WriteChannel implements AutoCloseable {
 
   public long align() throws IOException {
     if (currentPosition % 8 != 0) { // align on 8 byte boundaries
-      return writeZeros(8 - (int)(currentPosition % 8));
+      return writeZeros(8 - (int) (currentPosition % 8));
     }
     return 0;
   }
@@ -77,10 +78,10 @@ public class WriteChannel implements AutoCloseable {
 
   public static byte[] intToBytes(int value) {
     byte[] outBuffer = new byte[4];
-    outBuffer[3] = (byte)(value >>> 24);
-    outBuffer[2] = (byte)(value >>> 16);
-    outBuffer[1] = (byte)(value >>>  8);
-    outBuffer[0] = (byte)(value >>>  0);
+    outBuffer[3] = (byte) (value >>> 24);
+    outBuffer[2] = (byte) (value >>> 16);
+    outBuffer[1] = (byte) (value >>> 8);
+    outBuffer[0] = (byte) (value >>> 0);
     return outBuffer;
   }
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileReader.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileReader.java b/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileReader.java
index 364d273..484a82f 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileReader.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileReader.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.file.json;
 
 import static com.fasterxml.jackson.core.JsonToken.END_ARRAY;
@@ -114,7 +115,7 @@ public class JsonFileReader implements AutoCloseable, DictionaryProvider {
       dictionaries = new HashMap<>();
 
       // Convert fields with dictionaries to have the index type
-      for (Field field: originalSchema.getFields()) {
+      for (Field field : originalSchema.getFields()) {
         fields.add(DictionaryUtility.toMemoryFormat(field, allocator, dictionaries));
       }
       this.schema = new Schema(fields, originalSchema.getCustomMetadata());
@@ -233,7 +234,7 @@ public class JsonFileReader implements AutoCloseable, DictionaryProvider {
         BufferBacked innerVector = fieldInnerVectors.get(v);
         nextFieldIs(vectorType.getName());
         readToken(START_ARRAY);
-        ValueVector valueVector = (ValueVector)innerVector;
+        ValueVector valueVector = (ValueVector) innerVector;
         valueVector.allocateNew();
         Mutator mutator = valueVector.getMutator();
 
@@ -262,7 +263,7 @@ public class JsonFileReader implements AutoCloseable, DictionaryProvider {
         readToken(END_ARRAY);
       }
       if (vector instanceof NullableMapVector) {
-        ((NullableMapVector)vector).valueCount = count;
+        ((NullableMapVector) vector).valueCount = count;
       }
     }
     readToken(END_OBJECT);
@@ -278,96 +279,96 @@ public class JsonFileReader implements AutoCloseable, DictionaryProvider {
 
   private void setValueFromParser(ValueVector valueVector, int i) throws IOException {
     switch (valueVector.getMinorType()) {
-    case BIT:
-      ((BitVector)valueVector).getMutator().set(i, parser.readValueAs(Boolean.class) ? 1 : 0);
-      break;
-    case TINYINT:
-      ((TinyIntVector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case SMALLINT:
-      ((SmallIntVector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case INT:
-      ((IntVector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case BIGINT:
-      ((BigIntVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case UINT1:
-      ((UInt1Vector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case UINT2:
-      ((UInt2Vector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case UINT4:
-      ((UInt4Vector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case UINT8:
-      ((UInt8Vector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case FLOAT4:
-      ((Float4Vector)valueVector).getMutator().set(i, parser.readValueAs(Float.class));
-      break;
-    case FLOAT8:
-      ((Float8Vector)valueVector).getMutator().set(i, parser.readValueAs(Double.class));
-      break;
-    case VARBINARY:
-      ((VarBinaryVector)valueVector).getMutator().setSafe(i, decodeHexSafe(parser.readValueAs(String.class)));
-      break;
-    case VARCHAR:
-      ((VarCharVector)valueVector).getMutator().setSafe(i, parser.readValueAs(String.class).getBytes(UTF_8));
-      break;
-    case DATEDAY:
-      ((DateDayVector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case DATEMILLI:
-      ((DateMilliVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESEC:
-      ((TimeSecVector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case TIMEMILLI:
-      ((TimeMilliVector)valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
-      break;
-    case TIMEMICRO:
-      ((TimeMicroVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMENANO:
-      ((TimeNanoVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPSEC:
-      ((TimeStampSecVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPMILLI:
-      ((TimeStampMilliVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPMICRO:
-      ((TimeStampMicroVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPNANO:
-      ((TimeStampNanoVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPSECTZ:
-      ((TimeStampSecTZVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPMILLITZ:
-      ((TimeStampMilliTZVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPMICROTZ:
-      ((TimeStampMicroTZVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    case TIMESTAMPNANOTZ:
-      ((TimeStampNanoTZVector)valueVector).getMutator().set(i, parser.readValueAs(Long.class));
-      break;
-    default:
-      throw new UnsupportedOperationException("minor type: " + valueVector.getMinorType());
+      case BIT:
+        ((BitVector) valueVector).getMutator().set(i, parser.readValueAs(Boolean.class) ? 1 : 0);
+        break;
+      case TINYINT:
+        ((TinyIntVector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case SMALLINT:
+        ((SmallIntVector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case INT:
+        ((IntVector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case BIGINT:
+        ((BigIntVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case UINT1:
+        ((UInt1Vector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case UINT2:
+        ((UInt2Vector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case UINT4:
+        ((UInt4Vector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case UINT8:
+        ((UInt8Vector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case FLOAT4:
+        ((Float4Vector) valueVector).getMutator().set(i, parser.readValueAs(Float.class));
+        break;
+      case FLOAT8:
+        ((Float8Vector) valueVector).getMutator().set(i, parser.readValueAs(Double.class));
+        break;
+      case VARBINARY:
+        ((VarBinaryVector) valueVector).getMutator().setSafe(i, decodeHexSafe(parser.readValueAs(String.class)));
+        break;
+      case VARCHAR:
+        ((VarCharVector) valueVector).getMutator().setSafe(i, parser.readValueAs(String.class).getBytes(UTF_8));
+        break;
+      case DATEDAY:
+        ((DateDayVector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case DATEMILLI:
+        ((DateMilliVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESEC:
+        ((TimeSecVector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case TIMEMILLI:
+        ((TimeMilliVector) valueVector).getMutator().set(i, parser.readValueAs(Integer.class));
+        break;
+      case TIMEMICRO:
+        ((TimeMicroVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMENANO:
+        ((TimeNanoVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPSEC:
+        ((TimeStampSecVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPMILLI:
+        ((TimeStampMilliVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPMICRO:
+        ((TimeStampMicroVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPNANO:
+        ((TimeStampNanoVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPSECTZ:
+        ((TimeStampSecTZVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPMILLITZ:
+        ((TimeStampMilliTZVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPMICROTZ:
+        ((TimeStampMicroTZVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      case TIMESTAMPNANOTZ:
+        ((TimeStampNanoTZVector) valueVector).getMutator().set(i, parser.readValueAs(Long.class));
+        break;
+      default:
+        throw new UnsupportedOperationException("minor type: " + valueVector.getMinorType());
     }
   }
 
   @Override
   public void close() throws IOException {
     parser.close();
-    for (Dictionary dictionary: dictionaries.values()) {
+    for (Dictionary dictionary : dictionaries.values()) {
       dictionary.getVector().close();
     }
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileWriter.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileWriter.java b/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileWriter.java
index befa922..a2229ce 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileWriter.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/file/json/JsonFileWriter.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  ******************************************************************************/
+
 package org.apache.arrow.vector.file.json;
 
 import java.io.File;
@@ -60,12 +61,15 @@ public class JsonFileWriter implements AutoCloseable {
 
   public static final class JSONWriteConfig {
     private final boolean pretty;
+
     private JSONWriteConfig(boolean pretty) {
       this.pretty = pretty;
     }
+
     private JSONWriteConfig() {
       this.pretty = false;
     }
+
     public JSONWriteConfig pretty(boolean pretty) {
       return new JSONWriteConfig(pretty);
     }
@@ -98,7 +102,7 @@ public class JsonFileWriter implements AutoCloseable {
     this.schema = schema;  // Store original Schema to ensure batches written match
 
     // Convert fields with dictionaries to have dictionary type
-    for (Field field: schema.getFields()) {
+    for (Field field : schema.getFields()) {
       fields.add(DictionaryUtility.toMessageFormat(field, provider, dictionaryIdsUsed));
     }
     Schema updatedSchema = new Schema(fields, schema.getCustomMetadata());
@@ -117,7 +121,7 @@ public class JsonFileWriter implements AutoCloseable {
 
   private void writeDictionaryBatches(JsonGenerator generator, Set<Long> dictionaryIdsUsed, DictionaryProvider provider) throws IOException {
     generator.writeArrayFieldStart("dictionaries");
-    for (Long id: dictionaryIdsUsed) {
+    for (Long id : dictionaryIdsUsed) {
       generator.writeStartObject();
       generator.writeObjectField("id", id);
 
@@ -170,7 +174,7 @@ public class JsonFileWriter implements AutoCloseable {
         ArrowVectorType vectorType = vectorTypes.get(v);
         BufferBacked innerVector = fieldInnerVectors.get(v);
         generator.writeArrayFieldStart(vectorType.getName());
-        ValueVector valueVector = (ValueVector)innerVector;
+        ValueVector valueVector = (ValueVector) innerVector;
         for (int i = 0; i < valueVector.getAccessor().getValueCount(); i++) {
           writeValueToGenerator(valueVector, i);
         }
@@ -197,37 +201,37 @@ public class JsonFileWriter implements AutoCloseable {
   private void writeValueToGenerator(ValueVector valueVector, int i) throws IOException {
     switch (valueVector.getMinorType()) {
       case DATEDAY:
-        generator.writeNumber(((DateDayVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((DateDayVector) valueVector).getAccessor().get(i));
         break;
       case DATEMILLI:
-        generator.writeNumber(((DateMilliVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((DateMilliVector) valueVector).getAccessor().get(i));
         break;
       case TIMESEC:
-        generator.writeNumber(((TimeSecVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeSecVector) valueVector).getAccessor().get(i));
         break;
       case TIMEMILLI:
-        generator.writeNumber(((TimeMilliVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeMilliVector) valueVector).getAccessor().get(i));
         break;
       case TIMEMICRO:
-        generator.writeNumber(((TimeMicroVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeMicroVector) valueVector).getAccessor().get(i));
         break;
       case TIMENANO:
-        generator.writeNumber(((TimeNanoVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeNanoVector) valueVector).getAccessor().get(i));
         break;
       case TIMESTAMPSEC:
-        generator.writeNumber(((TimeStampSecVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeStampSecVector) valueVector).getAccessor().get(i));
         break;
       case TIMESTAMPMILLI:
-        generator.writeNumber(((TimeStampMilliVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeStampMilliVector) valueVector).getAccessor().get(i));
         break;
       case TIMESTAMPMICRO:
-        generator.writeNumber(((TimeStampMicroVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeStampMicroVector) valueVector).getAccessor().get(i));
         break;
       case TIMESTAMPNANO:
-        generator.writeNumber(((TimeStampNanoVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((TimeStampNanoVector) valueVector).getAccessor().get(i));
         break;
       case BIT:
-        generator.writeNumber(((BitVector)valueVector).getAccessor().get(i));
+        generator.writeNumber(((BitVector) valueVector).getAccessor().get(i));
         break;
       case VARBINARY:
         String hexString = Hex.encodeHexString(((VarBinaryVector) valueVector).getAccessor().get(i));

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/holders/ComplexHolder.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/holders/ComplexHolder.java b/java/vector/src/main/java/org/apache/arrow/vector/holders/ComplexHolder.java
index 0f9310d..9f923ee 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/holders/ComplexHolder.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/holders/ComplexHolder.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.holders;
 
 import org.apache.arrow.vector.complex.reader.FieldReader;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedListHolder.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedListHolder.java b/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedListHolder.java
index 83506cd..d8b2317 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedListHolder.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedListHolder.java
@@ -15,9 +15,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.holders;
 
-public final class RepeatedListHolder implements ValueHolder{
+public final class RepeatedListHolder implements ValueHolder {
   public int start;
   public int end;
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedMapHolder.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedMapHolder.java b/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedMapHolder.java
index 85d782b..c400b4d 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedMapHolder.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/holders/RepeatedMapHolder.java
@@ -15,9 +15,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.holders;
 
-public final class RepeatedMapHolder implements ValueHolder{
+public final class RepeatedMapHolder implements ValueHolder {
   public int start;
   public int end;
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/holders/UnionHolder.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/holders/UnionHolder.java b/java/vector/src/main/java/org/apache/arrow/vector/holders/UnionHolder.java
index b1b695e..46cf4c8 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/holders/UnionHolder.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/holders/UnionHolder.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.holders;
 
 import org.apache.arrow.vector.complex.reader.FieldReader;

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/holders/ValueHolder.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/holders/ValueHolder.java b/java/vector/src/main/java/org/apache/arrow/vector/holders/ValueHolder.java
index 16777c8..4d01263 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/holders/ValueHolder.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/holders/ValueHolder.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.holders;
 
 /**

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowBuffer.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowBuffer.java b/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowBuffer.java
index 4e2e200..d8c9e30 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowBuffer.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowBuffer.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.schema;
 
 import org.apache.arrow.flatbuf.Buffer;
@@ -58,19 +59,25 @@ public class ArrowBuffer implements FBSerializable {
 
   @Override
   public boolean equals(Object obj) {
-    if (this == obj)
+    if (this == obj) {
       return true;
-    if (obj == null)
+    }
+    if (obj == null) {
       return false;
-    if (getClass() != obj.getClass())
+    }
+    if (getClass() != obj.getClass()) {
       return false;
+    }
     ArrowBuffer other = (ArrowBuffer) obj;
-    if (offset != other.offset)
+    if (offset != other.offset) {
       return false;
-    if (page != other.page)
+    }
+    if (page != other.page) {
       return false;
-    if (size != other.size)
+    }
+    if (size != other.size) {
       return false;
+    }
     return true;
   }
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/7a4026a2/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowDictionaryBatch.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowDictionaryBatch.java b/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowDictionaryBatch.java
index 901877b..635fa3f 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowDictionaryBatch.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/schema/ArrowDictionaryBatch.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.arrow.vector.schema;
 
 import com.google.flatbuffers.FlatBufferBuilder;
@@ -22,39 +23,48 @@ import org.apache.arrow.flatbuf.DictionaryBatch;
 
 public class ArrowDictionaryBatch implements ArrowMessage {
 
-    private final long dictionaryId;
-    private final ArrowRecordBatch dictionary;
-
-    public ArrowDictionaryBatch(long dictionaryId, ArrowRecordBatch dictionary) {
-        this.dictionaryId = dictionaryId;
-        this.dictionary = dictionary;
-    }
-
-    public long getDictionaryId() { return dictionaryId; }
-    public ArrowRecordBatch getDictionary() { return dictionary; }
-
-    @Override
-    public int writeTo(FlatBufferBuilder builder) {
-        int dataOffset = dictionary.writeTo(builder);
-        DictionaryBatch.startDictionaryBatch(builder);
-        DictionaryBatch.addId(builder, dictionaryId);
-        DictionaryBatch.addData(builder, dataOffset);
-        return DictionaryBatch.endDictionaryBatch(builder);
-    }
-
-    @Override
-    public int computeBodyLength() { return dictionary.computeBodyLength(); }
-
-    @Override
-    public <T> T accepts(ArrowMessageVisitor<T> visitor) { return visitor.visit(this); }
-
-    @Override
-    public String toString() {
-       return "ArrowDictionaryBatch [dictionaryId=" + dictionaryId + ", dictionary=" + dictionary + "]";
-    }
-
-    @Override
-    public void close() {
-      dictionary.close();
-    }
+  private final long dictionaryId;
+  private final ArrowRecordBatch dictionary;
+
+  public ArrowDictionaryBatch(long dictionaryId, ArrowRecordBatch dictionary) {
+    this.dictionaryId = dictionaryId;
+    this.dictionary = dictionary;
+  }
+
+  public long getDictionaryId() {
+    return dictionaryId;
+  }
+
+  public ArrowRecordBatch getDictionary() {
+    return dictionary;
+  }
+
+  @Override
+  public int writeTo(FlatBufferBuilder builder) {
+    int dataOffset = dictionary.writeTo(builder);
+    DictionaryBatch.startDictionaryBatch(builder);
+    DictionaryBatch.addId(builder, dictionaryId);
+    DictionaryBatch.addData(builder, dataOffset);
+    return DictionaryBatch.endDictionaryBatch(builder);
+  }
+
+  @Override
+  public int computeBodyLength() {
+    return dictionary.computeBodyLength();
+  }
+
+  @Override
+  public <T> T accepts(ArrowMessageVisitor<T> visitor) {
+    return visitor.visit(this);
+  }
+
+  @Override
+  public String toString() {
+    return "ArrowDictionaryBatch [dictionaryId=" + dictionaryId + ", dictionary=" + dictionary + "]";
+  }
+
+  @Override
+  public void close() {
+    dictionary.close();
+  }
 }


Mime
View raw message