diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java index f6c8e4c3751..c8981a636df 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java @@ -51,7 +51,9 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.Map; @Service @@ -583,7 +585,7 @@ private void buildNotification(String permission, String objectType, Long object private List retrieveSubscribers(Long officeId, String permission) { - Collection topicSubscribers = new ArrayList<>(); + Set topicSubscribers = new HashSet<>(); List subscriberIds = new ArrayList<>(); Long entityId = officeId; String entityType= ""; @@ -596,7 +598,7 @@ private List retrieveSubscribers(Long officeId, String permission) { for (Role curRole : allRoles) { if (curRole.hasPermissionTo(permission) || curRole.hasPermissionTo("ALL_FUNCTIONS")) { String memberType = curRole.getName(); - topicSubscribers = topicSubscriberReadPlatformService.getSubscribers(entityId, entityType, memberType); + topicSubscribers.addAll(topicSubscriberReadPlatformService.getSubscribers(entityId, entityType, memberType)); } }