-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a template bug concerning @AutoOneOf arrays. Like AutoValue, Auto…
…OneOf allows values to be primitive arrays, but the code template referenced an undefined variable in that case. The implementation of foo.getMyArray() copies the array, so the implementation of equals(Object) checks whether the Object is of the generated subclass, and if so accesses the private myArray field directly. For @autovalue Foo, this subclass is AutoValue_Foo, and the $subclass template variable is set to that. But for @AutoOneOf Foo, there is a subclass per property, and we actually want AutoOneOf_Foo.Impl_myArray. So we need to make sure that $subclass is set to that in the #equalsThatExpression macro. This requires updating to EscapeVelocity 0.9.1, which allows variable references within strings, like "Impl_$p". RELNOTES=Primitive arrays now work in @AutoOneOf classes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=256190191
- Loading branch information
1 parent
91118b0
commit 81134b5
Showing
5 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters