Program: 172106
Project: 172106
Buggy source:
@Override public void deleteObjectOrCancelCheckOut(String repositoryId,final String objectId,final Boolean allVersions,ExtensionsData extension){
  checkRepositoryId(repositoryId);
  final CMISNodeInfo info=getOrCreateNodeInfo(objectId,"String_Node_Str");
  endReadOnlyTransaction();
  connector.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Boolean>(){
    public Boolean execute() throws Exception {
      try {
        if (info.isVariant(CMISObjectVariant.ASSOC)) {
          AssociationRef assocRef=info.getAssociationRef();
          connector.getNodeService().removeAssociation(assocRef.getSourceRef(),assocRef.getTargetRef(),assocRef.getTypeQName());
          return true;
        }
        NodeRef nodeRef=info.getNodeRef();
        if (info.isVariant(CMISObjectVariant.PWC)) {
          connector.getCheckOutCheckInService().cancelCheckout(nodeRef);
          return true;
        }
        if (info.isFolder()) {
          if (connector.getNodeService().getChildAssocs(nodeRef).size() > 0) {
            throw new CmisConstraintException("String_Node_Str");
          }
          connector.getNodeService().deleteNode(nodeRef);
          return true;
        }
        if (allVersions) {
          NodeRef workingCopy=connector.getCheckOutCheckInService().getWorkingCopy(nodeRef);
          if (workingCopy != null) {
            connector.getCheckOutCheckInService().cancelCheckout(workingCopy);
          }
        }
 else         if (info.isVariant(CMISObjectVariant.VERSION)) {
          Version version=((CMISNodeInfoImpl)info).getVersion();
          connector.getVersionService().deleteVersion(nodeRef,version);
          return true;
        }
        if (info.isVariant(CMISObjectVariant.VERSION)) {
          nodeRef=info.getCurrentNodeNodeRef();
        }
        List<ChildAssociationRef> childAssociations=connector.getNodeService().getParentAssocs(nodeRef);
        if (childAssociations != null) {
          for (          ChildAssociationRef childAssoc : childAssociations) {
            if (!childAssoc.isPrimary()) {
              connector.getNodeService().removeChildAssociation(childAssoc);
            }
          }
        }
        connector.getNodeService().deleteNode(nodeRef);
        return true;
      }
 catch (      AccessDeniedException ade) {
        throw new CmisPermissionDeniedException("String_Node_Str",ade);
      }
    }
  }
,false,true);
  endReadOnlyTransaction();
}

Fixed version (ground truth):
@Override public void deleteObjectOrCancelCheckOut(String repositoryId,final String objectId,final Boolean allVersions,ExtensionsData extension){
  checkRepositoryId(repositoryId);
  final CMISNodeInfo info=getOrCreateNodeInfo(objectId,"String_Node_Str");
  endReadOnlyTransaction();
  connector.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Boolean>(){
    public Boolean execute() throws Exception {
      try {
        if (info.isVariant(CMISObjectVariant.ASSOC)) {
          AssociationRef assocRef=info.getAssociationRef();
          connector.getNodeService().removeAssociation(assocRef.getSourceRef(),assocRef.getTargetRef(),assocRef.getTypeQName());
          return true;
        }
        NodeRef nodeRef=info.getNodeRef();
        if (info.isVariant(CMISObjectVariant.PWC)) {
          connector.getCheckOutCheckInService().cancelCheckout(nodeRef);
          return true;
        }
        if (info.isFolder()) {
          if (connector.getNodeService().getChildAssocs(nodeRef).size() > 0) {
            throw new CmisConstraintException("String_Node_Str");
          }
          connector.getNodeService().deleteNode(nodeRef);
          return true;
        }
        if (allVersions) {
          NodeRef workingCopy=connector.getCheckOutCheckInService().getWorkingCopy(nodeRef);
          if (workingCopy != null) {
            connector.getCheckOutCheckInService().cancelCheckout(workingCopy);
          }
        }
 else         if (info.isVariant(CMISObjectVariant.VERSION)) {
          Version version=((CMISNodeInfoImpl)info).getVersion();
          connector.getVersionService().deleteVersion(nodeRef,version);
          return true;
        }
        if (info.isVariant(CMISObjectVariant.VERSION)) {
          nodeRef=info.getCurrentNodeNodeRef();
        }
        List<ChildAssociationRef> childAssociations=connector.getNodeService().getParentAssocs(nodeRef);
        if (childAssociations != null) {
          for (          ChildAssociationRef childAssoc : childAssociations) {
            if (!childAssoc.isPrimary()) {
              connector.getNodeService().removeChildAssociation(childAssoc);
            }
          }
        }
        if (allVersions) {
          connector.getNodeService().deleteNode(nodeRef);
        }
 else {
          CMISNodeInfoImpl infoImpl=((CMISNodeInfoImpl)info);
          Version version=infoImpl.getVersion();
          if (infoImpl.getVersionHistory().getPredecessor(version) == null) {
            connector.getNodeService().deleteNode(nodeRef);
          }
 else {
            connector.getVersionService().deleteVersion(nodeRef,version);
          }
        }
        return true;
      }
 catch (      AccessDeniedException ade) {
        throw new CmisPermissionDeniedException("String_Node_Str",ade);
      }
    }
  }
,false,true);
  endReadOnlyTransaction();
}