Skip to content

Commit

Permalink
Fix checkstyle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mfjkri committed Sep 15, 2023
1 parent 574ed39 commit b6965d3
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 15 deletions.
9 changes: 7 additions & 2 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
import seedu.address.logic.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.*;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand Down Expand Up @@ -98,7 +103,7 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript
Remark updatedRemark = personToEdit.getRemark();
Set<Tag> updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags());

return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress,updatedRemark, updatedTags);
return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedRemark, updatedTags);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,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 @@ -12,7 +12,12 @@

import seedu.address.logic.commands.AddCommand;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.*;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public RemarkCommand parse(String args) throws ParseException {

return new RemarkCommand(index, new Remark(remark));
}
}
}
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/model/person/Remark.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.model.person;

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

/**
* Represents a Person's address in the address book.
Expand Down Expand Up @@ -36,4 +35,4 @@ public boolean equals(Object other) {
public int hashCode() {
return value.hashCode();
}
}
}
7 changes: 6 additions & 1 deletion src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

import seedu.address.model.AddressBook;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.person.*;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/seedu/address/storage/JsonAdaptedPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.person.*;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand All @@ -33,7 +38,7 @@ class JsonAdaptedPerson {
@JsonCreator
public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone,
@JsonProperty("email") String email, @JsonProperty("address") String address,
@JsonProperty("remark") String remark, @JsonProperty("tags") List<JsonAdaptedTag> tags) {
@JsonProperty("remark") String remark, @JsonProperty("tags") List<JsonAdaptedTag> tags) {

this.name = name;
this.phone = phone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import static seedu.address.logic.commands.CommandTestUtil.VALID_REMARK_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_REMARK_BOB;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
Expand Down Expand Up @@ -133,4 +132,4 @@ public void equals() {
assertFalse(standardCommand.equals(new RemarkCommand(INDEX_FIRST_PERSON,
new Remark(VALID_REMARK_BOB))));
}
}
}
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public void equals() {
@Test
public void toStringMethod() {
String expected = Person.class.getCanonicalName() + "{name=" + ALICE.getName() + ", phone=" + ALICE.getPhone()
+ ", email=" + ALICE.getEmail() + ", address=" + ALICE.getAddress() + ", remark=" + ALICE.getRemark() +
", tags=" + ALICE.getTags() + "}";
+ ", email=" + ALICE.getEmail() + ", address=" + ALICE.getAddress() + ", remark=" + ALICE.getRemark()
+ ", tags=" + ALICE.getTags() + "}";
assertEquals(expected, ALICE.toString());
}
}
7 changes: 6 additions & 1 deletion src/test/java/seedu/address/testutil/PersonBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import java.util.HashSet;
import java.util.Set;

import seedu.address.model.person.*;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;
import seedu.address.model.util.SampleDataUtil;

Expand Down

0 comments on commit b6965d3

Please sign in to comment.