Source:
default ColumnValueSelector<Long> makeColumnValueSelector(ReadableOffset offset, ImmutableBitmap nullValueBitmap) { if (nullValueBitmap.isEmpty()) { class HistoricalLongColumnSelector implements LongColumnSelector, HistoricalColumnSelector<Long> { @Override public boolean isNull() { return false; } @Override public long getLong() { return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { return ColumnarLongs.this.get(offset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); } } return new HistoricalLongColumnSelector(); } else { class HistoricalLongColumnSelectorWithNulls implements LongColumnSelector, HistoricalColumnSelector<Long> { private PeekableIntIterator nullIterator = nullValueBitmap.peekableIterator(); private int nullMark = -1; private int offsetMark = -1; @Override public boolean isNull() { final int i = offset.getOffset(); if (i < offsetMark) { nullMark = -1; nullIterator = nullValueBitmap.peekableIterator(); } offsetMark = i; if (nullMark < i) { nullIterator.advanceIfNeeded(offsetMark); if (nullIterator.hasNext()) { nullMark = nullIterator.next(); } } return nullMark == offsetMark; } @Override public long getLong() { Preconditions.checkState(NullHandling.replaceWithDefault() || !isNull()); return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { Preconditions.checkState(NullHandling.replaceWithDefault() || !nullValueBitmap.get(offset)); return ColumnarLongs.this.get(offset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); inspector.visit("nullValueBitmap", nullValueBitmap); } } return new HistoricalLongColumnSelectorWithNulls(); } }

Target:
default ColumnValueSelector<Long> makeColumnValueSelector(ReadableOffset offset, ImmutableBitmap nullValueBitmap) { if (nullValueBitmap.isEmpty()) { class HistoricalLongColumnSelector implements LongColumnSelector, HistoricalColumnSelector<Long> { @Override public boolean isNull() { return false; } @Override public long getLong() { return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { return ColumnarLongs.this.get(offset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); } } return new HistoricalLongColumnSelector(); } else { class HistoricalLongColumnSelectorWithNulls implements LongColumnSelector, HistoricalColumnSelector<Long> { private PeekableIntIterator nullIterator = nullValueBitmap.peekableIterator(); private int nullMark = -1; private int offsetMark = -1; @Override public boolean isNull() { final int i = offset.getOffset(); if (i < offsetMark) { nullMark = -1; nullIterator = nullValueBitmap.peekableIterator(); } offsetMark = i; if (nullMark < i) { nullIterator.advanceIfNeeded(offsetMark); if (nullIterator.hasNext()) { nullMark = nullIterator.next(); } } return nullMark == offsetMark; } @Override public long getLong() { assert NullHandling.replaceWithDefault() || !isNull(); return ColumnarLongs.this.get(offset.getOffset()); } @Override public double getDouble(int offset) { assert NullHandling.replaceWithDefault() || !nullValueBitmap.get(offset); return ColumnarLongs.this.get(offset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("columnar", ColumnarLongs.this); inspector.visit("offset", offset); inspector.visit("nullValueBitmap", nullValueBitmap); } } return new HistoricalLongColumnSelectorWithNulls(); } }