Skip to content

Commit 60179ce

Browse files
committed
Genericise MultiValueMaps; remove non-longer-needed casts
1 parent 916c7c5 commit 60179ce

File tree

1 file changed

+57
-57
lines changed
  • java/ql/test/library-tests/frameworks/spring/util

1 file changed

+57
-57
lines changed

java/ql/test/library-tests/frameworks/spring/util/Test.java

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -275,28 +275,28 @@ public void test() throws Exception {
275275
}
276276
{
277277
// "org.springframework.util;CollectionUtils;false;toMultiValueMap;;;Element of MapValue of Argument[0];Element of MapValue of ReturnValue;value"
278-
MultiValueMap out = null;
278+
MultiValueMap<Object, Object> out = null;
279279
Map in = Map.of(null, List.of(source()));
280280
out = CollectionUtils.toMultiValueMap(in);
281-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
281+
sink(getElement(getMapValue(out))); // $hasValueFlow
282282
}
283283
{
284284
// "org.springframework.util;CollectionUtils;false;toMultiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value"
285-
MultiValueMap out = null;
285+
MultiValueMap<Object, Object> out = null;
286286
Map in = Map.of(source(), null);
287287
out = CollectionUtils.toMultiValueMap(in);
288288
sink(getMapKey(out)); // $hasValueFlow
289289
}
290290
{
291291
// "org.springframework.util;CollectionUtils;false;unmodifiableMultiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value"
292-
MultiValueMap out = null;
292+
MultiValueMap<Object, Object> out = null;
293293
MultiValueMap in = new LinkedMultiValueMap(Map.of(source(), null));
294294
out = CollectionUtils.unmodifiableMultiValueMap(in);
295295
sink(getMapKey(out)); // $hasValueFlow
296296
}
297297
{
298298
// "org.springframework.util;CollectionUtils;false;unmodifiableMultiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value"
299-
MultiValueMap out = null;
299+
MultiValueMap<Object, Object> out = null;
300300
MultiValueMap in = new LinkedMultiValueMap();
301301
in.put(null, source());
302302
out = CollectionUtils.unmodifiableMultiValueMap(in);
@@ -424,166 +424,166 @@ public void test() throws Exception {
424424
}
425425
{
426426
// "org.springframework.util;LinkedMultiValueMap;false;LinkedMultiValueMap;(java.util.Map);;Element of MapValue of Argument[0];Element of MapValue of Argument[-1];value"
427-
LinkedMultiValueMap out = null;
427+
LinkedMultiValueMap<Object, Object> out = null;
428428
Map in = Map.of(null, List.of(source()));
429429
out = new LinkedMultiValueMap(in);
430-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
430+
sink(getElement(getMapValue(out))); // $hasValueFlow
431431
}
432432
{
433433
// "org.springframework.util;LinkedMultiValueMap;false;LinkedMultiValueMap;(java.util.Map);;MapKey of Argument[0];MapKey of Argument[-1];value"
434-
LinkedMultiValueMap out = null;
434+
LinkedMultiValueMap<Object, Object> out = null;
435435
Map in = Map.of(source(), null);
436436
out = new LinkedMultiValueMap(in);
437437
sink(getMapKey(out)); // $hasValueFlow
438438
}
439439
{
440440
// "org.springframework.util;LinkedMultiValueMap;false;deepCopy;;;MapKey of Argument[-1];MapValue of ReturnValue;value"
441-
LinkedMultiValueMap out = null;
441+
LinkedMultiValueMap<Object, Object> out = null;
442442
LinkedMultiValueMap in = (LinkedMultiValueMap)Map.of(source(), null);
443443
out = in.deepCopy();
444444
sink(getMapValue(out)); // $hasValueFlow
445445
}
446446
{
447447
// "org.springframework.util;LinkedMultiValueMap;false;deepCopy;;;MapValue of Argument[-1];MapValue of ReturnValue;value"
448-
LinkedMultiValueMap out = null;
448+
LinkedMultiValueMap<Object, Object> out = null;
449449
LinkedMultiValueMap in = (LinkedMultiValueMap)Map.of(null, source());
450450
out = in.deepCopy();
451451
sink(getMapValue(out)); // $hasValueFlow
452452
}
453453
{
454454
// "org.springframework.util;MultiValueMap;true;add;;;Argument[0];MapKey of Argument[-1];value"
455-
MultiValueMapAdapter out = null;
455+
MultiValueMapAdapter<Object, Object> out = null;
456456
Object in = source();
457457
out.add(in, null);
458458
sink(getMapKey(out)); // $hasValueFlow
459459
}
460460
{
461461
// "org.springframework.util;MultiValueMap;true;add;;;Argument[0];MapKey of Argument[-1];value"
462-
MultiValueMap out = null;
462+
MultiValueMap<Object, Object> out = null;
463463
Object in = source();
464464
out.add(in, null);
465465
sink(getMapKey(out)); // $hasValueFlow
466466
}
467467
{
468468
// "org.springframework.util;MultiValueMap;true;add;;;Argument[0];MapKey of Argument[-1];value"
469-
MultiValueMap out = null;
469+
MultiValueMap<Object, Object> out = null;
470470
Object in = source();
471471
out.add(in, (Object)null);
472472
sink(getMapKey(out)); // $hasValueFlow
473473
}
474474
{
475475
// "org.springframework.util;MultiValueMap;true;add;;;Argument[1];Element of MapValue of Argument[-1];value"
476-
MultiValueMapAdapter out = null;
476+
MultiValueMapAdapter<Object, Object> out = null;
477477
Object in = source();
478478
out.add(null, in);
479-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
479+
sink(getElement(getMapValue(out))); // $hasValueFlow
480480
}
481481
{
482482
// "org.springframework.util;MultiValueMap;true;add;;;Argument[1];Element of MapValue of Argument[-1];value"
483-
MultiValueMap out = null;
483+
MultiValueMap<Object, Object> out = null;
484484
Object in = source();
485485
out.add(null, in);
486-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
486+
sink(getElement(getMapValue(out))); // $hasValueFlow
487487
}
488488
{
489489
// "org.springframework.util;MultiValueMap;true;add;;;Argument[1];Element of MapValue of Argument[-1];value"
490-
MultiValueMap out = null;
490+
MultiValueMap<Object, Object> out = null;
491491
Object in = source();
492492
out.add((Object)null, in);
493-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
493+
sink(getElement(getMapValue(out))); // $hasValueFlow
494494
}
495495
{
496496
// "org.springframework.util;MultiValueMap;true;addAll;(java.lang.Object,java.util.List);;Element of Argument[1];Element of MapValue of Argument[-1];value"
497-
MultiValueMapAdapter out = null;
497+
MultiValueMapAdapter<Object, Object> out = null;
498498
List in = List.of(source());
499499
out.addAll(null, in);
500-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
500+
sink(getElement(getMapValue(out))); // $hasValueFlow
501501
}
502502
{
503503
// "org.springframework.util;MultiValueMap;true;addAll;(java.lang.Object,java.util.List);;Element of Argument[1];Element of MapValue of Argument[-1];value"
504-
MultiValueMap out = null;
504+
MultiValueMap<Object, Object> out = null;
505505
List in = List.of(source());
506506
out.addAll(null, in);
507-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
507+
sink(getElement(getMapValue(out))); // $hasValueFlow
508508
}
509509
{
510510
// "org.springframework.util;MultiValueMap;true;addAll;(java.lang.Object,java.util.List);;Element of Argument[1];Element of MapValue of Argument[-1];value"
511-
MultiValueMap out = null;
511+
MultiValueMap<Object, Object> out = null;
512512
List in = List.of(source());
513513
out.addAll((Object)null, in);
514-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
514+
sink(getElement(getMapValue(out))); // $hasValueFlow
515515
}
516516
{
517517
// "org.springframework.util;MultiValueMap;true;addAll;(org.springframework.util.MultiValueMap);;Element of MapValue of Argument[0];Element of MapValue of Argument[-1];value"
518-
MultiValueMapAdapter out = null;
518+
MultiValueMapAdapter<Object, Object> out = null;
519519
MultiValueMap in = (MultiValueMap)Map.of(null, List.of(source()));
520520
out.addAll(in);
521-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
521+
sink(getElement(getMapValue(out))); // $hasValueFlow
522522
}
523523
{
524524
// "org.springframework.util;MultiValueMap;true;addAll;(org.springframework.util.MultiValueMap);;Element of MapValue of Argument[0];Element of MapValue of Argument[-1];value"
525-
MultiValueMap out = null;
525+
MultiValueMap<Object, Object> out = null;
526526
MultiValueMap in = (MultiValueMap)Map.of(null, List.of(source()));
527527
out.addAll(in);
528-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
528+
sink(getElement(getMapValue(out))); // $hasValueFlow
529529
}
530530
{
531531
// "org.springframework.util;MultiValueMap;true;addAll;;;Argument[0];MapKey of Argument[-1];value"
532-
MultiValueMapAdapter out = null;
532+
MultiValueMapAdapter<Object, Object> out = null;
533533
Object in = source();
534534
out.addAll(in, null);
535535
sink(getMapKey(out)); // $hasValueFlow
536536
}
537537
{
538538
// "org.springframework.util;MultiValueMap;true;addAll;;;Argument[0];MapKey of Argument[-1];value"
539-
MultiValueMap out = null;
539+
MultiValueMap<Object, Object> out = null;
540540
Object in = source();
541541
out.addAll(in, (List)null);
542542
sink(getMapKey(out)); // $hasValueFlow
543543
}
544544
{
545545
// "org.springframework.util;MultiValueMap;true;addAll;;;Argument[0];MapKey of Argument[-1];value"
546-
MultiValueMapAdapter out = null;
546+
MultiValueMapAdapter<Object, Object> out = null;
547547
MultiValueMap<Object, Object> mvm = null;
548548
mvm.set(source(), "someValue");
549549
out.addAll(mvm);
550550
sink(getMapKey(out)); // $hasValueFlow
551551
}
552552
{
553553
// "org.springframework.util;MultiValueMap;true;addAll;;;Argument[0];MapKey of Argument[-1];value"
554-
MultiValueMap out = null;
554+
MultiValueMap<Object, Object> out = null;
555555
MultiValueMap<Object, Object> mvm = null;
556556
mvm.set(source(), "someValue");
557557
out.addAll(mvm);
558558
sink(getMapKey(out)); // $hasValueFlow
559559
}
560560
{
561561
// "org.springframework.util;MultiValueMap;true;addIfAbsent;;;Argument[0];MapKey of Argument[-1];value"
562-
MultiValueMap out = null;
562+
MultiValueMap<Object, Object> out = null;
563563
Object in = source();
564564
out.addIfAbsent(in, null);
565565
sink(getMapKey(out)); // $hasValueFlow
566566
}
567567
{
568568
// "org.springframework.util;MultiValueMap;true;addIfAbsent;;;Argument[0];MapKey of Argument[-1];value"
569-
MultiValueMap out = null;
569+
MultiValueMap<Object, Object> out = null;
570570
Object in = source();
571571
out.addIfAbsent(in, (Object)null);
572572
sink(getMapKey(out)); // $hasValueFlow
573573
}
574574
{
575575
// "org.springframework.util;MultiValueMap;true;addIfAbsent;;;Argument[1];Element of MapValue of Argument[-1];value"
576-
MultiValueMap out = null;
576+
MultiValueMap<Object, Object> out = null;
577577
Object in = source();
578578
out.addIfAbsent(null, in);
579-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
579+
sink(getElement(getMapValue(out))); // $hasValueFlow
580580
}
581581
{
582582
// "org.springframework.util;MultiValueMap;true;addIfAbsent;;;Argument[1];Element of MapValue of Argument[-1];value"
583-
MultiValueMap out = null;
583+
MultiValueMap<Object, Object> out = null;
584584
Object in = source();
585585
out.addIfAbsent((Object)null, in);
586-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
586+
sink(getElement(getMapValue(out))); // $hasValueFlow
587587
}
588588
{
589589
// "org.springframework.util;MultiValueMap;true;getFirst;;;Element of MapValue of Argument[-1];ReturnValue;value"
@@ -608,73 +608,73 @@ public void test() throws Exception {
608608
}
609609
{
610610
// "org.springframework.util;MultiValueMap;true;set;;;Argument[0];MapKey of Argument[-1];value"
611-
MultiValueMapAdapter out = null;
611+
MultiValueMapAdapter<Object, Object> out = null;
612612
Object in = source();
613613
out.set(in, null);
614614
sink(getMapKey(out)); // $hasValueFlow
615615
}
616616
{
617617
// "org.springframework.util;MultiValueMap;true;set;;;Argument[0];MapKey of Argument[-1];value"
618-
MultiValueMap out = null;
618+
MultiValueMap<Object, Object> out = null;
619619
Object in = source();
620620
out.set(in, null);
621621
sink(getMapKey(out)); // $hasValueFlow
622622
}
623623
{
624624
// "org.springframework.util;MultiValueMap;true;set;;;Argument[0];MapKey of Argument[-1];value"
625-
MultiValueMap out = null;
625+
MultiValueMap<Object, Object> out = null;
626626
Object in = source();
627627
out.set(in, (Object)null);
628628
sink(getMapKey(out)); // $hasValueFlow
629629
}
630630
{
631631
// "org.springframework.util;MultiValueMap;true;set;;;Argument[1];Element of MapValue of Argument[-1];value"
632-
MultiValueMapAdapter out = null;
632+
MultiValueMapAdapter<Object, Object> out = null;
633633
Object in = source();
634634
out.set(null, in);
635-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
635+
sink(getElement(getMapValue(out))); // $hasValueFlow
636636
}
637637
{
638638
// "org.springframework.util;MultiValueMap;true;set;;;Argument[1];Element of MapValue of Argument[-1];value"
639-
MultiValueMap out = null;
639+
MultiValueMap<Object, Object> out = null;
640640
Object in = source();
641641
out.set(null, in);
642-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
642+
sink(getElement(getMapValue(out))); // $hasValueFlow
643643
}
644644
{
645645
// "org.springframework.util;MultiValueMap;true;set;;;Argument[1];Element of MapValue of Argument[-1];value"
646-
MultiValueMap out = null;
646+
MultiValueMap<Object, Object> out = null;
647647
Object in = source();
648648
out.set((Object)null, in);
649-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
649+
sink(getElement(getMapValue(out))); // $hasValueFlow
650650
}
651651
{
652652
// "org.springframework.util;MultiValueMap;true;setAll;;;MapKey of Argument[0];MapKey of Argument[-1];value"
653-
MultiValueMapAdapter out = null;
653+
MultiValueMapAdapter<Object, Object> out = null;
654654
Map in = Map.of(source(), null);
655655
out.setAll(in);
656656
sink(getMapKey(out)); // $hasValueFlow
657657
}
658658
{
659659
// "org.springframework.util;MultiValueMap;true;setAll;;;MapKey of Argument[0];MapKey of Argument[-1];value"
660-
MultiValueMap out = null;
660+
MultiValueMap<Object, Object> out = null;
661661
Map in = Map.of(source(), null);
662662
out.setAll(in);
663663
sink(getMapKey(out)); // $hasValueFlow
664664
}
665665
{
666666
// "org.springframework.util;MultiValueMap;true;setAll;;;MapValue of Argument[0];Element of MapValue of Argument[-1];value"
667-
MultiValueMapAdapter out = null;
667+
MultiValueMapAdapter<Object, Object> out = null;
668668
Map in = Map.of(null, source());
669669
out.setAll(in);
670-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
670+
sink(getElement(getMapValue(out))); // $hasValueFlow
671671
}
672672
{
673673
// "org.springframework.util;MultiValueMap;true;setAll;;;MapValue of Argument[0];Element of MapValue of Argument[-1];value"
674-
MultiValueMap out = null;
674+
MultiValueMap<Object, Object> out = null;
675675
Map in = Map.of(null, source());
676676
out.setAll(in);
677-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
677+
sink(getElement(getMapValue(out))); // $hasValueFlow
678678
}
679679
{
680680
// "org.springframework.util;MultiValueMap;true;toSingleValueMap;;;Element of MapValue of Argument[-1];MapValue of ReturnValue;value"
@@ -706,14 +706,14 @@ public void test() throws Exception {
706706
}
707707
{
708708
// "org.springframework.util;MultiValueMapAdapter;false;MultiValueMapAdapter;;;Element of MapValue of Argument[0];Element of MapValue of Argument[-1];value"
709-
MultiValueMapAdapter out = null;
709+
MultiValueMapAdapter<Object, Object> out = null;
710710
Map in = Map.of(null, List.of(source()));
711711
out = new MultiValueMapAdapter(in);
712-
sink(getElement((List)getMapValue(out))); // $hasValueFlow
712+
sink(getElement(getMapValue(out))); // $hasValueFlow
713713
}
714714
{
715715
// "org.springframework.util;MultiValueMapAdapter;false;MultiValueMapAdapter;;;MapKey of Argument[0];MapKey of Argument[-1];value"
716-
MultiValueMapAdapter out = null;
716+
MultiValueMapAdapter<Object, Object> out = null;
717717
Map in = Map.of(source(), null);
718718
out = new MultiValueMapAdapter(in);
719719
sink(getMapKey(out)); // $hasValueFlow

0 commit comments

Comments
 (0)