private void updateCachedData(){
  int rangeStart=range.getStart();
  int expectedLastIndex=Math.max(0,Math.min(range.getLength(),getRowCount() - rangeStart));
  int lastIndex=getVisibleItemCount() - 1;
  while (lastIndex >= expectedLastIndex) {
    rows.remove(lastIndex);
    lastIndex--;
  }
}

private void updateCachedData ( ) { int rangeStart = range . getStart ( ) ; int expectedLastIndex = Math . max ( 0 , Math . min ( range . getLength ( ) , getRowCount ( ) - rangeStart ) ) ; int lastIndex = getVisibleItemCount ( ) - 1 ; while ( lastIndex >= expectedLastIndex ) { rows . remove ( lastIndex ) ; lastIndex -- ; } }
ensure that the cached data is consistent with the data size .
