Program: 75061
Project: 75061
Buggy source:
public ListIterator listIterator(final int index){
  checkMod();
  checkBoundsInclusive(index);
  return new ListIterator(){
    private final ListIterator i=backingList.listIterator(index + offset);
    private int position=index;
    public boolean hasNext(){
      checkMod();
      return position < size;
    }
    public boolean hasPrevious(){
      checkMod();
      return position > 0;
    }
    public Object next(){
      if (position == size)       throw new NoSuchElementException();
      $ASSIGN$SPECIAL$position(11,position);
      return i.next();
    }
    public Object previous(){
      if (position == 0)       throw new NoSuchElementException();
      $ASSIGN$SPECIAL$position(12,position);
      return i.previous();
    }
    public int nextIndex(){
      return i.nextIndex() - offset;
    }
    public int previousIndex(){
      return i.previousIndex() - offset;
    }
    public void remove(){
      i.remove();
      $ASSIGN$SPECIAL$size(12,size);
      $ASSIGN$position(nextIndex());
      setModCount(backingList.getModCount());
    }
    public void set(    Object o){
      i.set(o);
    }
    public void add(    Object o){
      i.add(o);
      $ASSIGN$SPECIAL$size(11,size);
      $ASSIGN$SPECIAL$position(11,position);
      setModCount(backingList.getModCount());
    }
final class _PROXY_ implements Rollbackable {
      public final void $COMMIT(      long timestamp){
        $COMMIT_ANONYMOUS(timestamp);
      }
      public final void $RESTORE(      long timestamp,      boolean trim){
        $RESTORE_ANONYMOUS(timestamp,trim);
      }
      public final Checkpoint $GET$CHECKPOINT(){
        return $GET$CHECKPOINT_ANONYMOUS();
      }
      public final Object $SET$CHECKPOINT(      Checkpoint checkpoint){
        $SET$CHECKPOINT_ANONYMOUS(checkpoint);
        return this;
      }
    }
    private final int $ASSIGN$position(    int newValue){
      if ($CHECKPOINT != null && $CHECKPOINT.getTimestamp() > 0) {
        $RECORD$position.add(null,position,$CHECKPOINT.getTimestamp());
      }
      return position=newValue;
    }
    private final int $ASSIGN$SPECIAL$position(    int operator,    long newValue){
      if ($CHECKPOINT != null && $CHECKPOINT.getTimestamp() > 0) {
        $RECORD$position.add(null,position,$CHECKPOINT.getTimestamp());
      }
switch (operator) {
case 0:
        return position+=newValue;
case 1:
      return position-=newValue;
case 2:
    return position*=newValue;
case 3:
  return position/=newValue;
case 4:
return position&=newValue;
case 5:
return position|=newValue;
case 6:
return position^=newValue;
case 7:
return position%=newValue;
case 8:
return position<<=newValue;
case 9:
return position>>=newValue;
case 10:
return position>>>=newValue;
case 11:
return position++;
case 12:
return position--;
case 13:
return ++position;
case 14:
return --position;
default :
return position;
}
}
public void $COMMIT_ANONYMOUS(long timestamp){
FieldRecord.commit($RECORDS,timestamp,$RECORD$$CHECKPOINT.getTopTimestamp());
$RECORD$$CHECKPOINT.commit(timestamp);
}
public void $RESTORE_ANONYMOUS(long timestamp,boolean trim){
$RECORD$i.restore(i,timestamp,trim);
position=$RECORD$position.restore(position,timestamp,trim);
if (timestamp <= $RECORD$$CHECKPOINT.getTopTimestamp()) {
$CHECKPOINT=$RECORD$$CHECKPOINT.restore($CHECKPOINT,new _PROXY_(),timestamp,trim);
FieldRecord.popState($RECORDS);
}
}
public final Checkpoint $GET$CHECKPOINT_ANONYMOUS(){
return $CHECKPOINT;
}
public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint){
if ($CHECKPOINT != checkpoint) {
Checkpoint oldCheckpoint=$CHECKPOINT;
if (checkpoint != null) {
$RECORD$$CHECKPOINT.add($CHECKPOINT,checkpoint.getTimestamp());
FieldRecord.pushState($RECORDS);
}
$CHECKPOINT=checkpoint;
oldCheckpoint.setCheckpoint(checkpoint);
checkpoint.addObject(new _PROXY_());
}
return this;
}
private FieldRecord $RECORD$i=new FieldRecord(0);
private FieldRecord $RECORD$position=new FieldRecord(0);
private FieldRecord[] $RECORDS=new FieldRecord[]{$RECORD$i,$RECORD$position};
{
$CHECKPOINT.addObject(new _PROXY_());
}
}
;
}

Fixed version (ground truth):
public ListIterator listIterator(final int index){
  checkMod();
  checkBoundsInclusive(index);
  return new ListIterator(){
    private final ListIterator i=backingList.listIterator(index + offset);
    private int position=index;
    public boolean hasNext(){
      checkMod();
      return position < size;
    }
    public boolean hasPrevious(){
      checkMod();
      return position > 0;
    }
    public Object next(){
      if (position == size)       throw new NoSuchElementException();
      $ASSIGN$SPECIAL$position(11,position);
      return i.next();
    }
    public Object previous(){
      if (position == 0)       throw new NoSuchElementException();
      $ASSIGN$SPECIAL$position(12,position);
      return i.previous();
    }
    public int nextIndex(){
      return i.nextIndex() - offset;
    }
    public int previousIndex(){
      return i.previousIndex() - offset;
    }
    public void remove(){
      i.remove();
      $ASSIGN$SPECIAL$size(12,size);
      $ASSIGN$position(nextIndex());
      setModCount(backingList.getModCount());
    }
    public void set(    Object o){
      i.set(o);
    }
    public void add(    Object o){
      i.add(o);
      $ASSIGN$SPECIAL$size(11,size);
      $ASSIGN$SPECIAL$position(11,position);
      setModCount(backingList.getModCount());
    }
final class _PROXY_ implements Rollbackable {
      public final void $COMMIT(      long timestamp){
        $COMMIT_ANONYMOUS(timestamp);
      }
      public final void $RESTORE(      long timestamp,      boolean trim){
        $RESTORE_ANONYMOUS(timestamp,trim);
      }
      public final Checkpoint $GET$CHECKPOINT(){
        return $GET$CHECKPOINT_ANONYMOUS();
      }
      public final Object $SET$CHECKPOINT(      Checkpoint checkpoint){
        $SET$CHECKPOINT_ANONYMOUS(checkpoint);
        return this;
      }
    }
    private final int $ASSIGN$position(    int newValue){
      if ($CHECKPOINT != null && $CHECKPOINT.getTimestamp() > 0) {
        $RECORD$position.add(null,position,$CHECKPOINT.getTimestamp());
      }
      return position=newValue;
    }
    private final int $ASSIGN$SPECIAL$position(    int operator,    long newValue){
      if ($CHECKPOINT != null && $CHECKPOINT.getTimestamp() > 0) {
        $RECORD$position.add(null,position,$CHECKPOINT.getTimestamp());
      }
switch (operator) {
case 0:
        return position+=newValue;
case 1:
      return position-=newValue;
case 2:
    return position*=newValue;
case 3:
  return position/=newValue;
case 4:
return position&=newValue;
case 5:
return position|=newValue;
case 6:
return position^=newValue;
case 7:
return position%=newValue;
case 8:
return position<<=newValue;
case 9:
return position>>=newValue;
case 10:
return position>>>=newValue;
case 11:
return position++;
case 12:
return position--;
case 13:
return ++position;
case 14:
return --position;
default :
return position;
}
}
public void $COMMIT_ANONYMOUS(long timestamp){
FieldRecord.commit($RECORDS,timestamp,$RECORD$$CHECKPOINT.getTopTimestamp());
$RECORD$$CHECKPOINT.commit(timestamp);
}
public void $RESTORE_ANONYMOUS(long timestamp,boolean trim){
$RECORD$i.restore(i,timestamp,trim);
position=$RECORD$position.restore(position,timestamp,trim);
if (timestamp <= $RECORD$$CHECKPOINT.getTopTimestamp()) {
$CHECKPOINT=$RECORD$$CHECKPOINT.restore($CHECKPOINT,new _PROXY_(),timestamp,trim);
FieldRecord.popState($RECORDS);
$RESTORE_ANONYMOUS(timestamp,trim);
}
}
public final Checkpoint $GET$CHECKPOINT_ANONYMOUS(){
return $CHECKPOINT;
}
public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint){
if ($CHECKPOINT != checkpoint) {
Checkpoint oldCheckpoint=$CHECKPOINT;
if (checkpoint != null) {
$RECORD$$CHECKPOINT.add($CHECKPOINT,checkpoint.getTimestamp());
FieldRecord.pushState($RECORDS);
}
$CHECKPOINT=checkpoint;
oldCheckpoint.setCheckpoint(checkpoint);
checkpoint.addObject(new _PROXY_());
}
return this;
}
private FieldRecord $RECORD$i=new FieldRecord(0);
private FieldRecord $RECORD$position=new FieldRecord(0);
private FieldRecord[] $RECORDS=new FieldRecord[]{$RECORD$i,$RECORD$position};
{
$CHECKPOINT.addObject(new _PROXY_());
}
}
;
}