Convert some value classes to AutoValue

These classes were found by searching for custom hashCode
implementations, and omitting some cases:

 - Classes requiring custom serialization, which is not supported[1][2].
 - Most instances with custom hashCode or equals implementations,
   where the code savings is not as significant.
 - All classes in the extension API. We may migrate these eventually,
   but let's avoid this large backwards incompatible change until
   we're more used to AutoValue elsewhere.
 - All classes in the UI package.[3]

There are likely still more value classes that were missed by this
search that do not implement equals or hashCode.

[1] https://github.com/google/auto/tree/master/value#serialization
[2] This excludes, among other things, all persistent cache keys. It
might be possible to convert persistent caches to use a key
marshalling strategy other than Java serialization, but probably not
without invalidating all existing entries.
[3] This should still be possible as generated classes are generally
GWT compatible.

Change-Id: I96796b9879b7e487b80949b63115ac4032180f8b
This commit is contained in:
Dave Borowitz
2014-11-09 17:57:45 -08:00
parent c87d29ec16
commit eba26614e5
24 changed files with 159 additions and 332 deletions

View File

@@ -525,7 +525,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
}
private void addLabelDelta(String name, short value) {
labelDelta.add(new LabelVote(name, value).format());
labelDelta.add(LabelVote.create(name, value).format());
}
private boolean insertMessage(RevisionResource rsrc, String msg,