Fix leaked 'MLPropertyInterceptor.setMLAware' in data load API implementation (ACE-4552)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@116895 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2015-11-10 10:39:07 +00:00
parent 5bcbdef83c
commit bcf40c1b72

View File

@@ -279,6 +279,8 @@ public class FileFolderLoader
{ {
// Add the cm:description additional properties // Add the cm:description additional properties
boolean wasMLAware = MLPropertyInterceptor.setMLAware(true); boolean wasMLAware = MLPropertyInterceptor.setMLAware(true);
try
{
MLText descriptions = new MLText(); MLText descriptions = new MLText();
String[] languages = Locale.getISOLanguages(); String[] languages = Locale.getISOLanguages();
String defaultLanguage = Locale.getDefault().getLanguage(); String defaultLanguage = Locale.getDefault().getLanguage();
@@ -308,8 +310,12 @@ public class FileFolderLoader
descriptions.put(languageLocale, description); descriptions.put(languageLocale, description);
} }
nodeService.setProperty(fileNodeRef, ContentModel.PROP_DESCRIPTION, descriptions); nodeService.setProperty(fileNodeRef, ContentModel.PROP_DESCRIPTION, descriptions);
}
finally
{
MLPropertyInterceptor.setMLAware(wasMLAware); MLPropertyInterceptor.setMLAware(wasMLAware);
} }
}
// Success // Success
count.incrementAndGet(); count.incrementAndGet();
} }