Program: 35485
Project: 35485
Buggy source:
/** 
 * Loads the presenter with the given project   {@code details}.
 * @param details The project details.
 */
private void load(final ProjectDetailsDTO details){
  computationTriggerManager.prepareForProject(getProject());
  view.getMainPanel().removeAll();
  final LayoutDTO layout=details.getLayout();
  int count=0;
  for (  final LayoutGroupDTO groupDTO : layout.getGroups()) {
    count+=groupDTO.getConstraints().size();
  }
  if (count == 0) {
    final Label label=new Label(I18N.CONSTANTS.projectDetailsNoDetails());
    label.addStyleName(STYLE_PROJECT_LABEL_10);
    view.setMainPanelWidget(label);
    return;
  }
  final Grid gridLayout=(Grid)layout.getWidget();
  final DispatchQueue queue=new DispatchQueue(dispatch,true);
  for (  final LayoutGroupDTO groupLayout : layout.getGroups()) {
    if (!groupLayout.getHasIterations()) {
      FieldSet fieldSet=createGroupLayoutFieldSet(getProject(),groupLayout,queue,null,null,null);
      gridLayout.setWidget(groupLayout.getRow(),groupLayout.getColumn(),fieldSet);
      continue;
    }
    final FieldSet fieldSet=(FieldSet)groupLayout.getWidget();
    gridLayout.setWidget(groupLayout.getRow(),groupLayout.getColumn(),fieldSet);
    final IterableGroupPanel tabPanel=Forms.iterableGroupPanel(dispatch,groupLayout,getProject(),ProfileUtils.isGranted(auth(),GlobalPermissionEnum.CREATE_ITERATIONS) && getProject().getCurrentAmendment() == null);
    tabPanel.setDelegate(this);
    fieldSet.add(tabPanel);
    tabPanel.setAutoHeight(true);
    tabPanel.setAutoWidth(true);
    tabPanel.setTabScroll(true);
    tabPanel.addStyleName("String_Node_Str");
    tabPanel.setBorders(true);
    tabPanel.setBodyBorder(false);
    Integer amendmentId;
    if (getProject().getCurrentAmendment() != null) {
      amendmentId=getProject().getCurrentAmendment().getId();
    }
 else {
      amendmentId=-1;
    }
    GetLayoutGroupIterations getIterations=new GetLayoutGroupIterations(groupLayout.getId(),getProject().getId(),amendmentId);
    queue.add(getIterations,new CommandResultHandler<ListResult<LayoutGroupIterationDTO>>(){
      @Override public void onCommandFailure(      final Throwable throwable){
        if (Log.isErrorEnabled()) {
          Log.error("String_Node_Str",throwable);
        }
        throw new RuntimeException(throwable);
      }
      @Override protected void onCommandSuccess(      ListResult<LayoutGroupIterationDTO> result){
        DispatchQueue iterationsQueue=new DispatchQueue(dispatch,true);
        for (        final LayoutGroupIterationDTO iteration : result.getList()) {
          final IterableGroupItem tab=new IterableGroupItem(tabPanel,iteration.getId(),iteration.getName());
          tabPanel.addIterationTab(tab);
          Layout tabLayout=Layouts.fitLayout();
          tab.setLayout(tabLayout);
          FieldSet tabSet=createGroupLayoutFieldSet(getProject(),groupLayout,iterationsQueue,iteration == null ? null : iteration.getId(),tabPanel,tab);
          tab.add(tabSet);
        }
        iterationsQueue.start();
        if (tabPanel.getItemCount() > 0) {
          tabPanel.setSelection(tabPanel.getItem(0));
        }
      }
    }
,new LoadingMask(view.getMainPanel()));
    fieldSet.layout();
  }
  queue.start();
  view.setMainPanelWidget(gridLayout);
}

Fixed version (ground truth):
/** 
 * Loads the presenter with the given project   {@code details}.
 * @param details The project details.
 */
private void load(final ProjectDetailsDTO details){
  computationTriggerManager.prepareForProject(getProject());
  view.getMainPanel().removeAll();
  final LayoutDTO layout=details.getLayout();
  int count=0;
  for (  final LayoutGroupDTO groupDTO : layout.getGroups()) {
    count+=groupDTO.getConstraints().size();
  }
  if (count == 0) {
    final Label label=new Label(I18N.CONSTANTS.projectDetailsNoDetails());
    label.addStyleName(STYLE_PROJECT_LABEL_10);
    view.setMainPanelWidget(label);
    return;
  }
  final Grid gridLayout=(Grid)layout.getWidget();
  final DispatchQueue queue=new DispatchQueue(dispatch,true);
  for (  final LayoutGroupDTO groupLayout : layout.getGroups()) {
    if (!groupLayout.getHasIterations()) {
      FieldSet fieldSet=createGroupLayoutFieldSet(getProject(),groupLayout,queue,null,null,null);
      fieldSet.setHeadingHtml(groupLayout.getTitle());
      fieldSet.setCollapsible(true);
      fieldSet.setBorders(true);
      gridLayout.setWidget(groupLayout.getRow(),groupLayout.getColumn(),fieldSet);
      continue;
    }
    final FieldSet fieldSet=(FieldSet)groupLayout.getWidget();
    gridLayout.setWidget(groupLayout.getRow(),groupLayout.getColumn(),fieldSet);
    final IterableGroupPanel tabPanel=Forms.iterableGroupPanel(dispatch,groupLayout,getProject(),ProfileUtils.isGranted(auth(),GlobalPermissionEnum.CREATE_ITERATIONS) && getProject().getCurrentAmendment() == null);
    tabPanel.setDelegate(this);
    fieldSet.add(tabPanel);
    tabPanel.setAutoHeight(true);
    tabPanel.setAutoWidth(true);
    tabPanel.setTabScroll(true);
    tabPanel.addStyleName("String_Node_Str");
    tabPanel.setBorders(true);
    tabPanel.setBodyBorder(false);
    Integer amendmentId;
    if (getProject().getCurrentAmendment() != null) {
      amendmentId=getProject().getCurrentAmendment().getId();
    }
 else {
      amendmentId=-1;
    }
    GetLayoutGroupIterations getIterations=new GetLayoutGroupIterations(groupLayout.getId(),getProject().getId(),amendmentId);
    queue.add(getIterations,new CommandResultHandler<ListResult<LayoutGroupIterationDTO>>(){
      @Override public void onCommandFailure(      final Throwable throwable){
        if (Log.isErrorEnabled()) {
          Log.error("String_Node_Str",throwable);
        }
        throw new RuntimeException(throwable);
      }
      @Override protected void onCommandSuccess(      ListResult<LayoutGroupIterationDTO> result){
        DispatchQueue iterationsQueue=new DispatchQueue(dispatch,true);
        for (        final LayoutGroupIterationDTO iteration : result.getList()) {
          final IterableGroupItem tab=new IterableGroupItem(tabPanel,iteration.getId(),iteration.getName());
          tabPanel.addIterationTab(tab);
          Layout tabLayout=Layouts.fitLayout();
          tab.setLayout(tabLayout);
          FieldSet tabSet=createGroupLayoutFieldSet(getProject(),groupLayout,iterationsQueue,iteration == null ? null : iteration.getId(),tabPanel,tab);
          tab.add(tabSet);
        }
        iterationsQueue.start();
        if (tabPanel.getItemCount() > 0) {
          tabPanel.setSelection(tabPanel.getItem(0));
        }
      }
    }
,new LoadingMask(view.getMainPanel()));
    fieldSet.layout();
  }
  queue.start();
  view.setMainPanelWidget(gridLayout);
}