From ab3f4a16eb7e25244f1ebd348c6e3f1c624b149e Mon Sep 17 00:00:00 2001 From: ehardon Date: Fri, 5 Mar 2021 10:14:53 +0200 Subject: [PATCH] address PR comment --- .../RecordsManagementAdminServiceImpl.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java index cce7d92977..bcd9e3fbe0 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java @@ -208,24 +208,15 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas if (!isCustomMapInit && getDictionaryService().getAllModels().contains(RM_CUSTOM_MODEL)) { // run as System on bootstrap - AuthenticationUtil.runAs(new RunAsWork() - { - public Object doWork() - { - RetryingTransactionCallback callback = new RetryingTransactionCallback() - { - public Void execute() - { - // initialise custom properties - initCustomMap(); - return null; - } - }; - transactionService.getRetryingTransactionHelper().doInTransaction(callback); - + AuthenticationUtil.runAsSystem((RunAsWork) () -> { + transactionService.getRetryingTransactionHelper() + .doInTransaction((RetryingTransactionCallback) () -> { + // initialise custom properties + initCustomMap(); return null; - } - }, AuthenticationUtil.getSystemUserName()); + }); + return null; + }); } } finally