Program: 35686
Project: 35686
Buggy source:
/** 
 * Adds a specific objective row.
 * @param specificObjective The specific objective. Must not be <code>null</code>.
 */
private void addSpecificObjective(final SpecificObjectiveDTO specificObjective){
  if (specificObjective == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final LogFrameGroupDTO logFrameGroup=specificObjective.getGroup();
  @SuppressWarnings("String_Node_Str") RowsGroup<LogFrameGroupDTO> g=(RowsGroup<LogFrameGroupDTO>)specificObjectivesView.getGroup(logFrameGroup.getClientSideId());
  if (g == null) {
    g=addSpecificObjectivesGroup(logFrameGroup);
  }
  final StringBuilder sb=new StringBuilder();
  sb.append(I18N.CONSTANTS.logFrameSpecificObjectivesCode());
  sb.append("String_Node_Str");
  sb.append(specificObjectivesPolicy.getCode(specificObjective.getCode(),specificObjective));
  specificObjective.setLabel(sb.toString());
  if (specificObjective.getPosition() == null) {
    specificObjective.setPosition(g.getRowsCount() + 1);
  }
  specificObjectivesView.insertRow(specificObjective.getPosition(),logFrameGroup.getClientSideId(),new Row<SpecificObjectiveDTO>(specificObjective){
    @Override public boolean isSimilar(    int column,    SpecificObjectiveDTO userObject,    SpecificObjectiveDTO other){
switch (column) {
case 1:
        return userObject.getCode() == other.getCode();
    }
    return false;
  }
  @Override public Widget getWidgetAt(  int column,  final SpecificObjectiveDTO userObject){
switch (column) {
case 0:
      return null;
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,buildSpecificObjectiveMenu(this,codeLabel));
}
return grid;
case 2:
final TextArea interventionLogicTextBox=new TextArea();
interventionLogicTextBox.setWidth("String_Node_Str");
interventionLogicTextBox.setHeight("String_Node_Str");
interventionLogicTextBox.setVisibleLines(3);
interventionLogicTextBox.addStyleName("String_Node_Str");
interventionLogicTextBox.setEnabled(!readOnly);
if (userObject != null) {
interventionLogicTextBox.setText(userObject.getInterventionLogic());
}
interventionLogicTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setInterventionLogic(interventionLogicTextBox.getText());
fireLogFrameEdited();
}
}
);
return interventionLogicTextBox;
case 3:
return new IndicatorListWidget(dispatcher,databaseId,specificObjective);
case 4:
final TextArea risksTextBox=new TextArea();
risksTextBox.setWidth("String_Node_Str");
risksTextBox.setHeight("String_Node_Str");
risksTextBox.setVisibleLines(3);
risksTextBox.addStyleName("String_Node_Str");
risksTextBox.setEnabled(!readOnly);
if (userObject != null) {
risksTextBox.setText(userObject.getRisks());
}
risksTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setRisks(risksTextBox.getText());
fireLogFrameEdited();
}
}
);
return risksTextBox;
case 5:
final TextArea assumptionsTextBox=new TextArea();
assumptionsTextBox.setWidth("String_Node_Str");
assumptionsTextBox.setHeight("String_Node_Str");
assumptionsTextBox.setVisibleLines(3);
assumptionsTextBox.addStyleName("String_Node_Str");
assumptionsTextBox.setEnabled(!readOnly);
if (userObject != null) {
assumptionsTextBox.setText(userObject.getAssumptions());
}
assumptionsTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setAssumptions(assumptionsTextBox.getText());
fireLogFrameEdited();
}
}
);
return assumptionsTextBox;
default :
return null;
}
}
@Override public int getId(SpecificObjectiveDTO userObject){
return userObject.getClientSideId();
}
}
);
fireLogFrameEdited();
for (final ExpectedResultDTO result : specificObjective.getExpectedResults()) {
addExpectedResult(result);
}
}

Fixed version (ground truth):
/** 
 * Adds a specific objective row.
 * @param specificObjective The specific objective. Must not be <code>null</code>.
 */
private void addSpecificObjective(final SpecificObjectiveDTO specificObjective){
  if (specificObjective == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final LogFrameGroupDTO logFrameGroup=specificObjective.getGroup();
  @SuppressWarnings("String_Node_Str") RowsGroup<LogFrameGroupDTO> g=(RowsGroup<LogFrameGroupDTO>)specificObjectivesView.getGroup(logFrameGroup.getClientSideId());
  if (g == null) {
    g=addSpecificObjectivesGroup(logFrameGroup);
  }
  final StringBuilder sb=new StringBuilder();
  sb.append(I18N.CONSTANTS.logFrameSpecificObjectivesCode());
  sb.append("String_Node_Str");
  sb.append(specificObjective.getFormattedCode());
  specificObjective.setLabel(sb.toString());
  if (specificObjective.getPosition() == null) {
    specificObjective.setPosition(g.getRowsCount() + 1);
  }
  specificObjectivesView.insertRow(specificObjective.getPosition(),logFrameGroup.getClientSideId(),new Row<SpecificObjectiveDTO>(specificObjective){
    @Override public boolean isSimilar(    int column,    SpecificObjectiveDTO userObject,    SpecificObjectiveDTO other){
switch (column) {
case 1:
        return userObject.getCode() == other.getCode();
    }
    return false;
  }
  @Override public Widget getWidgetAt(  int column,  final SpecificObjectiveDTO userObject){
switch (column) {
case 0:
      return null;
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,buildSpecificObjectiveMenu(this,codeLabel));
}
return grid;
case 2:
final TextArea interventionLogicTextBox=new TextArea();
interventionLogicTextBox.setWidth("String_Node_Str");
interventionLogicTextBox.setHeight("String_Node_Str");
interventionLogicTextBox.setVisibleLines(3);
interventionLogicTextBox.addStyleName("String_Node_Str");
interventionLogicTextBox.setEnabled(!readOnly);
if (userObject != null) {
interventionLogicTextBox.setText(userObject.getInterventionLogic());
}
interventionLogicTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setInterventionLogic(interventionLogicTextBox.getText());
fireLogFrameEdited();
}
}
);
return interventionLogicTextBox;
case 3:
return new IndicatorListWidget(dispatcher,databaseId,specificObjective);
case 4:
final TextArea risksTextBox=new TextArea();
risksTextBox.setWidth("String_Node_Str");
risksTextBox.setHeight("String_Node_Str");
risksTextBox.setVisibleLines(3);
risksTextBox.addStyleName("String_Node_Str");
risksTextBox.setEnabled(!readOnly);
if (userObject != null) {
risksTextBox.setText(userObject.getRisks());
}
risksTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setRisks(risksTextBox.getText());
fireLogFrameEdited();
}
}
);
return risksTextBox;
case 5:
final TextArea assumptionsTextBox=new TextArea();
assumptionsTextBox.setWidth("String_Node_Str");
assumptionsTextBox.setHeight("String_Node_Str");
assumptionsTextBox.setVisibleLines(3);
assumptionsTextBox.addStyleName("String_Node_Str");
assumptionsTextBox.setEnabled(!readOnly);
if (userObject != null) {
assumptionsTextBox.setText(userObject.getAssumptions());
}
assumptionsTextBox.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent e){
userObject.setAssumptions(assumptionsTextBox.getText());
fireLogFrameEdited();
}
}
);
return assumptionsTextBox;
default :
return null;
}
}
@Override public int getId(SpecificObjectiveDTO userObject){
return userObject.getClientSideId();
}
}
);
fireLogFrameEdited();
for (final ExpectedResultDTO result : specificObjective.getExpectedResults()) {
addExpectedResult(result);
}
}