Program: 172158
Project: 172158
Buggy source:
@Override public String createDocumentFromSource(String repositoryId,String sourceId,final Properties properties,String folderId,final VersioningState versioningState,final List<String> policies,final Acl addAces,final Acl removeAces,ExtensionsData extension){
  checkRepositoryId(repositoryId);
  final CMISNodeInfo parentInfo=getOrCreateFolderInfo(folderId,"String_Node_Str");
  final String name=connector.getNameProperty(properties);
  CMISNodeInfo info=getOrCreateNodeInfo(sourceId,"String_Node_Str");
  if (info.isVariant(CMISObjectVariant.ASSOC)) {
    throw new CmisConstraintException("String_Node_Str");
  }
  final NodeRef sourceNodeRef=info.getNodeRef();
  if (!info.isDocument()) {
    throw new CmisConstraintException("String_Node_Str");
  }
  final TypeDefinitionWrapper type=info.getType();
  connector.checkChildObjectType(parentInfo,type.getTypeId());
  endReadOnlyTransaction();
  NodeRef newNodeRef=connector.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<NodeRef>(){
    public NodeRef execute() throws Exception {
      try {
        NodeRef newDocumentNodeRef=connector.getFileFolderService().copy(sourceNodeRef,parentInfo.getNodeRef(),name).getNodeRef();
        connector.setProperties(newDocumentNodeRef,type,properties,new String[]{PropertyIds.NAME,PropertyIds.OBJECT_TYPE_ID});
        connector.applyPolicies(newDocumentNodeRef,type,policies);
        connector.applyACL(newDocumentNodeRef,type,addAces,removeAces);
        connector.applyVersioningState(newDocumentNodeRef,versioningState);
        return newDocumentNodeRef;
      }
 catch (      FileExistsException fee) {
        throw new CmisContentAlreadyExistsException("String_Node_Str",fee);
      }
catch (      IntegrityException ie) {
        throw new CmisConstraintException("String_Node_Str" + ie.getMessage(),ie);
      }
catch (      AccessDeniedException ade) {
        throw new CmisPermissionDeniedException("String_Node_Str",ade);
      }
    }
  }
,false,true);
  beginReadOnlyTransaction();
  return connector.createObjectId(newNodeRef);
}

Fixed version (ground truth):
@Override public String createDocumentFromSource(String repositoryId,String sourceId,final Properties properties,String folderId,final VersioningState versioningState,final List<String> policies,final Acl addAces,final Acl removeAces,ExtensionsData extension){
  checkRepositoryId(repositoryId);
  final CMISNodeInfo parentInfo=getOrCreateFolderInfo(folderId,"String_Node_Str");
  CMISNodeInfo info=getOrCreateNodeInfo(sourceId,"String_Node_Str");
  if (info.isVariant(CMISObjectVariant.ASSOC)) {
    throw new CmisConstraintException("String_Node_Str");
  }
  final NodeRef sourceNodeRef=info.getNodeRef();
  if (!info.isDocument()) {
    throw new CmisConstraintException("String_Node_Str");
  }
  final String name=connector.getNameProperty(properties,info.getName());
  final TypeDefinitionWrapper type=info.getType();
  connector.checkChildObjectType(parentInfo,type.getTypeId());
  endReadOnlyTransaction();
  NodeRef newNodeRef=connector.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<NodeRef>(){
    public NodeRef execute() throws Exception {
      try {
        NodeRef newDocumentNodeRef=connector.getFileFolderService().copy(sourceNodeRef,parentInfo.getNodeRef(),name).getNodeRef();
        connector.setProperties(newDocumentNodeRef,type,properties,new String[]{PropertyIds.NAME,PropertyIds.OBJECT_TYPE_ID});
        connector.applyPolicies(newDocumentNodeRef,type,policies);
        connector.applyACL(newDocumentNodeRef,type,addAces,removeAces);
        connector.applyVersioningState(newDocumentNodeRef,versioningState);
        return newDocumentNodeRef;
      }
 catch (      FileExistsException fee) {
        throw new CmisContentAlreadyExistsException("String_Node_Str",fee);
      }
catch (      IntegrityException ie) {
        throw new CmisConstraintException("String_Node_Str" + ie.getMessage(),ie);
      }
catch (      AccessDeniedException ade) {
        throw new CmisPermissionDeniedException("String_Node_Str",ade);
      }
    }
  }
,false,true);
  beginReadOnlyTransaction();
  return connector.createObjectId(newNodeRef);
}