Fix memberIn() operator for non-internal groups

The cache should just query the database for any usage
of the UUID given as the cache key.

Change-Id: I94ac67ee7598503b78ae87ec88f32c683b555696
This commit is contained in:
Shawn Pearce
2013-01-18 15:17:37 -08:00
parent f3ea0fb0a6
commit c65c508a88

View File

@@ -176,14 +176,9 @@ public class GroupIncludeCacheImpl implements GroupIncludeCache {
public Set<AccountGroup.UUID> load(AccountGroup.UUID key) throws Exception {
final ReviewDb db = schema.open();
try {
List<AccountGroup> group = db.accountGroups().byUUID(key).toList();
if (group.size() != 1) {
return Collections.emptySet();
}
Set<AccountGroup.Id> ids = Sets.newHashSet();
for (AccountGroupIncludeByUuid agi : db.accountGroupIncludesByUuid()
.byIncludeUUID(group.get(0).getGroupUUID())) {
.byIncludeUUID(key)) {
ids.add(agi.getGroupId());
}