Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LoD and Add logging #529

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public CustomerAddCommand parse(String args) throws ParseException {
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS);

if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL)
|| !argMultimap.getPreamble().isEmpty()) {
|| !argMultimap.isEmptyPreamble()) {
logger.severe("Could not parse command");
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, CustomerAddCommand.MESSAGE_USAGE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.util.Arrays;
import java.util.logging.Logger;

import seedu.address.logic.commands.customer.CustomerFindCommand;
import seedu.address.logic.parser.Parser;
Expand All @@ -14,6 +15,8 @@
*/
public class CustomerFindCommandParser implements Parser<CustomerFindCommand> {

private static final Logger logger = Logger.getLogger(CustomerFindCommandParser.class.getName());

/**
* Parses the given {@code String} of arguments in the context of the FindCommand
* and returns a FindCommand object for execution.
Expand All @@ -23,6 +26,7 @@ public class CustomerFindCommandParser implements Parser<CustomerFindCommand> {
public CustomerFindCommand parse(String args) throws ParseException {
String trimmedArgs = args.trim();
if (trimmedArgs.isEmpty()) {
logger.severe("Could not parse command");
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT, CustomerFindCommand.MESSAGE_USAGE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public UserLoginCommand parse(String args) throws ParseException {
ArgumentTokenizer.tokenize(args, PREFIX_USER, PREFIX_PASSWORD);

if (!arePrefixesPresent(argMultimap, PREFIX_USER, PREFIX_PASSWORD)
|| !argMultimap.getPreamble().isEmpty()) {
|| !argMultimap.isEmptyPreamble()) {
logger.severe("Could not parse command");
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, UserLoginCommand.MESSAGE_USAGE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public UserUpdateCommand parse(String args) throws ParseException {

UserUpdateDescriptor userUpdateDescriptor = new UserUpdateDescriptor();

if (!argMultimap.getPreamble().isEmpty()) {
if (!argMultimap.isEmptyPreamble()) {
logger.severe("Could not parse command");
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, UserUpdateCommand.MESSAGE_USAGE));
}
Expand Down
Loading