Skip to content

Commit

Permalink
Revert "Checkstyle errors [2]"
Browse files Browse the repository at this point in the history
This reverts commit 52210e6.
  • Loading branch information
Jeevz10 committed Oct 31, 2018
1 parent 52210e6 commit bb6bcaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/seedu/address/logic/commands/ListCommand.java
Expand Up @@ -32,9 +32,8 @@ public class ListCommand extends Command {
private final DepartmentContainsKeywordsPredicate predicate;

public ListCommand(String sortByParam, DepartmentContainsKeywordsPredicate predicate) {
requireNonNull(sortByParam);
//requireNonNull(predicate);
this.predicate = predicate;
requireNonNull(sortByParam);
listKey = sortByParam;
}

Expand All @@ -43,12 +42,12 @@ public CommandResult execute(Model model, CommandHistory history) {
requireNonNull(model);

switch (listKey) {
case (LIST_KEY_DEPARTMENT): model.updateFilteredPersonList(predicate);
return new CommandResult(
case (LIST_KEY_DEPARTMENT): model.updateFilteredPersonList(predicate);
return new CommandResult(
String.format(Messages.MESSAGE_PERSONS_LISTED_OVERVIEW, model.getFilteredPersonList().size()));
case (LIST_KEY_ALL): model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);
break;
default:
case (LIST_KEY_ALL): model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);
break;
default:
}

return new CommandResult(MESSAGE_SUCCESS);
Expand Down
Expand Up @@ -39,6 +39,7 @@ public ListCommand parse(String userInput) throws ParseException {

/**
* Checks if first word of the userInput is equals to "all"
* @param userInput
* @return boolean true if it is equal, if not, false
*/
private boolean parseAll(String userInput) {
Expand All @@ -47,6 +48,7 @@ private boolean parseAll(String userInput) {

/**
* Checks if first word of the userInput is equals to "dep"
* @param userInput
* @return boolean true if it is equal, if not, false
*/
private boolean parseDep(String userInput) {
Expand All @@ -55,6 +57,7 @@ private boolean parseDep(String userInput) {

/**
* Splits the userInput by whitespace and places it into a DepartmentContainsKeywordPredicate
* @param userInput
* @return a new predicate
*/
private DepartmentContainsKeywordsPredicate preparePredicate(String userInput) {
Expand Down

0 comments on commit bb6bcaa

Please sign in to comment.