Skip to content

Commit d8f156b

Browse files
mk868pujagani
andauthoredMar 26, 2025··
[java] Add nullness for interactions (#15118)
Co-authored-by: Puja Jagani <[email protected]>
1 parent 5a66cf9 commit d8f156b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed
 

Diff for: ‎java/src/org/openqa/selenium/interactions/Coordinates.java

+2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717

1818
package org.openqa.selenium.interactions;
1919

20+
import org.jspecify.annotations.NullMarked;
2021
import org.openqa.selenium.Point;
2122

2223
/**
2324
* Provides coordinates of an element for advanced interactions. Note that some coordinates (such as
2425
* screen coordinates) are evaluated lazily since the element may have to be scrolled into view.
2526
*/
27+
@NullMarked
2628
public interface Coordinates {
2729

2830
/**

Diff for: ‎java/src/org/openqa/selenium/interactions/Interactive.java

+2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
package org.openqa.selenium.interactions;
1919

2020
import java.util.Collection;
21+
import org.jspecify.annotations.NullMarked;
2122

2223
/**
2324
* Indicates that a class can be used with the W3C WebDriver <a
2425
* href="https://www.w3.org/TR/webdriver/#actions">Actions commands</a>.
2526
*/
27+
@NullMarked
2628
public interface Interactive {
2729
void perform(Collection<Sequence> actions);
2830

Diff for: ‎java/src/org/openqa/selenium/interactions/SourceType.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,24 @@
1717

1818
package org.openqa.selenium.interactions;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
2023
/** One of the allowing types for an {@link InputSource}. */
24+
@NullMarked
2125
public enum SourceType {
2226
KEY("key"),
2327
NONE(null),
2428
POINTER("pointer"),
2529
WHEEL("wheel");
2630

27-
private final String type;
31+
private final @Nullable String type;
2832

29-
SourceType(String type) {
33+
SourceType(@Nullable String type) {
3034
this.type = type;
3135
}
3236

33-
public String getType() {
37+
public @Nullable String getType() {
3438
return type;
3539
}
3640
}

0 commit comments

Comments
 (0)
Please sign in to comment.