Program: 35651
Project: 35651
Buggy source:
private Grid<FlexibleElementDTO> buildFieldsListGrid(){
  List<ColumnConfig> configs=new ArrayList<ColumnConfig>();
  ColumnConfig column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleName(),300);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    final FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      if ((projectModel != null && ProjectModelStatus.DRAFT.equals(projectModel.getStatus())) || (orgUnitModel != null && ProjectModelStatus.DRAFT.equals(orgUnitModel.getStatus()))) {
        final Anchor nameHyperlink;
        if (ElementTypeEnum.DEFAULT.equals(model.getElementType())) {
          nameHyperlink=new Anchor(DefaultFlexibleElementType.getName(((DefaultFlexibleElementDTO)model).getType()),true);
        }
 else         nameHyperlink=new Anchor(model.getLabel().replace("String_Node_Str","String_Node_Str"),true);
        nameHyperlink.addStyleName("String_Node_Str");
        nameHyperlink.addClickHandler(new ClickHandler(){
          @Override public void onClick(          ClickEvent event){
            showNewFlexibleElementForm(model,true);
          }
        }
);
        return nameHyperlink;
      }
 else {
        if (ElementTypeEnum.DEFAULT.equals(model.getElementType()))         return AdminUtil.createGridText(DefaultFlexibleElementType.getName(((DefaultFlexibleElementDTO)model).getType()).replace("String_Node_Str","String_Node_Str"));
 else         return AdminUtil.createGridText(model.getLabel().replace("String_Node_Str","String_Node_Str"));
      }
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleType(),125);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      return AdminUtil.createGridText(ElementTypeEnum.getName(model.getElementType()));
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleCompulsory(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      CheckBox validates=AdminUtil.createCheckBox(I18N.CONSTANTS.adminFlexibleCompulsory(),null);
      validates.disable();
      validates.setValue(model.getValidates());
      return validates;
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminProfilesPrivacyGroups(),125);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      PrivacyGroupDTO privacy=model.getPrivacyGroup();
      if (privacy != null)       return AdminUtil.createGridText(privacy.getTitle());
 else       return AdminUtil.createGridText("String_Node_Str");
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleAmendable(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      CheckBox amendable=AdminUtil.createCheckBox(I18N.CONSTANTS.adminFlexibleAmendable(),null);
      amendable.setValue(model.getAmendable());
      amendable.disable();
      return amendable;
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.Admin_BANNER(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      CheckBox banner=AdminUtil.createCheckBox(I18N.CONSTANTS.Admin_BANNER(),null);
      if (model.getBannerConstraint() != null) {
        banner.setValue(true);
      }
      banner.disable();
      return banner;
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleBannerPosition(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      if (model.getBannerConstraint() != null) {
        int order=model.getBannerConstraint().getSortOrder();
        return AdminUtil.createGridText(String.valueOf(order));
      }
      return AdminUtil.createGridText("String_Node_Str");
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleContainer(),120);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      BaseModelData container=model.getContainerModel();
      return AdminUtil.createGridText((String)container.get("String_Node_Str"));
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleGroup(),200);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    final FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      LayoutGroupDTO group=model.getGroup();
      if ((projectModel != null && ProjectModelStatus.DRAFT.equals(projectModel.getStatus())) || (orgUnitModel != null && ProjectModelStatus.DRAFT.equals(orgUnitModel.getStatus()))) {
        final Anchor nameHyperlink=new Anchor((String)group.get("String_Node_Str"),true);
        nameHyperlink.addStyleName("String_Node_Str");
        nameHyperlink.addClickHandler(new ClickHandler(){
          @Override public void onClick(          ClickEvent event){
            showNewGroupForm(model,true);
          }
        }
);
        return nameHyperlink;
      }
 else {
        return AdminUtil.createGridText((String)group.get("String_Node_Str"));
      }
    }
  }
);
  configs.add(column);
  ColumnModel cm=new ColumnModel(configs);
  fieldsStore.setSortField("String_Node_Str");
  Grid<FlexibleElementDTO> grid=new Grid<FlexibleElementDTO>(fieldsStore,cm);
  return grid;
}

Fixed version (ground truth):
private Grid<FlexibleElementDTO> buildFieldsListGrid(){
  List<ColumnConfig> configs=new ArrayList<ColumnConfig>();
  ColumnConfig column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleName(),300);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    final FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      if ((projectModel != null && ProjectModelStatus.DRAFT.equals(projectModel.getStatus())) || (orgUnitModel != null && ProjectModelStatus.DRAFT.equals(orgUnitModel.getStatus()))) {
        final Anchor nameHyperlink;
        if (ElementTypeEnum.DEFAULT.equals(model.getElementType())) {
          nameHyperlink=new Anchor(DefaultFlexibleElementType.getName(((DefaultFlexibleElementDTO)model).getType()),true);
        }
 else         nameHyperlink=new Anchor(model.getLabel(),true);
        nameHyperlink.addStyleName("String_Node_Str");
        nameHyperlink.addClickHandler(new ClickHandler(){
          @Override public void onClick(          ClickEvent event){
            showNewFlexibleElementForm(model,true);
          }
        }
);
        return nameHyperlink;
      }
 else {
        if (ElementTypeEnum.DEFAULT.equals(model.getElementType()))         return AdminUtil.createGridText(DefaultFlexibleElementType.getName(((DefaultFlexibleElementDTO)model).getType()));
 else         return AdminUtil.createGridText(model.getLabel());
      }
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleType(),125);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      return AdminUtil.createGridText(ElementTypeEnum.getName(model.getElementType()));
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleCompulsory(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      CheckBox validates=AdminUtil.createCheckBox(I18N.CONSTANTS.adminFlexibleCompulsory(),null);
      validates.disable();
      validates.setValue(model.getValidates());
      return validates;
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminProfilesPrivacyGroups(),125);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      PrivacyGroupDTO privacy=model.getPrivacyGroup();
      if (privacy != null)       return AdminUtil.createGridText(privacy.getTitle());
 else       return AdminUtil.createGridText("String_Node_Str");
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleAmendable(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      CheckBox amendable=AdminUtil.createCheckBox(I18N.CONSTANTS.adminFlexibleAmendable(),null);
      amendable.setValue(model.getAmendable());
      amendable.disable();
      return amendable;
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.Admin_BANNER(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      CheckBox banner=AdminUtil.createCheckBox(I18N.CONSTANTS.Admin_BANNER(),null);
      if (model.getBannerConstraint() != null) {
        banner.setValue(true);
      }
      banner.disable();
      return banner;
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleBannerPosition(),50);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      if (model.getBannerConstraint() != null) {
        int order=model.getBannerConstraint().getSortOrder();
        return AdminUtil.createGridText(String.valueOf(order));
      }
      return AdminUtil.createGridText("String_Node_Str");
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleContainer(),120);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      BaseModelData container=model.getContainerModel();
      return AdminUtil.createGridText((String)container.get("String_Node_Str"));
    }
  }
);
  configs.add(column);
  column=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.adminFlexibleGroup(),200);
  column.setRenderer(new GridCellRenderer<FlexibleElementDTO>(){
    @Override public Object render(    final FlexibleElementDTO model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<FlexibleElementDTO> store,    Grid<FlexibleElementDTO> grid){
      LayoutGroupDTO group=model.getGroup();
      if ((projectModel != null && ProjectModelStatus.DRAFT.equals(projectModel.getStatus())) || (orgUnitModel != null && ProjectModelStatus.DRAFT.equals(orgUnitModel.getStatus()))) {
        final Anchor nameHyperlink=new Anchor((String)group.get("String_Node_Str"),true);
        nameHyperlink.addStyleName("String_Node_Str");
        nameHyperlink.addClickHandler(new ClickHandler(){
          @Override public void onClick(          ClickEvent event){
            showNewGroupForm(model,true);
          }
        }
);
        return nameHyperlink;
      }
 else {
        return AdminUtil.createGridText((String)group.get("String_Node_Str"));
      }
    }
  }
);
  configs.add(column);
  ColumnModel cm=new ColumnModel(configs);
  fieldsStore.setSortField("String_Node_Str");
  Grid<FlexibleElementDTO> grid=new Grid<FlexibleElementDTO>(fieldsStore,cm);
  return grid;
}