aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-06-19Add Android files to build AutoValue am: 8d0c8f812f am: 0ba096d926r_aml_301500702android-mainline-12.0.0_r55android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r45android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r4android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r33android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r19android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android-mainline-11.0.0_r10android11-mainline-tethering-releaseandroid11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseColin Cross
Original change: https://android-review.googlesource.com/c/platform/external/auto/+/1341935 Change-Id: I21d8a0543fb8b16ae95deb229d6ffdfecdb3e59e
2020-06-19Merge tag auto-value-1.7.3^ into master am: b6571d386f am: 17516cb506Colin Cross
Original change: https://android-review.googlesource.com/c/platform/external/auto/+/1341934 Change-Id: I8e3eac079e9595bc7dc18b8f9c9d15611085e5aa
2020-06-19Add Android files to build AutoValue am: 8d0c8f812fColin Cross
Original change: https://android-review.googlesource.com/c/platform/external/auto/+/1341935 Change-Id: I20f2a6386f31b5976d3d50c07a2da33354efef7e
2020-06-19Merge tag auto-value-1.7.3^ into master am: b6571d386fColin Cross
Original change: https://android-review.googlesource.com/c/platform/external/auto/+/1341934 Change-Id: Ie00eca9d6c0c2f27708eef678c0e3b9f0bf90321
2020-06-18Add Android files to build AutoValueplatform-tools-30.0.4android-r-beta-3android-r-beta-2Colin Cross
Add Android.bp files, stubs for unused annotations, METADATA file and MODULE_LICENSE_APACHE2 file. Bug: 158870037 Test: m checkbuild Change-Id: Ibd9836e10c77c216af8d207c5347645e13cc2e3d
2020-06-17Merge tag auto-value-1.7.3^ into masterColin Cross
Merge the parent commit of auto-value-1.7.3 into master. The commit of the auto-value-1.7.3 tag is not on a branch so not replicated, but it just sets the version number. Bug: 158870037 Test: m checkbuild Change-Id: I1d88f1443d71b630efda822b04355c3b3fb20d59
2020-06-17Initial empty repositoryInna Palant
2020-06-09Change links from google.github.io/guava to guava.dev, including making sure ↵cpovirk
they're https. The links work even now because they automatically redirect. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=315389274
2020-06-09Change error reporting methods to use format strings.emcmanus
RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=315322251
2020-06-09Copy annotations from `@AutoValue.Builder` to the generated `Builder` subclass.emcmanus
This happens only if `@AutoValue.CopyAnnotations` is present on the `@AutoValue.Builder` class, using the same logic as for copying annotations from the main `@AutoValue` class. RELNOTES=Optionally copy annotations from the `@AutoValue.Builder` class to the generated subclass. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=315291023
2020-05-20Drop unnecessary parentheses in AutoAnnotation `equals` and `hashCode` methods.emcmanus
Fixes https://github.com/google/auto/issues/849. Closes https://github.com/google/auto/pull/850. RELNOTES=Drop unnecessary parentheses in AutoAnnotation `equals` and `hashCode` methods. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=312284275
2020-05-20Defer processing in `@AutoValue` classes if any abstract method has an ↵emcmanus
undefined return type or parameter type. This avoids problems in certain cases where other annotation processors will generate the currently-undefined type. Fixes https://github.com/google/auto/issues/847. RELNOTES=Fixed a problem when an `@AutoValue` class references types that are generated by other annotation processors. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=312172526
2020-05-17Demonstrate a static copy function instead of .clone()diamondm
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=311766573
2020-05-13Fix 3 ErrorProneStyle findings:clshepherd
* A summary fragment is required; consider using the value of the @return block as a summary fragment instead. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=311172889
2020-05-08Have SerializableAutoValueExtension declare that it is "isolating".emcmanus
Since it is a built-in extension, and since AutoValue itself only describes itself as isolating if all extensions are, this omission meant that the presence of AutoValue disabled incremental builds in Gradle. Add a test to ensure that we don't forget this with future extensions. Fixes https://github.com/google/auto/issues/844. RELNOTES=AutoValue is once again "isolating" for Gradle incremental compilation. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=310610697
2020-05-01Allow boxed @AutoValue properties to be set from the corresponding primitive ↵emcmanus
type. We also allow the converse, though that's less likely to be useful. RELNOTES=Allow boxed @AutoValue properties to be set from the corresponding primitive type. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=309320843
2020-04-28Upgrade AutoValue tests to more recent compile-testing APIs.emcmanus
In particular, the use of `onLineContaining` instead of `onLine` makes for much clearer compilation-error tests. Some tests now assert `.succeededWithoutWarnings()` where previously they just asserted that compilation succeeded. I checked that this change passes on Travis, which historically has discovered warnings that we didn't see locally. It doesn't appear to be necessary to add `-Xlint:-processor` or the like. Also remove some unneeded `throws Exception` clauses from test methods, and one unused private method in a test. RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=308672643
2020-04-27Generalize the logic for determining if we can make a BarBuilder out of a Bar.emcmanus
If you have an `@AutoValue` class `Foo` with a property `Bar bar()` and `Foo.Builder` has a method `BarBuilder barBuilder()`, then we previously allowed that, provided we knew how to make a `BarBuilder` (for example by calling `Bar.builder()`). But if, in addition, `Foo` has its own `toBuilder()` method, then we also need to be able to make a `BarBuilder` out of an existing `Bar`, because if you call `Foo.Builder builder = foo1.toBuilder()` then the builder returned by `builder.barBuilder()` must start off with the contents of `foo1.bar()`. Previously we allowed that when `Bar` had a method `BarBuilder toBuilder()`. We also had a special case for Guava classes like `ImmutableList`. `ImmutableList` doesn't have a `toBuilder()` method, but you can make an `ImmutableList.Builder` out of an `ImmutableList` by starting with an empty `ImmutableList.Builder` and calling `addAll(theImmutableList)`. The change here generalizes that special case: it will work if the `BarBuilder` class has a method `addAll` or `putAll` that can accept an argument of type `Bar`. `ImmutableList.Builder<E>` has a method `addAll(Iterable<? extends E>)` and you can pass an `ImmutableList<E>` to that method, so we still accept `ImmutableList.Builder<T> barBuilder()`. But we now also accept any other class that qualifies. Fixes https://github.com/google/auto/issues/794. RELNOTES=Generalized the logic for determining if we can make a BarBuilder out of a Bar. For example, if your `@AutoValue` class `Foo` has a property `IntList ints()`, then your builder can have `IntListBuilder intsBuilder()`, where `IntListBuilder` is your own type, and this will work even if there is a `Foo.toBuilder()` method, provided it's possible to call `IntListBuilder.addAll(IntList)`. Previously it worked, but not if there was a `Foo.toBuilder()` because we didn't know how to make `IntListBuilder` out of `IntList`. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=308628522
2020-04-22[AutoValue] Add serializable extension's g3doc to the opensource filegroup.alvinlao
The serializable/g3doc build rule wasn't used. RELNOTES=Add documentation for SerializableAutoValue extension. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=306863229
2020-04-15Update versions of Truth and Compile-testing.Sean Sullivan
Closes https://github.com/google/auto/pull/831 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=306447364
2020-04-10Warn if an @AutoValue.Builder class contains a static builder method.emcmanus
RELNOTES=AutoValue now gives a warning if the static builder() method is inside the @AutoValue.Builder class instead of directly in the @AutoValue class. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=304683697
2020-04-10Fix the SerializableAutoValueExtension from crashing if an AutoValue ↵alvinlao
contains multiple properties with the same type. RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=304293379
2020-04-10Release the SerializableAutoValue extension.alvinlao
RELNOTES=Release the SerializableAutoValue extension. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=304211473
2020-04-01Fix broken link in howto.mdcpovirk
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=304010271
2020-03-16Refactor BasicAnnotationProcessor (3 of 3)bcorso
(Context: No rush on these reviews. I was just reading through BasicAnnotationProcessor and decided to clean some stuff up.) Removes some of the duplication between package and type elements in validElements() RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=301196168
2020-03-16 Use try-with-resources for Files.walk. Otherwise the Stream is not closed ↵emcmanus
correctly. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=300791938
2020-03-13Apply a hack to OverridesTest so that it will work with newer versions of ecj.emcmanus
In Google's internal java8 compilation environment, problems with symbolic links mean that ecj can't find the standard system classes without this workaround. In other environments, including Google's java11, this problem doesn't arise. RELNOTES=Make OverridesTest work with Google's internal java8 compilation environment. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=300664328
2020-03-13Refactor BasicAnnotationProcessor (2 of 3)bcorso
This CL reduces some of the conversions between Set<ElementName> and Map<String, ? extends Optional<? extends Element>> where it's not needed. RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=300565432
2020-03-12Migrate CompileWithEclipseTest to open source.emcmanus
RELNOTES=Added CompileWithEclipseTest, which checks that AutoValue works with ecj, the Eclipse compiler. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=300358646
2020-03-11Update auto-factory dependencies.emcmanus
Closes https://github.com/google/auto/pull/818. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=300120801
2020-03-10Refactor BasicAnnotationProcessor (1 of 3)bcorso
This CL just does a format fix and applies some error-prone suggestions on BasicAnnotationProcessor. RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=299896536
2020-03-04Minor reformatting of markdowncpovirk
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=298399922
2020-03-04Omit java7_compat_test.sh from open-source codebase.cpovirk
It doesn't work there. Apparently ronshapiro@ noticed, as his in-progress Copybara config omits the file. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=298399027
2020-02-11If AutoValue detects an error, don't invoke extensions or generate code.emcmanus
For example if there's a type mismatch between a property getter and the corresponding setter in a Builder, we may otherwise end up invoking an extension with an inconsistent state. Also the generated code is likely to have compile errors of its own, which distract from the real source of the problem. Fixes https://github.com/google/auto/issues/809. RELNOTES=Don't generate code or invoke extensions if AutoValue detects a problem, for example a mismatch between getters and setters. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=294552938
2020-02-10Add type parameters to void AutoOneOf values.grahamrogers
This allows users of AutoOneOf to not have to manually cast the value. Before: @SuppressWarnings("unchecked") public static <T> MyOneOf<T> empty() { return (MyOneOf<T>) AutoOneOf_MyOneOf.empty(); } After: public static <T> MyOneOf<T> empty() { return AutoOneOf_MyOneOf.empty(); } RELNOTES=Add type parameters to factory methods for void AutoOneOf values ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=294216002
2020-01-16AutoValue best practices: mention that subclassing is now prevented.ghm
I think this obviates most of the reason to add explicit constructors. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=290029147
2020-01-13Make it an error if a setter has a @Nullable parameter when the property ↵emcmanus
being set is not @Nullable. We will generate code that rejects a null parameter whether or not @Nullable is present, so allowing it is just misleading users of the API. The mirror situation, where the property is @Nullable but the setter is not, is arguably also incorrect. In that case the generated code does *not* reject a null parameter, even though we might expect it to in the absence of @Nullable on the parameter. However, changing that would surely break a lot of existing code. Fixes https://github.com/google/auto/issues/777. RELNOTES=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. This already generated a NullPointerException at runtime. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=289103954
2020-01-10Delete Auto-Parent pom.xml entirely.cpovirk
It no longer provides meaningful functionality, and the Auto projects no longer use it. And of course existing users can continue to reference the releases in Maven Central. Followup to CL 245779060. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=288955500
2020-01-10Add MoreTypes.isConversionFromObjectUnchecked. This method tells, for a ↵emcmanus
given type, whether casting Object to that type will elicit an "unchecked" warning from the compiler. RELNOTES=Added MoreTypes.isConversionFromObjectUnchecked to test whether casting to a type will elicit an "unchecked" compiler warning. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=288896286
2020-01-02Improve toString alignment in AutoValue's toString.ghm
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=287824372
2020-01-02When checking builder setter parameters, use the final type. The final type ↵emcmanus
is the type after type-variable substitution. Report this type in error messages, since it may not be obvious. (See AutoValueNotEclipseTest for an example of the problem this is fixing.) Fix CompileWithEclipseTest so that it actually does exclude AutoValueNotEclipseTest.java from the compilation, as intended. Move the existing test within that file into AutoValueTest.java, since apparently the Eclipse bug it was provoking has been fixed. Add the test for the bug being fixed here into AutoValueNotEclipseTest.java, because it hits another Eclipse bug. Fixes https://github.com/google/auto/issues/802. RELNOTES=Fixed an issue with type checking of setter parameters in the presence of inheritance and generics. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=287580372
2019-12-18Fix 1 ErrorProneStyle finding:clshepherd
* Constructors and methods with the same name should appear sequentially with no other code in between. Please re-order or re-name methods. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=286176935
2019-12-16Suggest calling out a misuse in AutoValue regarding @Nullable fields.yunqin
This was identified as an AI in mini-PM for b/142561228. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=285472669
2019-12-06Simplify CastingUncheckedVisitor by passing the default value to the ↵dpb
superclass constructor and ignoring the parameter. Also make it a constant. RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283532121
2019-12-06Fix spacing in generated toString() for @AutoOneOf.emcmanus
Before the change: public String toString() { return "OneOfOne{dog=" + this.dog + "}"; } After the change: public String toString() { return "OneOfOne{dog=" + this.dog + "}"; } (Having to fiddle with spaces like this is perhaps the biggest disadvantage of the current template approach. It would go away if we postprocessed with google-java-format, though the performance overhead of that is probably too great.) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283507442
2019-12-02Use CLASS retention for @AutoService.emcmanus
This reapplies 28a2c791575a7e4545293169bea0921b81363a3 after fixing an internal, fragile test. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283349599
2019-12-02In TemplateVars, check that getResource returns non-null. This check is ↵emcmanus
redundant because if we reach this point then we've already checked that getResourceAsStream returns non-null for the same resource. But it's a little tricky to trace through the logic to prove that. Fixes https://github.com/google/auto/issues/796. RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283336231
2019-12-02Improve Maven instructions for AutoValue.emcmanus
It is not true that a dependency on the auto-value artifact transitively implies a dependency on auto-value-annotations, so it is not correct to suggest that users can include only the former. Make it clearer that <plugins> is inside the <build> section. Use ${auto-value.version} consistently, rather than sometimes that and sometimes ${version}. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283224151
2019-11-26Rollback 28a2c791575a7e4545293169bea0921b81363a3dludo
*** Reason for rollback *** breaks internal test *** Original change description *** Use CLASS retention for @AutoService Gradle incremental aggregating processors require all processed annotations to have CLASS retention so that the incremental compiler can substitute a class file for a source file if the file is unchanged. With SOURCE retention, Gradle requires a full rebuild. See: https://github.com/google/auto/issues/615 https://docs.gradle.org/6.0.1/userguide/java_plugin.html#aggregating_annotation_processors https://github.com/gradle/gradle/blob/v6.0.1/subprojects/langua... *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=282462095
2019-11-25Use CLASS retention for @AutoServiceemberrose
Gradle incremental aggregating processors require all processed annotations to have CLASS retention so that the incremental compiler can substitute a class file for a source file if the file is unchanged. With SOURCE retention, Gradle requires a full rebuild. See: https://github.com/google/auto/issues/615 https://docs.gradle.org/6.0.1/userguide/java_plugin.html#aggregating_annotation_processors https://github.com/gradle/gradle/blob/v6.0.1/subprojects/language-java/src/main/java/org/gradle/api/internal/tasks/compile/processing/AggregatingProcessingStrategy.java#L49-L56 RELNOTES=`AutoService`: Use `CLASS` retention to support Gradle aggregating incremental annotation processors ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=282380619