[java] specify nullability in org.openqa.selenium.grid.* packages#17173
[java] specify nullability in org.openqa.selenium.grid.* packages#17173asolntsev merged 2 commits intoSeleniumHQ:trunkfrom
org.openqa.selenium.grid.* packages#17173Conversation
Review Summary by QodoAdd JSpecify nullability annotations to Grid and related packages
WalkthroughsDescriptionAdds JSpecify nullability annotations across the Selenium Grid and related packages to improve type safety and null-safety analysis. **Key changes:** • Added @NullMarked package-level annotations to multiple grid packages (org.openqa.selenium.grid.*, org.openqa.selenium.manager, org.openqa.selenium.cli) • Added @Nullable and @NonNull annotations to fields, method parameters, and return types throughout grid components including: - Kubernetes session factory and options - Docker session factory and options - Relay session factory and options - Session data classes (SessionClosedData, SessionEventData, SessionCreatedData, etc.) - Grid distributor and node registry implementations - Configuration and session management classes • Removed unnecessary null checks where types are guaranteed non-null • Replaced deprecated Contents.string() calls with response::contentAsString method references • Improved code quality by extracting helper methods and using stream APIs • Refactored test classes to use local variables instead of class-level fields for better isolation • Made fromJson methods private where appropriate and added @SuppressWarnings annotations for data flow issues • Introduced self() helper method in AbstractDriverOptions to improve type safety of self-type casting • Converted static logger field to local variable in Debug class File Changes1. java/src/org/openqa/selenium/grid/node/kubernetes/KubernetesSessionFactory.java
|
Code Review by Qodo
1. Handlers made protected
|
org.openqa.selenium.grid.* packages
🔗 Related Issues
Partially implements #14291
💥 What does this PR do?
Adds JSpecify nullability annotations to packages
org.openqa.selenium.grid.*There are few warnings that can be improved later. Especially in grid tests.
🔄 Types of changes