AutoValue Release 1.4 RC3
Pre-releaseFunctional changes since 1.4 RC2
-
Builder setters now reject a null parameter immediately unless the corresponding property is
@Nullable
. Previously this check happened atbuild()
time, and in some cases didn't happen at all. -
If a property
foo()
orgetFoo()
has a builder methodfooBuilder()
then the property can not now be@Nullable
. AnImmutableList
, for example, started off empty, not null, in this case, so@Nullable
was misleading. -
Relatedly, the case where
foo()
is a nested@AutoValue
class is now more similar to the case where it is an immutable collection. If you never add anything tofooBuilder()
then you get an "empty"foo()
atbuild()
time, meaning whateverfooBuilder().build()
returns. -
Access modifiers like
protected
are copied from builder methods to their implementations, instead of the implementations always being public. Change by @torquestomp. -
AutoAnnotation now precomputes parts of the
hashCode
that are constant because they come from defaulted members. This avoids warnings about integer overflow from tools that check that.
Extension API changes since 1.4 RC2
- Extensions can now return null rather than generated code. In that case the extension does not generate a class in the AutoValue hierarchy, but it can still do other things like error checking or generating side files.
Bugs fixed since 1.4 RC2
-
GWT serialization tests are now run in prod mode. Change by @tbroyer.
-
If
@AutoValue Foo
has a builder, we always generated two constructors,Builder()
andBuilder(Foo)
, but we only used the second one ifFoo
had atoBuilder()
method. Now we only generate that constructor if it is needed. That avoids warnings about unused code. -
@AutoAnnotation
now works when the annotation and the factory method are in the default (unnamed) package. -
In the hack to work around spurious exceptions when reading resource files, we now handle NullPointerException in addition to IOException.
-
If a property has a name that is a Java keyword, for example
getPackage()
which defines a property calledpackage
, the Memoize extension will no longer generate code that doesn't compile.