@@ -0,0 +1,1814 @@
+package seedu.dailyplanner.logic.commands;%0A%0Aimport seedu.dailyplanner.commons.core.EventsCenter;%0Aimport seedu.dailyplanner.commons.core.Messages;%0Aimport seedu.dailyplanner.commons.core.UnmodifiableObservableList;%0Aimport seedu.dailyplanner.commons.events.ui.JumpToListRequestEvent;%0Aimport seedu.dailyplanner.model.task.ReadOnlyTask;%0Aimport seedu.dailyplanner.model.task.UniqueTaskList.PersonNotFoundException;%0A%0A/**%0A * Selects a person identified using it's last displayed index from the address book.%0A */%0Apublic class UnpinCommand extends Command %7B%0A%0A    public final int targetIndex;%0A%0A    public static final String COMMAND_WORD = %22unpin%22;%0A%0A    public static final String MESSAGE_USAGE = COMMAND_WORD%0A            + %22: Pins the task identified by the index number used in the last task listing on the pin board.%5Cn%22%0A            + %22Parameters: INDEX (must be a positive integer)%5Cn%22%0A            + %22Example: %22 + COMMAND_WORD + %22 1%22;%0A%0A    public static final String MESSAGE_COMPLETED_TASK_SUCCESS = %22Pinned Task: %251$s%22;%0A%0A    public UnpinCommand(int targetIndex) %7B%0A        this.targetIndex = targetIndex;%0A    %7D%0A%0A    @Override%0A    public CommandResult execute() %7B%0A%0A%09UnmodifiableObservableList%3CReadOnlyTask%3E lastShownList = model.getFilteredPersonList();%0A%0A        if (lastShownList.size() %3C targetIndex) %7B%0A            indicateAttemptToExecuteIncorrectCommand();%0A            return new CommandResult(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);%0A        %7D%0A        %0A        ReadOnlyTask taskToUnpin = lastShownList.get(targetIndex - 1);%0A%0A        try %7B%0A            model.unpinTask(targetIndex-1);%0A        %7D catch (PersonNotFoundException pnfe) %7B%0A            assert false : %22The target task cannot be missing%22;%0A        %7D%0A        return new CommandResult(String.format(MESSAGE_COMPLETED_TASK_SUCCESS, taskToUnpin));%0A    %7D%0A%0A%7D%0A

Fix Unpin Command bug