Program: 35641
Project: 35641
Buggy source:
/** 
 * Builds and returns the columns model for the projects tree grid.
 * @return The project tree grid columns model.
 */
private ColumnModel getProjectGridColumnModel(){
  final DateTimeFormat format=DateUtils.DATE_SHORT;
  final ColumnConfig starredIconColumn=new ColumnConfig("String_Node_Str","String_Node_Str",24);
  starredIconColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    private final DashboardImageBundle imageBundle=GWT.create(DashboardImageBundle.class);
    @Override public Object render(    final ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    final ListStore<ProjectDTOLight> store,    final Grid<ProjectDTOLight> grid){
      final Image icon;
      if (isFavoriteProject(authentication.getUserId(),model)) {
        icon=imageBundle.star().createImage();
        icon.setTitle("String_Node_Str");
      }
 else {
        icon=imageBundle.emptyStar().createImage();
        icon.setTitle("String_Node_Str");
      }
      icon.addClickHandler(new ClickHandler(){
        @Override public void onClick(        ClickEvent event){
          UpdateProjectFavorite updateCmd;
          int projectId=model.getId();
          if (projectId < 0)           projectId=model.get("String_Node_Str");
          if (isFavoriteProject(authentication.getUserId(),model)) {
            updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.REMOVE);
          }
 else {
            updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.ADD);
          }
          dispatcher.execute(updateCmd,new MaskingAsyncMonitor(projectTreePanel,I18N.CONSTANTS.loading()),new AsyncCallback<CreateResult>(){
            @Override public void onFailure(            Throwable caught){
              Log.error("String_Node_Str" + model.getId(),caught);
              MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
            }
            @Override public void onSuccess(            CreateResult result){
              if (result == null || result.getEntity() == null) {
                MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
              }
 else {
                ProjectDTOLight resultProject=(ProjectDTOLight)result.getEntity();
                model.setFavoriteUsers(resultProject.getFavoriteUsers());
                store.update(model);
                Notification.show(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.projectStarred());
              }
            }
          }
);
        }
      }
);
      icon.addStyleName("String_Node_Str");
      return icon;
    }
  }
);
  final ColumnConfig codeColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectName(),110);
  codeColumn.setRenderer(new WidgetTreeGridCellRenderer<ProjectDTOLight>(){
    @Override public Widget getWidget(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      Integer id=model.get("String_Node_Str");
      if (id <= 0) {
        id=model.get("String_Node_Str");
      }
      final Hyperlink h=new Hyperlink((String)model.get(property),true,ProjectPresenter.PAGE_ID.toString() + '!' + String.valueOf(id));
      if (!model.isLeaf()) {
        h.addStyleName("String_Node_Str");
      }
 else {
        h.addStyleName("String_Node_Str");
      }
      final com.google.gwt.user.client.ui.Grid panel=new com.google.gwt.user.client.ui.Grid(1,2);
      panel.setCellPadding(0);
      panel.setCellSpacing(0);
      panel.setWidget(0,0,FundingIconProvider.getProjectTypeIcon(model.getProjectModelType(authentication.getOrganizationId()),IconSize.SMALL_MEIDUM).createImage());
      panel.getCellFormatter().addStyleName(0,0,"String_Node_Str");
      panel.setWidget(0,1,h);
      panel.getCellFormatter().addStyleName(0,1,"String_Node_Str");
      return panel;
    }
  }
);
  final ColumnConfig titleColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectFullName(),230);
  titleColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      String title=(String)model.get(property);
      if (model.getParent() != null) {
        title="String_Node_Str" + title;
      }
      return createProjectGridText(model,title);
    }
  }
);
  final ColumnConfig currentPhaseName=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectActivePhase(),150);
  currentPhaseName.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return createProjectGridText(model,model.getCurrentPhaseName());
    }
  }
);
  final ColumnConfig orgUnitColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.orgunit(),150);
  orgUnitColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return createProjectGridText(model,(String)model.get(property));
    }
  }
);
  final ColumnConfig spentBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectSpendBudget(),100);
  spentBudgetColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return new RatioBar(NumberUtils.ratio(model.getSpendBudget(),model.getPlannedBudget()));
    }
  }
);
  final ColumnConfig plannedBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectPlannedBudget(),75);
  plannedBudgetColumn.setHidden(true);
  final ColumnConfig spendBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectSpendBudget(),75);
  spendBudgetColumn.setHidden(true);
  final ColumnConfig receivedBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectReceivedBudget(),75);
  receivedBudgetColumn.setHidden(true);
  final ColumnConfig timeColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectTime(),100);
  timeColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return new RatioBar(model.getElapsedTime());
    }
  }
);
  final ColumnConfig startDateColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectStartDate(),75);
  startDateColumn.setHidden(true);
  startDateColumn.setDateTimeFormat(format);
  startDateColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Date d=(Date)model.get(property);
      return createProjectGridText(model,d != null ? format.format(d) : "String_Node_Str");
    }
  }
);
  final ColumnConfig endDateColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectEndDate(),75);
  endDateColumn.setDateTimeFormat(format);
  endDateColumn.setHidden(true);
  endDateColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Date d=(Date)model.get(property);
      return createProjectGridText(model,d != null ? format.format(d) : "String_Node_Str");
    }
  }
);
  final ColumnConfig closeDateColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectClosedDate(),75);
  closeDateColumn.setDateTimeFormat(format);
  closeDateColumn.setHidden(true);
  closeDateColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Date d=(Date)model.get(property);
      return createProjectGridText(model,d != null ? format.format(d) : "String_Node_Str");
    }
  }
);
  final ColumnConfig activityColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.logFrameActivity(),100);
  activityColumn.setSortable(false);
  activityColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return new RatioBar(model.getActivityAdvancement() != null ? model.getActivityAdvancement() : 0);
    }
  }
);
  final ColumnConfig categoryColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.category(),150);
  categoryColumn.setSortable(false);
  categoryColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Set<CategoryElementDTO> elements=model.getCategoryElements();
      final LayoutContainer panel=new LayoutContainer();
      panel.setLayout(new FlowLayout());
      final FlowData data=new FlowData(new Margins(0,5,0,0));
      if (elements != null) {
        for (        final CategoryElementDTO element : elements) {
          panel.add(CategoryIconProvider.getIcon(element),data);
        }
      }
      return panel;
    }
  }
);
  return new ColumnModel(Arrays.asList(starredIconColumn,codeColumn,titleColumn,currentPhaseName,orgUnitColumn,spentBudgetColumn,plannedBudgetColumn,spendBudgetColumn,receivedBudgetColumn,startDateColumn,endDateColumn,closeDateColumn,timeColumn,activityColumn,categoryColumn));
}

Fixed version (ground truth):
/** 
 * Builds and returns the columns model for the projects tree grid.
 * @return The project tree grid columns model.
 */
private ColumnModel getProjectGridColumnModel(){
  final DateTimeFormat format=DateUtils.DATE_SHORT;
  final ColumnConfig starredIconColumn=new ColumnConfig("String_Node_Str","String_Node_Str",24);
  starredIconColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    private final DashboardImageBundle imageBundle=GWT.create(DashboardImageBundle.class);
    @Override public Object render(    final ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    final ListStore<ProjectDTOLight> store,    final Grid<ProjectDTOLight> grid){
      final Image icon;
      if (isFavoriteProject(authentication.getUserId(),model)) {
        icon=imageBundle.star().createImage();
        icon.setTitle("String_Node_Str");
      }
 else {
        icon=imageBundle.emptyStar().createImage();
        icon.setTitle("String_Node_Str");
      }
      icon.addClickHandler(new ClickHandler(){
        @Override public void onClick(        ClickEvent event){
          UpdateProjectFavorite updateCmd;
          int projectId=model.getId();
          if (projectId < 0) {
            projectId=(Integer)model.get("String_Node_Str");
          }
          if (isFavoriteProject(authentication.getUserId(),model)) {
            updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.REMOVE);
          }
 else {
            updateCmd=new UpdateProjectFavorite(projectId,UpdateProjectFavorite.UpdateType.ADD);
          }
          dispatcher.execute(updateCmd,new MaskingAsyncMonitor(projectTreePanel,I18N.CONSTANTS.loading()),new AsyncCallback<CreateResult>(){
            @Override public void onFailure(            Throwable caught){
              Log.error("String_Node_Str" + model.getId(),caught);
              MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
            }
            @Override public void onSuccess(            CreateResult result){
              if (result == null || result.getEntity() == null) {
                MessageBox.alert(I18N.CONSTANTS.projectStarredError(),I18N.CONSTANTS.projectStarredErrorDetails(),null);
              }
 else {
                ProjectDTOLight resultProject=(ProjectDTOLight)result.getEntity();
                model.setFavoriteUsers(resultProject.getFavoriteUsers());
                store.update(model);
                Notification.show(I18N.CONSTANTS.infoConfirmation(),I18N.CONSTANTS.projectStarred());
              }
            }
          }
);
        }
      }
);
      icon.addStyleName("String_Node_Str");
      return icon;
    }
  }
);
  final ColumnConfig codeColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectName(),110);
  codeColumn.setRenderer(new WidgetTreeGridCellRenderer<ProjectDTOLight>(){
    @Override public Widget getWidget(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      Integer id=model.get("String_Node_Str");
      if (id <= 0) {
        id=model.get("String_Node_Str");
      }
      final Hyperlink h=new Hyperlink((String)model.get(property),true,ProjectPresenter.PAGE_ID.toString() + '!' + String.valueOf(id));
      if (!model.isLeaf()) {
        h.addStyleName("String_Node_Str");
      }
 else {
        h.addStyleName("String_Node_Str");
      }
      final com.google.gwt.user.client.ui.Grid panel=new com.google.gwt.user.client.ui.Grid(1,2);
      panel.setCellPadding(0);
      panel.setCellSpacing(0);
      panel.setWidget(0,0,FundingIconProvider.getProjectTypeIcon(model.getProjectModelType(authentication.getOrganizationId()),IconSize.SMALL_MEIDUM).createImage());
      panel.getCellFormatter().addStyleName(0,0,"String_Node_Str");
      panel.setWidget(0,1,h);
      panel.getCellFormatter().addStyleName(0,1,"String_Node_Str");
      return panel;
    }
  }
);
  final ColumnConfig titleColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectFullName(),230);
  titleColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      String title=(String)model.get(property);
      if (model.getParent() != null) {
        title="String_Node_Str" + title;
      }
      return createProjectGridText(model,title);
    }
  }
);
  final ColumnConfig currentPhaseName=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectActivePhase(),150);
  currentPhaseName.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return createProjectGridText(model,model.getCurrentPhaseName());
    }
  }
);
  final ColumnConfig orgUnitColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.orgunit(),150);
  orgUnitColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return createProjectGridText(model,(String)model.get(property));
    }
  }
);
  final ColumnConfig spentBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectSpendBudget(),100);
  spentBudgetColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return new RatioBar(NumberUtils.ratio(model.getSpendBudget(),model.getPlannedBudget()));
    }
  }
);
  final ColumnConfig plannedBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectPlannedBudget(),75);
  plannedBudgetColumn.setHidden(true);
  final ColumnConfig spendBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectSpendBudget(),75);
  spendBudgetColumn.setHidden(true);
  final ColumnConfig receivedBudgetColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectReceivedBudget(),75);
  receivedBudgetColumn.setHidden(true);
  final ColumnConfig timeColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectTime(),100);
  timeColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return new RatioBar(model.getElapsedTime());
    }
  }
);
  final ColumnConfig startDateColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectStartDate(),75);
  startDateColumn.setHidden(true);
  startDateColumn.setDateTimeFormat(format);
  startDateColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Date d=(Date)model.get(property);
      return createProjectGridText(model,d != null ? format.format(d) : "String_Node_Str");
    }
  }
);
  final ColumnConfig endDateColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectEndDate(),75);
  endDateColumn.setDateTimeFormat(format);
  endDateColumn.setHidden(true);
  endDateColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Date d=(Date)model.get(property);
      return createProjectGridText(model,d != null ? format.format(d) : "String_Node_Str");
    }
  }
);
  final ColumnConfig closeDateColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.projectClosedDate(),75);
  closeDateColumn.setDateTimeFormat(format);
  closeDateColumn.setHidden(true);
  closeDateColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Date d=(Date)model.get(property);
      return createProjectGridText(model,d != null ? format.format(d) : "String_Node_Str");
    }
  }
);
  final ColumnConfig activityColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.logFrameActivity(),100);
  activityColumn.setSortable(false);
  activityColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      return new RatioBar(model.getActivityAdvancement() != null ? model.getActivityAdvancement() : 0);
    }
  }
);
  final ColumnConfig categoryColumn=new ColumnConfig("String_Node_Str",I18N.CONSTANTS.category(),150);
  categoryColumn.setSortable(false);
  categoryColumn.setRenderer(new GridCellRenderer<ProjectDTOLight>(){
    @Override public Object render(    ProjectDTOLight model,    String property,    ColumnData config,    int rowIndex,    int colIndex,    ListStore<ProjectDTOLight> store,    Grid<ProjectDTOLight> grid){
      final Set<CategoryElementDTO> elements=model.getCategoryElements();
      final LayoutContainer panel=new LayoutContainer();
      panel.setLayout(new FlowLayout());
      final FlowData data=new FlowData(new Margins(0,5,0,0));
      if (elements != null) {
        for (        final CategoryElementDTO element : elements) {
          panel.add(CategoryIconProvider.getIcon(element),data);
        }
      }
      return panel;
    }
  }
);
  return new ColumnModel(Arrays.asList(starredIconColumn,codeColumn,titleColumn,currentPhaseName,orgUnitColumn,spentBudgetColumn,plannedBudgetColumn,spendBudgetColumn,receivedBudgetColumn,startDateColumn,endDateColumn,closeDateColumn,timeColumn,activityColumn,categoryColumn));
}