Program: 35345
Project: 35345
Buggy source:
private void updateWithIterationChanges(final ContactDTO contactDTO,final AsyncCallback<ContactDTO> callback,final Component target){
  final List<IterationChange> iterationChangesList=new ArrayList<IterationChange>(iterationChanges.values());
  Iterator<IterationChange> iterator=iterationChangesList.iterator();
  while (iterator.hasNext()) {
    IterationChange iterationChange=iterator.next();
    if (iterationChange.isCreated() && Profiler.INSTANCE.isOfflineMode()) {
      iterator.remove();
    }
  }
  dispatch.execute(new UpdateLayoutGroupIterations(iterationChangesList,contactDTO.getId()),new CommandResultHandler<ListResult<IterationChange>>(){
    @Override public void onCommandFailure(    final Throwable caught){
      N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
    }
    @Override protected void onCommandSuccess(    ListResult<IterationChange> result){
      if (result != null) {
        for (        IterationChange iterationChange : result.getList()) {
          if (iterationChange.isDeleted()) {
            Iterator<ValueEvent> valuesIterator=valueChanges.iterator();
            while (valuesIterator.hasNext()) {
              ValueEvent valueEvent=valuesIterator.next();
              if (valueEvent.getIterationId() == iterationChange.getIterationId()) {
                valuesIterator.remove();
              }
            }
          }
 else           if (iterationChange.isCreated()) {
            int oldId=iterationChange.getIterationId();
            int newId=iterationChange.getNewIterationId();
            newIterationsTabItems.get(oldId).setIterationId(newId);
            for (            ValueEvent valueEvent : valueChanges) {
              if (valueEvent.getIterationId() == oldId) {
                valueEvent.setIterationId(newId);
              }
            }
          }
        }
        iterationChanges.clear();
        newIterationsTabItems.clear();
        updateContactValues(contactDTO,callback,target);
      }
 else {
        N10N.infoNotif(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.saveConfirm());
      }
    }
  }
,view.getSaveButton(),new LoadingMask(view.getDetailsContainer()),new LoadingMask(target));
}

Fixed version (ground truth):
private void updateWithIterationChanges(final ContactDTO contactDTO,final AsyncCallback<ContactDTO> callback,final Component target){
  final List<IterationChange> iterationChangesList=new ArrayList<IterationChange>(iterationChanges.values());
  Iterator<IterationChange> iterator=iterationChangesList.iterator();
  while (iterator.hasNext()) {
    IterationChange iterationChange=iterator.next();
    if (iterationChange.isCreated() && Profiler.INSTANCE.isOfflineMode()) {
      iterator.remove();
    }
  }
  dispatch.execute(new UpdateLayoutGroupIterations(iterationChangesList,contactDTO.getId()),new CommandResultHandler<ListResult<IterationChange>>(){
    @Override public void onCommandFailure(    final Throwable caught){
      N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
    }
    @Override protected void onCommandSuccess(    ListResult<IterationChange> result){
      if (result != null) {
        for (        IterationChange iterationChange : result.getList()) {
          if (iterationChange.isDeleted()) {
            Iterator<ValueEvent> valuesIterator=valueChanges.iterator();
            while (valuesIterator.hasNext()) {
              ValueEvent valueEvent=valuesIterator.next();
              Integer iterationId=valueEvent.getIterationId();
              if (iterationId != null && iterationId == iterationChange.getIterationId()) {
                valuesIterator.remove();
              }
            }
          }
 else           if (iterationChange.isCreated()) {
            int oldId=iterationChange.getIterationId();
            int newId=iterationChange.getNewIterationId();
            newIterationsTabItems.get(oldId).setIterationId(newId);
            for (            ValueEvent valueEvent : valueChanges) {
              Integer iterationId=valueEvent.getIterationId();
              if (iterationId != null && iterationId == oldId) {
                valueEvent.setIterationId(newId);
              }
            }
          }
        }
        iterationChanges.clear();
        newIterationsTabItems.clear();
        updateContactValues(contactDTO,callback,target);
      }
 else {
        N10N.infoNotif(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.saveConfirm());
      }
    }
  }
,view.getSaveButton(),new LoadingMask(view.getDetailsContainer()),new LoadingMask(target));
}