@@ -173,13 +173,16 @@ public OV putIfAbsent(OK key, OV value) {
173
173
174
174
@ Override
175
175
public void putAll (Map <? extends OK , ? extends OV > outerMap ) {
176
+ Objects .requireNonNull (outerMap , "The argument 'outerMap' must not be null." );
177
+
176
178
Map <IK , IV > asInner = new TransformToReadOnlyInnerMap (outerMap );
177
179
getInnerMap ().putAll (asInner );
178
180
}
179
181
180
182
@ Override
181
183
public OV compute (OK key , BiFunction <? super OK , ? super OV , ? extends OV > remappingFunction ) {
182
184
Objects .requireNonNull (remappingFunction , "The argument 'remappingFunction' must not be null." );
185
+
183
186
return transformToOuterValue (getInnerMap ().compute (
184
187
transformToInnerKey (key ),
185
188
transformToInnerKeyValueToValueFunction (remappingFunction )
@@ -189,6 +192,7 @@ public OV compute(OK key, BiFunction<? super OK, ? super OV, ? extends OV> remap
189
192
@ Override
190
193
public OV computeIfAbsent (OK key , Function <? super OK , ? extends OV > mappingFunction ) {
191
194
Objects .requireNonNull (mappingFunction , "The argument 'mappingFunction' must not be null." );
195
+
192
196
return transformToOuterValue (getInnerMap ().computeIfAbsent (
193
197
transformToInnerKey (key ),
194
198
transformToInnerToKeyValueFunction (mappingFunction )
@@ -198,6 +202,7 @@ public OV computeIfAbsent(OK key, Function<? super OK, ? extends OV> mappingFunc
198
202
@ Override
199
203
public OV computeIfPresent (OK key , BiFunction <? super OK , ? super OV , ? extends OV > remappingFunction ) {
200
204
Objects .requireNonNull (remappingFunction , "The argument 'remappingFunction' must not be null." );
205
+
201
206
return transformToOuterValue (getInnerMap ().computeIfPresent (
202
207
transformToInnerKey (key ),
203
208
transformToInnerKeyValueToValueFunction (remappingFunction )
@@ -207,6 +212,7 @@ public OV computeIfPresent(OK key, BiFunction<? super OK, ? super OV, ? extends
207
212
@ Override
208
213
public OV merge (OK key , OV value , BiFunction <? super OV , ? super OV , ? extends OV > remappingFunction ) {
209
214
Objects .requireNonNull (remappingFunction , "The argument 'remappingFunction' must not be null." );
215
+
210
216
return transformToOuterValue (getInnerMap ().merge (
211
217
transformToInnerKey (key ),
212
218
transformToInnerValue (value ),
@@ -232,6 +238,8 @@ public boolean replace(OK key, OV oldValue, OV newValue) {
232
238
233
239
@ Override
234
240
public void replaceAll (BiFunction <? super OK , ? super OV , ? extends OV > function ) {
241
+ Objects .requireNonNull (function , "The argument 'function' must not be null." );
242
+
235
243
getInnerMap ().replaceAll (transformToInnerKeyValueToValueFunction (function ));
236
244
}
237
245
@@ -283,6 +291,7 @@ public void clear() {
283
291
@ Override
284
292
public void forEach (BiConsumer <? super OK , ? super OV > action ) {
285
293
Objects .requireNonNull (action , "The argument 'action' must not be null." );
294
+
286
295
getInnerMap ().forEach (transformToInnerKeyValueConsumer (action ));
287
296
}
288
297
0 commit comments