Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2021S1#92 from anthony6401/fix-duplic…
Browse files Browse the repository at this point in the history
…ate-tag-branch

Fix duplicate tags bug and update fileAddress error message
  • Loading branch information
anthony6401 authored Oct 13, 2020
2 parents b6727f1 + 5c4e6c4 commit c01553e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/ShowCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class ShowCommand extends Command {
public static final String COMMAND_WORD = "show";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows a tag's file address. "
+ "Parameters: "
+ "\nParameters: "
+ PREFIX_TAG_NAME + "TAG_NAME "
+ "Example: " + COMMAND_WORD + " "
+ "\nExample: " + COMMAND_WORD + " "
+ PREFIX_TAG_NAME + "cs2103 ";

public static final String MESSAGE_SUCCESS = "%s's file path: %s";
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/seedu/address/logic/commands/TagCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
public class TagCommand extends Command {

public static final String COMMAND_WORD = "tag";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a tag to the HelleFile's address book.\n"
+ "Parameters: "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a tag to the HelleFile's address book. "
+ "\nParameters: "
+ PREFIX_TAG_NAME + "TAG_NAME "
+ PREFIX_FILE_ADDRESS + "FILE_ADDRESS\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_FILE_ADDRESS + "FILE_ADDRESS "
+ "\nExample: " + COMMAND_WORD + " "
+ PREFIX_TAG_NAME + "cs2103 "
+ PREFIX_FILE_ADDRESS + "F:\\OneDrive\\CS2013T ";

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/model/tag/FileAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
*/
public class FileAddress {

// TODO change message to be more understandable
public static final String MESSAGE_CONSTRAINTS = "File addresses can take any values, and it should not be blank";
public static final String MESSAGE_CONSTRAINTS = "File address can only take a valid file path!";

/*
* The first character of the address must not be a whitespace,
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/model/tag/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public boolean isSameTag(Tag otherTag) {
}

return otherTag != null
&& otherTag.getTagName().equals(getTagName())
&& otherTag.getFileAddress().equals(getFileAddress());
&& otherTag.getTagName().equals(getTagName());
}
/**
* Returns true if both tag have the same identity and data fields.
Expand Down

0 comments on commit c01553e

Please sign in to comment.