-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] JSpecify annotations for immutable models and enums #14395
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 🔍
|
PR Code Suggestions ✨
|
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!
…Q#14395) Co-authored-by: Puja Jagani <[email protected]> Co-authored-by: Diego Molina <[email protected]>
User description
Description
In this PR I'm adding nullness annotations for classes
DimensionKeysPointRectangleUsernameAndPasswordDimensionequalsaccepts null argument -> marked with@NullableKeysgetKeyFromUnicodecan return null value -> return type marked with@NullablePointequalsaccepts null argument -> marked with@NullableRectangleequalsaccepts null argument -> marked with@NullableUsernameAndPasswordNo null values
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
@NullMarkedannotations to several classes and enums to improve nullness handling.equalsmethods inDimension,Point, andRectangleclasses to accept@Nullableparameters.getKeyFromUnicodemethod inKeysenum to return@Nullable.NullPointerExceptions.Changes walkthrough 📝
Dimension.java
Add nullness annotations to Dimension classjava/src/org/openqa/selenium/Dimension.java
@NullMarkedannotation to theDimensionclass.equalsmethod to accept@Nullableparameter.Keys.java
Add nullness annotations to Keys enumjava/src/org/openqa/selenium/Keys.java
@NullMarkedannotation to theKeysenum.getKeyFromUnicodemethod to return@Nullable.Point.java
Add nullness annotations to Point classjava/src/org/openqa/selenium/Point.java
@NullMarkedannotation to thePointclass.equalsmethod to accept@Nullableparameter.Rectangle.java
Add nullness annotations to Rectangle classjava/src/org/openqa/selenium/Rectangle.java
@NullMarkedannotation to theRectangleclass.equalsmethod to accept@Nullableparameter.UsernameAndPassword.java
Add nullness annotations to UsernameAndPassword classjava/src/org/openqa/selenium/UsernameAndPassword.java
@NullMarkedannotation to theUsernameAndPasswordclass.