You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Logging Improvement The warning message is logged every time a TOML file is parsed, which might lead to excessive logging. Consider adding a flag to log this warning only once per JVM session.
Add a conditional check for showing the warning message
Consider adding a version check or feature flag to conditionally show the warning, allowing for easier transition when the new TOML parser is implemented.
-LOG.warning("Please use quotes to denote strings. Upcoming TOML parser will require this and unquoted strings will throw an error in the future");+if (shouldWarnAboutTomlQuotes()) {+ LOG.warning("Please use quotes to denote strings. Upcoming TOML parser will require this and unquoted strings will throw an error in the future");+}
Apply this suggestion
Suggestion importance[1-10]: 8
Why: Adding a conditional check for the warning message is a proactive enhancement that allows for smoother transitions when the new TOML parser is implemented, making it a valuable improvement.
8
Maintainability
Extract the warning message into a constant
Consider using a constant for the warning message to improve maintainability and allow for easier updates in the future.
-LOG.warning("Please use quotes to denote strings. Upcoming TOML parser will require this and unquoted strings will throw an error in the future");+private static final String TOML_QUOTE_WARNING = "Please use quotes to denote strings. Upcoming TOML parser will require this and unquoted strings will throw an error in the future";+...+LOG.warning(TOML_QUOTE_WARNING);
Suggestion importance[1-10]: 7
Why: Extracting the warning message into a constant improves maintainability by making it easier to update the message in the future, but it is not a critical change.
7
Best practice
Use a more specific logger name
Consider using a more specific logger name, such as 'org.openqa.selenium.grid.config.TomlConfig', instead of using the class name directly.
-private static final Logger LOG = Logger.getLogger(TomlConfig.class.getName());+private static final Logger LOG = Logger.getLogger("org.openqa.selenium.grid.config.TomlConfig");
Apply this suggestion
Suggestion importance[1-10]: 5
Why: Using a more specific logger name can improve logging clarity and organization, but the current logger name is already functional and this change is not crucial.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
This adds a warning stated in #14470 which tells about the future change. Strings in TOML now need to have quotes
Motivation and Context
Warning to help migration from old TOML parser to the new parser
Types of changes
Checklist
PR Type
enhancement
Description
TomlConfig
class to provide warnings.Changes walkthrough 📝
TomlConfig.java
Add warning for future TOML string quoting requirement
java/src/org/openqa/selenium/grid/config/TomlConfig.java
TomlConfig
class.