Program: 172157
Project: 172157
Buggy source:
@Override public String createFolder(String repositoryId,final Properties properties,String folderId,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);
  final String objectTypeId=connector.getObjectTypeIdProperty(properties);
  final TypeDefinitionWrapper type=connector.getTypeForCreate(objectTypeId,BaseTypeId.CMIS_FOLDER);
  connector.checkChildObjectType(parentInfo,type.getTypeId());
  endReadOnlyTransaction();
  NodeRef newNodeRef=connector.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<NodeRef>(){
    public NodeRef execute() throws Exception {
      try {
        NodeRef nodeRef=connector.getFileFolderService().create(parentInfo.getNodeRef(),name,type.getAlfrescoClass()).getNodeRef();
        connector.setProperties(nodeRef,type,properties,new String[]{PropertyIds.NAME,PropertyIds.OBJECT_TYPE_ID});
        connector.applyPolicies(nodeRef,type,policies);
        connector.applyACL(nodeRef,type,addAces,removeAces);
        return nodeRef;
      }
 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 newNodeRef.toString();
}

Fixed version (ground truth):
@Override public String createFolder(String repositoryId,final Properties properties,String folderId,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,null);
  final String objectTypeId=connector.getObjectTypeIdProperty(properties);
  final TypeDefinitionWrapper type=connector.getTypeForCreate(objectTypeId,BaseTypeId.CMIS_FOLDER);
  connector.checkChildObjectType(parentInfo,type.getTypeId());
  endReadOnlyTransaction();
  NodeRef newNodeRef=connector.getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<NodeRef>(){
    public NodeRef execute() throws Exception {
      try {
        NodeRef nodeRef=connector.getFileFolderService().create(parentInfo.getNodeRef(),name,type.getAlfrescoClass()).getNodeRef();
        connector.setProperties(nodeRef,type,properties,new String[]{PropertyIds.NAME,PropertyIds.OBJECT_TYPE_ID});
        connector.applyPolicies(nodeRef,type,policies);
        connector.applyACL(nodeRef,type,addAces,removeAces);
        return nodeRef;
      }
 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 newNodeRef.toString();
}