diff --git a/java/src/org/openqa/selenium/support/BUILD.bazel b/java/src/org/openqa/selenium/support/BUILD.bazel index 27c13c87b5a5b..ba0a0a10beb06 100644 --- a/java/src/org/openqa/selenium/support/BUILD.bazel +++ b/java/src/org/openqa/selenium/support/BUILD.bazel @@ -35,6 +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") ], ) diff --git a/java/src/org/openqa/selenium/support/Color.java b/java/src/org/openqa/selenium/support/Color.java index bb11a5117741b..ef75b0810ecb1 100644 --- a/java/src/org/openqa/selenium/support/Color.java +++ b/java/src/org/openqa/selenium/support/Color.java @@ -20,7 +20,10 @@ import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; +@NullMarked public class Color { private final int red; private final int green; @@ -122,7 +125,7 @@ public int hashCode() { } private abstract static class Converter { - public Color getColor(String value) { + public @Nullable Color getColor(String value) { Matcher matcher = getPattern().matcher(value); if (matcher.find()) { double a = 1.0;