Program: 96529
Project: 96529
Buggy source:
private void createResultFields(Composite composite,FormToolkit toolkit){
  final Review review;
  ReviewData rd=ReviewsUiPlugin.getDataManager().getReviewData(getModel().getTask());
  if (rd != null) {
    review=rd.getReview();
  }
 else {
    review=parseFromAttachments();
    if (review != null) {
      ReviewsUiPlugin.getDataManager().storeTask(getModel().getTask(),review);
    }
  }
  Composite resultComposite=toolkit.createComposite(composite);
  resultComposite.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT,true,false));
  resultComposite.setLayout(new GridLayout(2,false));
  final ComboViewer ratingList=new ComboViewer(resultComposite,SWT.READ_ONLY | SWT.BORDER | SWT.FLAT);
  ratingList.setContentProvider(ArrayContentProvider.getInstance());
  ratingList.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return ((Rating)element).getName();
    }
    @Override public Image getImage(    Object element){
      Rating rating=((Rating)element);
switch (rating) {
case FAILED:
        return Images.REVIEW_RESULT_FAILED.createImage();
case NONE:
      return Images.REVIEW_RESULT_NONE.createImage();
case PASSED:
    return Images.REVIEW_RESULT_PASSED.createImage();
case WARNING:
  return Images.REVIEW_RESULT_WARNING.createImage();
}
return super.getImage(element);
}
}
);
ratingList.setInput(Rating.VALUES);
ratingList.getControl().setLayoutData(new GridData(SWT.LEFT,SWT.TOP,false,false));
final Text commentText=toolkit.createText(resultComposite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
GridData gd=new GridData(SWT.FILL,SWT.DEFAULT,true,false);
gd.heightHint=30;
commentText.setLayoutData(gd);
if (review.getResult() != null) {
Rating rating=review.getResult().getRating();
ratingList.setSelection(new StructuredSelection(rating));
commentText.setText(review.getResult().getText());
}
commentText.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e){
if (review.getResult() == null) {
review.setResult(ReviewFactory.eINSTANCE.createReviewResult());
}
review.getResult().setText(commentText.getText());
}
}
);
ratingList.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged(SelectionChangedEvent event){
Rating rating=(Rating)((IStructuredSelection)event.getSelection()).getFirstElement();
if (review.getResult() == null) {
review.setResult(ReviewFactory.eINSTANCE.createReviewResult());
}
review.getResult().setRating(rating);
}
}
);
}

Fixed version (ground truth):
private void createResultFields(Composite composite,FormToolkit toolkit){
  final Review review;
  ReviewData rd=ReviewsUiPlugin.getDataManager().getReviewData(getModel().getTask());
  if (rd != null) {
    review=rd.getReview();
  }
 else {
    review=parseFromAttachments();
    if (review != null) {
      ReviewsUiPlugin.getDataManager().storeTask(getModel().getTask(),review);
    }
  }
  Composite resultComposite=toolkit.createComposite(composite);
  resultComposite.setLayoutData(new GridData(SWT.FILL,SWT.DEFAULT,true,false));
  resultComposite.setLayout(new GridLayout(2,false));
  final ComboViewer ratingList=new ComboViewer(resultComposite,SWT.READ_ONLY | SWT.BORDER | SWT.FLAT);
  ratingList.setContentProvider(ArrayContentProvider.getInstance());
  ratingList.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return ((Rating)element).getName();
    }
    @Override public Image getImage(    Object element){
      Rating rating=((Rating)element);
switch (rating) {
case FAILED:
        return Images.REVIEW_RESULT_FAILED.createImage();
case NONE:
      return Images.REVIEW_RESULT_NONE.createImage();
case PASSED:
    return Images.REVIEW_RESULT_PASSED.createImage();
case WARNING:
  return Images.REVIEW_RESULT_WARNING.createImage();
}
return super.getImage(element);
}
}
);
ratingList.setInput(Rating.VALUES);
ratingList.getControl().setLayoutData(new GridData(SWT.LEFT,SWT.TOP,false,false));
final Text commentText=toolkit.createText(resultComposite,"String_Node_Str",SWT.BORDER | SWT.MULTI);
GridData gd=new GridData(SWT.FILL,SWT.DEFAULT,true,false);
gd.heightHint=30;
commentText.setLayoutData(gd);
if (review.getResult() != null) {
Rating rating=review.getResult().getRating();
ratingList.setSelection(new StructuredSelection(rating));
String comment=review.getResult().getText();
commentText.setText(comment != null ? comment : "String_Node_Str");
}
commentText.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e){
if (review.getResult() == null) {
review.setResult(ReviewFactory.eINSTANCE.createReviewResult());
}
review.getResult().setText(commentText.getText());
}
}
);
ratingList.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged(SelectionChangedEvent event){
Rating rating=(Rating)((IStructuredSelection)event.getSelection()).getFirstElement();
if (review.getResult() == null) {
review.setResult(ReviewFactory.eINSTANCE.createReviewResult());
}
review.getResult().setRating(rating);
}
}
);
}