Simplify implementation of group.PutName
The use of the GroupDetailFactory seems to be a relic of previous code. Neither a comment nor a test enforces that we keep this apparent unnecessary conversion and hence we get rid of it. Change-Id: I397d6f0b78782c6fe48c61b00e9ed379b8f551aa
This commit is contained in:
@@ -34,20 +34,15 @@ public class GroupDetailFactory implements Callable<GroupDetail> {
|
||||
|
||||
private final ReviewDb db;
|
||||
private final GroupControl.Factory groupControl;
|
||||
private final GroupCache groupCache;
|
||||
|
||||
private final AccountGroup.Id groupId;
|
||||
private GroupControl control;
|
||||
|
||||
@Inject
|
||||
GroupDetailFactory(
|
||||
ReviewDb db,
|
||||
GroupControl.Factory groupControl,
|
||||
GroupCache groupCache,
|
||||
@Assisted AccountGroup.Id groupId) {
|
||||
ReviewDb db, GroupControl.Factory groupControl, @Assisted AccountGroup.Id groupId) {
|
||||
this.db = db;
|
||||
this.groupControl = groupControl;
|
||||
this.groupCache = groupCache;
|
||||
|
||||
this.groupId = groupId;
|
||||
}
|
||||
@@ -55,9 +50,7 @@ public class GroupDetailFactory implements Callable<GroupDetail> {
|
||||
@Override
|
||||
public GroupDetail call() throws OrmException, NoSuchGroupException {
|
||||
control = groupControl.validateFor(groupId);
|
||||
AccountGroup group = groupCache.get(groupId);
|
||||
GroupDetail detail = new GroupDetail();
|
||||
detail.setGroup(group);
|
||||
detail.setMembers(loadMembers());
|
||||
detail.setIncludes(loadIncludes());
|
||||
return detail;
|
||||
|
Reference in New Issue
Block a user