Skip to content

Commit

Permalink
should be InvalidCharactersNotice
Browse files Browse the repository at this point in the history
  • Loading branch information
qcdyx committed Oct 9, 2024
1 parent f4086e6 commit df56d3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
label = "Best Practices for All Files",
url = "https://gtfs.org/schedule/reference/#file-requirements")
})
public class NoInvalidCharactersNotice extends ValidationNotice {
public class InvalidCharactersNotice extends ValidationNotice {

/** Name of the faulty file. */
private final String filename;
Expand All @@ -44,7 +44,7 @@ public class NoInvalidCharactersNotice extends ValidationNotice {
/** The row number of the faulty record. */
private final int csvRowNumber;

public NoInvalidCharactersNotice(
public InvalidCharactersNotice(
String filename, String fieldName, String fieldValue, int csvRowNumber) {
this.filename = filename;
this.fieldName = fieldName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.mobilitydata.gtfsvalidator.annotation.Generated;
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidator;
import org.mobilitydata.gtfsvalidator.annotation.NoInvalidCharacters;
import org.mobilitydata.gtfsvalidator.notice.NoInvalidCharactersNotice;
import org.mobilitydata.gtfsvalidator.notice.InvalidCharactersNotice;
import org.mobilitydata.gtfsvalidator.notice.NoticeContainer;
import org.mobilitydata.gtfsvalidator.validator.SingleEntityValidator;

Expand All @@ -19,7 +19,7 @@
* as the replacement character (\uFFFD).
*
* @see NoInvalidCharacters
* @see NoInvalidCharactersNotice
* @see InvalidCharactersNotice
*/
public class NoInvalidCharactersValidatorGenerator {
static final String REPLACEMENT_CHAR = "\uFFFD";
Expand Down Expand Up @@ -65,7 +65,7 @@ private static TypeSpec generateValidator(GtfsFileDescriptor fileDescriptor) {
.beginControlFlow("if (value.contains(\"$L\"))", REPLACEMENT_CHAR)
.addStatement(
"noticeContainer.addValidationNotice(new $T(\"$L\", \"$L\", value, entity.csvRowNumber()))",
NoInvalidCharactersNotice.class,
InvalidCharactersNotice.class,
fileDescriptor.filename(),
FieldNameConverter.gtfsColumnName(noInvalidCharactersField.name()))
.endControlFlow()
Expand Down

0 comments on commit df56d3b

Please sign in to comment.