Merge branch 'stable-2.13'
* stable-2.13:
Fix reviewnotes export
Change-Id: I721d822ec027db64d33ba9a9839216c90680a3d8
Signed-off-by: Edwin Kempin <ekempin@google.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java
index 9137e63..520ae0a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java
@@ -17,6 +17,7 @@
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Maps;
+import com.google.common.collect.MultimapBuilder;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.server.ReviewDb;
@@ -72,8 +73,11 @@
private ListMultimap<Project.NameKey, ChangeNotes> mergedChanges() {
try (ReviewDb db = database.open()) {
- return notesFactory.create(
- db, notes -> notes.getChange().getStatus() == Change.Status.MERGED);
+ return MultimapBuilder.hashKeys()
+ .arrayListValues()
+ .build(
+ notesFactory.create(
+ db, notes -> notes.getChange().getStatus() == Change.Status.MERGED));
} catch (OrmException | IOException e) {
stderr.println("Cannot read changes from database " + e.getMessage());
return ImmutableListMultimap.of();