Program: 119923
Project: 119923
Buggy source:
UIRelationShipLinker(ListViewer categoryViewer,final ListViewer functionViewer,final Object docDisplayer){
  categoryViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      try {
        Category category=(Category)((IStructuredSelection)event.getSelection()).getFirstElement();
        if (category == null) {
          return;
        }
        functionViewer.setInput(category.getFunctions());
        if (category.getFunctions().isEmpty()) {
          if (docDisplayer instanceof Text) {
            ((Text)docDisplayer).setText("String_Node_Str");
          }
 else           if (docDisplayer instanceof Browser) {
            ((Browser)docDisplayer).setText("String_Node_Str");
          }
          return;
        }
        functionViewer.setSelection(new StructuredSelection(category.getFunctions().get(0)));
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  functionViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
      if (function != null && function.getDescription() != null) {
        if (docDisplayer instanceof Text) {
          ((Text)docDisplayer).setText(function.getDescription());
        }
 else         if (docDisplayer instanceof Browser) {
          ((Browser)docDisplayer).setText(function.getDescription());
        }
      }
 else {
        if (docDisplayer instanceof Text) {
          ((Text)docDisplayer).setText("String_Node_Str");
        }
 else         if (docDisplayer instanceof Browser) {
          ((Browser)docDisplayer).setText("String_Node_Str");
        }
      }
    }
  }
);
  functionViewer.addDoubleClickListener(new IDoubleClickListener(){
    @Override public void doubleClick(    DoubleClickEvent event){
      try {
        Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
        selectedFunction=function;
        if (function != null && function.getDescription() != null) {
          if (docDisplayer instanceof Text) {
            ((Text)docDisplayer).setText(function.getDescription());
          }
 else           if (docDisplayer instanceof Browser) {
            ((Browser)docDisplayer).setText(function.getDescription());
          }
          VirtualMetadataColumn column=new VirtualMetadataColumn();
          column.setTalendType(function.getTalendType().getName());
          column.setFunction(function);
          ExpressionComposite expressionComposite=ExpressionBuilderDialog.getExpressionComposite();
          if (expressionComposite != null && expressionComposite instanceof PigExpressionComposite) {
            if (function.isUserDefined()) {
              expressionComposite.setExpression(JavaUtils.JAVA_PIGUDF_DIRECTORY + "String_Node_Str" + function.getName()+ "String_Node_Str",true);
            }
 else {
              expressionComposite.setExpression(function.getName() + "String_Node_Str",true);
            }
          }
 else {
            expressionComposite.setExpression(FunctionManagerExt.getOneColData(column,false),true);
          }
        }
 else {
          if (docDisplayer instanceof Text) {
            ((Text)docDisplayer).setText("String_Node_Str");
          }
 else           if (docDisplayer instanceof Browser) {
            ((Browser)docDisplayer).setText("String_Node_Str");
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}

Fixed version (ground truth):
UIRelationShipLinker(ListViewer categoryViewer,final ListViewer functionViewer,final Object docDisplayer){
  categoryViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      try {
        Category category=(Category)((IStructuredSelection)event.getSelection()).getFirstElement();
        if (category == null) {
          return;
        }
        functionViewer.setInput(category.getFunctions());
        if (category.getFunctions().isEmpty()) {
          if (docDisplayer instanceof Text) {
            ((Text)docDisplayer).setText("String_Node_Str");
          }
 else           if (docDisplayer instanceof Browser) {
            ((Browser)docDisplayer).setText("String_Node_Str");
          }
          return;
        }
        functionViewer.setSelection(new StructuredSelection(category.getFunctions().get(0)));
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  functionViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
      if (function != null && function.getDescription() != null) {
        if (docDisplayer instanceof Text) {
          ((Text)docDisplayer).setText(function.getDescription());
        }
 else         if (docDisplayer instanceof Browser) {
          ((Browser)docDisplayer).setText(function.getDescription());
        }
      }
 else {
        if (docDisplayer instanceof Text) {
          ((Text)docDisplayer).setText("String_Node_Str");
        }
 else         if (docDisplayer instanceof Browser) {
          ((Browser)docDisplayer).setText("String_Node_Str");
        }
      }
    }
  }
);
  functionViewer.addDoubleClickListener(new IDoubleClickListener(){
    @Override public void doubleClick(    DoubleClickEvent event){
      try {
        Function function=(Function)((IStructuredSelection)event.getSelection()).getFirstElement();
        selectedFunction=function;
        if (function != null && function.getDescription() != null) {
          if (docDisplayer instanceof Text) {
            ((Text)docDisplayer).setText(function.getDescription());
          }
 else           if (docDisplayer instanceof Browser) {
            ((Browser)docDisplayer).setText(function.getDescription());
          }
          VirtualMetadataColumn column=new VirtualMetadataColumn();
          column.setTalendType(function.getTalendType().getName());
          column.setFunction(function);
          ExpressionComposite expressionComposite=ExpressionBuilderDialog.getExpressionComposite();
          if (expressionComposite != null && expressionComposite instanceof PigExpressionComposite) {
            if (function.isUserDefined()) {
              expressionComposite.setExpression(JavaUtils.JAVA_PIGUDF_DIRECTORY + "String_Node_Str" + function.getName()+ "String_Node_Str",true);
            }
 else {
              expressionComposite.setExpression(function.getName() + "String_Node_Str",true);
            }
          }
 else {
            expressionComposite.setExpression(FunctionManagerExt.getOneColData(column,false),true);
          }
          expressionComposite.modificationRecord.pushRecored(expressionComposite.getExpression());
        }
 else {
          if (docDisplayer instanceof Text) {
            ((Text)docDisplayer).setText("String_Node_Str");
          }
 else           if (docDisplayer instanceof Browser) {
            ((Browser)docDisplayer).setText("String_Node_Str");
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
}