Skip to content

Commit

Permalink
Edit FindCommandParser to remove trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-setyawan committed Apr 4, 2024
1 parent 630a745 commit e9e581d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_DIAGNOSIS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.commands.exceptions.CommandException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NRIC;
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS;

import seedu.address.commons.util.ToStringBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public FindCommand parse(String args) throws ParseException {
return new FindCommand(new NameContainsKeywordsPredicate(list));
} else if (trimmedArgs.startsWith(PREFIX_ADDRESS.getPrefix())) {
String[] addressKeywords = trimmedArgs.substring(2).trim().split(",");
int len = addressKeywords.length;
int len = addressKeywords.length;
for (int i = 0; i < len; i++) {
addressKeywords[i] = addressKeywords[i].trim();
}
List<String> list = Arrays.asList(addressKeywords);
return new FindCommand(new AddressContainsKeywordsPredicate(list));
} else if (trimmedArgs.startsWith(PREFIX_CONDITION.getPrefix())) {
String[] conditionKeywords = trimmedArgs.substring(4).trim().split(",");
int len = conditionKeywords.length;
int len = conditionKeywords.length;
for (int i = 0; i < len; i++) {
conditionKeywords[i] = conditionKeywords[i].trim();
}
Expand Down

0 comments on commit e9e581d

Please sign in to comment.