diff --git a/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java b/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java index 6318afa..9610c19 100644 --- a/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java +++ b/src/main/java/org/gcube/portal/notifications/thread/CommentNotificationsThread.java @@ -34,7 +34,6 @@ public class CommentNotificationsThread implements Runnable { /** * - * @param libclient * @param userManager * @param commenterUserId * @param commentedPostId @@ -44,7 +43,7 @@ public class CommentNotificationsThread implements Runnable { * @param commentKey * @param likes */ - public CommentNotificationsThread(LibClient libclient, UserManager userManager, String commenterUserId, + public CommentNotificationsThread(UserManager userManager, String commenterUserId, String commentedPostId, String commentText, NotificationsManager nm, String postOwnerId, String commentKey, ArrayList likes) { super(); this.nm = nm; @@ -55,15 +54,21 @@ public class CommentNotificationsThread implements Runnable { this.commentKey = commentKey; this.likes = likes; this.userManager = userManager; - - userIdsToNotify = new HashSet(); - List postComments = libclient.getAllCommentsByPostIdLib(commentedPostId); - for (Comment comment : postComments) { - if (comment.getUserid().compareTo(commenterUserId) != 0) { - userIdsToNotify.add(comment.getUserid()); + try { + LibClient libClient = new LibClient(); + userIdsToNotify = new HashSet(); + List postComments = libClient.getAllCommentsByPostIdLib(commentedPostId); + for (Comment comment : postComments) { + if (comment.getUserid().compareTo(commenterUserId) != 0) { + userIdsToNotify.add(comment.getUserid()); + } } + } catch (Exception e) { + throw new RuntimeException(e); } + + //clean //this.comments = comments; }