[NO ISSUE][RT] Fix list builder to re use object

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
When the list builder is reset, the offsets byte array
is set to null which causes it to be created again
when writing the list out. Avoid setting it to null in
reset.

Change-Id: I43bdfa514d9c78cfb7dfda009d0ea678ad846eba
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3287
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/AbstractListBuilder.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/AbstractListBuilder.java
index 35f6170..04e3e67 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/AbstractListBuilder.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/AbstractListBuilder.java
@@ -32,16 +32,15 @@
 import org.apache.hyracks.storage.common.arraylist.IntArrayList;
 
 public abstract class AbstractListBuilder implements IAsterixListBuilder {
-    protected final GrowableArray outputStorage;
-    protected final DataOutputStream outputStream;
-    protected final IntArrayList offsets;
-    protected int metadataInfoSize;
-    protected byte[] offsetArray;
-    protected int offsetPosition;
-    protected int headerSize;
-    protected ATypeTag itemTypeTag;
     protected final ATypeTag listType;
-
+    protected final GrowableArray outputStorage;
+    protected final IntArrayList offsets;
+    private final DataOutputStream outputStream;
+    private int metadataInfoSize;
+    private byte[] offsetArray;
+    private int offsetPosition;
+    private int headerSize;
+    private ATypeTag itemTypeTag;
     protected boolean fixedSize = false;
     protected int numberOfItems;
 
@@ -58,7 +57,6 @@
     @Override
     public void reset(AbstractCollectionType listType) {
         this.outputStorage.reset();
-        this.offsetArray = null;
         this.offsets.clear();
         this.offsetPosition = 0;
         this.numberOfItems = 0;
@@ -79,7 +77,6 @@
             byte[] data = item.getByteArray();
             int start = item.getStartOffset();
             int len = item.getLength();
-
             byte serializedTypeTag = data[start];
             if (!fixedSize && ((serializedTypeTag != ATypeTag.SERIALIZED_NULL_TYPE_TAG
                     && serializedTypeTag != ATypeTag.SERIALIZED_MISSING_TYPE_TAG) || itemTypeTag == ATypeTag.ANY)) {