Skip to content

Commit

Permalink
Fix Style Check for JavaCI
Browse files Browse the repository at this point in the history
  • Loading branch information
S-K-Y-Light committed Oct 15, 2024
1 parent 41ca07e commit e2f357c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class Messages {

public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_STUDENT_DISPLAYED_INDEX = "The student provided at index %1$d is invalid";

public static final String MESSAGE_INVALID_STUDENT_DISPLAYED_INDEX =
"The student provided at index %1$d is invalid";
public static final String MESSAGE_INVALID_INDEX_SHOWN = "The student provided at index/indices %1$s is invalid";
public static final String MESSAGE_STUDENTS_LISTED_OVERVIEW = "%1$d students listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/model/AddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public void addStudent(Student p) {
/**
* Replaces the given student {@code target} in the list with {@code editedStudent}.
* {@code target} must exist in the address book.
* The student identity of {@code editedStudent} must not be the same as another existing student in the address book.
* The student identity of {@code editedStudent} must not be the same
* as another existing student in the address book.
*/
public void setStudent(Student target, Student editedStudent) {
requireNonNull(editedStudent);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public interface Model {
/**
* Replaces the given student {@code target} with {@code editedStudent}.
* {@code target} must exist in the address book.
* The student identity of {@code editedStudent} must not be the same as another existing student in the address book.
* The student identity of {@code editedStudent} must not be the same as
* another existing student in the address book.
*/
void setStudent(Student target, Student editedStudent);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

/**
* A list of students that enforces uniqueness between its elements and does not allow nulls.
* A student is considered unique by comparing using {@code Student#isSameStudent(Student)}. As such, adding and updating of
* students uses Student#isSameStudent(Student) for equality so as to ensure that the student being added or updated is
* unique in terms of identity in the UniqueStudentList. However, the removal of a student uses Student#equals(Object) so
* as to ensure that the student with exactly the same fields will be removed.
* A student is considered unique by comparing using {@code Student#isSameStudent(Student)}.
* As such, adding and updating of students uses Student#isSameStudent(Student) for equality
* so as to ensure that the student being added or updated is unique in terms of identity in
* the UniqueStudentList. However, the removal of a student uses Student#equals(Object)
* so as to ensure that the student with exactly the same fields will be removed.
*
* Supports a minimal set of list operations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package seedu.address.model.student.exceptions;

/**
* Signals that the operation will result in duplicate Students (Students are considered duplicates if they have the same
* identity).
* Signals that the operation will result in duplicate Students
* (Students are considered duplicates if they have the same identity).
*/
public class DuplicateStudentException extends RuntimeException {
public DuplicateStudentException() {
Expand Down
12 changes: 8 additions & 4 deletions src/test/java/seedu/address/logic/commands/EditCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public void execute_allFieldsSpecifiedUnfilteredList_success() {
EditStudentDescriptor descriptor = new EditStudentDescriptorBuilder(editedStudent).build();
EditCommand editCommand = new EditCommand(INDEX_FIRST_STUDENT, descriptor);

String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS, Messages.format(editedStudent));
String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS,
Messages.format(editedStudent));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.setStudent(model.getFilteredStudentList().get(0), editedStudent);
Expand All @@ -62,7 +63,8 @@ public void execute_someFieldsSpecifiedUnfilteredList_success() {
.withPhone(VALID_PHONE_BOB).withCourses(VALID_COURSE_CS2103T).build();
EditCommand editCommand = new EditCommand(indexLastStudent, descriptor);

String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS, Messages.format(editedStudent));
String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS,
Messages.format(editedStudent));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.setStudent(lastStudent, editedStudent);
Expand All @@ -75,7 +77,8 @@ public void execute_noFieldSpecifiedUnfilteredList_success() {
EditCommand editCommand = new EditCommand(INDEX_FIRST_STUDENT, new EditStudentDescriptor());
Student editedStudent = model.getFilteredStudentList().get(INDEX_FIRST_STUDENT.getZeroBased());

String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS, Messages.format(editedStudent));
String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS,
Messages.format(editedStudent));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());

Expand All @@ -91,7 +94,8 @@ public void execute_filteredList_success() {
EditCommand editCommand = new EditCommand(INDEX_FIRST_STUDENT,
new EditStudentDescriptorBuilder().withName(VALID_NAME_BOB).build());

String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS, Messages.format(editedStudent));
String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_STUDENT_SUCCESS,
Messages.format(editedStudent));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.setStudent(model.getFilteredStudentList().get(0), editedStudent);
Expand Down

0 comments on commit e2f357c

Please sign in to comment.