Convert Project.NameKey to an immutable type

Follows the pattern of other key type refactorings, adding a static
factory method. However, unlike the other key types, this one can't be
an @AutoValue, because it has other subclasses and specific requirements
around the implementation of equals. So we're stuck with boilerplate; at
least it's only one field.

See I6982fb24 for context.

Change-Id: Ic46c4a357f4ee77f18e54e87ca97af6e834834b6
This commit is contained in:
Dave Borowitz
2019-04-19 09:14:35 -07:00
parent 766a93d2a0
commit 5c9a6500a8
111 changed files with 307 additions and 320 deletions

View File

@@ -136,7 +136,7 @@ public class SearchingChangeCacheImpl implements GitReferenceUpdatedListener {
@Override
public void onGitReferenceUpdated(GitReferenceUpdatedListener.Event event) {
if (event.getRefName().startsWith(RefNames.REFS_CHANGES)) {
cache.invalidate(new Project.NameKey(event.getProjectName()));
cache.invalidate(Project.nameKey(event.getProjectName()));
}
}