-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java] Add nullness for AppCacheStatus, Credential, and Either #15119
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Fixed NullAway errors:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mk868! This looks good to me. Just waiting for the test to pass before I merge it.
User description
Description
Changed files
org.openqa.selenium.html5.AppCacheStatus
- nullable annotations addedorg.openqa.selenium.internal.Either
- nullable annotations added (docs: Declaring generic types)org.openqa.selenium.virtualauthenticator.Credential
- added null value checking to avoid unexpected NPEsNullAway 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, Bug fix
Description
Added JSpecify nullness annotations to improve null safety.
AppCacheStatus
enum with@NullMarked
and@Nullable
.Either
class with nullness annotations for generic types.Improved null value handling in
Credential.fromMap
method.Changes walkthrough 📝
AppCacheStatus.java
Add nullness annotations to AppCacheStatus
java/src/org/openqa/selenium/html5/AppCacheStatus.java
@NullMarked
annotation to the class.getEnum
methods with@Nullable
for null safety.Either.java
Add nullness annotations to Either class
java/src/org/openqa/selenium/internal/Either.java
@NullMarked
annotation to the class.@Nullable
to indicate nullability.Credential.java
Improve null handling in Credential.fromMap
java/src/org/openqa/selenium/virtualauthenticator/Credential.java
fromMap
method.