@@ -32,20 +32,54 @@ public class Test {
32
32
Object source () { return null ; }
33
33
void sink (Object o ) { }
34
34
35
+ class MyAbstractKeyValue <K , V > extends AbstractKeyValue <K , V > {
36
+ MyAbstractKeyValue (K key , V value ) {
37
+ super (key , value );
38
+ }
39
+
40
+ K mySetKey (final K key ) {
41
+ return super .setKey (key );
42
+ }
43
+
44
+ V mySetValue (final V value ) {
45
+ return super .setValue (value );
46
+ }
47
+ }
48
+
49
+ class MyAbstractMapEntry <K , V > extends AbstractMapEntry <K , V > {
50
+ MyAbstractMapEntry (final K key , final V value ) {
51
+ super (key , value );
52
+ }
53
+ @ Override
54
+ public K getKey () { return null ; }
55
+ @ Override
56
+ public V getValue () { return null ; }
57
+ }
58
+
59
+ class MyAbstractMapEntryDecorator <K , V > extends AbstractMapEntryDecorator <K , V > {
60
+ MyAbstractMapEntryDecorator (final Map .Entry <K , V > entry ) {
61
+ super (entry );
62
+ }
63
+
64
+ Map .Entry <K , V > myGetMapEntry () {
65
+ return super .getMapEntry ();
66
+ }
67
+ }
68
+
35
69
public void test () {
36
70
37
71
{
38
72
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[0];MapKey of Argument[-1];value"
39
73
AbstractKeyValue out = null ;
40
74
Object in = (Object )source ();
41
- out = new AbstractKeyValue (in , null );
75
+ out = new MyAbstractKeyValue (in , null );
42
76
sink (getMapKey (out )); // $hasValueFlow
43
77
}
44
78
{
45
79
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[1];MapValue of Argument[-1];value"
46
80
AbstractKeyValue out = null ;
47
81
Object in = (Object )source ();
48
- out = new AbstractKeyValue (null , in );
82
+ out = new MyAbstractKeyValue (null , in );
49
83
sink (getMapValue (out )); // $hasValueFlow
50
84
}
51
85
{
@@ -57,9 +91,9 @@ public void test() {
57
91
}
58
92
{
59
93
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value"
60
- AbstractKeyValue out = null ;
94
+ MyAbstractKeyValue out = null ;
61
95
Object in = (Object )source ();
62
- out .setKey (in );
96
+ out .mySetKey (in );
63
97
sink (getMapKey (out )); // $hasValueFlow
64
98
}
65
99
{
@@ -72,15 +106,15 @@ public void test() {
72
106
{
73
107
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value"
74
108
Object out = null ;
75
- AbstractKeyValue in = (AbstractKeyValue )newWithMapValue (source ());
76
- out = in .setKey (null );
109
+ MyAbstractKeyValue in = (MyAbstractKeyValue )newWithMapValue (source ());
110
+ out = in .mySetKey (null );
77
111
sink (out ); // $hasValueFlow
78
112
}
79
113
{
80
114
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value"
81
115
Object out = null ;
82
- AbstractKeyValue in = (AbstractKeyValue )newWithMapValue (source ());
83
- out = in .setKey ((Object )null );
116
+ MyAbstractKeyValue in = (MyAbstractKeyValue )newWithMapValue (source ());
117
+ out = in .mySetKey ((Object )null );
84
118
sink (out ); // $hasValueFlow
85
119
}
86
120
{
@@ -106,9 +140,9 @@ public void test() {
106
140
}
107
141
{
108
142
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value"
109
- AbstractKeyValue out = null ;
143
+ MyAbstractKeyValue out = null ;
110
144
Object in = (Object )source ();
111
- out .setValue (in );
145
+ out .mySetValue (in );
112
146
sink (getMapValue (out )); // $hasValueFlow
113
147
}
114
148
{
@@ -128,112 +162,112 @@ public void test() {
128
162
{
129
163
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value"
130
164
Object out = null ;
131
- AbstractMapEntry in = (AbstractMapEntry )newWithMapValue (source ());
165
+ AbstractMapEntry in = (MyAbstractMapEntry )newWithMapValue (source ());
132
166
out = in .setValue (null );
133
167
sink (out ); // $hasValueFlow
134
168
}
135
169
{
136
170
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value"
137
171
Object out = null ;
138
- AbstractMapEntry in = (AbstractMapEntry )newWithMapValue (source ());
172
+ AbstractMapEntry in = (MyAbstractMapEntry )newWithMapValue (source ());
139
173
out = in .setValue ((Object )null );
140
174
sink (out ); // $hasValueFlow
141
175
}
142
176
{
143
177
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value"
144
178
Object out = null ;
145
- AbstractKeyValue in = (AbstractKeyValue )newWithMapValue (source ());
146
- out = in .setValue (null );
179
+ MyAbstractKeyValue in = (MyAbstractKeyValue )newWithMapValue (source ());
180
+ out = in .mySetValue (null );
147
181
sink (out ); // $hasValueFlow
148
182
}
149
183
{
150
184
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value"
151
185
Object out = null ;
152
- AbstractKeyValue in = (AbstractKeyValue )newWithMapValue (source ());
153
- out = in .setValue ((Object )null );
186
+ MyAbstractKeyValue in = (MyAbstractKeyValue )newWithMapValue (source ());
187
+ out = in .mySetValue ((Object )null );
154
188
sink (out ); // $hasValueFlow
155
189
}
156
190
{
157
191
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint"
158
192
String out = null ;
159
- AbstractKeyValue in = (AbstractKeyValue )newWithMapKey (source ());
193
+ AbstractKeyValue in = (MyAbstractKeyValue )newWithMapKey (source ());
160
194
out = in .toString ();
161
195
sink (out ); // $hasTaintFlow
162
196
}
163
197
{
164
198
// "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint"
165
199
String out = null ;
166
- AbstractKeyValue in = (AbstractKeyValue )newWithMapValue (source ());
200
+ AbstractKeyValue in = (MyAbstractKeyValue )newWithMapValue (source ());
167
201
out = in .toString ();
168
202
sink (out ); // $hasTaintFlow
169
203
}
170
204
{
171
205
// "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value"
172
206
AbstractMapEntry out = null ;
173
207
Object in = (Object )source ();
174
- out = new AbstractMapEntry (in , null );
208
+ out = new MyAbstractMapEntry (in , null );
175
209
sink (getMapKey (out )); // $hasValueFlow
176
210
}
177
211
{
178
212
// "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value"
179
213
AbstractMapEntry out = null ;
180
214
Object in = (Object )source ();
181
- out = new AbstractMapEntry (null , in );
215
+ out = new MyAbstractMapEntry (null , in );
182
216
sink (getMapValue (out )); // $hasValueFlow
183
217
}
184
218
{
185
219
// "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value"
186
220
AbstractMapEntryDecorator out = null ;
187
- Map <> .Entry in = (Map <> .Entry )newWithMapKey (source ());
188
- out = new AbstractMapEntryDecorator (in );
221
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapKey (source ());
222
+ out = new MyAbstractMapEntryDecorator (in );
189
223
sink (getMapKey (out )); // $hasValueFlow
190
224
}
191
225
{
192
226
// "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value"
193
227
AbstractMapEntryDecorator out = null ;
194
- Map <> .Entry in = (Map <> .Entry )newWithMapValue (source ());
195
- out = new AbstractMapEntryDecorator (in );
228
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapValue (source ());
229
+ out = new MyAbstractMapEntryDecorator (in );
196
230
sink (getMapValue (out )); // $hasValueFlow
197
231
}
198
232
{
199
233
// "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value"
200
- Map <> .Entry out = null ;
201
- AbstractMapEntryDecorator in = (AbstractMapEntryDecorator )newWithMapKey (source ());
202
- out = in .getMapEntry ();
234
+ Map .Entry < String , String > out = null ;
235
+ MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator )newWithMapKey (source ());
236
+ out = in .myGetMapEntry ();
203
237
sink (getMapKey (out )); // $hasValueFlow
204
238
}
205
239
{
206
240
// "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value"
207
- Map <> .Entry out = null ;
208
- AbstractMapEntryDecorator in = (AbstractMapEntryDecorator )newWithMapValue (source ());
209
- out = in .getMapEntry ();
241
+ Map .Entry < String , String > out = null ;
242
+ MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator )newWithMapValue (source ());
243
+ out = in .myGetMapEntry ();
210
244
sink (getMapValue (out )); // $hasValueFlow
211
245
}
212
246
{
213
247
// "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint"
214
248
String out = null ;
215
- AbstractMapEntryDecorator in = (AbstractMapEntryDecorator )newWithMapKey (source ());
249
+ AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator )newWithMapKey (source ());
216
250
out = in .toString ();
217
251
sink (out ); // $hasTaintFlow
218
252
}
219
253
{
220
254
// "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint"
221
255
String out = null ;
222
- AbstractMapEntryDecorator in = (AbstractMapEntryDecorator )newWithMapValue (source ());
256
+ AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator )newWithMapValue (source ());
223
257
out = in .toString ();
224
258
sink (out ); // $hasTaintFlow
225
259
}
226
260
{
227
261
// "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value"
228
262
DefaultKeyValue out = null ;
229
- Map <> .Entry in = (Map <> .Entry )newWithMapKey (source ());
263
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapKey (source ());
230
264
out = new DefaultKeyValue (in );
231
265
sink (getMapKey (out )); // $hasValueFlow
232
266
}
233
267
{
234
268
// "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value"
235
269
DefaultKeyValue out = null ;
236
- Map <> .Entry in = (Map <> .Entry )newWithMapValue (source ());
270
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapValue (source ());
237
271
out = new DefaultKeyValue (in );
238
272
sink (getMapValue (out )); // $hasValueFlow
239
273
}
@@ -267,29 +301,29 @@ public void test() {
267
301
}
268
302
{
269
303
// "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value"
270
- Map <> .Entry out = null ;
304
+ Map .Entry < String , String > out = null ;
271
305
DefaultKeyValue in = (DefaultKeyValue )newWithMapKey (source ());
272
306
out = in .toMapEntry ();
273
307
sink (getMapKey (out )); // $hasValueFlow
274
308
}
275
309
{
276
310
// "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value"
277
- Map <> .Entry out = null ;
311
+ Map .Entry < String , String > out = null ;
278
312
DefaultKeyValue in = (DefaultKeyValue )newWithMapValue (source ());
279
313
out = in .toMapEntry ();
280
314
sink (getMapValue (out )); // $hasValueFlow
281
315
}
282
316
{
283
317
// "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value"
284
318
DefaultMapEntry out = null ;
285
- Map <> .Entry in = (Map <> .Entry )newWithMapKey (source ());
319
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapKey (source ());
286
320
out = new DefaultMapEntry (in );
287
321
sink (getMapKey (out )); // $hasValueFlow
288
322
}
289
323
{
290
324
// "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value"
291
325
DefaultMapEntry out = null ;
292
- Map <> .Entry in = (Map <> .Entry )newWithMapValue (source ());
326
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapValue (source ());
293
327
out = new DefaultMapEntry (in );
294
328
sink (getMapValue (out )); // $hasValueFlow
295
329
}
@@ -338,14 +372,14 @@ public void test() {
338
372
{
339
373
// "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value"
340
374
UnmodifiableMapEntry out = null ;
341
- Map <> .Entry in = (Map <> .Entry )newWithMapKey (source ());
375
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapKey (source ());
342
376
out = new UnmodifiableMapEntry (in );
343
377
sink (getMapKey (out )); // $hasValueFlow
344
378
}
345
379
{
346
380
// "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value"
347
381
UnmodifiableMapEntry out = null ;
348
- Map <> .Entry in = (Map <> .Entry )newWithMapValue (source ());
382
+ Map .Entry < String , String > in = (Map .Entry < String , String > )newWithMapValue (source ());
349
383
out = new UnmodifiableMapEntry (in );
350
384
sink (getMapValue (out )); // $hasValueFlow
351
385
}
@@ -394,14 +428,14 @@ public void test() {
394
428
{
395
429
// "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value"
396
430
Object out = null ;
397
- AbstractMapEntryDecorator in = (AbstractMapEntryDecorator )newWithMapKey (source ());
431
+ AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator )newWithMapKey (source ());
398
432
out = in .getKey ();
399
433
sink (out ); // $hasValueFlow
400
434
}
401
435
{
402
436
// "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value"
403
437
Object out = null ;
404
- AbstractKeyValue in = (AbstractKeyValue )newWithMapKey (source ());
438
+ AbstractKeyValue in = (MyAbstractKeyValue )newWithMapKey (source ());
405
439
out = in .getKey ();
406
440
sink (out ); // $hasValueFlow
407
441
}
@@ -422,14 +456,14 @@ public void test() {
422
456
{
423
457
// "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value"
424
458
Object out = null ;
425
- AbstractMapEntryDecorator in = (AbstractMapEntryDecorator )newWithMapValue (source ());
459
+ AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator )newWithMapValue (source ());
426
460
out = in .getValue ();
427
461
sink (out ); // $hasValueFlow
428
462
}
429
463
{
430
464
// "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value"
431
465
Object out = null ;
432
- AbstractKeyValue in = (AbstractKeyValue )newWithMapValue (source ());
466
+ AbstractKeyValue in = (MyAbstractKeyValue )newWithMapValue (source ());
433
467
out = in .getValue ();
434
468
sink (out ); // $hasValueFlow
435
469
}
@@ -693,10 +727,12 @@ public void test() {
693
727
sink (getMapValue (out )); // $hasValueFlow
694
728
}
695
729
{
730
+ // Note it is tricky to get this to compile - the compiler thinks it is ambiguous
731
+ // which overload it should choose unless you put the generic types in correctly
696
732
// "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value"
697
- MultiMap out = null ;
698
- Iterable in = (Iterable )newWithElement (source ());
699
- MapUtils .populateMap (out , in , (Transformer )null );
733
+ MultiMap < Integer , String > out = null ;
734
+ Iterable < String > in = (Iterable < String > )newWithElement (source ());
735
+ MapUtils .populateMap (out , in , (Transformer < String , Integer > )null );
700
736
sink (getMapValue (out )); // $hasValueFlow
701
737
}
702
738
{
0 commit comments