Skip to content

AutoValue Release 1.5

Choose a tag to compare

@eamonnmcmanus eamonnmcmanus released this 15 Aug 16:43
· 1226 commits to main since this release

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 @AutoValue annotation has changed from SOURCE to CLASS. 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 @AutoValue class cannot extend another, even if the classes are compiled separately.

  • It is now an error if @Memoized is applied to a method not inside an @AutoValue class.

  • Type annotations are now handled more consistently. If @Nullable is a type annotation, a property of type @Nullable Integer will have that type used everywhere in the generated code. Associated bugs with nested type annotations, like Outer.@Inner, have been fixed.

Bugs fixed since 1.4.1

  • @Memoized methods can now throw checked exceptions. Previously this failed because the exceptions were not copied into the throws clause of the generated override, so the call to super.foo() did not compile.

  • The generated hashCode() method uses h = (int) (h ^ longProperty) rather than h ^= longProperty to 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 @AutoValue inherits the abstract method from a class or interface in a different package.