Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3901990a9aa915cddadc42fae7811011cabbdc39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
/*******************************************************************************
 * Copyright (c) 2001, 2017 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
 *     						bug 185682 - Increment/decrement operators mark local variables as read
 *     						bug 328281 - visibility leaks not detected when analyzing unused field in private class
 *							Bug 410218 - Optional warning for arguments of "unexpected" types to Map#get(Object), Collection#remove(Object) et al.
 *******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;

import junit.framework.Test;

/* Collects potential programming problems tests that are not segregated in a
 * dedicated test class (aka NullReferenceTest). */
@SuppressWarnings({ "unchecked", "rawtypes" })
public class ProgrammingProblemsTest extends AbstractRegressionTest {

public ProgrammingProblemsTest(String name) {
    super(name);
}

	// Static initializer to specify tests subset using TESTS_* static variables
  	// All specified tests which does not belong to the class are skipped...
  	// Only the highest compliance level is run; add the VM argument
  	// -Dcompliance=1.4 (for example) to lower it if needed
  	static {
//    	TESTS_NAMES = new String[] { "test0055" };
//		TESTS_NUMBERS = new int[] { 56 };
//  	TESTS_RANGE = new int[] { 1, -1 };
  	}

public static Test suite() {
    return buildAllCompliancesTestSuite(testClass());
}

public static Class testClass() {
    return ProgrammingProblemsTest.class;
}
protected Map getCompilerOptions() {
	Map compilerOptions = super.getCompilerOptions();
	compilerOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal,  CompilerOptions.OPTIMIZE_OUT);
	return compilerOptions;
}
void runTest(
		String[] testFiles,
		String[] errorOptions,
		String[] warningOptions,
		String[] ignoreOptions,
		boolean expectingCompilerErrors,
		String expectedCompilerLog,
		String expectedOutputString,
		boolean forceExecution,
		String[] classLib,
		boolean shouldFlushOutputDirectory,
		String[] vmArguments,
		Map customOptions,
		ICompilerRequestor clientRequestor,
		boolean skipJavac) {
	Map compilerOptions = customOptions;
	if (errorOptions != null || warningOptions != null ||
			ignoreOptions != null) {
		if (compilerOptions == null) {
			compilerOptions = new HashMap();
		}
		if (errorOptions != null) {
		    for (int i = 0; i < errorOptions.length; i++) {
		    	compilerOptions.put(errorOptions[i], CompilerOptions.ERROR);
		    }
		}
		if (warningOptions != null) {
		    for (int i = 0; i < warningOptions.length; i++) {
		    	compilerOptions.put(warningOptions[i], CompilerOptions.WARNING);
		    }
		}
		if (ignoreOptions != null) {
		    for (int i = 0; i < ignoreOptions.length; i++) {
		    	compilerOptions.put(ignoreOptions[i], CompilerOptions.IGNORE);
		    }
		}
	}
	runTest(testFiles,
		expectingCompilerErrors,
		expectedCompilerLog,
		expectedOutputString,
		"" /* expectedErrorString */,
		forceExecution,
		classLib,
		shouldFlushOutputDirectory,
		vmArguments,
		compilerOptions,
		clientRequestor,
		skipJavac);
}

// default behavior upon unread parameters
public void test0001_unread_parameters() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo(boolean b) {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		false /* skipJavac */);
}

// reporting unread paramaters as warning
public void test0002_unread_parameters() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo(boolean b) {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 2)\n" +
		"	public void foo(boolean b) {\n" +
		"	                        ^\n" +
		"The value of the parameter b is not used\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unread parameters using the Javadoc
// @param disables by default
public void test0003_unread_parameters() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"/** @param b mute warning **/\n" +
			"  public void foo(boolean b) {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unread parameters using the Javadoc
// @param disabling can be disabled
public void test0004_unread_parameters() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterIncludeDocCommentReference,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"/** @param b mute warning **/\n" +
			"  public void foo(boolean b) {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 3)\n" +
		"	public void foo(boolean b) {\n" +
		"	                        ^\n" +
		"The value of the parameter b is not used\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unread parameters using SuppressWarnings
public void test0005_unread_parameters() {
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
		runTest(
			new String[] {
				"X.java",
				"public class X {\n" +
				"@SuppressWarnings(\"unused\")\n" + // most specific token
				"  public void foo(boolean b) {\n" +
				"  }\n" +
				"@SuppressWarnings(\"all\")\n" + // least specific token
				"  public void foo(int i) {\n" +
				"  }\n" +
				"}\n"
				},
			null /* errorOptions */,
			new String[] {
				CompilerOptions.OPTION_ReportUnusedParameter
				} /* warningOptions */,
			null /* ignoreOptions */,
			false /* expectingCompilerErrors */,
			"" /* expectedCompilerLog */,
			"" /* expectedOutputString */,
			false /* forceExecution */,
			null /* classLib */,
			true /* shouldFlushOutputDirectory */,
			null /* vmArguments */,
			null /* customOptions */,
			null /* clientRequestor */,
			true /* skipJavac */);
	}
}

// reporting unread paramaters as error
public void test0006_unread_parameters() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo(boolean b) {\n" +
			"  }\n" +
			"}\n"
			},
		new String[] {
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		true /* expectingCompilerErrors */,
		"----------\n" +
		"1. ERROR in X.java (at line 2)\n" +
		"	public void foo(boolean b) {\n" +
		"	                        ^\n" +
		"The value of the parameter b is not used\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// default behavior upon unnecessary declaration of thrown checked exceptions
public void test0007_declared_thrown_checked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"  public void foo() throws IOException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		false /* skipJavac */);
}

// reporting unnecessary declaration of thrown checked exceptions as warning
public void test0008_declared_thrown_checked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"  public void foo() throws IOException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 3)\n" +
		"	public void foo() throws IOException {\n" +
		"	                         ^^^^^^^^^^^\n" +
		"The declared exception IOException is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unnecessary declaration of thrown checked
// exceptions using the Javadoc
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73244
// @throws disables by default
public void test0009_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"/** @throws IOException mute warning **/\n" +
			"  public void foo() throws IOException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unnecessary declaration of thrown checked
// exceptions using the Javadoc
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73244
// @throws disabling can be disabled
public void test0010_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"/** @throws IOException mute warning **/\n" +
			"  public void foo() throws IOException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 4)\n" +
		"	public void foo() throws IOException {\n" +
		"	                         ^^^^^^^^^^^\n" +
		"The declared exception IOException is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unnecessary declaration of thrown checked
// exceptions using SuppressWarnings
public void test0011_declared_thrown_checked_exceptions() {
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
		runTest(
			new String[] {
				"X.java",
				"import java.io.IOException;\n" +
				"public class X {\n" +
				"@SuppressWarnings(\"all\")\n" + // no specific token
				"  public void foo() throws IOException {\n" +
				"  }\n" +
				"}\n"
				},
			null /* errorOptions */,
			new String[] {
				CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
				} /* warningOptions */,
			null /* ignoreOptions */,
			false /* expectingCompilerErrors */,
			"" /* expectedCompilerLog */,
			"" /* expectedOutputString */,
			false /* forceExecution */,
			null /* classLib */,
			true /* shouldFlushOutputDirectory */,
			null /* vmArguments */,
			null /* customOptions */,
			null /* clientRequestor */,
			true /* skipJavac */);
	}
}

// reporting unnecessary declaration of thrown checked exceptions as error
public void test0012_declared_thrown_checked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"  public void foo() throws IOException {\n" +
			"  }\n" +
			"}\n"
			},
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		true /* expectingCompilerErrors */,
		"----------\n" +
		"1. ERROR in X.java (at line 3)\n" +
		"	public void foo() throws IOException {\n" +
		"	                         ^^^^^^^^^^^\n" +
		"The declared exception IOException is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// disabling the reporting of unnecessary declaration of thrown checked
// exceptions using the Javadoc
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73244
// @throws disables by default, but only exact matches work
public void test0013_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"import java.io.EOFException;\n" +
			"public class X {\n" +
			"/** @throws EOFException does not mute warning for IOException **/\n" +
			"  public void foo() throws IOException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 5)\n" +
		"	public void foo() throws IOException {\n" +
		"	                         ^^^^^^^^^^^\n" +
		"The declared exception IOException is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// interaction between errors and warnings
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203721
public void test0014_declared_thrown_checked_exceptions_unread_parameters() {
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"  void foo(int unused) throws IOException {}\n" +
			"}\n"
			},
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* warningOptions */,
		null /* ignoreOptions */,
		true /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 3)\n" +
		"	void foo(int unused) throws IOException {}\n" +
		"	             ^^^^^^\n" +
		"The value of the parameter unused is not used\n" +
		"----------\n" +
		"2. ERROR in X.java (at line 3)\n" +
		"	void foo(int unused) throws IOException {}\n" +
		"	                            ^^^^^^^^^^^\n" +
		"The declared exception IOException is not actually thrown by the method foo(int) from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// interaction between errors and warnings
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203721
// variant: both warnings show up
public void test0015_declared_thrown_checked_exceptions_unread_parameters() {
	runTest(
		new String[] {
			"X.java",
			"import java.io.IOException;\n" +
			"public class X {\n" +
			"  void foo(int unused) throws IOException {}\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException,
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 3)\n" +
		"	void foo(int unused) throws IOException {}\n" +
		"	             ^^^^^^\n" +
		"The value of the parameter unused is not used\n" +
		"----------\n" +
		"2. WARNING in X.java (at line 3)\n" +
		"	void foo(int unused) throws IOException {}\n" +
		"	                            ^^^^^^^^^^^\n" +
		"The declared exception IOException is not actually thrown by the method foo(int) from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// reporting unread paramaters as error on a constructor
public void test0016_unread_parameters_constructor() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public X(boolean b) {\n" +
			"  }\n" +
			"}\n"
			},
		new String[] {
			CompilerOptions.OPTION_ReportUnusedParameter
			} /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		true /* expectingCompilerErrors */,
		"----------\n" +
		"1. ERROR in X.java (at line 2)\n" +
		"	public X(boolean b) {\n" +
		"	                 ^\n" +
		"The value of the parameter b is not used\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208001
public void test0017_shadowing_package_visible_methods() {
	runTest(
		new String[] {
			"p/X.java",
			"package p;\n" +
			"public class X {\n" +
			"  void foo() {\n" +
			"  }\n" +
			"}\n",
			"q/Y.java",
			"package q;\n" +
			"public class Y extends p.X {\n" +
			"  void foo() {\n" +
			"  }\n" +
			"}\n",
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in q\\Y.java (at line 3)\n" +
		"	void foo() {\n" +
		"	     ^^^^^\n" +
		"The method Y.foo() does not override the inherited method from X since it is private to a different package\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		new ICompilerRequestor() {
			public void acceptResult(CompilationResult result) {
				if (result.compilationUnit.getFileName()[0] == 'Y') {
					assertEquals("unexpected problems count", 1, result.problemCount);
					assertEquals("unexpected category", CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT, result.problems[0].getCategoryID());
				}
			}
		} /* clientRequestor */,
		true /* skipJavac */);
}
// default behavior upon unnecessary declaration of thrown unchecked exceptions
public void test0018_declared_thrown_unchecked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws ArithmeticException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// default behavior upon unnecessary declaration of thrown unchecked exceptions
public void test0019_declared_thrown_unchecked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws RuntimeException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// default behavior upon unnecessary declaration of Exception
public void test0020_declared_thrown_checked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// default behavior upon unnecessary declaration of Throwable
public void test0021_declared_thrown_checked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Throwable {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}

// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning
public void test0022_declared_thrown_unchecked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws ArithmeticException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// the external API uses another string literal - had it wrong in first attempt
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions, using Exception instead
public void test0023_declared_thrown_unchecked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 2)\n" +
		"	public void foo() throws Exception {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Exception is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning
public void test0024_declared_thrown_unchecked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws RuntimeException {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// focused on Exception and Throwable, which are not unchecked but can catch
// unchecked exceptions
public void test0025_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 2)\n" +
		"	public void foo() throws Exception {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Exception is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// focused on Exception and Throwable, which are not unchecked but can catch
// unchecked exceptions
public void test0026_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Throwable {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 2)\n" +
		"	public void foo() throws Throwable {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Throwable is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// disabling the reporting of unnecessary declaration of thrown unchecked
// exceptions using the Javadoc
// @throws disables by default
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions, using Exception instead
public void test0027_declared_thrown_unchecked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"/** @throws Exception mute warning **/\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// disabling the reporting of unnecessary declaration of thrown unchecked
// exceptions using the Javadoc
// @throws disabling can be disabled
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions, using Exception instead
public void test0028_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference,
			CompilerOptions.DISABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"/** @throws Exception mute warning **/\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 3)\n" +
		"	public void foo() throws Exception {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Exception is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// disabling the reporting of unnecessary declaration of thrown unchecked
// exceptions using SuppressWarnings
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions, using Exception instead
public void test0029_declared_thrown_checked_exceptions() {
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
		Map customOptions = new HashMap();
		customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
				CompilerOptions.DISABLED);
		runTest(
			new String[] {
				"X.java",
				"public class X {\n" +
				"@SuppressWarnings(\"all\")\n" + // no specific token
				"  public void foo() throws Exception {\n" +
				"  }\n" +
				"}\n"
				},
			null /* errorOptions */,
			new String[] {
				CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
				} /* warningOptions */,
			null /* ignoreOptions */,
			false /* expectingCompilerErrors */,
			"" /* expectedCompilerLog */,
			"" /* expectedOutputString */,
			false /* forceExecution */,
			null /* classLib */,
			true /* shouldFlushOutputDirectory */,
			null /* vmArguments */,
			customOptions,
			null /* clientRequestor */,
			true /* skipJavac */);
	}
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as error
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the error for unchecked exceptions, using Exception instead
public void test0030_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* errorOptions */,
		null /* warningOptions */,
		null /* ignoreOptions */,
		true /* expectingCompilerErrors */,
		"----------\n" +
		"1. ERROR in X.java (at line 2)\n" +
		"	public void foo() throws Exception {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Exception is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// disabling the reporting of unnecessary declaration of thrown unchecked
// exceptions using the Javadoc
// @throws disables by default, but only exact matches work
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions, using Exception instead
public void test0031_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_DocCommentSupport,
			CompilerOptions.ENABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"/** @throws Throwable does not mute warning for Exception **/\n" +
			"  public void foo() throws Exception {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 3)\n" +
		"	public void foo() throws Exception {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Exception is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions
public void test0032_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Error {\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
// suppressed the warning for unchecked exceptions, using Exception instead
public void test0033_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public void foo() throws Exception {\n" +
			"    if (bar()) {\n" +
			"      throw new Exception();\n" +
			"    }\n" +
			"  }\n" +
			"  boolean bar() {\n" +
			"    return true;\n" +
			"  }\n" +
			"}\n"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=216897
// reporting unnecessary declaration of thrown unchecked exceptions as warning
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
public void test0034_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public static final class MyError extends Error {\n" +
			"    private static final long serialVersionUID = 1L;\n" +
			"  }\n" +
			"  public void foo() throws Throwable {\n" +
			"    try {\n" +
			"      bar();\n" +
			"    } catch (MyError e) {\n" +
			"    }\n" +
			"  }\n" +
			"  private void bar() {}\n" +
			"}"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"----------\n" +
		"1. WARNING in X.java (at line 5)\n" +
		"	public void foo() throws Throwable {\n" +
		"	                         ^^^^^^^^^\n" +
		"The declared exception Throwable is not actually thrown by the method foo() from type X\n" +
		"----------\n" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
public void test0035_declared_thrown_checked_exceptions() {
	Map customOptions = new HashMap();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
			CompilerOptions.DISABLED);
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public static final class MyError extends Error {\n" +
			"    private static final long serialVersionUID = 1L;\n" +
			"  }\n" +
			"  public void foo() throws Throwable {\n" +
			"    throw new MyError();\n" +
			"  }\n" +
			"}"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		customOptions,
		null /* clientRequestor */,
		true /* skipJavac */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=219461
public void test0036_declared_thrown_checked_exceptions() {
	runTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"  public static class E1 extends Exception {\n" +
			"    private static final long serialVersionUID = 1L;\n" +
			"  }\n" +
			"  public static class E2 extends E1 {\n" +
			"    private static final long serialVersionUID = 1L;\n" +
			"  }\n" +
			"  public void foo() throws E1 {\n" +
			"    throw new E2();\n" +
			"  }\n" +
			"}"
			},
		null /* errorOptions */,
		new String[] {
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException
			} /* warningOptions */,
		null /* ignoreOptions */,
		false /* expectingCompilerErrors */,
		"" /* expectedCompilerLog */,
		"" /* expectedOutputString */,
		false /* forceExecution */,
		null /* classLib */,
		true /* shouldFlushOutputDirectory */,
		null /* vmArguments */,
		null /* customOptions */,
		null /* clientRequestor */,
		true /* skipJavac */);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=115814
public void test0037() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		boolean b1 = args == args;\n" +
			"		boolean b2 = args != args;\n" +
			"		boolean b3 = b1 == b1;\n" +
			"		boolean b4 = b1 != b1;\n" +
			"		boolean b5 = b1 && b1;\n" +
			"		boolean b6 = b1 || b1;\n" +
			"		\n" +
			"		boolean b7 = foo() == foo();\n" +
			"		boolean b8 = foo() != foo();\n" +
			"		boolean b9 = foo() && foo();\n" +
			"		boolean b10 = foo() || foo();\n" +
			"	}\n" +
			"	static boolean foo() { return true; }\n" +
			"	Zork z;\n" +
			"}\n"
			},
			"----------\n" +
			"1. WARNING in X.java (at line 3)\n" +
			"	boolean b1 = args == args;\n" +
			"	             ^^^^^^^^^^^^\n" +
			"Comparing identical expressions\n" +
			"----------\n" +
			"2. WARNING in X.java (at line 4)\n" +
			"	boolean b2 = args != args;\n" +
			"	             ^^^^^^^^^^^^\n" +
			"Comparing identical expressions\n" +
			"----------\n" +
			"3. WARNING in X.java (at line 5)\n" +
			"	boolean b3 = b1 == b1;\n" +
			"	             ^^^^^^^^\n" +
			"Comparing identical expressions\n" +
			"----------\n" +
			"4. WARNING in X.java (at line 6)\n" +
			"	boolean b4 = b1 != b1;\n" +
			"	             ^^^^^^^^\n" +
			"Comparing identical expressions\n" +
			"----------\n" +
			"5. WARNING in X.java (at line 7)\n" +
			"	boolean b5 = b1 && b1;\n" +
			"	             ^^^^^^^^\n" +
			"Comparing identical expressions\n" +
			"----------\n" +
			"6. WARNING in X.java (at line 8)\n" +
			"	boolean b6 = b1 || b1;\n" +
			"	             ^^^^^^^^\n" +
			"Comparing identical expressions\n" +
			"----------\n" +
			"7. ERROR in X.java (at line 16)\n" +
			"	Zork z;\n" +
			"	^^^^\n" +
			"Zork cannot be resolved to a type\n" +
			"----------\n");
}

/**
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=276740"
 */
public void test0038() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		boolean b1 = 1 == 1;\n" +
			"		boolean b2 = 1 != 1;\n" +
			"		boolean b3 = 1 == 1.0;\n" +
			"		boolean b4 = 1 != 1.0;\n" +
			"		boolean b5 = 1 == 2;\n" +
			"		boolean b6 = 1 != 2;\n" +
			"		boolean b7 = 1 == 2.0;\n" +
			"		boolean b8 = 1 != 2.0;\n" +
			"       final short s1 = 1;\n" +
			"       final short s2 = 2;\n" +
			"       boolean b9 = 1 == s1;\n" +
			"       boolean b10 = 1 == s2;\n" +
			"       boolean b91 = 1 != s1;\n" +
			"       boolean b101 = 1 != s2;\n" +
			"       final long l1 = 1;\n" +
			"       final long l2 = 2;\n" +
			"       boolean b11 = 1 == l1;\n" +
			"       boolean b12 = 1 == l2;\n" +
			"       boolean b111 = 1 != l1;\n" +
			"       boolean b121 = 1 != l2;\n" +
			"       boolean b13 = s1 == l1;\n" +
			"       boolean b14 = s1 == l2;\n" +
			"       boolean b15 = s1 != l1;\n" +
			"       boolean b16 = s1 != l2;\n" +
			"	}\n" +
			"	Zork z;\n" +
			"}\n"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	boolean b1 = 1 == 1;\n" + 
			"	             ^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 4)\n" + 
			"	boolean b2 = 1 != 1;\n" + 
			"	             ^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"3. WARNING in X.java (at line 5)\n" + 
			"	boolean b3 = 1 == 1.0;\n" + 
			"	             ^^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"4. WARNING in X.java (at line 6)\n" + 
			"	boolean b4 = 1 != 1.0;\n" + 
			"	             ^^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"5. WARNING in X.java (at line 13)\n" + 
			"	boolean b9 = 1 == s1;\n" + 
			"	             ^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"6. WARNING in X.java (at line 15)\n" + 
			"	boolean b91 = 1 != s1;\n" + 
			"	              ^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"7. WARNING in X.java (at line 19)\n" + 
			"	boolean b11 = 1 == l1;\n" + 
			"	              ^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"8. WARNING in X.java (at line 21)\n" + 
			"	boolean b111 = 1 != l1;\n" + 
			"	               ^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"9. WARNING in X.java (at line 23)\n" + 
			"	boolean b13 = s1 == l1;\n" + 
			"	              ^^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"10. WARNING in X.java (at line 25)\n" + 
			"	boolean b15 = s1 != l1;\n" + 
			"	              ^^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"11. ERROR in X.java (at line 28)\n" + 
			"	Zork z;\n" + 
			"	^^^^\n" + 
			"Zork cannot be resolved to a type\n" + 
			"----------\n");
}

/**
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=276741"
 */
public void test0039() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"	public void gain(String[] args) {\n" +
			"		boolean b1 = this == this;\n" +
			"		boolean b2 = this != this;\n" +		
			"		boolean b3 = this != new X();\n" +
			"		boolean b4 = this == new X();\n" +
			"	}\n" +
			"	Zork z;\n" +
			"}\n"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	boolean b1 = this == this;\n" + 
			"	             ^^^^^^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 4)\n" + 
			"	boolean b2 = this != this;\n" + 
			"	             ^^^^^^^^^^^^\n" + 
			"Comparing identical expressions\n" + 
			"----------\n" + 
			"3. ERROR in X.java (at line 8)\n" + 
			"	Zork z;\n" + 
			"	^^^^\n" + 
			"Zork cannot be resolved to a type\n" + 
			"----------\n");
}
/**
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=281776"
 * We now tolerate comparison of float and double entities against
 * themselves as a legitimate idiom for NaN checking. 
 */
public void test0040() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" +
		    "    public static void main(String[] args) {\n" +
		    "        double var = Double.NaN;\n" +
		    "            if(var != var) {\n" +
		    "                  System.out.println(\"NaN\");\n" +
		    "            }\n" +
		    "            float varf = 10;\n" +
		    "            if(varf != varf) {\n" +
		    "            	System.out.println(\"NaN\");\n" +
		    "            }\n" +
		    "   }\n" +
			"	Zork z;\n" +
			"}\n"
			},
			"----------\n" + 
			"1. ERROR in X.java (at line 12)\n" + 
			"	Zork z;\n" + 
			"	^^^^\n" + 
			"Zork cannot be resolved to a type\n" + 
			"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=251227
public void test0041() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		System.out.println(1.0 == 1.0);\n" +
			"		System.out.println(1.0f == 1.0f);\n" +
			"	}\n" +
			"}\n"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 3)\n" + 
		"	System.out.println(1.0 == 1.0);\n" + 
		"	                   ^^^^^^^^^^\n" + 
		"Comparing identical expressions\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 4)\n" + 
		"	System.out.println(1.0f == 1.0f);\n" + 
		"	                   ^^^^^^^^^^^^\n" + 
		"Comparing identical expressions\n" + 
		"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=248897
public void test0042() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5) {
		return;
	}
	runTest(
			new String[] {
				"Test.java",
				"public class Test {\n" +
				"    public static void main(String[]  args) {\n" +
				"        final String var = \"Hello\";\n" +
				"        final int local = 10;\n" +
				"        @ZAnn(var + local)\n" +
				"        class X {}\n" +
				"        new X();\n" +
				"    }\n" +
				"}\n" +
				"@interface ZAnn {\n" +
				"    String value();\n" +
				"}\n"
				},
			null /* errorOptions */,
			new String[] {
				CompilerOptions.OPTION_ReportUnusedLocal
				} /* warningOptions */,
			null /* ignoreOptions */,
			false /* expectingCompilerErrors */,
			"" /* expectedCompilerLog */,
			"" /* expectedOutputString */,
			false /* forceExecution */,
			null /* classLib */,
			true /* shouldFlushOutputDirectory */,
			null /* vmArguments */,
			null /* customOptions */,
			null /* clientRequestor */,
			true /* skipJavac */);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=313825
public void test0043() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"class X {\n" + 
			"	void foo(int i) {\n" + 
			"		foo((a));\n" + 
			"	}\n" + 
			"}"
		},
		"----------\n" + 
		"1. ERROR in X.java (at line 3)\n" + 
		"	foo((a));\n" + 
		"	     ^\n" + 
		"a cannot be resolved to a variable\n" + 
		"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310264
public void test0044() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"class X {\n" + 
			"   volatile int x;\n" +
			"   int nvx;\n" +
			"	void foo(int i) {\n" +
			"		x = x;\n" + 
			"       nvx = nvx;\n" +
			"	}\n" + 
			"}"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 6)\n" + 
		"	nvx = nvx;\n" + 
		"	^^^^^^^^^\n" + 
		"The assignment to variable nvx has no effect\n" + 
		"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310264
public void test0045() {
	this.runNegativeTest(
		new String[] {
			"X.java",
			"class X {\n" + 
			"   volatile int x = this.x;\n" +
			"   int nvx = this.nvx;\n" +
			"	void foo(int i) {\n" +
			"	}\n" + 
			"}"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 2)\n" + 
		"	volatile int x = this.x;\n" + 
		"	             ^^^^^^^^^^\n" + 
		"The assignment to variable x has no effect\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 3)\n" + 
		"	int nvx = this.nvx;\n" + 
		"	    ^^^^^^^^^^^^^^\n" + 
		"The assignment to variable nvx has no effect\n" + 
		"----------\n");
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
public void test0046() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" + 
				"    int foo() {\n" + 
				"        int i=1;\n" + 
				"        boolean b=false;\n" + 
				"        b|=true;\n" + 			// not a relevant usage
				"        int k = 2;\n" + 
				"        --k;\n" + 				// not a relevant usage
				"        k+=3;\n" + 			// not a relevant usage
				"        Integer j = 3;\n" + 
				"        j++;\n" + 				// relevant because unboxing is involved
				"        i++;\n" +				// not relevant but should still not report because next is relevant
				"        return i++;\n" + 		// value after increment is used
				"    }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 4)\n" + 
			"	boolean b=false;\n" + 
			"	        ^\n" + 
			"The value of the local variable b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 6)\n" + 
			"	int k = 2;\n" + 
			"	    ^\n" + 
			"The value of the local variable k is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// variant with private fields instead of locals
public void test0046_field() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" + 
				"    private int i=1;\n" + 
				"    private boolean b=false;\n" + 
				"    private int k = 2;\n" + 
				"    private Integer j = 3;\n" + 
				"    int foo() {\n" + 
				"        b|=true;\n" + 			// not a relevant usage
				"        --k;\n" + 				// not a relevant usage
				"        k+=3;\n" + 			// not a relevant usage
				"        j++;\n" + 				// relevant because unboxing is involved
				"        return i++;\n" + 		// value after increment is used
				"    }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	private boolean b=false;\n" + 
			"	                ^\n" + 
			"The value of the field X.b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 4)\n" + 
			"	private int k = 2;\n" + 
			"	            ^\n" + 
			"The value of the field X.k is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// variant with private fields instead of locals - this-qualified access
public void test0046_field_this_qualified() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" + 
				"    private int i=1;\n" + 
				"    private boolean b=false;\n" + 
				"    private int k = 2;\n" + 
				"    private Integer j = 3;\n" + 
				"    int foo() {\n" + 
				"        this.b|=true;\n" + 		// not a relevant usage
				"        --this.k;\n" + 			// not a relevant usage
				"        getThis().k+=3;\n" + 		// not a relevant usage
				"        this.j++;\n" + 			// relevant because unboxing is involved
				"        return this.i++;\n" + 		// value after increment is used
				"    }\n" +
				"    X getThis() { return this; }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	private boolean b=false;\n" + 
			"	                ^\n" + 
			"The value of the field X.b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 4)\n" + 
			"	private int k = 2;\n" + 
			"	            ^\n" + 
			"The value of the field X.k is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// variant with private fields instead of locals - regular qualified access
public void test0046_field_qualified() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" + 
				"    private int i=1;\n" + 
				"    private boolean b=false;\n" + 
				"    private int k = 2;\n" + 
				"    private Integer j = 3;\n" + 
				"    int foo(X that) {\n" + 
				"        that.b|=true;\n" + 		// not a relevant usage
				"        --that.k;\n" + 			// not a relevant usage
				"        that.k+=3;\n" + 			// not a relevant usage
				"        that.j++;\n" + 			// relevant because unboxing is involved
				"        that.i++;\n"+				// not relevant but should still not report because next is relevant
				"        return that.i++;\n" + 		// value after increment is used
				"    }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	private boolean b=false;\n" + 
			"	                ^\n" + 
			"The value of the field X.b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 4)\n" + 
			"	private int k = 2;\n" + 
			"	            ^\n" + 
			"The value of the field X.k is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// variant with fields inside a private type
public void test0046_field_in_private_type() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" +
				"    private class Y {\n" + 
				"        int i=1;\n" + 
				"        public boolean b=false;\n" + 
				"        protected int k = 2;\n" + 
				"        Integer j = 3;\n" +
				"    }\n" + 
				"    int foo(Y y) {\n" + 
				"        y.b|=true;\n" + 				// not a relevant usage
				"        --y.k;\n" + 					// not a relevant usage
				"        y.k+=3;\n" + 					// not a relevant usage
				"        y.j++;\n" + 					// relevant because unboxing is involved
				"        int result = y.i++;\n" + 	// value after increment is used
				"        y.i++;\n" +					// not relevant, but previous is
				"        return result;\n" +
				"    }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 4)\n" + 
			"	public boolean b=false;\n" + 
			"	               ^\n" + 
			"The value of the field X.Y.b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 5)\n" + 
			"	protected int k = 2;\n" + 
			"	              ^\n" + 
			"The value of the field X.Y.k is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
public void test0047() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" + 
				"    void foo(int param1, int param2, Integer param3) {\n" + 
				"        boolean b=false;\n" + 
				"        b|=true;\n" + 			// not a relevant usage
				"        param1++;\n" + 		// not a relevant usage
				"        {\n" +
				"            int val=23;\n" +
				"            param2 += val;\n" +// not a relevant usage of param2
				"        }\n" +
				"        param3++;\n" + 		// relevant because unboxing is involved
				"    }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 2)\n" + 
			"	void foo(int param1, int param2, Integer param3) {\n" + 
			"	             ^^^^^^\n" + 
			"The value of the parameter param1 is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 2)\n" + 
			"	void foo(int param1, int param2, Integer param3) {\n" + 
			"	                         ^^^^^^\n" + 
			"The value of the parameter param2 is not used\n" + 
			"----------\n" + 
			"3. WARNING in X.java (at line 3)\n" + 
			"	boolean b=false;\n" + 
			"	        ^\n" + 
			"The value of the local variable b is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// To verify that unused parameter warning is not shown for an implementing method's parameter when
// CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract is disabled
public void test0048() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"public class X extends A implements Y{\n" + 
				"   public void foo(int param1, int param2, Integer param3) {\n" + // implementing method, so dont warn
				"        boolean b=false;\n" + 
				"        b|=true;\n" + 			// not a relevant usage
				"        param1++;\n" + 		// not a relevant usage
				"        param2 += 1;\n" + 		// not a relevant usage
				"        param3++;\n" + 		// relevant because unboxing is involved
				"    }\n" + 
				"   public void foo(int param1, int param2) {\n" + // warn
				"        boolean b=false;\n" + 
				"        b|=true;\n" + 			// not a relevant usage
				"        param1++;\n" + 		// not a relevant usage
				"        param2 += 1;\n" + 		// not a relevant usage
				"    }\n" +
				"   public void bar(int param1, int param2, Integer param3) {\n" + // implementing method, so dont warn
				"        param1++;\n" + 		// not a relevant usage
				"        param2 += 1;\n" + 		// not a relevant usage
				"        param3++;\n" + 		// relevant because unboxing is involved
				"    }\n" +
				"}\n" +
				"interface Y{\n" +
				"	public void foo(int param1, int param2, Integer param3);" +
				"}\n" +
				"abstract class A{\n" +
				"	public abstract void bar(int param1, int param2, Integer param3);" +
				"}\n"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	boolean b=false;\n" + 
			"	        ^\n" + 
			"The value of the local variable b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 9)\n" + 
			"	public void foo(int param1, int param2) {\n" + 
			"	                    ^^^^^^\n" + 
			"The value of the parameter param1 is not used\n" + 
			"----------\n" + 
			"3. WARNING in X.java (at line 9)\n" + 
			"	public void foo(int param1, int param2) {\n" + 
			"	                                ^^^^^^\n" + 
			"The value of the parameter param2 is not used\n" + 
			"----------\n" + 
			"4. WARNING in X.java (at line 10)\n" + 
			"	boolean b=false;\n" + 
			"	        ^\n" + 
			"The value of the local variable b is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// To verify that unused parameter warning is not shown for an overriding method's parameter when
// CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete is disabled
public void test0049() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"public class X extends A {\n" + 
				"   public void foo(int param1, int param2, Integer param3) {\n" + // overriding method, so dont warn
				"        boolean b=false;\n" + 
				"        b|=true;\n" + 			// not a relevant usage
				"        param1++;\n" + 		// not a relevant usage
				"        param2 += 1;\n" + 		// not a relevant usage
				"        param3++;\n" + 		// relevant because unboxing is involved
				"    }\n" + 
				"   public void foo(int param1, Integer param3) {\n" + // overriding method, so dont warn
				"        param1++;\n" + 		// not a relevant usage
				"        param3++;\n" + 		// relevant because unboxing is involved
				"    }\n" + 
				"}\n" +
				"class A{\n" +
				"   public void foo(int param1, int param2, Integer param3) {\n" +
				"        param1 -=1;\n" + 		// not a relevant usage
				"        param2--;\n" + 		// not a relevant usage
				"        param3--;\n" + 		// relevant because unboxing is involved
				"    }\n" + 
				"}\n"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 3)\n" + 
			"	boolean b=false;\n" + 
			"	        ^\n" + 
			"The value of the local variable b is not used\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 9)\n" + 
			"	public void foo(int param1, Integer param3) {\n" + 
			"	                    ^^^^^^\n" + 
			"The value of the parameter param1 is not used\n" + 
			"----------\n" + 
			"3. WARNING in X.java (at line 15)\n" + 
			"	public void foo(int param1, int param2, Integer param3) {\n" + 
			"	                    ^^^^^^\n" + 
			"The value of the parameter param1 is not used\n" + 
			"----------\n" + 
			"4. WARNING in X.java (at line 15)\n" + 
			"	public void foo(int param1, int param2, Integer param3) {\n" + 
			"	                                ^^^^^^\n" + 
			"The value of the parameter param2 is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// To verify that unused local warning is not shown for locals declared in unreachable code
public void test0050() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"class X {\n" + 
				"    int foo() {\n" + 
				"        int i=1;\n" +
				"		 if (false) {\n" + 
				"        	boolean b=false;\n" + // don't complain as unused
				"        	b|=true;\n" +
				"		 }\n" + 			// not a relevant usage
				"        int k = 2;\n" + 
				"        --k;\n" + 			// not a relevant usage
				"        k+=3;\n" + 		// not a relevant usage
				"        Integer j = 3;\n" + 
				"        j++;\n" + 			// relevant because unboxing is involved
				"        return i++;\n" + 	// value after increment is used
				"    }\n" + 
				"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 4)\n" + 
			"	if (false) {\n" + 
			"        	boolean b=false;\n" + 
			"        	b|=true;\n" + 
			"		 }\n" + 
			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
			"Dead code\n" + 
			"----------\n" + 
			"2. WARNING in X.java (at line 8)\n" + 
			"	int k = 2;\n" + 
			"	    ^\n" + 
			"The value of the local variable k is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185682
// To verify that a constructor argument is handled correctly
public void test0051() {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
					"X.java",
					"class X {\n" + 
					"    X(int abc) {\n" + 
					"        abc++;\n" +    // not a relevant usage
					"    }\n" + 
					"}"
			},
			"----------\n" + 
			"1. WARNING in X.java (at line 2)\n" + 
			"	X(int abc) {\n" + 
			"	      ^^^\n" + 
			"The value of the parameter abc is not used\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328281
public void test0052() {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR);
	this.runConformTest(
			new String[] {
					"X.java",
					"class X {\n" +
					"    Y y = new Y();\n" +
					"    private class Y {\n" +
					"        int abc;\n" + 
					"        Y() {\n" + 
					"            abc++;\n" +    // not a relevant usage
					"        }\n" +
					"    }\n" +
					"    class Z extends Y {}\n" + // makes 'abc' externally accessible
					"}"
			},
			"",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			null/*vmArguments*/,
			customOptions,
			null/*requestor*/);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328281
// multi-level inheritance
public void test0052a() {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR);
	customOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
	this.runConformTest(
			new String[] {
					"Outer.java",
					"class Outer {\n" + 
					"    private class Inner1 {\n" + 
					"        int foo;\n" +
					"    }\n" + 
					"    private class Inner2 extends Inner1 { }\n" + 
					"    class Inner3 extends Inner2 { }\n" +  // foo is exposed here
					"}\n"
			},
			"",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			null/*vmArguments*/,
			customOptions,
			null/*requestor*/);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328281
// member type of private
public void test0052b() {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR);
	customOptions.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
	this.runConformTest(
			new String[] {
					"Outer.java",
					"class Outer {\n" + 
					"    private class Inner1 {\n" + 
					"        class Foo{}\n" +
					"    }\n" + 
					"    private class Inner2 extends Inner1 { }\n" + 
					"    class Inner3 extends Inner2 { }\n" +  // Foo is exposed here
					"}\n"
			},
			"",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			null/*vmArguments*/,
			customOptions,
			null/*requestor*/);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328519
public void test0053() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runConformTest(
		new String[] {
			"X.java",
			"class X {\n" + 
			"    int foo() {\n" + 
			"        int i=1;\n" +
			"        i++;\n" + 	// value after increment is still not used
			"        return 0;\n" + 
			"    }\n" + 
			"}"
		},
		"",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		null,
		customOptions,
		null);
	String expectedOutput =
		"  // Method descriptor #15 ()I\n" + 
		"  // Stack: 1, Locals: 1\n" + 
		"  int foo();\n" + 
		"    0  iconst_0\n" + 
		"    1  ireturn\n" + 
		"      Line numbers:\n" + 
		"        [pc: 0, line: 5]\n" + 
		"      Local variable table:\n" + 
		"        [pc: 0, pc: 2] local: this index: 0 type: X\n";
	checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328519
public void test0054() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.ERROR);
	this.runConformTest(
		new String[] {
			"X.java",
			"class X {\n" + 
			"    int foo() {\n" + 
			"        int i=1;\n" +
			"        return i+=1;\n" + 	// value is used as it is returned
			"    }\n" + 
			"}"
		},
		"",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		null,
		customOptions,
		null);
	String expectedOutput =
		"  // Method descriptor #15 ()I\n" + 
		"  // Stack: 1, Locals: 2\n" + 
		"  int foo();\n" + 
		"    0  iconst_1\n" + 
		"    1  istore_1 [i]\n" + 
		"    2  iinc 1 1 [i]\n" + 
		"    5  iload_1 [i]\n" + 
		"    6  ireturn\n" + 
		"      Line numbers:\n" + 
		"        [pc: 0, line: 3]\n" + 
		"        [pc: 2, line: 4]\n" + 
		"      Local variable table:\n" + 
		"        [pc: 0, pc: 7] local: this index: 0 type: X\n" + 
		"        [pc: 2, pc: 7] local: i index: 1 type: int\n";
	checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
}

// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329613
// regression caused by https://bugs.eclipse.org/bugs/show_bug.cgi?id=328519
public void test0055() {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	customOptions.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
	this.runNegativeTest(
			new String[] {
					"test1/E.java",
					"package test1;\n" +
					"public class E {\n" +
						"    private void foo() {\n" +
						"        int a= 10;\n" +
						"        a++;\n" +
						"        a--;\n" +
						"        --a;\n" +
						"        ++a;\n" +
						"        for ( ; ; a++) {\n" +
							"        }\n" +
							"    }\n" +
							"}"
			},
			"----------\n" +
			"1. WARNING in test1\\E.java (at line 4)\n" +
			"	int a= 10;\n" +
			"	    ^\n" +
			"The value of the local variable a is not used\n" +
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=328519
public void test0056() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.ERROR);
	this.runConformTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"    static int foo() {\n" + 
			"        int i = 2;\n" + 
			"        int j = 3;\n" + 
			"        return (i += j *= 3);\n" + 	// value is used as it is returned
			"    }\n" + 
			"    public static void main(String[] args) {\n" + 
			"        System.out.println(foo());\n" + 
			"    }\n" + 
			"}"
		},
		"11",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		null,
		customOptions,
		null);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=328519
public void test0057() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
	this.runConformTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"    public static void main (String args[]) {\n" + 
			"        int i = 0;\n" + 
			"        i += 4 + foo();\n" + 
			"    }\n" + 
			"    public static int foo() {\n" + 
			"    	System.out.println(\"OK\");\n" + 
			"    	return 0;\n" + 
			"    }\n" + 
			"}"
		},
		"OK",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		null,
		customOptions,
		null);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=336648
public void _test0058() {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	this.runNegativeTest(
			new String[] {
				"X.java",
				"public class X {\n" +
				"    void foo(String m) {\n" +
				"        final String message= m;\n" +
				"        new Runnable() {\n" +
				"            public void run() {\n" +
				"                if (\"x\".equals(message)) {\n" +
				"                    bug(); // undefined method\n" +
				"                }\n" +
				"            }\n" +
				"        }.run();\n" +
				"    }\n" +
				"}\n"
			},
			"----------\n" + 
			"1. ERROR in X.java (at line 7)\n" + 
			"	bug(); // undefined method\n" + 
			"	^^^\n" + 
			"The method bug() is undefined for the type new Runnable(){}\n" + 
			"----------\n",
			null/*classLibraries*/,
			true/*shouldFlushOutputDirectory*/,
			customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=339139
// Issue local variable not used warning inside deadcode
public void test0059() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
	customOptions.put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.WARNING);
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"    public static void main(String[] args) {\n" + 
			"    	Object a = null;\n" + 
			"    	if (a != null){\n" + 
			"        	int j = 3;\n" + 
			"        	j++;\n" + 	// value is not used
			"    	}\n" +
			"    	System.out.println(\"OK\");\n" + 
			"    }\n" + 
			"}"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 4)\n" + 
		"	if (a != null){\n" + 
		"        	int j = 3;\n" + 
		"        	j++;\n" + 
		"    	}\n" + 
		"	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
		"Dead code\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 5)\n" + 
		"	int j = 3;\n" + 
		"	    ^\n" + 
		"The value of the local variable j is not used\n" + 
		"----------\n",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417803,  [internal] Build a build environment compiler to warn on TypeBinding comparisons
public void test0060() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUninternedIdentityComparison, CompilerOptions.ENABLED);
	this.runNegativeTest(
		new String[] {
			"org/eclipse/jdt/internal/compiler/lookup/X.java",
			"package org.eclipse.jdt.internal.compiler.lookup;\n" +
			"class TypeBinding {\n" +
			"}\n" +
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void gain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void vain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void cain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"}\n"
		},
		"----------\n" + 
		"1. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 7)\n" + 
		"	if (t1 == t2) { \n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"2. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 9)\n" + 
		"	if (t1 == t2) {\n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"3. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 16)\n" + 
		"	if (t1 == t2) { \n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"4. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 18)\n" + 
		"	if (t1 == t2) {\n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"5. ERROR in org\\eclipse\\jdt\\internal\\compiler\\lookup\\X.java (at line 28)\n" + 
		"	if (t1 == t2) { \n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417803,  [internal] Build a build environment compiler to warn on TypeBinding comparisons
public void test0061() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUninternedIdentityComparison, CompilerOptions.ENABLED);
	this.runNegativeTest(
		new String[] {
			"org/eclipse/nonjdt/internal/compiler/lookup/X.java",
			"package org.eclipse.nonjdt.internal.compiler.lookup;\n" +
			"class TypeBinding {\n" +
			"}\n" +
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void gain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void vain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void cain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"}\n"
		},
		"",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417803,  [internal] Build a build environment compiler to warn on TypeBinding comparisons
public void test0062() throws Exception {
	Map customOptions = getCompilerOptions();
	this.runNegativeTest(
		new String[] {
			"org/eclipse/jdt/internal/compiler/lookup/X.java",
			"package org.eclipse.jdt.internal.compiler.lookup;\n" +
			"class TypeBinding {\n" +
			"}\n" +
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void gain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void vain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void cain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"}\n"
		},
		"",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=417803,  [internal] Build a build environment compiler to warn on TypeBinding comparisons
public void test0063() throws Exception {
	Map customOptions = getCompilerOptions();
	customOptions.put(CompilerOptions.OPTION_ReportUninternedIdentityComparison, CompilerOptions.ENABLED);
	this.runNegativeTest(
		new String[] {
			"org/eclipse/jdt/core/dom/X.java",
			"package org.eclipse.jdt.core.dom;\n" +
			"interface ITypeBinding {\n" +
			"}\n" +
			"class TypeBinding implements ITypeBinding {\n" +
			"}\n" +
			"public class X {\n" +
			"	public static void main(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void gain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) {\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void vain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		//$IDENTITY-COMPARISON$\n" +
			"		if (t1 == t2) { \n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"	public static void cain(String[] args) {\n" +
			"		TypeBinding t1 = null, t2 = null;\n" +
			"		if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"			if (t2 == t1) {  //$IDENTITY-COMPARISON$\n" +
			"				if (t1 == t2) { //$IDENTITY-COMPARISON$\n" +
			"				}\n" +
			"			}\n" +
			"		}\n" +
			"	}\n" +
			"}\n"
		},
		"----------\n" + 
		"1. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 9)\n" + 
		"	if (t1 == t2) { \n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"2. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 11)\n" + 
		"	if (t1 == t2) {\n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"3. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 18)\n" + 
		"	if (t1 == t2) { \n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"4. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 20)\n" + 
		"	if (t1 == t2) {\n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n" + 
		"5. ERROR in org\\eclipse\\jdt\\core\\dom\\X.java (at line 30)\n" + 
		"	if (t1 == t2) { \n" + 
		"	    ^^^^^^^^\n" + 
		"The uninterned types TypeBinding and TypeBinding should not be compared using ==/!= operators.\n" + 
		"----------\n",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// Collection: contains & remove & get
public void testBug410218a() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	runNegativeTest(
		new String[] {
			"X.java",
			"import java.util.*;\n" +
			"class X {\n" +
			"  void test() {\n" +
			"	Set<Short> set = new HashSet<Short>();\n" + 
			"	short one = 1;\n" + 
			"	set.add(one);\n" + 
			"\n" + 
			"	if (set.contains(\"ONE\")) // bad\n" +
			"		set.remove(\"ONE\"); // bad\n" + 
			"	if (set.contains(1)) // bad\n" +
			"		set.remove(1); // bad (tries to remove \"Integer 1\")\n" + 
			"	System.out.println(set); // shows that the \"Short 1\" is still in!\n" + 
			"\n" + 
			"	if (set.contains(one)) // ok\n" +
			"		set.remove(one); // ok\n" + 
			"	if (set.contains(Short.valueOf(one))) // ok\n" +
			"		set.remove(Short.valueOf(one)); // ok\n" + 
			"	System.out.println(set);\n" +
			"  }\n" +
			"}\n"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 8)\n" + 
		"	if (set.contains(\"ONE\")) // bad\n" + 
		"	                 ^^^^^\n" + 
		"Unlikely argument type String for contains(Object) on a Collection<Short>\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 9)\n" + 
		"	set.remove(\"ONE\"); // bad\n" + 
		"	           ^^^^^\n" + 
		"Unlikely argument type String for remove(Object) on a Collection<Short>\n" + 
		"----------\n" + 
		"3. WARNING in X.java (at line 10)\n" + 
		"	if (set.contains(1)) // bad\n" + 
		"	                 ^\n" + 
		"Unlikely argument type int for contains(Object) on a Collection<Short>\n" + 
		"----------\n" + 
		"4. WARNING in X.java (at line 11)\n" + 
		"	set.remove(1); // bad (tries to remove \"Integer 1\")\n" + 
		"	           ^\n" + 
		"Unlikely argument type int for remove(Object) on a Collection<Short>\n" + 
		"----------\n");
}
// HashSet vs. TreeSet
public void testBug410218b() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	runNegativeTest(
		new String[] {
			"X.java",
			"import java.util.*;\n" +
			"class X {\n" +
			"  <T> void test(Set<HashSet<T>> hss, TreeSet<T> ts, LinkedHashSet<T> lhs) {\n" +
			"	if (hss.contains(ts)) // bad\n" +
			"		hss.remove(ts); // bad\n" + 
			"	if (hss.contains((Set<T>)ts)) // ok\n" +
			"		hss.remove((Set<T>)ts); // ok\n" + 
			"	if (hss.contains(lhs)) // ok\n" +
			"		hss.remove(lhs); // ok\n" + 
			"  }\n" +
			"}\n"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 4)\n" + 
		"	if (hss.contains(ts)) // bad\n" + 
		"	                 ^^\n" + 
		"Unlikely argument type TreeSet<T> for contains(Object) on a Collection<HashSet<T>>\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 5)\n" + 
		"	hss.remove(ts); // bad\n" + 
		"	           ^^\n" + 
		"Unlikely argument type TreeSet<T> for remove(Object) on a Collection<HashSet<T>>\n" + 
		"----------\n");
}
// HashSet vs. TreeSet or: strict
public void testBug410218b2() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT, JavaCore.ENABLED);
	runNegativeTest(
		new String[] {
			"X.java",
			"import java.util.*;\n" +
			"class X {\n" +
			"  <T> void test(Set<HashSet<T>> hss, TreeSet<T> ts, LinkedHashSet<T> lhs) {\n" +
			"	if (hss.contains(ts)) // bad\n" +
			"		hss.remove(ts); // bad\n" + 
			"	if (hss.contains((Set<T>)ts)) // bad (because of strict check)\n" +
			"		hss.remove((Set<T>)ts); // bad (because of strict check)\n" + 
			"	if (hss.contains(lhs)) // ok\n" +
			"		hss.remove(lhs); // ok\n" + 
			"  }\n" +
			"}\n"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 4)\n" + 
		"	if (hss.contains(ts)) // bad\n" + 
		"	                 ^^\n" + 
		"Unlikely argument type TreeSet<T> for contains(Object) on a Collection<HashSet<T>>\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 5)\n" + 
		"	hss.remove(ts); // bad\n" + 
		"	           ^^\n" + 
		"Unlikely argument type TreeSet<T> for remove(Object) on a Collection<HashSet<T>>\n" + 
		"----------\n" + 
		"3. WARNING in X.java (at line 6)\n" + 
		"	if (hss.contains((Set<T>)ts)) // bad (because of strict check)\n" + 
		"	                 ^^^^^^^^^^\n" + 
		"Unlikely argument type Set<T> for contains(Object) on a Collection<HashSet<T>>\n" + 
		"----------\n" + 
		"4. WARNING in X.java (at line 7)\n" + 
		"	hss.remove((Set<T>)ts); // bad (because of strict check)\n" + 
		"	           ^^^^^^^^^^\n" + 
		"Unlikely argument type Set<T> for remove(Object) on a Collection<HashSet<T>>\n" + 
		"----------\n",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// Map: contains* & remove & get
public void testBug410218c() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	runNegativeTest(
		new String[] {
			"X.java",
			"import java.util.*;\n" +
			"class X {\n" +
			"  Number test(Map<? extends Number, Number> m, boolean f) {\n" +
			"	if (m.containsKey(\"ONE\")) // bad\n" + 
			"		m.remove(\"ONE\"); // bad\n" +
			"	if (m.containsValue(\"ONE\")) // bad\n" + 
			"		m.remove(\"ONE\"); // bad\n" + 
			"	short one = 1;\n" +
			"	if (m.containsKey(one)) // almost ok\n" +
			"		m.remove(one); // almost ok\n" +
			"	if (m.containsValue(Short.valueOf(one))) // ok\n" + 
			"		m.remove(Short.valueOf(one)); // almost ok\n" + 
			"	if (f)\n" +
			"		return m.get(\"ONE\"); // bad\n" +
			"	return m.get(one);\n // almost ok\n" +
			"  }\n" +
			"}\n"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 4)\n" + 
		"	if (m.containsKey(\"ONE\")) // bad\n" + 
		"	                  ^^^^^\n" + 
		"Unlikely argument type String for containsKey(Object) on a Map<capture#1-of ? extends Number,Number>\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 5)\n" + 
		"	m.remove(\"ONE\"); // bad\n" + 
		"	         ^^^^^\n" + 
		"Unlikely argument type String for remove(Object) on a Map<capture#2-of ? extends Number,Number>\n" + 
		"----------\n" + 
		"3. WARNING in X.java (at line 6)\n" + 
		"	if (m.containsValue(\"ONE\")) // bad\n" + 
		"	                    ^^^^^\n" + 
		"Unlikely argument type String for containsValue(Object) on a Map<capture#3-of ? extends Number,Number>\n" + 
		"----------\n" + 
		"4. WARNING in X.java (at line 7)\n" + 
		"	m.remove(\"ONE\"); // bad\n" + 
		"	         ^^^^^\n" + 
		"Unlikely argument type String for remove(Object) on a Map<capture#4-of ? extends Number,Number>\n" + 
		"----------\n" + 
		"5. WARNING in X.java (at line 14)\n" + 
		"	return m.get(\"ONE\"); // bad\n" + 
		"	             ^^^^^\n" + 
		"Unlikely argument type String for get(Object) on a Map<capture#9-of ? extends Number,Number>\n" + 
		"----------\n");
}
// Collection: {contains,remove,retain}All, non-generic sub type of Collection, configured to be ERROR
public void testBug410218d() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, JavaCore.ERROR);
	runNegativeTest(
		new String[] {
			"X.java",
			"import java.util.*;\n" +
			"interface NumberCollection extends Collection<Number> {}\n" +
			"class X {\n" +
			"  void test(NumberCollection numbers, List<Integer> ints, Set<String> stringSet) {\n" +
			"	if (numbers.containsAll(ints)) // ok\n" +
			"		numbers.removeAll(ints); // ok\n" + 
			"	else\n" +
			"		numbers.retainAll(ints); // ok\n" + 
			"\n" + 
			"	numbers.removeAll(stringSet); // bad\n" + 
			"  }\n" +
			"}\n"
		},
		"----------\n" + 
		"1. ERROR in X.java (at line 10)\n" + 
		"	numbers.removeAll(stringSet); // bad\n" + 
		"	                  ^^^^^^^^^\n" + 
		"Unlikely argument type Set<String> for removeAll(Collection<?>) on a Collection<Number>\n" + 
		"----------\n",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
// List.indexOf: w/ and w/o @SuppressWarnings
public void testBug410218e() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, JavaCore.WARNING);
	runNegativeTest(
		new String[] {
			"X.java",
			"import java.util.*;\n" +
			"class X {\n" +
			"  int test1(List<Integer> ints, Object o) {\n" +
			"	return ints.indexOf(\"ONE\"); // bad\n" + 
			"  }\n" +
			"  @SuppressWarnings(\"unlikely-arg-type\")\n" +
			"  int test2(List<Integer> ints, boolean f, Object o) {\n" +
			"	if (f)\n" +
			"		return ints.indexOf(\"ONE\"); // bad but suppressed\n" +
			"	return ints.indexOf(o); // supertype\n" + 
			"  }\n" +
			"}\n"
		},
		"----------\n" + 
		"1. WARNING in X.java (at line 4)\n" + 
		"	return ints.indexOf(\"ONE\"); // bad\n" + 
		"	                    ^^^^^\n" + 
		"Unlikely argument type String for indexOf(Object) on a List<Integer>\n" + 
		"----------\n",
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}

// Method references, equals, wildcards
public void testBug410218f() {
	if (this.complianceLevel < ClassFileConstants.JDK1_8)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, JavaCore.WARNING);
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE, JavaCore.INFO);
	runNegativeTest(
		new String[] {
			"test/TestUnlikely.java",
			"package test;\n" +
			"\n" +
			"import java.util.Collection;\n" +
			"import java.util.Iterator;\n" +
			"import java.util.List;\n" +
			"import java.util.Map;\n" +
			"import java.util.Objects;\n" +
			"import java.util.Set;\n" +
			"import java.util.function.BiPredicate;\n" +
			"import java.util.function.Predicate;\n" +
			"\n" +
			"public class TestUnlikely {\n" +
			"	interface Interface {\n" +
			"	}\n" +
			"\n" +
			"	interface OtherInterface {\n" +
			"	}\n" +
			"\n" +
			"	static class NonFinal implements Interface {\n" +
			"	}\n" +
			"\n" +
			"	static class Sub extends NonFinal implements OtherInterface {\n" +
			"	}\n" +
			"\n" +
			"	static final class Final implements Interface {\n" +
			"	}\n" +
			"\n" +
			"	void f1(List<Interface> c, Interface i, OtherInterface o, Final f, NonFinal nf, Sub s) {\n" +
			"		c.remove(i);\n" +
			"		c.remove(o); // warning: unrelated interface\n" +
			"		c.remove(f);\n" +
			"		c.remove(nf);\n" +
			"		c.remove(s);\n" +
			"	}\n" +
			"\n" +
			"	void f2(List<OtherInterface> c, Interface i, OtherInterface o, Final f, NonFinal nf, Sub s) {\n" +
			"		c.remove(i); // warning: unrelated interface\n" +
			"		c.remove(o);\n" +
			"		c.remove(f); // warning: impossible\n" +
			"		c.remove(nf); // warning: castable, but not supertype\n" +
			"		c.remove(s);\n" +
			"	}\n" +
			"\n" +
			"	void f3(List<Final> c, Interface i, OtherInterface o, Final f, NonFinal nf, Sub s) {\n" +
			"		c.remove(i); // supertype\n" +
			"		c.remove(o); // warning: impossible\n" +
			"		c.remove(f);\n" +
			"		c.remove(nf); // warning: impossible\n" +
			"		c.remove(s); // warning: impossible\n" +
			"	}\n" +
			"\n" +
			"	void f4(List<NonFinal> c, Interface i, OtherInterface o, Final f, NonFinal nf, Sub s) {\n" +
			"		c.remove(i); // supertype\n" +
			"		c.remove(o); // warning: unrelated interface\n" +
			"		c.remove(f); // warning: impossible\n" +
			"		c.remove(nf);\n" +
			"		c.remove(s);\n" +
			"	}\n" +
			"\n" +
			"	void f5(List<Sub> c, Interface i, OtherInterface o, Final f, NonFinal nf, Sub s) {\n" +
			"		c.remove(i); // supertype\n" +
			"		c.remove(o); // supertype\n" +
			"		c.remove(f); // warning: impossible\n" +
			"		c.remove(nf); // supertype\n" +
			"		c.remove(s);\n" +
			"	}\n" +
			"\n" +
			"	<K, V> void map(Map<K, V> map, K key, V value) {\n" +
			"		map.containsKey(key);\n" +
			"		map.containsKey(value); // warning\n" +
			"		map.containsValue(key); // warning\n" +
			"		map.containsValue(value);\n" +
			"	}\n" +
			"\n" +
			"	boolean wildcards(Collection<?> c, Iterable<?> s) {\n" +
			"		for (Iterator<?> iterator = s.iterator(); iterator.hasNext();) {\n" +
			"			if (c.contains(iterator.next())) {\n" +
			"				return true;\n" +
			"			}\n" +
			"		}\n" +
			"		return false;\n" +
			"	}\n" +
			"\n" +
			"	<T, U extends T> boolean relatedTypeVariables(Collection<T> c, Iterable<U> s) {\n" +
			"		for (Iterator<?> iterator = s.iterator(); iterator.hasNext();) {\n" +
			"			if (c.contains(iterator.next())) {\n" +
			"				return true;\n" +
			"			}\n" +
			"		}\n" +
			"		return false;\n" +
			"	}\n" +
			"\n" +
			"	<T, U> boolean unrelatedTypeVariables(Collection<T> c, Iterable<U> s) {\n" +
			"		for (Iterator<U> iterator = s.iterator(); iterator.hasNext();) {\n" +
			"			if (c.contains(iterator.next())) { // warning\n" +
			"				return true;\n" +
			"			}\n" +
			"		}\n" +
			"		return false;\n" +
			"	}\n" +
			"\n" +
			"	void all(List<NonFinal> c, Collection<Sub> s, Set<Final> other) {\n" +
			"		c.removeAll(s);\n" +
			"		s.removeAll(c);\n" +
			"		c.removeAll(other); // warning\n" +
			"	}\n" +
			"\n" +
			"	void methodRef(Set<Interface> c, Interface i, OtherInterface o, Final f, NonFinal nf, Sub s) {\n" +
			"		Predicate<Interface> p1 = c::contains;\n" +
			"		BiPredicate<Collection<Interface>, Interface> bp1 = Collection<Interface>::contains;\n" +
			"		Predicate<OtherInterface> p2 = c::contains; // warning\n" +
			"		BiPredicate<Collection<Interface>, OtherInterface> bp2 = Collection<Interface>::contains; // warning\n" +
			"		p1.test(i);\n" +
			"		bp1.test(c, i);\n" +
			"		p2.test(o);\n" +
			"		bp2.test(c, o);\n" +
			"	}\n" +
			"\n" +
			"	void equals(String s, Integer i, Number n) {\n" +
			"		s.equals(i); // info\n" +
			"		i.equals(s); // info\n" +
			"		i.equals(n);\n" +
			"		n.equals(i);\n" +
			"\n" +
			"		Predicate<String> p1 = i::equals; // info\n" +
			"		p1.test(s);\n" +
			"\n" +
			"		BiPredicate<String, Integer> bp2 = Object::equals; // info\n" +
			"		bp2.test(s, i);\n" +
			"\n" +
			"		Objects.equals(s, i); // info\n" +
			"		Objects.equals(i, s); // info\n" +
			"		Objects.equals(n, i);\n" +
			"		Objects.equals(i, n);\n" +
			"\n" +
			"		BiPredicate<String, Integer> bp3 = Objects::equals; // info\n" +
			"		bp3.test(s, i);\n" +
			"	}\n" +
			"\n" +
			"}\n" +
			"",
		}, 
		"----------\n" + 
		"1. WARNING in test\\TestUnlikely.java (at line 30)\n" + 
		"	c.remove(o); // warning: unrelated interface\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.Interface>\n" + 
		"----------\n" + 
		"2. WARNING in test\\TestUnlikely.java (at line 37)\n" + 
		"	c.remove(i); // warning: unrelated interface\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.Interface for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" + 
		"----------\n" + 
		"3. WARNING in test\\TestUnlikely.java (at line 39)\n" + 
		"	c.remove(f); // warning: impossible\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" + 
		"----------\n" + 
		"4. WARNING in test\\TestUnlikely.java (at line 40)\n" + 
		"	c.remove(nf); // warning: castable, but not supertype\n" + 
		"	         ^^\n" + 
		"Unlikely argument type TestUnlikely.NonFinal for remove(Object) on a Collection<TestUnlikely.OtherInterface>\n" + 
		"----------\n" + 
		"5. WARNING in test\\TestUnlikely.java (at line 46)\n" + 
		"	c.remove(o); // warning: impossible\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.Final>\n" + 
		"----------\n" + 
		"6. WARNING in test\\TestUnlikely.java (at line 48)\n" + 
		"	c.remove(nf); // warning: impossible\n" + 
		"	         ^^\n" + 
		"Unlikely argument type TestUnlikely.NonFinal for remove(Object) on a Collection<TestUnlikely.Final>\n" + 
		"----------\n" + 
		"7. WARNING in test\\TestUnlikely.java (at line 49)\n" + 
		"	c.remove(s); // warning: impossible\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.Sub for remove(Object) on a Collection<TestUnlikely.Final>\n" + 
		"----------\n" + 
		"8. WARNING in test\\TestUnlikely.java (at line 54)\n" + 
		"	c.remove(o); // warning: unrelated interface\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.OtherInterface for remove(Object) on a Collection<TestUnlikely.NonFinal>\n" + 
		"----------\n" + 
		"9. WARNING in test\\TestUnlikely.java (at line 55)\n" + 
		"	c.remove(f); // warning: impossible\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.NonFinal>\n" + 
		"----------\n" + 
		"10. WARNING in test\\TestUnlikely.java (at line 63)\n" + 
		"	c.remove(f); // warning: impossible\n" + 
		"	         ^\n" + 
		"Unlikely argument type TestUnlikely.Final for remove(Object) on a Collection<TestUnlikely.Sub>\n" + 
		"----------\n" + 
		"11. WARNING in test\\TestUnlikely.java (at line 70)\n" + 
		"	map.containsKey(value); // warning\n" + 
		"	                ^^^^^\n" + 
		"Unlikely argument type V for containsKey(Object) on a Map<K,V>\n" + 
		"----------\n" + 
		"12. WARNING in test\\TestUnlikely.java (at line 71)\n" + 
		"	map.containsValue(key); // warning\n" + 
		"	                  ^^^\n" + 
		"Unlikely argument type K for containsValue(Object) on a Map<K,V>\n" + 
		"----------\n" + 
		"13. WARNING in test\\TestUnlikely.java (at line 95)\n" + 
		"	if (c.contains(iterator.next())) { // warning\n" + 
		"	               ^^^^^^^^^^^^^^^\n" + 
		"Unlikely argument type U for contains(Object) on a Collection<T>\n" + 
		"----------\n" + 
		"14. WARNING in test\\TestUnlikely.java (at line 105)\n" + 
		"	c.removeAll(other); // warning\n" + 
		"	            ^^^^^\n" + 
		"Unlikely argument type Set<TestUnlikely.Final> for removeAll(Collection<?>) on a Collection<TestUnlikely.NonFinal>\n" + 
		"----------\n" + 
		"15. WARNING in test\\TestUnlikely.java (at line 111)\n" + 
		"	Predicate<OtherInterface> p2 = c::contains; // warning\n" + 
		"	                               ^^^^^^^^^^^\n" + 
		"Unlikely argument type TestUnlikely.OtherInterface for contains(Object) on a Collection<TestUnlikely.Interface>\n" + 
		"----------\n" + 
		"16. WARNING in test\\TestUnlikely.java (at line 112)\n" + 
		"	BiPredicate<Collection<Interface>, OtherInterface> bp2 = Collection<Interface>::contains; // warning\n" + 
		"	                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
		"Unlikely argument type TestUnlikely.OtherInterface for contains(Object) on a Collection<TestUnlikely.Interface>\n" + 
		"----------\n" + 
		"17. INFO in test\\TestUnlikely.java (at line 120)\n" + 
		"	s.equals(i); // info\n" + 
		"	         ^\n" + 
		"Unlikely argument type for equals(): Integer seems to be unrelated to String\n" + 
		"----------\n" + 
		"18. INFO in test\\TestUnlikely.java (at line 121)\n" + 
		"	i.equals(s); // info\n" + 
		"	         ^\n" + 
		"Unlikely argument type for equals(): String seems to be unrelated to Integer\n" + 
		"----------\n" + 
		"19. INFO in test\\TestUnlikely.java (at line 125)\n" + 
		"	Predicate<String> p1 = i::equals; // info\n" + 
		"	                       ^^^^^^^^^\n" + 
		"Unlikely argument type for equals(): String seems to be unrelated to Integer\n" + 
		"----------\n" + 
		"20. INFO in test\\TestUnlikely.java (at line 128)\n" + 
		"	BiPredicate<String, Integer> bp2 = Object::equals; // info\n" + 
		"	                                   ^^^^^^^^^^^^^^\n" + 
		"Unlikely argument type for equals(): Integer seems to be unrelated to String\n" + 
		"----------\n" + 
		"21. INFO in test\\TestUnlikely.java (at line 131)\n" + 
		"	Objects.equals(s, i); // info\n" + 
		"	                  ^\n" + 
		"Unlikely argument type for equals(): Integer seems to be unrelated to String\n" + 
		"----------\n" + 
		"22. INFO in test\\TestUnlikely.java (at line 132)\n" + 
		"	Objects.equals(i, s); // info\n" + 
		"	                  ^\n" + 
		"Unlikely argument type for equals(): String seems to be unrelated to Integer\n" + 
		"----------\n" + 
		"23. INFO in test\\TestUnlikely.java (at line 136)\n" + 
		"	BiPredicate<String, Integer> bp3 = Objects::equals; // info\n" + 
		"	                                   ^^^^^^^^^^^^^^^\n" + 
		"Unlikely argument type for equals(): Integer seems to be unrelated to String\n" + 
		"----------\n"
		,
		null/*classLibraries*/,
		true/*shouldFlushOutputDirectory*/,
		customOptions);
}
public void testBug514956a() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, JavaCore.WARNING);
	customOptions.put(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK, JavaCore.ERROR);
	runConformTest(
		new String[] {
			"Unlikely.java",
			"import java.util.Map;\n" + 
			"\n" + 
			"interface MApplicationElement {}\n" + 
			"interface EObject {}\n" + 
			"public class Unlikely {\n" + 
			"	void m(Map<MApplicationElement, MApplicationElement> map, EObject key) {\n" + 
			"		map.get((MApplicationElement)key);\n" + 
			"	}\n" + 
			"}\n"
		},
		customOptions);
}
public void testBug514956b() {
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE, JavaCore.WARNING);
	customOptions.put(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK, JavaCore.ERROR);
	runConformTest(
		new String[] {
			"Unlikely.java",
			"interface EObject {}\n" + 
			"public class Unlikely {\n" + 
			"	boolean m(EObject key) {\n" + 
			"		return this.equals((Unlikely)key);\n" + 
			"	}\n" + 
			"}\n"
		},
		customOptions);
}
public void testBug514956c() {
	Map customOptions = getCompilerOptions();
	customOptions.put(JavaCore.COMPILER_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE, JavaCore.WARNING);
	customOptions.put(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK, JavaCore.ERROR);
	runNegativeTest(
		new String[] {
			"Unlikely.java",
			"interface I1 {}\n" + 
			"interface I2 {}\n" + 
			"interface I3 {}\n" + 
			"public class Unlikely implements I1 {\n" + 
			"	boolean m1(I1 i1) {\n" + 
			"		return i1.equals((I1)this);\n" + // not a downcast
			"	}\n" + 
			"	boolean m2(I1 i1, I2 i2) {\n" + 
			"		return i1.equals((I3)i2);\n" + // cast doesn't fix a problem
			"	}\n" + 
			"}\n"
		},
		"----------\n" + 
		"1. ERROR in Unlikely.java (at line 6)\n" + 
		"	return i1.equals((I1)this);\n" + 
		"	                 ^^^^^^^^\n" + 
		"Unnecessary cast from Unlikely to I1\n" + 
		"----------\n" + 
		"2. ERROR in Unlikely.java (at line 9)\n" + 
		"	return i1.equals((I3)i2);\n" + 
		"	                 ^^^^^^\n" + 
		"Unnecessary cast from I2 to I3\n" + 
		"----------\n" + 
		"3. WARNING in Unlikely.java (at line 9)\n" + 
		"	return i1.equals((I3)i2);\n" + 
		"	                 ^^^^^^\n" + 
		"Unlikely argument type for equals(): I3 seems to be unrelated to I1\n" + 
		"----------\n",
		null, // classlibs
		false, // flush output dir
		customOptions);
}
// mixture of raw type an parametrized type
public void testBug513310() {
	if (this.complianceLevel < ClassFileConstants.JDK1_5)
		return;
	runConformTest(
		new String[] {
			"test/Test.java",
			"package test;\n" +
			"\n" +
			"import java.util.List;\n" +
			"import java.util.Set;\n" +
			"\n" +
			"public class Test {\n" +
			"	void f(List dependencyList, Set<Object> set) {\n" +
			"		dependencyList.removeAll(set);\n" +
			"	}\n" +
			"}\n" +
			"",
		} 
	);
}
}

Back to the top