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
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
In the changes, I removed the explicit casting to the string type in concatenation operations and substring replacement. These operations are performed implicitly when operating on strings.
Motivation and Context
The changes are minor and mostly pertain to the quality and readability of the code.
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
2, because the changes are straightforward and mostly involve removing redundant toString() calls and minor syntax adjustments. The PR is focused on code cleanup and readability improvements, which are generally easier to review than changes that involve complex logic or new features.
🧪 Relevant tests
No
⚡ Possible issues
Possible Bug: The removal of toString() in error and logging messages could potentially change the output if the default toString() implementation is not overridden in the object being logged or thrown. This should be verified to ensure that the output remains informative and useful.
-throw new IllegalArgumentException("Unable to find mapping for " + response);+throw new IllegalArgumentException("Expected 'value' key to be a Map in response: " + response);
Enhance exception handling by including the root cause in the thrown exception.
Include the exception message in the JsonException to provide more context about the NumberFormatException.
-throw new JsonException("Unable to parse to a number: " + builder + ". " + input);+throw new JsonException("Unable to parse to a number: " + builder + ". " + input, e);
Maintainability
Refactor string concatenation to use String.format for better readability.
Use String.format for constructing Redis keys to enhance readability and maintainability.
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
In the changes, I removed the explicit casting to the string type in concatenation operations and substring replacement. These operations are performed implicitly when operating on strings.
Motivation and Context
The changes are minor and mostly pertain to the quality and readability of the code.
Types of changes
Checklist
PR Type
enhancement
Description
Changes walkthrough 📝
2 files
FetchError.java
Cleanup of try-with-resources syntax
java/src/org/openqa/selenium/bidi/network/FetchError.java
SerializationOptions.java
Cleanup enum declaration syntax
java/src/org/openqa/selenium/bidi/script/SerializationOptions.java
8 files
EvaluateResult.java
Simplify access modifier in enum declaration
java/src/org/openqa/selenium/bidi/script/EvaluateResult.java
RedisBackedSessionMap.java
Remove redundant toString() calls in RedisBackedSessionMap
java/src/org/openqa/selenium/grid/sessionmap/redis/RedisBackedSessionMap.java
generation methods.
JsonInput.java
Simplify exception message construction
java/src/org/openqa/selenium/json/JsonInput.java
ErrorCodec.java
Remove redundant toString() calls in ErrorCodec
java/src/org/openqa/selenium/remote/ErrorCodec.java
LocatingElementHandler.java
Simplify proxy element description generation
java/src/org/openqa/selenium/support/pagefactory/internal/LocatingElementHandler.java
DragAndDropTest.java
Simplify exception message in DragAndDropTest
java/test/org/openqa/selenium/interactions/DragAndDropTest.java
TestFileLocator.java
Optimize path replacement in TestFileLocator
java/test/org/openqa/selenium/javascript/TestFileLocator.java
call.
JsonTest.java
Streamline JSON serialization test
java/test/org/openqa/selenium/json/JsonTest.java
1 files
ProxySettingTest.java
Syntax correction in ProxySettingTest
java/test/org/openqa/selenium/ProxySettingTest.java