Program: 35484
Project: 35484
Buggy source:
/** 
 * Loads the presenter with the org unit details.
 * @param details The details.
 */
private void load(OrgUnitDetailsDTO details){
  computationTriggerManager.prepareForOrgUnit(getOrgUnit());
  view.getContentOrgUnitDetailsPanel().removeAll();
  final LayoutDTO layout=details.getLayout();
  int count=0;
  for (  final LayoutGroupDTO groupDTO : layout.getGroups()) {
    count+=groupDTO.getConstraints().size();
  }
  if (count == 0) {
    view.setMainPanelWidget(new Label(I18N.CONSTANTS.projectDetailsNoDetails()));
    return;
  }
  final Grid gridLayout=new Grid(layout.getRowsCount(),layout.getColumnsCount());
  gridLayout.setCellPadding(0);
  gridLayout.setCellSpacing(0);
  gridLayout.setWidth("String_Node_Str");
  final DispatchQueue queue=new DispatchQueue(dispatch,true);
  for (  final LayoutGroupDTO groupLayout : layout.getGroups()) {
    if (!groupLayout.getHasIterations()) {
      FieldSet fieldSet=createGroupLayoutFieldSet(getOrgUnit(),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,getOrgUnit(),ProfileUtils.isGranted(auth(),GlobalPermissionEnum.CREATE_ITERATIONS));
    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);
    GetLayoutGroupIterations getIterations=new GetLayoutGroupIterations(groupLayout.getId(),getOrgUnit().getId(),-1);
    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(getOrgUnit(),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.getContentOrgUnitDetailsPanel()));
    fieldSet.layout();
  }
  queue.start();
  view.setMainPanelWidget(gridLayout);
}

Fixed version (ground truth):
/** 
 * Loads the presenter with the org unit details.
 * @param details The details.
 */
private void load(OrgUnitDetailsDTO details){
  computationTriggerManager.prepareForOrgUnit(getOrgUnit());
  view.getContentOrgUnitDetailsPanel().removeAll();
  final LayoutDTO layout=details.getLayout();
  int count=0;
  for (  final LayoutGroupDTO groupDTO : layout.getGroups()) {
    count+=groupDTO.getConstraints().size();
  }
  if (count == 0) {
    view.setMainPanelWidget(new Label(I18N.CONSTANTS.projectDetailsNoDetails()));
    return;
  }
  final Grid gridLayout=new Grid(layout.getRowsCount(),layout.getColumnsCount());
  gridLayout.setCellPadding(0);
  gridLayout.setCellSpacing(0);
  gridLayout.setWidth("String_Node_Str");
  final DispatchQueue queue=new DispatchQueue(dispatch,true);
  for (  final LayoutGroupDTO groupLayout : layout.getGroups()) {
    if (!groupLayout.getHasIterations()) {
      FieldSet fieldSet=createGroupLayoutFieldSet(getOrgUnit(),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,getOrgUnit(),ProfileUtils.isGranted(auth(),GlobalPermissionEnum.CREATE_ITERATIONS));
    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);
    GetLayoutGroupIterations getIterations=new GetLayoutGroupIterations(groupLayout.getId(),getOrgUnit().getId(),-1);
    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(getOrgUnit(),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.getContentOrgUnitDetailsPanel()));
    fieldSet.layout();
  }
  queue.start();
  view.setMainPanelWidget(gridLayout);
}