From 71565ff47a32e3ee36066cb49c3477955c3a7c88 Mon Sep 17 00:00:00 2001 From: Neil McErlean Date: Tue, 14 Jul 2015 11:13:06 +0000 Subject: [PATCH] Part of RM-2343. Ensure that blank or whitespace-only values for the 'Classified By' field are not accepted. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@108246 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../classification/ContentClassificationService.java | 2 ++ .../classification/ContentClassificationServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java index dc708c9164..227bac1c9e 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java @@ -50,6 +50,8 @@ public interface ContentClassificationService * @param classificationReasonIds A non-empty set of ids of reasons for classifying the content in this way. * @param content The node to classify. * @throws LevelIdNotFound If the supplied level id is not found. + * @thorws IllegalArgumentException If the supplied {@code classifiedBy} is {@code null}, + * the empty string or a string consisting only of whitespace. * @throws ReasonIdNotFound If any of the supplied reason ids are not found. * @throws InvalidNodeRefException If the node could not be found. * @throws InvalidNode If the supplied node is not a content node. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java index ccea4dd79a..612f6aaad6 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java @@ -89,7 +89,7 @@ public class ContentClassificationServiceImpl extends ServiceBaseImpl implements Set classificationReasonIds, final NodeRef content) { checkNotBlank("classificationLevelId", classificationLevelId); - mandatory("classifiedBy", classifiedBy); + checkNotBlank("classifiedBy", classifiedBy); mandatory("classificationReasonIds", classificationReasonIds); mandatory("content", content);