Skip to content

Commit d029de4

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#80 from successs404/branch-delete-grp
Remove empty Group constructor
2 parents 8dd827a + 94c516f commit d029de4

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/main/java/seedu/address/logic/commands/DelGrpCommand.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@ public DelGrpCommand(GrpContainsKeywordPredicate grpPredicate) {
3333
public CommandResult execute(Model model) throws CommandException {
3434
requireNonNull(model);
3535

36-
Group toDel = new Group();
37-
38-
boolean hasGroup = false;
36+
Group toDel = null;
3937

4038
if (!model.getSerenity().getGroupList().isEmpty()) {
4139
for (Group group : model.getSerenity().getGroupList()) {
4240
if (group.getName().equals(grpPredicate.getKeyword())) {
4341
toDel = group;
44-
hasGroup = true;
4542
break;
4643
}
4744
}
4845
}
4946

50-
if (!hasGroup) {
47+
if (toDel == null) {
5148
throw new CommandException(Messages.MESSAGE_GROUP_EMPTY);
5249
}
5350

src/main/java/seedu/address/model/group/Group.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public class Group {
2525
private UniqueStudentList students;
2626
private UniqueLessonList lessons;
2727

28-
// Empty constructor
29-
public Group() {}
30-
3128
/**
3229
* Constructs a {@code Group}
3330
*

0 commit comments

Comments
 (0)