1
0
mirror of synced 2026-08-04 17:27:13 +00:00

Add missing @Nullable to setters of Nullable Fields

There are setters and builder methods that initialize members that are
`@Nullable` but do not accept `@Nullable` parameters.

For example:

```
private @Nullable Object foo;

public void setFoo(Object foo) {
    this.foo = foo;
}
```

It is an unnecessary restriction that the parameter is unable to be null
since the field can be null.

This commit fixes these inconsistencies.

Closes gh-18618
This commit is contained in:
Robert Winch
2026-01-29 13:58:42 -06:00
parent b591a0a757
commit 6a6c7a7a78
10 changed files with 30 additions and 25 deletions
@@ -122,7 +122,7 @@ public final class RequiredFactor {
* @param authority the authority.
* @return the builder.
*/
public Builder authority(String authority) {
public Builder authority(@Nullable String authority) {
this.authority = authority;
return this;
}
@@ -205,7 +205,7 @@ public final class RequiredFactor {
* @param validDuration the {@link Duration}.
* @return
*/
public Builder validDuration(Duration validDuration) {
public Builder validDuration(@Nullable Duration validDuration) {
this.validDuration = validDuration;
return this;
}