Skip to content

Commit

Permalink
Merge pull request #223 from lerxuann/branch-v1.4
Browse files Browse the repository at this point in the history
Fix bugs in find and delete commands
  • Loading branch information
Kailash201 authored Nov 5, 2023
2 parents 7b4796a + c852de5 commit b462864
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ListGroupCommand extends Command {
@Override
public CommandResult execute(Model model) {
requireNonNull(model);
MESSAGE_SUCCESS.setLength(0);
MESSAGE_SUCCESS.append("Groups in address book:\n");
ObservableList<Group> groupList = model.getFilteredGroupList();
groupList.stream().forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public DeleteCommand parse(String args) throws ParseException {
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);

// check if either n/ or g/ are present
if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_GROUPTAG)
|| !argMultimap.getPreamble().isEmpty()) {
if ((!arePrefixesPresent(argMultimap, PREFIX_NAME) || !argMultimap.getPreamble().isEmpty())
&& !arePrefixesPresent(argMultimap, PREFIX_GROUPTAG)) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteCommand.MESSAGE_USAGE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public FindCommand parse(String args) throws ParseException {
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_GROUPTAG);

// check if either n/ or g/ are present
if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_GROUPTAG)
|| !argMultimap.getPreamble().isEmpty()) {
if ((!arePrefixesPresent(argMultimap, PREFIX_NAME) || !argMultimap.getPreamble().isEmpty())
&& !arePrefixesPresent(argMultimap, PREFIX_GROUPTAG)) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT,
FindCommand.MESSAGE_USAGE));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<?import javafx.scene.layout.HBox?>
<fx:root type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1"
title="Address App" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
title="ProjectPRO" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
<icons>
<Image url="@/images/address_book_32.png" />
</icons>
Expand Down

0 comments on commit b462864

Please sign in to comment.