Program: 35685
Project: 35685
Buggy source:
/** 
 * Adds an activity row.
 * @param activity The activity. Must not be <code>null</code>.
 */
private void addActivity(final LogFrameActivityDTO activity){
  if (activity == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final LogFrameGroupDTO group=activity.getGroup();
  @SuppressWarnings("String_Node_Str") RowsGroup<LogFrameGroupDTO> g=(RowsGroup<LogFrameGroupDTO>)activitiesView.getGroup(group.getClientSideId());
  if (g == null) {
    g=addActivitiesGroup(group);
  }
  final StringBuilder sb=new StringBuilder();
  sb.append(I18N.CONSTANTS.logFrameActivitiesCode());
  sb.append("String_Node_Str");
  sb.append(activitiesPolicy.getCode(activity.getCode(),activity));
  activity.setLabel(sb.toString());
  if (activity.getPosition() == null) {
    activity.setPosition(g.getRowsCount() + 1);
  }
  activitiesView.insertRow(activity.getPosition(),group.getClientSideId(),new Row<LogFrameActivityDTO>(activity){
    @Override public boolean isSimilar(    int column,    LogFrameActivityDTO userObject,    LogFrameActivityDTO other){
switch (column) {
case 0:
        return userObject.getParentExpectedResult() != null && other.getParentExpectedResult() != null && userObject.getParentExpectedResult().getCode() == other.getParentExpectedResult().getCode();
    }
    return false;
  }
  @Override public Widget getWidgetAt(  int column,  final LogFrameActivityDTO userObject){
switch (column) {
case 0:
      final Label parentCodeLabel=new Label();
    parentCodeLabel.addStyleName(CSS_CODE_LABEL_STYLE_NAME);
  final ExpectedResultDTO parent;
if (userObject != null && (parent=userObject.getParentExpectedResult()) != null) {
  final StringBuilder sb=new StringBuilder();
  sb.append(I18N.CONSTANTS.logFrameActivitiesCode());
  sb.append("String_Node_Str");
  sb.append(I18N.CONSTANTS.logFrameExceptedResultsCode());
  sb.append("String_Node_Str");
  sb.append(expectedResultsPolicy.getCode(parent.getCode(),parent));
  sb.append("String_Node_Str");
  parentCodeLabel.setText(sb.toString());
}
return parentCodeLabel;
case 1:
final Label codeLabel=new Label();
codeLabel.addStyleName(CSS_CODE_LABEL_STYLE_NAME);
if (userObject != null) {
codeLabel.setText(userObject.getLabel());
}
final Grid grid=new Grid(1,2);
grid.setCellPadding(0);
grid.setCellSpacing(0);
grid.setWidget(0,0,codeLabel);
if (!readOnly) {
grid.setWidget(0,1,buildActivityMenu(this,codeLabel));
}
return grid;
case 2:
return new IndicatorListWidget(dispatcher,databaseId,userObject);
case 5:
final TextArea contentTextBox=new TextArea();
contentTextBox.setWidth("String_Node_Str");
contentTextBox.setHeight("String_Node_Str");
contentTextBox.setVisibleLines(2);
contentTextBox.addStyleName("String_Node_Str");
contentTextBox.setEnabled(!readOnly);
if (userObject != null) {
contentTextBox.setText(userObject.getTitle());
}
contentTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setTitle(contentTextBox.getText());
fireLogFrameEdited();
}
}
);
return contentTextBox;
default :
return null;
}
}
@Override public int getId(LogFrameActivityDTO userObject){
return userObject.getClientSideId();
}
}
);
fireLogFrameEdited();
}

Fixed version (ground truth):
/** 
 * Adds an activity row.
 * @param activity The activity. Must not be <code>null</code>.
 */
private void addActivity(final LogFrameActivityDTO activity){
  if (activity == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final LogFrameGroupDTO group=activity.getGroup();
  @SuppressWarnings("String_Node_Str") RowsGroup<LogFrameGroupDTO> g=(RowsGroup<LogFrameGroupDTO>)activitiesView.getGroup(group.getClientSideId());
  if (g == null) {
    g=addActivitiesGroup(group);
  }
  final StringBuilder sb=new StringBuilder();
  sb.append(I18N.CONSTANTS.logFrameActivitiesCode());
  sb.append("String_Node_Str");
  sb.append(activity.getFormattedCode());
  activity.setLabel(sb.toString());
  if (activity.getPosition() == null) {
    activity.setPosition(g.getRowsCount() + 1);
  }
  activitiesView.insertRow(activity.getPosition(),group.getClientSideId(),new Row<LogFrameActivityDTO>(activity){
    @Override public boolean isSimilar(    int column,    LogFrameActivityDTO userObject,    LogFrameActivityDTO other){
switch (column) {
case 0:
        return userObject.getParentExpectedResult() != null && other.getParentExpectedResult() != null && userObject.getParentExpectedResult().getCode() == other.getParentExpectedResult().getCode();
    }
    return false;
  }
  @Override public Widget getWidgetAt(  int column,  final LogFrameActivityDTO userObject){
switch (column) {
case 0:
      final Label parentCodeLabel=new Label();
    parentCodeLabel.addStyleName(CSS_CODE_LABEL_STYLE_NAME);
  final ExpectedResultDTO parent;
if (userObject != null && (parent=userObject.getParentExpectedResult()) != null) {
  final StringBuilder sb=new StringBuilder();
  sb.append(I18N.CONSTANTS.logFrameActivitiesCode());
  sb.append("String_Node_Str");
  sb.append(I18N.CONSTANTS.logFrameExceptedResultsCode());
  sb.append("String_Node_Str");
  sb.append(parent.getFormattedCode());
  sb.append("String_Node_Str");
  parentCodeLabel.setText(sb.toString());
}
return parentCodeLabel;
case 1:
final Label codeLabel=new Label();
codeLabel.addStyleName(CSS_CODE_LABEL_STYLE_NAME);
if (userObject != null) {
codeLabel.setText(userObject.getLabel());
}
final Grid grid=new Grid(1,2);
grid.setCellPadding(0);
grid.setCellSpacing(0);
grid.setWidget(0,0,codeLabel);
if (!readOnly) {
grid.setWidget(0,1,buildActivityMenu(this,codeLabel));
}
return grid;
case 2:
final TextArea contentTextBox=new TextArea();
contentTextBox.setWidth("String_Node_Str");
contentTextBox.setHeight("String_Node_Str");
contentTextBox.setVisibleLines(2);
contentTextBox.addStyleName("String_Node_Str");
contentTextBox.setEnabled(!readOnly);
if (userObject != null) {
contentTextBox.setText(userObject.getTitle());
}
contentTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setTitle(contentTextBox.getText());
fireLogFrameEdited();
}
}
);
return contentTextBox;
case 3:
return new IndicatorListWidget(dispatcher,databaseId,userObject);
case 4:
return new Label();
case 5:
return new Label();
default :
return null;
}
}
@Override public int getId(LogFrameActivityDTO userObject){
return userObject.getClientSideId();
}
}
);
fireLogFrameEdited();
}