[java] Add nullness for interactions #15118
Open
+8
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Description
In this PR I'm adding nullness annotations for classes:
org.openqa.selenium.interactions.Coordinates
org.openqa.selenium.interactions.Interactive
org.openqa.selenium.interactions.SourceType
- I also changednull
to"none"
as descried in the w3.org, this change should be safe to apply becauseSourceType.NONE
has no uses in the code.NullAway analysis: #14421
Motivation and Context
The JSpecify nullness annotations will give developers better exposure to potential problems with their code to avoid NullPointerExceptions.
Related issue: #14291
Types of changes
Checklist
PR Type
Enhancement
Description
Added JSpecify
@NullMarked
annotations to improve nullness handling.Updated
SourceType.NONE
value fromnull
to"none"
for compliance.Enhanced IDE and static analysis support for nullability.
Changes walkthrough 📝
Coordinates.java
Add `@NullMarked` annotation to `Coordinates`
java/src/org/openqa/selenium/interactions/Coordinates.java
@NullMarked
annotation to theCoordinates
interface.Interactive.java
Add `@NullMarked` annotation to `Interactive`
java/src/org/openqa/selenium/interactions/Interactive.java
@NullMarked
annotation to theInteractive
interface.SourceType.java
Add `@NullMarked` annotation and update `SourceType.NONE`
java/src/org/openqa/selenium/interactions/SourceType.java
@NullMarked
annotation to theSourceType
enum.SourceType.NONE
value fromnull
to"none"
.