-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] Add JSpecify annotations to Color class (Issue #14291) #16626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java] Add JSpecify annotations to Color class (Issue #14291) #16626
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
|
Thank you, @spencerarq for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Code Suggestions ✨No code suggestions found for the PR. |
asolntsev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spencerarq Please fix the formatting in BUILD.bazel:
diff --git a/java/src/org/openqa/selenium/support/BUILD.bazel b/java/src/org/openqa/selenium/support/BUILD.bazel
index ba0a0a1..ddc2313 100644
--- a/java/src/org/openqa/selenium/support/BUILD.bazel
+++ b/java/src/org/openqa/selenium/support/BUILD.bazel
@@ -35,7 +35,7 @@ java_export(
"//java/src/org/openqa/selenium/support/ui:components",
"//java/src/org/openqa/selenium/support/ui:elements",
"//java/src/org/openqa/selenium/support/ui:wait",
- artifact("org.jspecify:jspecify")
+ artifact("org.jspecify:jspecify"),
],
)9bc97c3 to
582c864
Compare
|
Applied the requested changes: added the missing comma and updated the jspecify dependency to use Please let me know if anything else is needed. |
User description
🔗 Related Issues
Fixes: #14291
(This PR addresses the ongoing effort to adopt JSpecify annotations for null-safety.)
💥 What does this PR do?
This PR adds JSpecify annotations to the
org.openqa.selenium.support.Colorclass, as part of the effort to improve null-safety across the codebase.🔧 Implementation Notes
1. Annotation: The
Colorclass was annotated with@NullMarked(defaulting parameters and return types to non-null).2. Build Fix: The infrastructure required an update. I added
org.jspecify:jspecifydependency to thesupport-libtarget inBUILD.bazelto resolve the indirect dependency error from Bazel's strict policy.3. Motivation: This provides better static analysis support and improves Kotlin interoperability by making nullability contracts explicit for developers using the Java bindings.
💡 Additional Considerations
Verification: All related tests were executed successfully using Bazel:
bazel test //java/test/org/openqa/selenium/support:ColorTestThe build completed successfully and 1 test passed.
🔄 Types of changes
PR Type
Enhancement, Documentation
Description
Add JSpecify
@NullMarkedand@Nullableannotations to Color classImprove null-safety and Kotlin interoperability with explicit nullability contracts
Add
org.jspecify:jspecifydependency to support-lib BUILD targetMark
Converter.getColor()method return type as nullableDiagram Walkthrough
File Walkthrough
Color.java
Add JSpecify null-safety annotations to Color classjava/src/org/openqa/selenium/support/Color.java
@NullMarkedclass-level annotation to default parameters andreturn types to non-null
@Nullableannotation toConverter.getColor()method return typeNullMarkedandNullable)BUILD.bazel
Add JSpecify dependency to BUILD configurationjava/src/org/openqa/selenium/support/BUILD.bazel
org.jspecify:jspecifyartifact dependency to support-libjava_export target
policy