github google/auto auto-value-1.7.1
AutoValue 1.7.1

3 years ago

New features

  • SerializableAutoValue extension. This can be used to serialize @AutoValue classes with properties of type java.util.Optional, even though java.util.Optional is not serializable, and it can also be configured to serialize other arbitrary types. Thanks to @alvinlao for this contribution! (f91d2fe)
  • The logic for determining if we can make a BarBuilder out of a Bar has been generalized. For example, if your @AutoValue class Foo has a property IntList ints(), then your builder can have IntListBuilder intsBuilder(). Previously this worked if there was no Foo.toBuilder() method, or if IntList had its own toBuilder() method. Now it also works if it is possible to call IntListBuilder.addAll(IntList). (6aeb44f)
  • AutoValue now allows boxed properties to be set from the corresponding primitive type, for example Integer from int. (2bbe506)

Behaviour changes

  • AutoValue now gives a warning if the static builder() method is inside the @AutoValue.Builder class instead of directly in the @AutoValue class. (fcccded)
  • AutoValue doesn't generate code or invoke extensions if it detects a problem, for example a mismatch between getters and setters. (ecb6032)
  • AutoOneOf factory methods for void values now have type parameters if the @AutoOneOf class does. (4ab1b53)
  • It is now a compilation error if a setter method in a builder has a parameter marked @Nullable when the corresponding property is not in fact @Nullable. Calling such a method with a null parameter already generated a NullPointerException at runtime. (bd7bed2)
  • The @Memoized annotation now has class-level retention, rather than source-level. (107694b)

Bug fixes

  • We fixed an issue with type checking of setter parameters in the presence of inheritance and generics. (e97d1f0)
  • We now generate a better toString() for arrays in AutoOneOf (0a7c049)

Miscellaneous

  • We added CompileWithEclipseTest, which checks that AutoValue works with ecj, the Eclipse compiler. (05e983c)

Don't miss a new auto release

NewReleases is sending notifications on new releases.