Program: 129141
Project: 129141
Buggy source:
public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  this.sourceNode=node;
  this.selection=selection;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    canWork=false;
  }
  if (selection != null) {
    if (((StructuredSelection)selection).toArray().length > 1) {
      canWork=false;
    }
 else     if (((StructuredSelection)selection).toArray().length == 1) {
      Object obj=((StructuredSelection)selection).toList().get(0);
      if (canWork) {
        RepositoryNode sourceNode=(RepositoryNode)obj;
        if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
          canWork=false;
        }
 else         if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC) {
          canWork=false;
        }
 else         if (node.getContentType() == ERepositoryObjectType.JOBS || node.getContentType() == ERepositoryObjectType.JOBLETS || node.getContentType() == ERepositoryObjectType.GENERATED || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC) {
          canWork=false;
        }
 else         if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_CDC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_QUERY || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_TABLE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_VIEW || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_SYNONYM || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SAP_FUNCTION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SAP_IDOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.MDM_CONCEPT || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT) {
          canWork=false;
        }
      }
    }
  }
 else {
    canWork=false;
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  RepositoryNode node=(RepositoryNode)selection.getFirstElement();
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  this.sourceNode=node;
  this.selection=selection;
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    canWork=false;
  }
  if (selection != null) {
    if (((StructuredSelection)selection).toArray().length > 1) {
      canWork=false;
    }
 else     if (((StructuredSelection)selection).toArray().length == 1) {
      Object obj=((StructuredSelection)selection).toList().get(0);
      if (canWork) {
        RepositoryNode sourceNode=(RepositoryNode)obj;
        if (!CopyObjectAction.getInstance().validateAction(sourceNode,null)) {
          canWork=false;
        }
 else         if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC) {
          canWork=false;
        }
 else         if (node.getContentType() == ERepositoryObjectType.JOBS || node.getContentType() == ERepositoryObjectType.JOBLETS || node.getContentType() == ERepositoryObjectType.GENERATED || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOB_DOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.JOBLET_DOC) {
          canWork=false;
        }
 else         if (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_CDC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_QUERY || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_TABLE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_VIEW || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_CON_SYNONYM || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SAP_FUNCTION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SAP_IDOC || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.MDM_CONCEPT || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT) {
          canWork=false;
        }
      }
    }
  }
 else {
    canWork=false;
  }
  setEnabled(canWork);
}