Program: 35411
Project: 35411
Buggy source:
@Override public FieldSet createGroupLayoutFieldSet(FlexibleElementContainer container,final LayoutGroupDTO groupLayout,DispatchQueue queue,final Integer iterationId,final IterableGroupPanel tabPanel,final IterableGroupItem tabItem){
  final ProjectDTO project=(ProjectDTO)container;
  final FieldSet fieldSet=(FieldSet)groupLayout.getWidget();
  if (ClientUtils.isEmpty(groupLayout.getConstraints())) {
    return fieldSet;
  }
  for (  final LayoutConstraintDTO constraintDTO : groupLayout.getConstraints()) {
    final FlexibleElementDTO elementDTO=constraintDTO.getFlexibleElementDTO();
    if (elementDTO.isDisabled()) {
      continue;
    }
    final Integer amendmentId;
    if (project.getCurrentAmendment() != null) {
      amendmentId=project.getCurrentAmendment().getId();
    }
 else {
      amendmentId=null;
    }
    GetValue getValue;
    getValue=new GetValue(project.getId(),elementDTO.getId(),elementDTO.getEntityName(),amendmentId,iterationId);
    queue.add(getValue,new CommandResultHandler<ValueResult>(){
      @Override public void onCommandFailure(      final Throwable throwable){
        if (Log.isErrorEnabled()) {
          Log.error("String_Node_Str",throwable);
        }
        throw new RuntimeException(throwable);
      }
      @Override public void onCommandSuccess(      final ValueResult valueResult){
        if (Log.isDebugEnabled()) {
          Log.debug("String_Node_Str" + valueResult);
        }
        elementDTO.setService(dispatch);
        elementDTO.setAuthenticationProvider(injector.getAuthenticationProvider());
        elementDTO.setEventBus(eventBus);
        elementDTO.setCache(injector.getClientCache());
        elementDTO.setCurrentContainerDTO(project);
        elementDTO.setTransfertManager(injector.getTransfertManager());
        elementDTO.assignValue(valueResult);
        elementDTO.setTabPanel(tabPanel);
        final ProjectPresenter projectPresenter=injector.getProjectPresenter();
        elementDTO.init();
        final Component elementComponent=elementDTO.getElementComponent(valueResult);
        if (elementDTO.getAmendable() && projectPresenter.projectIsLocked() && projectPresenter.canUnlockProject()&& !ProfileUtils.isGranted(auth(),GlobalPermissionEnum.MODIFY_LOCKED_CONTENT)) {
          projectPresenter.addUnlockProjectPopup(elementDTO,elementComponent,new LoadingMask(view.getTabPanelPhases()));
        }
        final FormData formData;
        if (elementDTO.getPreferredWidth() == 0) {
          formData=new FormData("String_Node_Str");
        }
 else {
          formData=new FormData(elementDTO.getPreferredWidth(),-1);
        }
        if (elementComponent != null) {
          fieldSet.add(elementComponent,formData);
        }
        fieldSet.layout();
        computationTriggerManager.listenToValueChangesOfElement(elementDTO,elementComponent,valueChanges);
        elementDTO.addValueHandler(new ValueHandler(){
          @Override public void onValueChange(          final ValueEvent event){
            if (tabPanel != null) {
              event.setIterationId(tabPanel.getCurrentIterationId());
            }
            valueChanges.add(event);
            if (!getCurrentDisplayedPhase().isEnded()) {
              refreshSaveButtonState();
            }
          }
        }
);
        if (elementDTO.getValidates()) {
          elementDTO.addRequiredValueHandler(new RequiredValueHandler(){
            @Override public void onRequiredValueChange(            RequiredValueEvent event){
              final Integer iterationId=tabPanel != null ? tabPanel.getCurrentIterationId() : null;
              currentPhaseRequiredElements.putActual(iterationId,elementDTO.getId(),event.isValueOn());
              if (isCurrentPhase(getCurrentProject().getCurrentPhase())) {
                activePhaseRequiredElements.putActual(iterationId,elementDTO.getId(),event.isValueOn());
              }
              if (event.isImmediate()) {
                view.getButtonSavePhase().fireEvent(Events.OnClick);
              }
              elementDTO.setFilledIn(currentPhaseRequiredElements.isActuallyTrue(elementDTO.getId()));
              view.getGridRequiredElements().getStore().update(elementDTO);
              elementDTO.getTabPanel().setElementValidity(elementDTO,event.isValueOn());
              refreshRequiredElementContentPanelHeader();
            }
          }
);
          if (tabItem != null) {
            tabItem.setElementValidity(elementDTO,elementDTO.isCorrectRequiredValue(valueResult));
            tabItem.refreshTitle();
          }
          elementDTO.setGroup(groupLayout);
          elementDTO.setConstraint(constraintDTO);
          requiredElementsSet.add(elementDTO);
          view.getGridRequiredElements().getStore().removeAll();
          view.getGridRequiredElements().getStore().add(sortRequiredElements(new ArrayList<FlexibleElementDTO>(requiredElementsSet)));
          refreshRequiredElementContentPanelHeader();
          currentPhaseRequiredElements.putSaved(iterationId,elementDTO.getId(),elementDTO.isFilledIn());
          if (isCurrentPhase(getCurrentProject().getCurrentPhase())) {
            activePhaseRequiredElements.putSaved(iterationId,elementDTO.getId(),elementDTO.isFilledIn());
          }
        }
      }
    }
,new LoadingMask(view.getTabPanelPhases()));
  }
  fieldSet.setCollapsible(false);
  fieldSet.setAutoHeight(true);
  fieldSet.setBorders(false);
  fieldSet.setHeadingHtml("String_Node_Str");
  return fieldSet;
}

Fixed version (ground truth):
@Override public FieldSet createGroupLayoutFieldSet(FlexibleElementContainer container,final LayoutGroupDTO groupLayout,DispatchQueue queue,final Integer iterationId,final IterableGroupPanel tabPanel,final IterableGroupItem tabItem){
  final ProjectDTO project=(ProjectDTO)container;
  final FieldSet fieldSet=(FieldSet)groupLayout.getWidget();
  if (ClientUtils.isEmpty(groupLayout.getConstraints())) {
    return fieldSet;
  }
  for (  final LayoutConstraintDTO constraintDTO : groupLayout.getConstraints()) {
    final FlexibleElementDTO elementDTO=constraintDTO.getFlexibleElementDTO();
    if (elementDTO.isDisabled()) {
      continue;
    }
    final Integer amendmentId;
    if (project.getCurrentAmendment() != null) {
      amendmentId=project.getCurrentAmendment().getId();
    }
 else {
      amendmentId=null;
    }
    GetValue getValue;
    getValue=new GetValue(project.getId(),elementDTO.getId(),elementDTO.getEntityName(),amendmentId,iterationId);
    queue.add(getValue,new CommandResultHandler<ValueResult>(){
      @Override public void onCommandFailure(      final Throwable throwable){
        if (Log.isErrorEnabled()) {
          Log.error("String_Node_Str",throwable);
        }
        throw new RuntimeException(throwable);
      }
      @Override public void onCommandSuccess(      final ValueResult valueResult){
        if (Log.isDebugEnabled()) {
          Log.debug("String_Node_Str" + valueResult);
        }
        elementDTO.setService(dispatch);
        elementDTO.setAuthenticationProvider(injector.getAuthenticationProvider());
        elementDTO.setEventBus(eventBus);
        elementDTO.setCache(injector.getClientCache());
        elementDTO.setCurrentContainerDTO(project);
        elementDTO.setTransfertManager(injector.getTransfertManager());
        elementDTO.assignValue(valueResult);
        elementDTO.setTabPanel(tabPanel);
        final ProjectPresenter projectPresenter=injector.getProjectPresenter();
        elementDTO.init();
        final Component elementComponent=elementDTO.getElementComponent(valueResult);
        if (elementDTO.getAmendable() && projectPresenter.projectIsLocked() && projectPresenter.canUnlockProject()&& !ProfileUtils.isGranted(auth(),GlobalPermissionEnum.MODIFY_LOCKED_CONTENT)) {
          projectPresenter.addUnlockProjectPopup(elementDTO,elementComponent,new LoadingMask(view.getTabPanelPhases()));
        }
        final FormData formData;
        if (elementDTO.getPreferredWidth() == 0) {
          formData=new FormData("String_Node_Str");
        }
 else {
          formData=new FormData(elementDTO.getPreferredWidth(),-1);
        }
        if (elementComponent != null) {
          fieldSet.add(elementComponent,formData);
        }
        fieldSet.layout();
        computationTriggerManager.listenToValueChangesOfElement(elementDTO,elementComponent,valueChanges);
        elementDTO.addValueHandler(new ValueHandler(){
          @Override public void onValueChange(          final ValueEvent event){
            if (tabPanel != null) {
              event.setIterationId(tabPanel.getCurrentIterationId());
            }
            valueChanges.add(event);
            if (!getCurrentDisplayedPhase().isEnded()) {
              refreshSaveButtonState();
            }
          }
        }
);
        if (elementDTO.getValidates()) {
          elementDTO.addRequiredValueHandler(new RequiredValueHandler(){
            @Override public void onRequiredValueChange(            RequiredValueEvent event){
              final Integer iterationId=tabPanel != null ? tabPanel.getCurrentIterationId() : null;
              currentPhaseRequiredElements.putActual(iterationId,elementDTO.getId(),event.isValueOn());
              if (isCurrentPhase(getCurrentProject().getCurrentPhase())) {
                activePhaseRequiredElements.putActual(iterationId,elementDTO.getId(),event.isValueOn());
              }
              if (event.isImmediate()) {
                view.getButtonSavePhase().fireEvent(Events.OnClick);
              }
              elementDTO.setFilledIn(currentPhaseRequiredElements.isActuallyTrue(elementDTO.getId()));
              view.getGridRequiredElements().getStore().update(elementDTO);
              if (iterationId != null) {
                elementDTO.getTabPanel().setElementValidity(elementDTO,event.isValueOn());
              }
              refreshRequiredElementContentPanelHeader();
            }
          }
);
          if (tabItem != null) {
            tabItem.setElementValidity(elementDTO,elementDTO.isCorrectRequiredValue(valueResult));
            tabItem.refreshTitle();
          }
          elementDTO.setGroup(groupLayout);
          elementDTO.setConstraint(constraintDTO);
          requiredElementsSet.add(elementDTO);
          view.getGridRequiredElements().getStore().removeAll();
          view.getGridRequiredElements().getStore().add(sortRequiredElements(new ArrayList<FlexibleElementDTO>(requiredElementsSet)));
          refreshRequiredElementContentPanelHeader();
          currentPhaseRequiredElements.putSaved(iterationId,elementDTO.getId(),elementDTO.isFilledIn());
          if (isCurrentPhase(getCurrentProject().getCurrentPhase())) {
            activePhaseRequiredElements.putSaved(iterationId,elementDTO.getId(),elementDTO.isFilledIn());
          }
        }
      }
    }
,new LoadingMask(view.getTabPanelPhases()));
  }
  fieldSet.setCollapsible(false);
  fieldSet.setAutoHeight(true);
  fieldSet.setBorders(false);
  fieldSet.setHeadingHtml("String_Node_Str");
  return fieldSet;
}