use of com.intellij.util.containers.hash.HashMap in project intellij-community by JetBrains.
the class SvnPropertiesDiffViewer method collectRecords.
@NotNull
private static List<PropertyRecord> collectRecords(@NotNull SvnPropertiesDiffRequest request) {
List<DiffContent> originalContents = request.getContents();
List<PropertyData> properties1 = getProperties(originalContents.get(0));
List<PropertyData> properties2 = getProperties(originalContents.get(1));
Map<String, PropertyValue> before = new HashMap<>();
Map<String, PropertyValue> after = new HashMap<>();
if (properties1 != null) {
for (PropertyData data : properties1) {
before.put(data.getName(), data.getValue());
}
}
if (properties2 != null) {
for (PropertyData data : properties2) {
after.put(data.getName(), data.getValue());
}
}
List<PropertyRecord> records = new ArrayList<>();
for (String name : ContainerUtil.union(before.keySet(), after.keySet())) {
records.add(createRecord(name, before.get(name), after.get(name)));
}
ContainerUtil.sort(records, (o1, o2) -> StringUtil.naturalCompare(o1.getName(), o2.getName()));
return records;
}
Aggregations