- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.6k
[java] Add nullness for AppCacheStatus, Credential, and Either #15119
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
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.
AppCacheStatusenum with@NullMarkedand@Nullable.Eitherclass with nullness annotations for generic types.Improved null value handling in
Credential.fromMapmethod.Changes walkthrough 📝
AppCacheStatus.java
Add nullness annotations to AppCacheStatusjava/src/org/openqa/selenium/html5/AppCacheStatus.java
@NullMarkedannotation to the class.getEnummethods with@Nullablefor null safety.Either.java
Add nullness annotations to Either classjava/src/org/openqa/selenium/internal/Either.java
@NullMarkedannotation to the class.@Nullableto indicate nullability.Credential.java
Improve null handling in Credential.fromMapjava/src/org/openqa/selenium/virtualauthenticator/Credential.java
fromMapmethod.