mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged DEV/JASONH to HEAD
12170: (Partial) Performance improvement (ALFCOM-1507) in getBaseVersion() 12622: JCR - add test for ALFCOM-1507 performance improvement git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12653 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1035,7 +1035,15 @@ public class NodeImpl extends ItemImpl implements Node
|
||||
// construct version
|
||||
VersionService versionService = session.getRepositoryImpl().getServiceRegistry().getVersionService();
|
||||
org.alfresco.service.cmr.version.VersionHistory versionHistory = versionService.getVersionHistory(nodeRef);
|
||||
org.alfresco.service.cmr.version.Version version = versionService.getCurrentVersion(nodeRef);
|
||||
|
||||
// This patch halves the time this method takes to execute. Implements ALFCOM-1507
|
||||
// org.alfresco.service.cmr.version.Version version = versionService.getCurrentVersion(nodeRef);
|
||||
org.alfresco.service.cmr.version.Version version = null;
|
||||
if (versionHistory != null)
|
||||
{
|
||||
String versionLabel = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
|
||||
version = versionHistory.getVersion(versionLabel);
|
||||
}
|
||||
return new VersionImpl(new VersionHistoryImpl(session, versionHistory), version).getProxy();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user