public RegionCommitList trim(RegionCommit rc){
  if (get(size() - 1) != rc) {
    return this;
  }
  if (this.trimRC == rc) {
    return this.trimChild;
  }
  RegionCommitList result=new RegionCommitList(this);
  this.trimRC=rc;
  this.trimChild=result;
  result.remove(result.size() - 1);
{
    Iterator it=result.iterator();
    while (it.hasNext()) {
      RegionCommit itrc=(RegionCommit)it.next();
      itrc.incRefCount();
      if (itrc.needsAck()) {
        result.needsAck=true;
      }
    }
  }
  return result;
}

public RegionCommitList trim ( RegionCommit rc ) { if ( get ( size ( ) - 1 ) != rc ) { return this ; } if ( this . trimRC == rc ) { return this . trimChild ; } RegionCommitList result = new RegionCommitList ( this ) ; this . trimRC = rc ; this . trimChild = result ; result . remove ( result . size ( ) - 1 ) ; { Iterator it = result . iterator ( ) ; while ( it . hasNext ( ) ) { RegionCommit itrc = ( RegionCommit ) it . next ( ) ; itrc . incRefCount ( ) ; if ( itrc . needsAck ( ) ) { result . needsAck = true ; } } } return result ; }
creates a new list , if needed , that contains all the elements of the specified old list except the last one if it is ' rc ' . also recomputes needsack field .
