There are two lastSet member variables in the code. One is in BaseVariableWidthVector and the other is in ListVector. In BaseVariableWidthVector, the lastSet refers to the last index that is actually set, while in ListVector, the lastSet refers to the next index that will be set. So there is an inconsistency.
According to the name, lastSet should refer to the last index that is actually set. So the semantics in ListVector should be revised. However, the setLastSet and getLastSet methods in ListVector have been made public, so they cannot be changed freely. My initial idea is that: we first change the internal semantics of ListVector, leaving the external semantics (setLastSet and getLastSet methods) unchanged. Meanwhile, we make the setLastset & getLastSet methods deprecated. Changing the external semantics will be performed later as a long process. Would you please give some comments? Do you have some other ideas? Thank you in advance. Liya Fan