Skip to content

Commit 9013ae5

Browse files
committed
[java] JSpecify annotations for ExpectedCondition
1 parent 345bee3 commit 9013ae5

File tree

3 files changed

+85
-75
lines changed

3 files changed

+85
-75
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ java_library(
5858
"//java/src/org/openqa/selenium:core",
5959
"//java/src/org/openqa/selenium/remote",
6060
artifact("com.google.guava:guava"),
61+
artifact("org.jspecify:jspecify"),
6162
],
6263
)

java/src/org/openqa/selenium/support/ui/ExpectedCondition.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
package org.openqa.selenium.support.ui;
1919

2020
import com.google.common.base.Function;
21+
import org.jspecify.annotations.NullMarked;
22+
import org.jspecify.annotations.Nullable;
2123
import org.openqa.selenium.WebDriver;
2224

2325
/**
@@ -34,5 +36,6 @@
3436
// NB: this originally extended Guava's Function interface since Java didn't have one. To avoid code
3537
// such as "com.google.common.base.Function condition = ExpectedConditions.elementFound(By);"
3638
// breaking at compile time, we continue to extend Guava's Function interface.
37-
public interface ExpectedCondition<T>
39+
@NullMarked
40+
public interface ExpectedCondition<T extends @Nullable Object>
3841
extends Function<WebDriver, T>, java.util.function.Function<WebDriver, T> {}

0 commit comments

Comments
 (0)