Program: 126928
Project: 126928
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof RepositoryNode)) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=(RepositoryNode)firstElement;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      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 || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_VALIDATION_RULES) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  Object firstElement=selection.getFirstElement();
  if (!(firstElement instanceof RepositoryNode)) {
    setEnabled(false);
    return;
  }
  RepositoryNode node=(RepositoryNode)firstElement;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    canWork=false;
  }
  ERepositoryObjectType objectType=null;
  for (  Object obj : ((StructuredSelection)selection).toArray()) {
    if (canWork) {
      RepositoryNode sourceNode=(RepositoryNode)obj;
      ERepositoryObjectType type=sourceNode.getObjectType();
      if (objectType != null && objectType != type) {
        canWork=false;
        break;
      }
 else {
        objectType=type;
      }
      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 || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_SALESFORCE_MODULE || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESOPERATION || node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.SERVICESPORT || (node.getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_VALIDATION_RULES && node.getParent().getProperties(EProperties.CONTENT_TYPE) == ERepositoryObjectType.METADATA_VALIDATIONS_RULES_FOLDER)) {
        canWork=false;
      }
    }
 else {
      break;
    }
  }
  setEnabled(canWork);
}