Skip to content

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Mar 12, 2024
1 parent 3b80bf2 commit ba8e563
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/Migrating-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ risk - even if the environment changed.
### Aborting on invalid configuration

If you want OTP to abort the startup when encountering unknown configuration parameters, you can add
the flag `--configCheck` to your regular OTP CLI commands.
the flag `--abortOnUnknownConfig` to your regular OTP CLI commands.

This should of course be used wisely as it can also accidentally make your production instances refuse
to start up.
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ nav:
- Router: 'RouterConfiguration.md'
- "Route Request": 'RouteRequest.md'
- "Realtime Updaters": 'UpdaterConfig.md'
- "Migrating Configuration": 'Migrating-Configuration.md'
- "Migrating between versions/builds": 'Migrating-Configuration.md'
- Features explained:
- "Routing modes": 'RoutingModes.md'
- "In-station navigation": 'In-Station-Navigation.md'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/opentripplanner/standalone/OTPMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ private static void startOTPServer(CommandLineParameters cli) {
* Optionally, check if the config is valid and if not abort the startup process.
*/
private static void detectUnusedConfigParams(CommandLineParameters cli, ConfigModel config) {
if (cli.configCheck && config.hasIUnknownProperties()) {
if (cli.abortOnUnknownConfig && config.hasUnknownProperties()) {
throw new OtpAppException(
"Configuration contains invalid properties (see above for details). " +
"Please fix your configuration or remove --configCheck from your OTP CLI parameters."
"Please fix your configuration or remove --abortOnUnknownConfig from your OTP CLI parameters."
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ public class CommandLineParameters {
public boolean visualize;

@Parameter(
names = { "--configCheck" },
names = { "--abortOnUnknownConfig" },
description = "Abort the startup if configuration files are found to be invalid."
)
public boolean configCheck = false;
public boolean abortOnUnknownConfig = false;

/**
* The remaining single parameter after the switches is the directory with the configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static void initializeOtpFeatures(OtpConfig otpConfig) {
/**
* Checks if any unknown or invalid properties were encountered while loading the configuration.
*/
public boolean hasIUnknownProperties() {
public boolean hasUnknownProperties() {
return (
otpConfig.hasUnknownProperties() ||
buildConfig.hasUnknownProperties() ||
Expand Down

0 comments on commit ba8e563

Please sign in to comment.