Skip to content

Generate registries of tables and validators#1290

Merged
aababilov merged 1 commit intoMobilityData:masterfrom
aababilov:no-class-path
Nov 10, 2022
Merged

Generate registries of tables and validators#1290
aababilov merged 1 commit intoMobilityData:masterfrom
aababilov:no-class-path

Conversation

@aababilov
Copy link
Copy Markdown
Collaborator

@aababilov aababilov commented Nov 9, 2022

Do not use the potentially unsafe ClassPath library that requires a lot of permissions and is problematic to run in a secure sandbox.

This is an API change.
Old code.

validatorLoader = ValidatorLoader.createForDefaultPackage();
feedLoader = new GtfsFeedLoader();

New code.

validatorLoader = ValidatorLoader.createFromRegistry(new DefaultValidatorRegistry());
feedLoader = new GtfsFeedLoader(new DefaultTableRegistry());

ValidatorLoader.createForPackages is removed. Create a custom implementation of GtfsValidatorRegistry and call ValidatorLoader.createFromRegistry.

We are still using ClassPath in NoticeSchemaGenerator and VersionResolver. They are not used for validation.

Do not use the potentially unsafe ClassPath library that requires a lot
of permissions and is problematic to run in a secure sandbox.

We are still using ClassPath in NoticeSchemaGenerator. This can be
changed later.
Copy link
Copy Markdown
Collaborator

@asvechnikov2 asvechnikov2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@aababilov aababilov merged commit 7fb105e into MobilityData:master Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants