ASTERIXDB-1334 and ASTERIXDB-1616: Fix null bitmap size.

Change-Id: I1eaa215b8fc2df02fecb7f86cc5169f07765b09d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1163
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/RecordBuilder.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/RecordBuilder.java
index 7e6d97e..ca7c0b0 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/RecordBuilder.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/builders/RecordBuilder.java
@@ -157,7 +157,7 @@
                 // the null bit is 1, which means the field is not a null,
                 // the missing bit is 0, means the field is missing (by default).
                 Arrays.fill(nullBitMap, 0, nullBitMapSize, (byte) 0xAA);
-                headerSize += nullBitMap.length;
+                headerSize += nullBitMapSize;
             }
         }
     }