Skip to content

Commit

Permalink
InvalidCharacterNotice changes based on requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
qcdyx committed Oct 16, 2024
1 parent 5d32118 commit 2a2628f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice;

/**
* This field contains invalid characters such as the replacement character ("\uFFFD").
* This field contains invalid characters, such as the replacement character ("\uFFFD").
*
* <p>Fields with customer-facing text should not contain invalid characters to ensure good
* readability and accessibility.
* <p>Check that text was properly encoded in UTF-8 as required by GTFS.
*/
@GtfsValidationNotice(severity = ERROR)
public class InvalidCharactersNotice extends ValidationNotice {
public class InvalidCharacterNotice extends ValidationNotice {
/** The name of the file containing the invalid characters. */
private final String filename;

Expand All @@ -24,7 +23,7 @@ public class InvalidCharactersNotice extends ValidationNotice {
/** The value of the field containing the invalid characters. */
private final String fieldValue;

public InvalidCharactersNotice(
public InvalidCharacterNotice(
String filename, long csvRowNumber, String fieldName, String fieldValue) {
this.filename = filename;
this.csvRowNumber = csvRowNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public String asString(int columnIndex, GtfsColumnDescriptor columnDescriptor) {
// Validate if the string contains invalid characters
if (containsInvalidCharacters(s)) {
noticeContainer.addValidationNotice(
new InvalidCharactersNotice(
fileName, getRowNumber(), columnDescriptor.columnName(), s));
new InvalidCharacterNotice(fileName, getRowNumber(), columnDescriptor.columnName(), s));
}

s =
Expand Down

0 comments on commit 2a2628f

Please sign in to comment.