Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moe Sync #737

Merged
merged 7 commits into from
May 27, 2019
Merged

Moe Sync #737

merged 7 commits into from
May 27, 2019

Conversation

ronshapiro
Copy link
Contributor

This code has been reviewed and submitted internally. Feel free to discuss on the PR and we can submit follow-up changes as necessary.

Commits:

Don't compare TypeMirrors using Object#equals

They don't override Object#equals and are not interned, so reference
equality is not useful. This was causing unnecessary duplication of
Provider fields in AutoFactories.

d9c0593


Add an originating element for AutoFactory types

c148ee4


Make AutoFactory an isolating annotation processor in Gradle

RELNOTES=Gradle: @AutoFactory is now an isolating annotation processor

0b58d04


Allow @AutoOneOf properties to be void.

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.

d5e4f55


Improve the logic for setter type conversion. Setter type conversion is when for example we have a property `Optional foo()` or `ImmutableList 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.

e0c631a


Better support for ImmutableSortedSet and ImmutableSortedMap. Use .copyOfSorted when setting from a SortedSet or SortedMap. Use .naturalOrder when constructing a builder.

Fixes #666.

RELNOTES=Use ImmutableSortedSet.copyOfSorted and .naturalOrder where appropriate.

7564c4c


Migrate Correspondence subclasses to instead call Correspondence.from.

6c9bd9f

cushon and others added 7 commits May 27, 2019 10:31
They don't override Object#equals and are not interned, so reference
equality is not useful. This was causing unnecessary duplication of
Provider fields in AutoFactories.

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248752047
RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248722215
RELNOTES=Gradle: `@AutoFactory` is now an isolating annotation processor

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248771150
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
…is when 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
…pyOfSorted when setting from a SortedSet or SortedMap. Use .naturalOrder when constructing a builder.

Fixes #666.

RELNOTES=Use ImmutableSortedSet.copyOfSorted and .naturalOrder where appropriate.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249632356
@ronshapiro ronshapiro merged commit f13cae1 into master May 27, 2019
@ronshapiro ronshapiro deleted the sync-master-2019/05/24 branch May 27, 2019 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using a collection builder with ImmutableSortedSet
5 participants