Program: 35661
Project: 35661
Buggy source:
public LayoutGroupSigmahForm(Dispatcher dispatcher,final AsyncCallback<CreateResult> callback,FlexibleElementDTO fxToUpdate,ProjectModelDTO projectModelToUpdate,OrgUnitModelDTO orgUnitModelToUpdate){
  this.dispatcher=dispatcher;
  this.projectModelToUpdate=projectModelToUpdate;
  this.orgUnitModelToUpdate=orgUnitModelToUpdate;
  UIConstants constants=GWT.create(UIConstants.class);
  if (fxToUpdate != null) {
    layoutGroupToUpdate=fxToUpdate.getGroup();
  }
  FormLayout layout=new FormLayout();
  layout.setLabelWidth(LABEL_WIDTH);
  setLayout(layout);
  nameField=new TextField<String>();
  nameField.setFieldLabel(constants.adminPrivacyGroupsName());
  nameField.setAllowBlank(false);
  if (layoutGroupToUpdate != null && layoutGroupToUpdate.getTitle() != null && !layoutGroupToUpdate.getTitle().isEmpty())   nameField.setValue(layoutGroupToUpdate.getTitle());
  add(nameField);
  final ListStore<BaseModelData> containersStore=new ListStore<BaseModelData>();
  containerList=new ComboBox<BaseModelData>();
  containerList.setEditable(false);
  containerList.setDisplayField("String_Node_Str");
  containerList.setValueField("String_Node_Str");
  containerList.setFieldLabel(I18N.CONSTANTS.adminFlexibleContainer());
  containerList.setAllowBlank(false);
  containerList.setTriggerAction(TriggerAction.ALL);
  if (projectModelToUpdate != null) {
    containersStore.add(projectModelToUpdate.getProjectDetailsDTO());
    for (    PhaseModelDTO p : projectModelToUpdate.getPhaseModelsDTO()) {
      containersStore.add(p);
    }
  }
 else   if (orgUnitModelToUpdate != null) {
    containersStore.add(orgUnitModelToUpdate.getDetails());
  }
  containerList.setStore(containersStore);
  rowField=new SimpleComboBox<Integer>();
  rowField.setEditable(false);
  rowField.setFieldLabel(constants.adminFlexibleGroupVPosition());
  if (fxToUpdate != null) {
    rowField.setSimpleValue(layoutGroupToUpdate.getRow());
  }
  if (fxToUpdate != null) {
    containerList.setValue(fxToUpdate.getContainerModel());
    if (fxToUpdate.getContainerModel() != null) {
      LayoutDTO container=new LayoutDTO();
      if (fxToUpdate.getContainerModel() instanceof ProjectDetailsDTO) {
        container=((ProjectDetailsDTO)containerList.getValue()).getLayoutDTO();
      }
 else       if (fxToUpdate.getContainerModel() instanceof PhaseModelDTO) {
        container=((PhaseModelDTO)containerList.getValue()).getLayoutDTO();
      }
 else       if (fxToUpdate.getContainerModel() instanceof OrgUnitDetailsDTO) {
        container=((OrgUnitDetailsDTO)containerList.getValue()).getLayout();
      }
      if (container != null) {
        rowField.removeAll();
        for (int i=0; i < container.getRowsCount(); i++) {
          rowField.add(i);
        }
      }
    }
  }
  containerList.addListener(Events.Select,new Listener<BaseEvent>(){
    @Override public void handleEvent(    BaseEvent be){
      LayoutDTO container=null;
      if (containerList.getValue() != null) {
        if (containerList.getValue() instanceof ProjectDetailsDTO) {
          container=((ProjectDetailsDTO)containerList.getValue()).getLayoutDTO();
        }
 else         if (containerList.getValue() instanceof PhaseModelDTO) {
          container=((PhaseModelDTO)containerList.getValue()).getLayoutDTO();
        }
 else         if (containerList.getValue() instanceof OrgUnitDetailsDTO) {
          container=((OrgUnitDetailsDTO)containerList.getValue()).getLayout();
        }
      }
      if (container != null) {
        rowField.removeAll();
        for (int i=0; i < container.getRowsCount(); i++) {
          rowField.add(i);
        }
      }
    }
  }
);
  add(containerList);
  add(rowField);
  final Button createButton=new Button(I18N.CONSTANTS.save());
  createButton.addListener(Events.OnClick,new Listener<ButtonEvent>(){
    @Override public void handleEvent(    ButtonEvent be){
      createLayoutGroup(callback);
    }
  }
);
  add(createButton);
}

Fixed version (ground truth):
public LayoutGroupSigmahForm(Dispatcher dispatcher,final AsyncCallback<CreateResult> callback,FlexibleElementDTO fxToUpdate,ProjectModelDTO projectModelToUpdate,OrgUnitModelDTO orgUnitModelToUpdate){
  this.dispatcher=dispatcher;
  this.projectModelToUpdate=projectModelToUpdate;
  this.orgUnitModelToUpdate=orgUnitModelToUpdate;
  UIConstants constants=GWT.create(UIConstants.class);
  if (fxToUpdate != null) {
    layoutGroupToUpdate=fxToUpdate.getGroup();
  }
  FormLayout layout=new FormLayout();
  layout.setLabelWidth(LABEL_WIDTH);
  setLayout(layout);
  nameField=new TextField<String>();
  nameField.setFieldLabel(constants.adminPrivacyGroupsName());
  nameField.setAllowBlank(false);
  if (layoutGroupToUpdate != null && layoutGroupToUpdate.getTitle() != null && !layoutGroupToUpdate.getTitle().isEmpty())   nameField.setValue(layoutGroupToUpdate.getTitle());
  add(nameField);
  final ListStore<BaseModelData> containersStore=new ListStore<BaseModelData>();
  containerList=new ComboBox<BaseModelData>();
  containerList.setEditable(false);
  containerList.setDisplayField("String_Node_Str");
  containerList.setValueField("String_Node_Str");
  containerList.setFieldLabel(I18N.CONSTANTS.adminFlexibleContainer());
  containerList.setAllowBlank(false);
  containerList.setTriggerAction(TriggerAction.ALL);
  if (projectModelToUpdate != null) {
    containersStore.add(projectModelToUpdate.getProjectDetailsDTO());
    for (    PhaseModelDTO p : projectModelToUpdate.getPhaseModelsDTO()) {
      containersStore.add(p);
    }
  }
 else   if (orgUnitModelToUpdate != null) {
    containersStore.add(orgUnitModelToUpdate.getDetails());
  }
  containerList.setStore(containersStore);
  rowField=new SimpleComboBox<Integer>();
  rowField.setEditable(false);
  rowField.setFieldLabel(constants.adminFlexibleGroupVPosition());
  if (fxToUpdate != null) {
    rowField.setSimpleValue(layoutGroupToUpdate.getRow());
  }
  if (fxToUpdate != null) {
    containerList.setValue(fxToUpdate.getContainerModel());
    if (fxToUpdate.getContainerModel() != null) {
      LayoutDTO container=new LayoutDTO();
      if (fxToUpdate.getContainerModel() instanceof ProjectDetailsDTO) {
        container=((ProjectDetailsDTO)containerList.getValue()).getLayoutDTO();
      }
 else       if (fxToUpdate.getContainerModel() instanceof PhaseModelDTO) {
        container=((PhaseModelDTO)containerList.getValue()).getLayoutDTO();
      }
 else       if (fxToUpdate.getContainerModel() instanceof OrgUnitDetailsDTO) {
        container=((OrgUnitDetailsDTO)containerList.getValue()).getLayout();
      }
      if (container != null) {
        rowField.removeAll();
        for (int i=0; i < container.getRowsCount(); i++) {
          rowField.add(i);
        }
        rowField.add(container.getRowsCount());
      }
    }
  }
  containerList.addListener(Events.Select,new Listener<BaseEvent>(){
    @Override public void handleEvent(    BaseEvent be){
      LayoutDTO container=null;
      if (containerList.getValue() != null) {
        if (containerList.getValue() instanceof ProjectDetailsDTO) {
          container=((ProjectDetailsDTO)containerList.getValue()).getLayoutDTO();
        }
 else         if (containerList.getValue() instanceof PhaseModelDTO) {
          container=((PhaseModelDTO)containerList.getValue()).getLayoutDTO();
        }
 else         if (containerList.getValue() instanceof OrgUnitDetailsDTO) {
          container=((OrgUnitDetailsDTO)containerList.getValue()).getLayout();
        }
      }
      if (container != null) {
        rowField.removeAll();
        for (int i=0; i < container.getRowsCount(); i++) {
          rowField.add(i);
        }
        rowField.add(container.getRowsCount());
      }
    }
  }
);
  add(containerList);
  add(rowField);
  final Button createButton=new Button(I18N.CONSTANTS.save());
  createButton.addListener(Events.OnClick,new Listener<ButtonEvent>(){
    @Override public void handleEvent(    ButtonEvent be){
      createLayoutGroup(callback);
    }
  }
);
  add(createButton);
}