7
7
8
8
import com .google .common .collect .Sets ;
9
9
import com .intellij .openapi .util .Pair ;
10
- import java .util .ArrayList ;
11
10
import java .util .HashMap ;
12
11
import java .util .List ;
13
12
import java .util .Map ;
@@ -69,7 +68,7 @@ public static Pair<Map<String, Boolean>, Map<String, String>> unionVersionDataWi
69
68
final boolean shouldKeepNew
70
69
) {
71
70
final Map <String , Boolean > union = new HashMap <>();
72
- final List <String > removed = new ArrayList <>();
71
+ final Map <String , Boolean > removedUnion = new HashMap <>();
73
72
final Map <String , String > changelog = new HashMap <>();
74
73
75
74
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
80
79
final Map <String , Boolean > removedData = removedSet .stream ().collect (
81
80
Collectors .toMap (
82
81
Map .Entry ::getKey ,
83
- Map . Entry :: getValue
82
+ element -> true
84
83
)
85
84
);
86
- removedData .forEach ((key , value ) -> removed .add (key ));
85
+ removedUnion .putAll (removedData );
86
+
87
87
final Sets .SetView <Map .Entry <String , Boolean >> newDataSet = Sets .difference (
88
88
vData .getValue ().entrySet (),
89
89
removedSet
@@ -102,9 +102,9 @@ public static Pair<Map<String, Boolean>, Map<String, String>> unionVersionDataWi
102
102
}
103
103
}
104
104
}
105
- final Set <Map .Entry <String , Boolean >> filteredUnionSet = Sets .filter (
105
+ final Sets . SetView <Map .Entry <String , Boolean >> filteredUnionSet = Sets .difference (
106
106
union .entrySet (),
107
- entry -> ! removed . contains ( entry . getKey () )
107
+ removedUnion . entrySet ( )
108
108
);
109
109
final Map <String , Boolean > filteredUnion = filteredUnionSet .stream ().collect (
110
110
Collectors .toMap (
0 commit comments