google / auto

A collection of source code generators for Java.
Apache License 2.0
10.43k stars 1.2k forks source link

Really produce only a warning for setters with boxed primitive types for primitive properties. #1830

Closed copybara-service[bot] closed 2 months ago

copybara-service[bot] commented 2 months ago

Really produce only a warning for setters with boxed primitive types for primitive properties.

We'd attempted this in cl/659352853, but we ended up reporting a warning and then failing with an error on a later step instead.

With the new test, we see an error until we make the prod change that I've included:

Compilation produced the following diagnostics:
foo/bar/Baz.java:11: warning: [AutoValueUnnecessaryBoxing] property method foo.bar.Baz.blam() is primitive but parameter of setter method is not
    Builder blam(Integer x);
            ^
foo/bar/Baz.java:10: error: [AutoValueBuilderMissingMethod] Expected a method with this signature: foo.bar.Baz.Builder blam(int), or a blamBuilder() method
  public interface Builder {
         ^

RELNOTES=n/a