Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2146,17 +2146,24 @@ private static String describe(String scope) {
*/
private static Map<String, Set<String>> orderGroups(Manifest baseline, Manifest current,
Map<String, String> oldBindings, Map<String, String> currentBindings) {
Map<String, String> firstNames = new HashMap<>();
Map<String, Set<String>> groups = new TreeMap<>();
addOrderGroups(groups, baseline, oldBindings);
addOrderGroups(groups, current, currentBindings);
groups.values().removeIf(names -> names.size() < 2);
addOrderGroups(firstNames, groups, baseline, oldBindings);
addOrderGroups(firstNames, groups, current, currentBindings);
return groups;
}

private static void addOrderGroups(Map<String, Set<String>> groups, Manifest manifest, Map<String, String> bindings) {
private static void addOrderGroups(Map<String, String> firstNames, Map<String, Set<String>> groups,
Manifest manifest, Map<String, String> bindings) {
bindings.forEach((name, id) -> {
if (manifest.functions().containsKey(name)) {
groups.computeIfAbsent(id, k -> new TreeSet<>()).add(name);
if (!manifest.functions().containsKey(name)) {
return;
}
String first = firstNames.putIfAbsent(id, name);
if (first != null && !first.equals(name)) {
Set<String> names = groups.computeIfAbsent(id, k -> new TreeSet<>());
names.add(first);
names.add(name);
}
});
}
Expand Down
Loading