File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
common/src/main/java/org/embeddedt/modernfix/util Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -141,14 +141,16 @@ public int hashCode() {
141141 }
142142
143143 public static <T > CanonizingStringMap <T > deepCopy (CanonizingStringMap <T > inputMap , Function <T , T > deepCopier ) {
144+ Objects .requireNonNull (deepCopier );
144145 Object2ObjectMap <String , T > copiedBackingMap ;
145146 int size = inputMap .backingMap .size ();
146147 if (size > GROWTH_THRESHOLD ) {
147148 copiedBackingMap = new Object2ObjectOpenHashMap <>(size );
148149 } else
149150 copiedBackingMap = new Object2ObjectArrayMap <>(size );
150151 inputMap .backingMap .object2ObjectEntrySet ().forEach (entry -> {
151- copiedBackingMap .put (entry .getKey (), deepCopier .apply (entry .getValue ()));
152+ if (entry .getKey () != null && entry .getValue () != null )
153+ copiedBackingMap .put (entry .getKey (), deepCopier .apply (entry .getValue ()));
152154 });
153155 return new CanonizingStringMap <>(copiedBackingMap );
154156 }
You can’t perform that action at this time.
0 commit comments