Skip to content

Commit

Permalink
Fix copy-paste mistake 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ReflectiveObsidian committed Apr 4, 2024
1 parent 176204f commit 67255aa
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Map;

import seedu.address.logic.Messages;
import seedu.address.logic.commands.AddAttributeCommand;
import seedu.address.logic.commands.EditAttributeCommand;
import seedu.address.logic.parser.exceptions.ParseException;

Expand All @@ -26,7 +25,7 @@ public EditAttributeCommand parse(String userInput) throws ParseException {
userInput = userInput.trim();
int firstSlashIndex = userInput.indexOf('/');
if (firstSlashIndex == -1) {
throw new ParseException(Messages.MESSAGE_MISSING_UUID + "\n" + AddAttributeCommand.MESSAGE_USAGE);
throw new ParseException(Messages.MESSAGE_MISSING_UUID + "\n" + EditAttributeCommand.MESSAGE_USAGE);
}

// Find the index of the start of attributes section (the second slash)
Expand All @@ -37,7 +36,7 @@ public EditAttributeCommand parse(String userInput) throws ParseException {
// Extract UUID, which is between the first slash and the start of the second segment
String uuid = userInput.substring(firstSlashIndex + 1, endOfUuidIndex).trim();
if (uuid.contains(" ") || uuid.length() < 2) {
throw new ParseException(Messages.MESSAGE_INVALID_UUID_FORMAT + "\n" + AddAttributeCommand.MESSAGE_USAGE);
throw new ParseException(Messages.MESSAGE_INVALID_UUID_FORMAT + "\n" + EditAttributeCommand.MESSAGE_USAGE);
}

// Attributes part starts after the second slash, if there is one
Expand All @@ -64,7 +63,7 @@ public EditAttributeCommand parse(String userInput) throws ParseException {

if (attributes.isEmpty()) {
// You may decide to remove this check if attributes are optional
throw new ParseException(Messages.MESSAGE_MISSING_ATTRIBUTES + "\n" + AddAttributeCommand.MESSAGE_USAGE);
throw new ParseException(Messages.MESSAGE_MISSING_ATTRIBUTES + "\n" + EditAttributeCommand.MESSAGE_USAGE);
}

return new EditAttributeCommand(uuid, attributes);
Expand Down

0 comments on commit 67255aa

Please sign in to comment.