AutoValue Release 1.5
Functional changes since 1.4.1
-
This release requires the compiler to be Java 8 or later. It can still generate Java 7 code using
-source 7 -target 7, but the compiler itself must be a Java 8 compiler. -
The retention of the
@AutoValueannotation has changed fromSOURCEtoCLASS. This means that it is possible for code-analysis tools to tell whether a class is an@AutoValue. AutoValue itself uses this to enforce the check that one@AutoValueclass cannot extend another, even if the classes are compiled separately. -
It is now an error if
@Memoizedis applied to a method not inside an@AutoValueclass. -
Type annotations are now handled more consistently. If
@Nullableis a type annotation, a property of type@Nullable Integerwill have that type used everywhere in the generated code. Associated bugs with nested type annotations, likeOuter.@Inner, have been fixed.
Bugs fixed since 1.4.1
-
@Memoizedmethods can now throw checked exceptions. Previously this failed because the exceptions were not copied into thethrowsclause of the generated override, so the call tosuper.foo()did not compile. -
The generated
hashCode()method usesh = (int) (h ^ longProperty)rather thanh ^= longPropertyto avoid warnings about loss of precision. -
Annotations are not copied from an abstract method to its implementation if they are not visible from the latter. This can happen if the
@AutoValueinherits the abstract method from a class or interface in a different package.