Skip to content

Add @CheckReturnValue to CallOptions.withX() methods #3671

@groakley

Description

@groakley

This would help prevent errors like the following toy example

This is incorrect

CallOptions setExecutor(CallOptions callOptions, Executor executor) {
  // @CheckReturnValue would have caused this line to be flagged
  callOptions.withExecutor(executor);
  return callOptions;
}

It should be

CallOptions setExecutor(CallOptions callOptions, Executor executor) {
  return callOptions.withExecutor(executor);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions