Skip to content
Snippets Groups Projects

Extract ForumFactory from ForumManager

Merged Torsten Grote requested to merge 375-extract-forumfactory-from-forummanager into master

The code for creating forums in ForumManager was used by ForumSharingManager and also needed by InviteeEngine. This extracts it into its own class.

Closes #375 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
70 65 }
71 66
72 67 @Override
73 public Forum createForum(String name) {
74 int length = StringUtils.toUtf8(name).length;
75 if (length == 0) throw new IllegalArgumentException();
76 if (length > MAX_FORUM_NAME_LENGTH)
77 throw new IllegalArgumentException();
78 byte[] salt = new byte[FORUM_SALT_LENGTH];
79 random.nextBytes(salt);
80 return createForum(name, salt);
81 }
68 public Forum addForum(String name) throws DbException {
69 Forum f = forumFactory.createForum(name);
  • Contributor

    Sanity check: was there ever a case where addForum() was called that did not have createForum() called immediately prior? Is there any need for such a situation now?

  • I searched for usages and there was actually just one place where it was used and there createForum() was called right before. I figured that if we ever need it differently, we can always create a new/different method.

  • Contributor

    :thumbsup:

  • Contributor

    Otherwise LGTM!

  • Torsten Grote mentioned in commit ba928875

    mentioned in commit ba928875

  • Torsten Grote Status changed to merged

    Status changed to merged

  • akwizgran Milestone changed to %Milestone D

    Milestone changed to %Milestone D

  • Please register or sign in to reply
    Loading