You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New feature (non-breaking change which adds functionality and tests!)
PR Type
Enhancement
Description
Add JSpecify null-safety annotations to FedCM classes
Mark classes with @NullMarked for comprehensive null checking
Annotate nullable fields and return types with @nullable
Improve type safety across federated credential management API
Diagram Walkthrough
flowchart LR
A["FedCM Classes"] -->|Add @NullMarked| B["Class-level annotation"]
A -->|Add @Nullable| C["Field annotations"]
A -->|Add @Nullable| D["Return type annotations"]
B --> E["Enhanced null safety"]
C --> E
D --> E
Replace dict.getOrDefault(key, null) with dict.get(key) in the constructor. This change aligns with the class's new @NullMarked annotation, as getOrDefault with a null default is invalid for a map with a non-nullable value type, and it also removes a redundant cast.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies that getOrDefault(key, null) is inconsistent with the newly added @NullMarked annotation, which treats the map's value type as non-nullable. The proposed change to use dict.get() is the correct approach and aligns with the PR's goal of improving null-safety.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
🔗 Related Issues
Related #14291
💥 What does this PR do?
JSpecify annotations added to the:
org.openqa.selenium.federatedcredentialmanagement.FederatedCredentialManagementAccountorg.openqa.selenium.federatedcredentialmanagement.FederatedCredentialManagementDialogorg.openqa.selenium.federatedcredentialmanagement.HasFederatedCredentialManagement🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add JSpecify null-safety annotations to FedCM classes
Mark classes with @NullMarked for comprehensive null checking
Annotate nullable fields and return types with @nullable
Improve type safety across federated credential management API
Diagram Walkthrough
File Walkthrough
FederatedCredentialManagementAccount.java
Add null-safety annotations to account classjava/src/org/openqa/selenium/federatedcredentialmanagement/FederatedCredentialManagementAccount.java
@NullMarkedclass-level annotation for comprehensive nullchecking
@Nullableannotations to all nine private String fields@Nullableannotations to all nine getter method return typesFederatedCredentialManagementDialog.java
Add null-safety annotations to dialog interfacejava/src/org/openqa/selenium/federatedcredentialmanagement/FederatedCredentialManagementDialog.java
@NullMarkedinterface-level annotation@Nullableannotations to three getter method return typesgetDialogType(),getTitle(),getSubtitle()HasFederatedCredentialManagement.java
Add null-safety annotations to capability interfacejava/src/org/openqa/selenium/federatedcredentialmanagement/HasFederatedCredentialManagement.java
@NullMarkedinterface-level annotation@Nullableannotation togetFederatedCredentialManagementDialog()return type
@Betaannotation