google / google/auto

Request for feedback: checker for required method calls on builders

Open
#851 1 comment 0 reactions 0 assignees View on GitHub
Component: value P4 type=other
Dominant language
Java
Stars
10.6k
Forks
1.2k
Avg merge
6h 32m
Merged PRs (30d)
13

Description

Dear AutoValue developers,

We would like your feedback on a static analysis tool that prevents errors in AutoValue clients by guaranteeing that required methods are always called on AutoValue Builders. The required methods are those that set a property that is not `@Nullable`, `Optional`, or a Guava Immutable Collection. We have run the checker on some projects that use AutoValue, and discovered a real bug:

https://github.com/googleapis/gapic-generator/issues/2892

You can read more about the checker in its README:

https://github.com/kelloggm/object-construction-checker

and in a soon-to-be-published research paper:

https://homes.cs.washington.edu/~kelloggm/papers/ICSE2020-camera-ready.pdf

Here is a sample project showing the checker in action for some sample AutoValue code:

https://github.com/msridhar/obj-cons-autovalue-example

We would be very happy to get your feedback on this checker. If you think it is of value, we would like to have the checker publicized to AutoValue users. Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.