Program: 94145
Project: 94145
Buggy source:
private void makeActions(){
  startRSAAction=new Action(){
    public void run(){
      if (discovery != null)       try {
        discovery.startRSA();
        startRSAAction.setEnabled(false);
      }
 catch (      BundleException e) {
        logError(Messages.EndpointDiscoveryView_ERROR_RSA_START_FAILED,e);
        showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_START_PREFIX + e.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
      }
    }
  }
;
  startRSAAction.setText(Messages.EndpointDiscoveryView_START_RSA);
  startRSAAction.setToolTipText(Messages.EndpointDiscoveryView_START_RSA_SERVICE);
  startRSAAction.setEnabled(discovery.getRSA() == null);
  copyValueAction=new Action(){
    public void run(){
      Object o=((ITreeSelection)viewer.getSelection()).getFirstElement();
      String data=((EndpointPropertyNode)o).getPropertyValue().toString();
      if (data != null && data.length() > 0) {
        clipboard.setContents(new Object[]{data},new Transfer[]{TextTransfer.getInstance()});
      }
    }
  }
;
  copyValueAction.setText(Messages.EndpointDiscoveryView_COPY_PROPERTY_VALUE);
  copyValueAction.setToolTipText(Messages.EndpointDiscoveryView_COPY_PROPERTY_VALUE);
  copyValueAction.setImageDescriptor(RSAImageRegistry.DESC_PROPERTY_OBJ);
  copyNameAction=new Action(){
    public void run(){
      Object o=((ITreeSelection)viewer.getSelection()).getFirstElement();
      String data=((EndpointPropertyNode)o).getPropertyName();
      if (data != null && data.length() > 0) {
        clipboard.setContents(new Object[]{data},new Transfer[]{TextTransfer.getInstance()});
      }
    }
  }
;
  copyNameAction.setText(Messages.EndpointDiscoveryView_COPY_PROPERTY_NAME);
  copyNameAction.setToolTipText(Messages.EndpointDiscoveryView_COPY_PROPERTY_NAME);
  copyNameAction.setImageDescriptor(RSAImageRegistry.DESC_PROPERTY_OBJ);
  importAction=new Action(){
    public void run(){
      EndpointNode edNode=getEDNodeSelected();
      if (edNode != null) {
        RemoteServiceAdmin rsa=discovery.getRSA();
        if (rsa == null)         showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IS_NULL);
 else {
          EndpointDescription ed=edNode.getEndpointDescription();
          ImportRegistration reg=(ImportRegistration)rsa.importService(ed);
          Throwable exception=reg.getException();
          if (exception != null) {
            logError(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IMPORTSERVICE_FAILED,exception);
            showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IMPORTSERVICE_FAILED_PREFIX + exception.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
          }
 else {
            edNode.setImportReg(new ImportRegistrationNode(reg));
            viewer.refresh();
          }
        }
      }
    }
  }
;
  importAction.setText(Messages.EndpointDiscoveryView_IMPORT_REMOTE_SERVICE);
  importAction.setToolTipText(Messages.EndpointDiscoveryView_IMPORT_REMOTE_SERVICE_TT);
  importAction.setImageDescriptor(RSAImageRegistry.DESC_RSPROXY_CO);
  unimportAction=new Action(){
    public void run(){
      EndpointNode edNode=getEDNodeSelected();
      if (edNode != null) {
        ImportRegistration ir=edNode.getImportRegistration();
        if (ir == null)         return;
        try {
          ir.close();
          edNode.setImportReg(null);
          viewer.refresh();
        }
 catch (        Exception e) {
          logError(Messages.EndpointDiscoveryView_ERROR_MSG_CANNOT_CLOSE_IR,e);
          showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_CANNOT_CLOSE_IR_PREFIX + e.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
        }
      }
    }
  }
;
  unimportAction.setText(Messages.EndpointDiscoveryView_CLOSE_IMPORTED_REMOTE_SERVICE);
  unimportAction.setToolTipText(Messages.EndpointDiscoveryView_CLOSE_IMPORTED_REMOTE_SERVICE_TT);
  edefDiscoverAction=new Action(){
    public void run(){
      IEndpointDescriptionLocator locator=discovery.getEndpointDescriptionLocator();
      if (locator != null) {
        FileDialog dialog=new FileDialog(viewer.getControl().getShell(),SWT.OPEN);
        dialog.setFilterExtensions(new String[]{"String_Node_Str"});
        dialog.setText(Messages.EndpointDiscoveryView_OPEN_EDEF_FILE);
        dialog.setFilterPath(null);
        String result=dialog.open();
        if (result != null)         try {
          EndpointDescription[] eds=(EndpointDescription[])new EndpointDescriptionReader().readEndpointDescriptions(new FileInputStream(result));
          if (eds != null) {
            for (int i=0; i < eds.length; i++)             locator.discoverEndpoint(eds[i]);
          }
        }
 catch (        IOException e) {
          logError(Messages.EndpointDiscoveryView_ERROR_MSG_ENDPOINT_PARSING_FAILED,e);
          showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_ENDPOINT_PARSING_FAILED_PREFIX + e.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
        }
      }
    }
  }
;
  edefDiscoverAction.setText(Messages.EndpointDiscoveryView_OPEN_EDEF_FILE_DIALOG);
  edefDiscoverAction.setToolTipText(Messages.EndpointDiscoveryView_OPEN_EDEF_FILE_DIALOG_TT);
  edefDiscoverAction.setEnabled(discovery.getRSA() != null);
  edefDiscoverAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE));
  undiscoverAction=new Action(){
    public void run(){
      EndpointNode endpoint=getEDNodeSelected();
      if (endpoint != null && endpoint.getImportRegistration() == null) {
        IEndpointDescriptionLocator l=discovery.getEndpointDescriptionLocator();
        if (l != null && MessageDialog.openQuestion(viewer.getControl().getShell(),Messages.EndpointDiscoveryView_REMOVE_ENDPOINT_QUESTION_TITLE,Messages.EndpointDiscoveryView_REMOVE_ENDPOINT_QUESTION))         l.undiscoverEndpoint(endpoint.getEndpointDescription());
      }
    }
  }
;
  undiscoverAction.setText(Messages.EndpointDiscoveryView_REMOVE_ENDPOINT);
  undiscoverAction.setToolTipText(Messages.EndpointDiscoveryView_REMOVE_ENDPOINT_TT);
}

Fixed version (ground truth):
private void makeActions(){
  startRSAAction=new Action(){
    public void run(){
      if (discovery != null)       try {
        discovery.startRSA();
        startRSAAction.setEnabled(false);
      }
 catch (      BundleException e) {
        logError(Messages.EndpointDiscoveryView_ERROR_RSA_START_FAILED,e);
        showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_START_PREFIX + e.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
      }
    }
  }
;
  startRSAAction.setText(Messages.EndpointDiscoveryView_START_RSA);
  startRSAAction.setToolTipText(Messages.EndpointDiscoveryView_START_RSA_SERVICE);
  startRSAAction.setEnabled(discovery.getRSA() == null);
  copyValueAction=new Action(){
    public void run(){
      Object o=((ITreeSelection)viewer.getSelection()).getFirstElement();
      String data=((EndpointPropertyNode)o).getPropertyValue().toString();
      if (data != null && data.length() > 0) {
        clipboard.setContents(new Object[]{data},new Transfer[]{TextTransfer.getInstance()});
      }
    }
  }
;
  copyValueAction.setText(Messages.EndpointDiscoveryView_COPY_PROPERTY_VALUE);
  copyValueAction.setToolTipText(Messages.EndpointDiscoveryView_COPY_PROPERTY_VALUE);
  copyValueAction.setImageDescriptor(RSAImageRegistry.DESC_PROPERTY_OBJ);
  copyNameAction=new Action(){
    public void run(){
      Object o=((ITreeSelection)viewer.getSelection()).getFirstElement();
      String data=((EndpointPropertyNode)o).getPropertyName();
      if (data != null && data.length() > 0) {
        clipboard.setContents(new Object[]{data},new Transfer[]{TextTransfer.getInstance()});
      }
    }
  }
;
  copyNameAction.setText(Messages.EndpointDiscoveryView_COPY_PROPERTY_NAME);
  copyNameAction.setToolTipText(Messages.EndpointDiscoveryView_COPY_PROPERTY_NAME);
  copyNameAction.setImageDescriptor(RSAImageRegistry.DESC_PROPERTY_OBJ);
  importAction=new Action(){
    public void run(){
      EndpointNode edNode=getEDNodeSelected();
      if (edNode != null) {
        RemoteServiceAdmin rsa=discovery.getRSA();
        if (rsa == null)         showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IS_NULL);
 else {
          EndpointDescription ed=edNode.getEndpointDescription();
          ImportRegistration reg=(ImportRegistration)rsa.importService(ed);
          if (reg == null) {
            logError(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IMPORTSERVICE_FAILED,new Exception("String_Node_Str"));
            showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IMPORTSERVICE_FAILED_PREFIX + "String_Node_Str" + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
            return;
          }
          Throwable exception=reg.getException();
          if (exception != null) {
            logError(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IMPORTSERVICE_FAILED,exception);
            showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_RSA_IMPORTSERVICE_FAILED_PREFIX + exception.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
          }
 else {
            edNode.setImportReg(new ImportRegistrationNode(reg));
            viewer.refresh();
          }
        }
      }
    }
  }
;
  importAction.setText(Messages.EndpointDiscoveryView_IMPORT_REMOTE_SERVICE);
  importAction.setToolTipText(Messages.EndpointDiscoveryView_IMPORT_REMOTE_SERVICE_TT);
  importAction.setImageDescriptor(RSAImageRegistry.DESC_RSPROXY_CO);
  unimportAction=new Action(){
    public void run(){
      EndpointNode edNode=getEDNodeSelected();
      if (edNode != null) {
        ImportRegistration ir=edNode.getImportRegistration();
        if (ir == null)         return;
        try {
          ir.close();
          edNode.setImportReg(null);
          viewer.refresh();
        }
 catch (        Exception e) {
          logError(Messages.EndpointDiscoveryView_ERROR_MSG_CANNOT_CLOSE_IR,e);
          showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_CANNOT_CLOSE_IR_PREFIX + e.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
        }
      }
    }
  }
;
  unimportAction.setText(Messages.EndpointDiscoveryView_CLOSE_IMPORTED_REMOTE_SERVICE);
  unimportAction.setToolTipText(Messages.EndpointDiscoveryView_CLOSE_IMPORTED_REMOTE_SERVICE_TT);
  edefDiscoverAction=new Action(){
    public void run(){
      IEndpointDescriptionLocator locator=discovery.getEndpointDescriptionLocator();
      if (locator != null) {
        FileDialog dialog=new FileDialog(viewer.getControl().getShell(),SWT.OPEN);
        dialog.setFilterExtensions(new String[]{"String_Node_Str"});
        dialog.setText(Messages.EndpointDiscoveryView_OPEN_EDEF_FILE);
        dialog.setFilterPath(null);
        String result=dialog.open();
        if (result != null)         try {
          EndpointDescription[] eds=(EndpointDescription[])new EndpointDescriptionReader().readEndpointDescriptions(new FileInputStream(result));
          if (eds != null) {
            for (int i=0; i < eds.length; i++)             locator.discoverEndpoint(eds[i]);
          }
        }
 catch (        IOException e) {
          logError(Messages.EndpointDiscoveryView_ERROR_MSG_ENDPOINT_PARSING_FAILED,e);
          showMessage(Messages.EndpointDiscoveryView_ERROR_MSG_ENDPOINT_PARSING_FAILED_PREFIX + e.getMessage() + Messages.EndpointDiscoveryView_ERROR_MSG_SUFFIX);
        }
      }
    }
  }
;
  edefDiscoverAction.setText(Messages.EndpointDiscoveryView_OPEN_EDEF_FILE_DIALOG);
  edefDiscoverAction.setToolTipText(Messages.EndpointDiscoveryView_OPEN_EDEF_FILE_DIALOG_TT);
  edefDiscoverAction.setEnabled(discovery.getRSA() != null);
  edefDiscoverAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE));
  undiscoverAction=new Action(){
    public void run(){
      EndpointNode endpoint=getEDNodeSelected();
      if (endpoint != null && endpoint.getImportRegistration() == null) {
        IEndpointDescriptionLocator l=discovery.getEndpointDescriptionLocator();
        if (l != null && MessageDialog.openQuestion(viewer.getControl().getShell(),Messages.EndpointDiscoveryView_REMOVE_ENDPOINT_QUESTION_TITLE,Messages.EndpointDiscoveryView_REMOVE_ENDPOINT_QUESTION))         l.undiscoverEndpoint(endpoint.getEndpointDescription());
      }
    }
  }
;
  undiscoverAction.setText(Messages.EndpointDiscoveryView_REMOVE_ENDPOINT);
  undiscoverAction.setToolTipText(Messages.EndpointDiscoveryView_REMOVE_ENDPOINT_TT);
}