Skip to content

Commit d4c3e1b

Browse files
authored
[java] Add JSpecify annotations to Color class (Issue #14291) (#16626)
* [java] Add JSpecify annotations to Color class
1 parent 0a0fce9 commit d4c3e1b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

java/src/org/openqa/selenium/support/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ java_export(
3535
"//java/src/org/openqa/selenium/support/ui:components",
3636
"//java/src/org/openqa/selenium/support/ui:elements",
3737
"//java/src/org/openqa/selenium/support/ui:wait",
38+
artifact("org.jspecify:jspecify"),
3839
],
3940
)
4041

java/src/org/openqa/selenium/support/Color.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
import java.util.Locale;
2121
import java.util.regex.Matcher;
2222
import java.util.regex.Pattern;
23+
import org.jspecify.annotations.NullMarked;
24+
import org.jspecify.annotations.Nullable;
2325

26+
@NullMarked
2427
public class Color {
2528
private final int red;
2629
private final int green;
@@ -122,7 +125,7 @@ public int hashCode() {
122125
}
123126

124127
private abstract static class Converter {
125-
public Color getColor(String value) {
128+
public @Nullable Color getColor(String value) {
126129
Matcher matcher = getPattern().matcher(value);
127130
if (matcher.find()) {
128131
double a = 1.0;

0 commit comments

Comments
 (0)