Skip to content

Mark setter parameters for oneof fields with @NonNull #1340

Open
@Egorand

Description

@Egorand

Based on #1210.

// Java
public Builder foo(Integer foo) {
  this.foo = foo;
  this.bar = null;
  this.baz = null;
  return this;
}

Passing null as the argument will break the oneof contract, marking the parameter with @NonNull can at least hint at the potential problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions