Program: 119134
Project: 119134
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 + FunctionManager.JAVA_METHOD_SEPARATED + function.getName()+ FunctionManager.FUN_PREFIX+ FunctionManager.FUN_SUFFIX,true);
            }
 else             if ("String_Node_Str".equals(function.getCategory())) {
              expressionComposite.setExpression(function.getClassName() + FunctionManager.FUN_PREFIX + FunctionManager.FUN_SUFFIX,true);
            }
 else {
              expressionComposite.setExpression(function.getName() + FunctionManager.FUN_PREFIX + FunctionManager.FUN_SUFFIX,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();
      }
    }
  }
);
}

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(convert2HTML(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(convert2HTML(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 + FunctionManager.JAVA_METHOD_SEPARATED + function.getName()+ FunctionManager.FUN_PREFIX+ FunctionManager.FUN_SUFFIX,true);
            }
 else             if ("String_Node_Str".equals(function.getCategory())) {
              expressionComposite.setExpression(function.getClassName() + FunctionManager.FUN_PREFIX + FunctionManager.FUN_SUFFIX,true);
            }
 else {
              expressionComposite.setExpression(function.getName() + FunctionManager.FUN_PREFIX + FunctionManager.FUN_SUFFIX,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();
      }
    }
  }
);
}