Stop using deprecated SoyListData and SoyMapData

Per the deprecation notices, users of these classes should use normal
List and Map instead. The Soy rendering APIs can automatically handle
conversion of native Java types.

Change-Id: I101e455fea721a7cb083dd2b26c59e5e7527acf8
This commit is contained in:
David Pursehouse
2019-05-02 10:58:56 +09:00
parent 92fb7f7dbe
commit e8c846468a
3 changed files with 28 additions and 27 deletions

View File

@@ -44,15 +44,15 @@ import com.google.gerrit.server.permissions.GlobalPermission;
import com.google.gerrit.server.permissions.PermissionBackendException;
import com.google.gerrit.server.project.ProjectState;
import com.google.gerrit.server.query.change.ChangeData;
import com.google.template.soy.data.SoyListData;
import com.google.template.soy.data.SoyMapData;
import java.io.IOException;
import java.sql.Timestamp;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -563,11 +563,11 @@ public abstract class ChangeEmail extends NotificationEmail {
* a 'type' key which maps to one of 'common', 'add' or 'remove' and a 'text' key which maps to
* the line's content.
*/
private SoyListData getDiffTemplateData() {
SoyListData result = new SoyListData();
private List<Map<String, String>> getDiffTemplateData() {
List<Map<String, String>> result = new ArrayList<>();
Splitter lineSplitter = Splitter.on(System.getProperty("line.separator"));
for (String diffLine : lineSplitter.split(getUnifiedDiff())) {
SoyMapData lineData = new SoyMapData();
Map<String, String> lineData = new HashMap<>();
lineData.put("text", diffLine);
// Skip empty lines and lines that look like diff headers.