Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2021S1#80 from successs404/branch-del…
Browse files Browse the repository at this point in the history
…ete-grp

Remove empty Group constructor
  • Loading branch information
chunyongg authored Oct 12, 2020
2 parents 8dd827a + 94c516f commit d029de4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/main/java/seedu/address/logic/commands/DelGrpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,18 @@ public DelGrpCommand(GrpContainsKeywordPredicate grpPredicate) {
public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);

Group toDel = new Group();

boolean hasGroup = false;
Group toDel = null;

if (!model.getSerenity().getGroupList().isEmpty()) {
for (Group group : model.getSerenity().getGroupList()) {
if (group.getName().equals(grpPredicate.getKeyword())) {
toDel = group;
hasGroup = true;
break;
}
}
}

if (!hasGroup) {
if (toDel == null) {
throw new CommandException(Messages.MESSAGE_GROUP_EMPTY);
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/seedu/address/model/group/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public class Group {
private UniqueStudentList students;
private UniqueLessonList lessons;

// Empty constructor
public Group() {}

/**
* Constructs a {@code Group}
*
Expand Down

0 comments on commit d029de4

Please sign in to comment.