Skip to content

Commit

Permalink
Fix checkstyle violations
Browse files Browse the repository at this point in the history
  • Loading branch information
starchypotatocode committed Sep 23, 2024
1 parent ec51a0b commit 359afae
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ public boolean equals(Object other) {
return index.equals(e.index)
&& remark.equals(e.remark);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class AddCommandParser implements Parser<AddCommand> {
*/
public AddCommand parse(String args) throws ParseException {
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG, PREFIX_REMARK);
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS,
PREFIX_REMARK, PREFIX_TAG);

if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL)
|| !argMultimap.getPreamble().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import hallpointer.address.model.person.Email;
import hallpointer.address.model.person.Name;
import hallpointer.address.model.person.Phone;
import hallpointer.address.model.person.Remark;
import hallpointer.address.model.tag.Tag;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package hallpointer.address.logic.parser;

import static hallpointer.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static hallpointer.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static hallpointer.address.logic.parser.CliSyntax.PREFIX_EMAIL;
import static hallpointer.address.logic.parser.CliSyntax.PREFIX_NAME;
import static hallpointer.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static hallpointer.address.logic.parser.CliSyntax.PREFIX_REMARK;
import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -39,4 +35,4 @@ public RemarkCommand parse(String args) throws ParseException {
String remark = argMultimap.getValue(PREFIX_REMARK).orElse("");
return new RemarkCommand(index, new Remark(remark));
}
}
}
1 change: 0 additions & 1 deletion src/main/java/hallpointer/address/model/person/Remark.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package hallpointer.address.model.person;

import static hallpointer.address.commons.util.AppUtil.checkArgument;
import static java.util.Objects.requireNonNull;

/**
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/hallpointer/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ public class SampleDataUtil {
public static Person[] getSamplePersons() {
return new Person[] {
new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("[email protected]"),
new Address("Blk 30 Geylang Street 29, #06-40"), EMPTY_REMARK
, getTagSet("friends")),
new Address("Blk 30 Geylang Street 29, #06-40"), EMPTY_REMARK,
getTagSet("friends")),
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"),
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), EMPTY_REMARK
, getTagSet("colleagues", "friends")),
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), EMPTY_REMARK,
getTagSet("colleagues", "friends")),
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"),
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), EMPTY_REMARK
, getTagSet("neighbours")),
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), EMPTY_REMARK,
getTagSet("neighbours")),
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"),
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), EMPTY_REMARK
, getTagSet("family")),
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), EMPTY_REMARK,
getTagSet("family")),
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"),
new Address("Blk 47 Tampines Street 20, #17-35"), EMPTY_REMARK
, getTagSet("classmates")),
new Address("Blk 47 Tampines Street 20, #17-35"), EMPTY_REMARK,
getTagSet("classmates")),
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"),
new Address("Blk 45 Aljunied Street 85, #11-31"), EMPTY_REMARK
, getTagSet("colleagues"))
new Address("Blk 45 Aljunied Street 85, #11-31"), EMPTY_REMARK,
getTagSet("colleagues"))
};
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/hallpointer/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public class PersonCard extends UiPart<Region> {

private static final String FXML = "PersonListCard.fxml";

@FXML
private Label remark;


/**
* Note: Certain keywords such as "location" and "resources" are reserved keywords in JavaFX.
Expand All @@ -42,6 +41,8 @@ public class PersonCard extends UiPart<Region> {
@FXML
private Label email;
@FXML
private Label remark;
@FXML
private FlowPane tags;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
*/
public class RemarkCommandTest {

private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs());
private static final String REMARK_STUB = "Some remark";
private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs());


@Test
public void execute() {
Expand Down Expand Up @@ -120,4 +121,4 @@ public void equals() {
assertFalse(standardCommand.equals(new RemarkCommand(INDEX_FIRST_PERSON, new Remark(VALID_REMARK_BOB))));
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void parse_indexSpecified_success() {
assertParseSuccess(parser, userInput, expectedCommand);
// no remark
userInput = targetIndex.getOneBased() + " " + PREFIX_REMARK;
expectedCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(""));
expectedCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(""));
assertParseSuccess(parser, userInput, expectedCommand);
}
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public void toModelType_invalidName_throwsIllegalValueException() {

@Test
public void toModelType_nullName_throwsIllegalValueException() {
JsonAdaptedPerson person = new JsonAdaptedPerson(null, VALID_PHONE, VALID_EMAIL, VALID_ADDRESS, VALID_REMARK, VALID_TAGS);
JsonAdaptedPerson person = new JsonAdaptedPerson(null, VALID_PHONE, VALID_EMAIL,
VALID_ADDRESS, VALID_REMARK, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Name.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
Expand All @@ -64,7 +65,8 @@ public void toModelType_invalidPhone_throwsIllegalValueException() {

@Test
public void toModelType_nullPhone_throwsIllegalValueException() {
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, null, VALID_EMAIL, VALID_ADDRESS, VALID_REMARK, VALID_TAGS);
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, null, VALID_EMAIL, VALID_ADDRESS,
VALID_REMARK, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Phone.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
Expand All @@ -79,7 +81,8 @@ public void toModelType_invalidEmail_throwsIllegalValueException() {

@Test
public void toModelType_nullEmail_throwsIllegalValueException() {
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, null, VALID_ADDRESS, VALID_REMARK, VALID_TAGS);
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, null, VALID_ADDRESS,
VALID_REMARK, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Email.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
Expand All @@ -94,7 +97,8 @@ public void toModelType_invalidAddress_throwsIllegalValueException() {

@Test
public void toModelType_nullAddress_throwsIllegalValueException() {
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, null, VALID_REMARK, VALID_TAGS);
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, null,
VALID_REMARK, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Address.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
Expand Down

0 comments on commit 359afae

Please sign in to comment.