Program: 35658
Project: 35658
Buggy source:
public void showNewGroupForm(final FlexibleElementDTO model,final boolean isUpdate){
  int width=400;
  int height=200;
  String title=I18N.CONSTANTS.adminFlexibleGroup();
  final Window window=new Window();
  window.setHeading(title);
  window.setSize(width,height);
  window.setPlain(true);
  window.setModal(true);
  window.setBlinkModal(true);
  window.setLayout(new FitLayout());
  final LayoutGroupSigmahForm form=new LayoutGroupSigmahForm(dispatcher,new AsyncCallback<CreateResult>(){
    @Override public void onFailure(    Throwable arg0){
      window.hide();
    }
    @Override public void onSuccess(    CreateResult result){
      window.hide();
      if (result != null) {
        if (isUpdate) {
          List<FlexibleElementDTO> modifiedFlexs=AdminFlexibleElementsView.this.getFieldsStore().findModels("String_Node_Str",model.getGroup());
          for (          FlexibleElementDTO modifiedFlex : modifiedFlexs) {
            modifiedFlex.setGroup((LayoutGroupDTO)result.getEntity());
            AdminFlexibleElementsView.this.getFieldsStore().update(modifiedFlex);
          }
          AdminFlexibleElementsView.this.getFieldsStore().commitChanges();
        }
        addedGroups.add((LayoutGroupDTO)result.getEntity());
      }
    }
  }
,model,projectModel,orgUnitModel);
  window.add(form);
  window.show();
}

Fixed version (ground truth):
public void showNewGroupForm(final FlexibleElementDTO model,final boolean isUpdate){
  int width=400;
  int height=200;
  String title=I18N.CONSTANTS.adminFlexibleGroup();
  final Window window=new Window();
  window.setHeading(title);
  window.setSize(width,height);
  window.setPlain(true);
  window.setModal(true);
  window.setBlinkModal(true);
  window.setLayout(new FitLayout());
  final LayoutGroupSigmahForm form=new LayoutGroupSigmahForm(dispatcher,new AsyncCallback<CreateResult>(){
    @Override public void onFailure(    Throwable arg0){
      window.hide();
    }
    @Override public void onSuccess(    CreateResult layoutGroupResult){
      window.hide();
      if (layoutGroupResult != null) {
        if (projectModel != null) {
          GetProjectModel refreshModel=new GetProjectModel();
          refreshModel.setId(projectModel.getId());
          dispatcher.execute(refreshModel,null,new AsyncCallback<ProjectModelDTO>(){
            @Override public void onFailure(            Throwable arg0){
              AdminUtil.alertPbmData(alert);
            }
            @Override public void onSuccess(            ProjectModelDTO modelResult){
              if (modelResult != null) {
                AdminFlexibleElementsView.this.getFieldsStore().removeAll();
                projectModel=modelResult;
                AdminFlexibleElementsView.this.getFieldsStore().add(projectModel.getAllElements());
              }
            }
          }
);
        }
 else         if (orgUnitModel != null) {
          GetOrgUnitModel refreshModel=new GetOrgUnitModel();
          refreshModel.setId(orgUnitModel.getId());
          dispatcher.execute(refreshModel,null,new AsyncCallback<OrgUnitModelDTO>(){
            @Override public void onFailure(            Throwable arg0){
              AdminUtil.alertPbmData(alert);
            }
            @Override public void onSuccess(            OrgUnitModelDTO modelResult){
              if (modelResult != null) {
                AdminFlexibleElementsView.this.getFieldsStore().removeAll();
                orgUnitModel=modelResult;
                AdminFlexibleElementsView.this.getFieldsStore().add(orgUnitModel.getAllElements());
              }
            }
          }
);
        }
        if (isUpdate) {
          List<FlexibleElementDTO> modifiedFlexs=AdminFlexibleElementsView.this.getFieldsStore().findModels("String_Node_Str",model.getGroup());
          for (          FlexibleElementDTO modifiedFlex : modifiedFlexs) {
            modifiedFlex.setGroup((LayoutGroupDTO)layoutGroupResult.getEntity());
            AdminFlexibleElementsView.this.getFieldsStore().update(modifiedFlex);
          }
          AdminFlexibleElementsView.this.getFieldsStore().commitChanges();
        }
        addedGroups.add((LayoutGroupDTO)layoutGroupResult.getEntity());
      }
    }
  }
,model,projectModel,orgUnitModel);
  window.add(form);
  window.show();
}