question: 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 ; }
target:  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.