Program: 35347
Project: 35347
Buggy source:
/** 
 * Method executed on save button action.
 */
private void onSaveAction(){
  if (!iterationChanges.isEmpty()) {
    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();
      }
    }
    UpdateLayoutGroupIterations updateLayoutGroupIterations=new UpdateLayoutGroupIterations(iterationChangesList,getProject().getId());
    dispatch.execute(updateLayoutGroupIterations,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 UpdateProject(getProject().getId(),valueChanges),new CommandResultHandler<VoidResult>(){
          @Override public void onCommandFailure(          final Throwable caught){
            N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
          }
          @Override public void onCommandSuccess(          final VoidResult result){
            updateProject();
          }
        }
,new LoadingMask(view.getMainPanel()));
      }
    }
,view.getSaveButton(),new LoadingMask(view.getMainPanel()));
  }
 else {
    dispatch.execute(new UpdateProject(getProject().getId(),valueChanges),new CommandResultHandler<VoidResult>(){
      @Override public void onCommandFailure(      final Throwable caught){
        N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
      }
      @Override public void onCommandSuccess(      final VoidResult result){
        updateProject();
      }
    }
,view.getSaveButton(),new LoadingMask(view.getMainPanel()));
  }
}

Fixed version (ground truth):
/** 
 * Method executed on save button action.
 */
private void onSaveAction(){
  if (!iterationChanges.isEmpty()) {
    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();
      }
    }
    UpdateLayoutGroupIterations updateLayoutGroupIterations=new UpdateLayoutGroupIterations(iterationChangesList,getProject().getId());
    dispatch.execute(updateLayoutGroupIterations,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();
              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();
        dispatch.execute(new UpdateProject(getProject().getId(),valueChanges),new CommandResultHandler<VoidResult>(){
          @Override public void onCommandFailure(          final Throwable caught){
            N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
          }
          @Override public void onCommandSuccess(          final VoidResult result){
            updateProject();
          }
        }
,new LoadingMask(view.getMainPanel()));
      }
    }
,view.getSaveButton(),new LoadingMask(view.getMainPanel()));
  }
 else {
    dispatch.execute(new UpdateProject(getProject().getId(),valueChanges),new CommandResultHandler<VoidResult>(){
      @Override public void onCommandFailure(      final Throwable caught){
        N10N.error(I18N.CONSTANTS.save(),I18N.CONSTANTS.saveError());
      }
      @Override public void onCommandSuccess(      final VoidResult result){
        updateProject();
      }
    }
,view.getSaveButton(),new LoadingMask(view.getMainPanel()));
  }
}