Program: 35364
Project: 35364
Buggy source:
private void updateContact(final ContactDTO contactDTO,final AsyncCallback<ContactDTO> callback,final Component target){
  dispatch.execute(new UpdateLayoutGroupIterations(new ArrayList<IterationChange>(iterationChanges.values()),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){
      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();
      dispatch.execute(new UpdateContact(contactDTO.getId(),valueChanges),new CommandResultHandler<VoidResult>(){
        @Override public void onCommandFailure(        final Throwable caught){
          N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
        }
        @Override protected void onCommandSuccess(        final VoidResult result){
          N10N.infoNotif(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.saveConfirm());
          eventBus.fireEvent(new UpdateEvent(UpdateEvent.CONTACT_UPDATE,contactDTO));
          for (          final ValueEvent event : valueChanges) {
            if (event.getSource() instanceof DefaultContactFlexibleElementDTO) {
              updateCurrentContact(contactDTO,(DefaultContactFlexibleElementDTO)event.getSource(),event.getSingleValue());
            }
          }
          valueChanges.clear();
          if (callback != null) {
            callback.onSuccess(contactDTO);
          }
        }
      }
,view.getSaveButton(),new LoadingMask(view.getDetailsContainer()),new LoadingMask(target));
    }
  }
,view.getSaveButton(),new LoadingMask(view.getDetailsContainer()),new LoadingMask(target));
}

Fixed version (ground truth):
private void updateContact(final ContactDTO contactDTO,final AsyncCallback<ContactDTO> callback,final Component target){
  dispatch.execute(new UpdateLayoutGroupIterations(new ArrayList<IterationChange>(iterationChanges.values()),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){
      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();
      dispatch.execute(new UpdateContact(contactDTO.getId(),valueChanges),new CommandResultHandler<VoidResult>(){
        @Override public void onCommandFailure(        final Throwable caught){
          N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
        }
        @Override protected void onCommandSuccess(        final VoidResult result){
          N10N.infoNotif(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.saveConfirm());
          eventBus.fireEvent(new UpdateEvent(UpdateEvent.CONTACT_UPDATE,contactDTO));
          for (          final ValueEvent event : valueChanges) {
            if (event.getSource() instanceof DefaultContactFlexibleElementDTO) {
              updateCurrentContact(contactDTO,(DefaultContactFlexibleElementDTO)event.getSource(),event.getSingleValue());
            }
          }
          valueChanges.clear();
          if (callback != null) {
            callback.onSuccess(contactDTO);
          }
          refresh(contactDTO);
        }
      }
,view.getSaveButton(),new LoadingMask(view.getDetailsContainer()),new LoadingMask(target));
    }
  }
,view.getSaveButton(),new LoadingMask(view.getDetailsContainer()),new LoadingMask(target));
}