Age | Commit message (Collapse) | Author |
|
example, if we have `@AutoValue abstract class Foo<T extends @NullableType Object>`, then we should generate `class AutoValue_Foo<T extends @NullableType Object> extends Foo<T>`, rather than just `class AutoValue_Foo<T> extends Foo<T>` as at present.
RELNOTES=In AutoValue code, include type annotations in bounds of type-parameter declarations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=254752026
|
|
RELNOTES=Handle inner classes correctly when the outer class has a type parameter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=254205692
|
|
@SuppressWarnings(value = {"mutable"}), write @SuppressWarnings("mutable").
RELNOTES=Use the short form of annotations in generated code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=253993453
|
|
Renames may include:
- containsAllOf => containsAtLeast
- containsAllIn => containsAtLeastElementsIn
- isSameAs => isSameInstanceAs
- isOrdered => isInOrder
- isStrictlyOrdered => isInStrictOrder
The other major change is to change custom subjects to extend raw Subject instead of supplying type parameters. The type parameters are being removed from Subject. This CL will temporarily produce rawtypes warnings, which will go away when I remove the type parameters (as soon as this batch of CLs is submitted).
Some CLs in this batch also migrate calls away from actualAsString(). Its literal replacement is `"<" + actual + ">"` (unless an object overrides actualCustomStringRepresentation()), but usually I've made a larger change, such as switching from an old-style "Not true that..." failure message to one generated with the Fact API. In that case, the new code usually contains a direct reference to this.actual (a field that I occasionally had to create). Another larger change I sometimes made is to switch from a manual check-and-fail approach to instead use check(...). And sometimes I just remove a withMessage() call that's no longer necessary now that the code uses check(...), or I introduce a check(...) call. (An assertion made with check(...) automatically includes the actual value from the original subject, so there's no need to set it again with withMessage().)
Finally, there's one CL in this batch in which I migrate a Correspondence subclass to instead use Correspondence.from.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=251495286
|
|
for example we have a property `Optional<String> foo()` or `ImmutableList<String> bar()` and a setter like `setFoo(String x)` or `setBar(String[] x)`. The generated setter will need to do `Optional.of(x)` or `ImmutableList.copyOf(x)`.
Previously the logic to do this was split into two places: (a) where we determined whether a conversion was possible, and (b) where we generated the code. In (b) we had to guess the name of the copy method (`of` or `copyOf` for example) even though we knew it in (a). Now we arrange for the information about the method name to be copied from (a) to (b).
This change will allow us to add logic to support ImmutableSortedSet.copyOfSorted and ImmutableSortedMap.copyOfSorted.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249476752
|
|
An abstract void method means that the associated kind has no value. The factory method has no parameter and calling the implementation of the void method does nothing unless the instance is of another kind.
RELNOTES=Allow @AutoOneOf properties to be void.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249301961
|
|
read that.
actual() is being removed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246997654
|
|
(The exact change is slightly different in some cases, like when using custom subjects or check(), but it's always a migration from named(...) to [assert]WithMessage(...).)
named(...) is being removed.
This CL may slightly modify the failure messages produced, but all the old information will still be present.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246871370
|
|
They behave identically, and the old names are being removed.
Open-source note: The new methods are available in Truth as of version 0.44.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246151837
|
|
The two behave identically, and isNotSameAs is being removed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245851407
|
|
(The exact change is slightly different in some cases, like when using custom subjects or check(), but it's always a migration from named(...) to [assert]WithMessage(...).)
named(...) is being removed.
This CL may slightly modify the failure messages produced, but all the old information will still be present.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245027656
|
|
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244721908
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244250754
|
|
Fixes https://github.com/google/auto/issues/718.
RELNOTES=Fix an intermittent issue with AutoValue extensions and Gradle.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=242786899
|
|
AutoValue extensions. See https://github.com/google/auto/issues/718.
RELNOTES=More detailed exception information if AutoValue extensions cannot be loaded.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=241929228
|
|
Fixes https://github.com/google/auto/issues/715.
RELNOTES=Expand the exceptions covered by the workaround for a JDK8 jar bug.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=240859625
|
|
Note: Several methods are copied from the com.google.auto.value.processor that should be moved to a common location.
RELNOTES=Support @CopyAnnotations in classes generated by MemoizeExtension.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=240174112
|
|
ThrowableSubject.hasMessageThat(). This replaces assertions of the form assertThat(e).hasMessage(...) and assertThat(e.getMessage()) with assertThat(e).hasMessageThat().
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=239181584
|
|
In the case where the setter parameter is supposed to be the same as the getter type, we use appropriate logic to take inheritance into account. We also verify that the type of a parameter that we are thinking of feeding to ImmutableSet.copyOf (for example) will actually lead to an ImmutableSet of the right type.
RELNOTES=Improved type checking for builder setter parameters.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=238503171
|
|
types.
We translate the getter return types into the type context of the builder. For example, if the @AutoValue class is Foo<T> then its builder must be Foo.Builder<T>. A getter like `abstract List<T> getList()` is compatible with a setter like `Builder setList(List<T> list)`, even though the <T> parameter in each case is different. So we convert `List<T-{Foo}> getList()` into `List<T{Foo.Builder}> getList()` before comparing types.
RELNOTES=Better checking of types in setters against types in getters.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=238100041
|
|
hashCode optimization
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233968723
|
|
The generated code already rejects null values, whether or not @Nullable is present, so this just lets users know earlier that what they are trying is not going to work.
RELNOTES=It is a compilation error for an @AutoOneOf property to be @Nullable since null values are not in fact accepted.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229442655
|
|
The options will then be returned by AutoValueProcessor.getSupportedOptions().
This change is based on code by Zac Sweers. Closes https://github.com/google/auto/pull/680.
RELNOTES=AutoValue extensions can now declare supported options.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=229202570
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=227518597
|
|
as an optimization
RELNOTES=When `hashCode()` is `@Memoized`, `equals()` will be optimized to check hash codes first before other properies
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219306578
|
|
case where one of the types is of type "Class", it triggers an "Error Prone" error: http://errorprone.info/bugpattern/GetClassOnClass
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219005298
|
|
It currently only recognises @Nullable as a method annotation, typically for javax.annotation.Nullable, but does not recognise the TYPE_USE version from the checker framework.
We also annotate the corresponding constructor parameter, though currently only for the TYPE_USE case.
While testing this I discovered that we can pick up two versions of MemoizeExtension because it changed packages. Specifically I saw Maven picking up AutoValue 1.5.3 via compile-testing. The way ServiceLoader works means that we will load and run both versions of MemoizeExtension in this case. So I added a hack to AutoValueProcessor so it will ignore the old version if it sees it.
RELNOTES=MemoizeExtension recognises @Nullable type annotations, not just method annotations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218175594
|
|
Fixes https://github.com/google/auto/issues/670.
RELNOTES=Remove unnecessary parentheses from the generated equals(Object) method in @AutoValue classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218164872
|
|
This eliminates the need to include the giant java.desktop module on Java 9+.
Based on https://github.com/google/auto/pull/647 by Jakob Buchgraber.
RELNOTES=Remove the need for the java.desktop module on Java 9+.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202499735
|
|
RELNOTES=Delete AutoValue's copy of EscapeVelocity.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199745763
|
|
AutoAnnotationCompilationTest and AutoOneOfCompilationTest.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199736684
|
|
its own copy.
A later change will delete that copy.
RELNOTES=Use separate EscapeVelocity project rather than AutoValue's own copy.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199709073
|
|
RELNOTES=Add capability to annotate individual AutoValue fields
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199491872
|
|
changes are arguably for the worse, but it's worth having a consistent format.
RELNOTES=Reformatted AutoValue source code using google-java-format.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198512874
|
|
@Nullable parameter.
This is based on https://github.com/google/auto/pull/353 by Kenzie Togami.
Closes https://github.com/google/auto/pull/353.
RELNOTES:
Allow an Optional property to be set in a builder through a method with a @Nullable parameter.
NOTE: As a side-effect of this change, a setter for a @Nullable property must have its parameter also marked @Nullable. Previously, if the @Nullable was not a TYPE_USE @Nullable, it was copied from the getter to the parameter of the generated setter implementation. For TYPE_USE @Nullable it was already necessary to mark the setter parameter @Nullable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195471227
|
|
generated subclasses.
This CL also includes a certain amount of refactoring to share more code between AutoValue and AutoOneOf.
RELNOTES=If an `@AutoOneOf` class has `@CopyAnnotations`, copy class annotations to the generated subclasses.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190293950
|
|
own class
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188329311
|
|
internal class name to avoid confusing Proguard.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185534047
|
|
715b8eb505649a4acaaa5889d4f4b51a91dd8a91, 0383c1cf7472d7444463353aa2ac956c9471130a
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184027387
|
|
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183442436
|
|
The deprecation warnings currently cause the test to fail when running on JDK 9.
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183417231
|
|
test failure that only shows up on Travis.
I'm still trying to understand why we get these failures in the first place. My theory is that, in this environment only, the test is finding com/google/auto/value/AutoOneOf.java when it sees `import com.google.auto.value.AutoOneOf`, so that file is "implicitly compiled". I'm not sure if that might be considered a bug in compile-testing, or in the Travis configuration.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183085105
|
|
Object or String are in scope.
Fixes https://github.com/google/auto/issues/403.
RELNOTES=Handle redeclared Object or String in @AutoValue classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182927083
|
|
`${` not followed by an identifier (so not `${foo.bar}` or whatever) then those are just two plain-text characters. If you have `$foo.!` rather than `$foo.bar` then the `.!` are just plain-text characters.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182860539
|
|
#*...*# and can span lines.
Also add a couple of extra test cases around $ when it is not followed by an identifier.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182584435
|
|
RELNOTES=Introduced @AutoOneOf for tagged-union types in Java.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182536936
|
|
code that is specific to @AutoValue and code that will be shared with @AutoOneOf. Move template code that will be shared into a new equalshashcode.vm.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182381197
|
|
Always supply -Xlint:-processing -implicit:none in test methods that call compilation.succeededWithoutWarnings(). That suppresses warnings that "@SomeAnnotation was not consumed by any processor" and "Implicitly compiled files were not subject to annotation processing".
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181179743
|
|
construct. Also allow # not followed by an identifier, which is treated as a plain # character.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180868803
|
|
testing copying annotations instead of one from javax.annotations.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180717772
|