77
88import com .google .common .collect .Sets ;
99import com .intellij .openapi .util .Pair ;
10- import java .util .ArrayList ;
1110import java .util .HashMap ;
1211import java .util .List ;
1312import java .util .Map ;
@@ -69,7 +68,7 @@ public static Pair<Map<String, Boolean>, Map<String, String>> unionVersionDataWi
6968 final boolean shouldKeepNew
7069 ) {
7170 final Map <String , Boolean > union = new HashMap <>();
72- final List <String > removed = new ArrayList <>();
71+ final Map <String , Boolean > removedUnion = new HashMap <>();
7372 final Map <String , String > changelog = new HashMap <>();
7473
7574 for (final Map .Entry <String , Map <String , Boolean >> vData : versioningData .entrySet ()) {
@@ -80,10 +79,11 @@ public static Pair<Map<String, Boolean>, Map<String, String>> unionVersionDataWi
8079 final Map <String , Boolean > removedData = removedSet .stream ().collect (
8180 Collectors .toMap (
8281 Map .Entry ::getKey ,
83- Map . Entry :: getValue
82+ element -> true
8483 )
8584 );
86- removedData .forEach ((key , value ) -> removed .add (key ));
85+ removedUnion .putAll (removedData );
86+
8787 final Sets .SetView <Map .Entry <String , Boolean >> newDataSet = Sets .difference (
8888 vData .getValue ().entrySet (),
8989 removedSet
@@ -102,9 +102,9 @@ public static Pair<Map<String, Boolean>, Map<String, String>> unionVersionDataWi
102102 }
103103 }
104104 }
105- final Set <Map .Entry <String , Boolean >> filteredUnionSet = Sets .filter (
105+ final Sets . SetView <Map .Entry <String , Boolean >> filteredUnionSet = Sets .difference (
106106 union .entrySet (),
107- entry -> ! removed . contains ( entry . getKey () )
107+ removedUnion . entrySet ( )
108108 );
109109 final Map <String , Boolean > filteredUnion = filteredUnionSet .stream ().collect (
110110 Collectors .toMap (
0 commit comments