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 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236
|
<?xml version="1.0" encoding="UTF-8"?>
<MessageCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="messagecollection.xsd">
<!--
**********************************************************************
Plugin information
**********************************************************************
-->
<Plugin>
<ShortDescription>Core FindBugs plugin</ShortDescription>
<Details>
<![CDATA[
<p>
This plugin contains all of the standard FindBugs detectors.
</p>
]]>
</Details>
</Plugin>
<FindBugsMain cmd="addMessages" class="edu.umd.cs.findbugs.AddMessages">
<Description>add msgs (e.g., textual descriptions of bugs) to analysis results
</Description>
</FindBugsMain>
<FindBugsMain cmd="analyze" class="edu.umd.cs.findbugs.FindBugs2">
<Description>Perform FindBugs Analysis</Description>
</FindBugsMain>
<FindBugsMain cmd="gui" class="edu.umd.cs.findbugs.gui2.Driver">
<Description>Launch FindBugs GUI</Description>
</FindBugsMain>
<FindBugsMain cmd="list" class="edu.umd.cs.findbugs.PrintingBugReporter">
<Description>Convert analysis results to textual form</Description>
</FindBugsMain>
<FindBugsMain cmd="help" class="edu.umd.cs.findbugs.ShowHelp">
<Description>Provide help for commands</Description>
</FindBugsMain>
<FindBugsMain cmd="version" class="edu.umd.cs.findbugs.Version">
<Description>List FindBugs version</Description>
</FindBugsMain>
<FindBugsMain cmd="filter" class="edu.umd.cs.findbugs.workflow.Filter">
<Description>Filter analysis results</Description>
</FindBugsMain>
<FindBugsMain cmd="set" class="edu.umd.cs.findbugs.workflow.SetBugDatabaseInfo">
<Description>Set project configuration/options</Description>
</FindBugsMain>
<FindBugsMain cmd="history" class="edu.umd.cs.findbugs.workflow.MineBugHistory">
<Description>List details from multi-version analysis results</Description>
</FindBugsMain>
<FindBugsMain cmd="union" class="edu.umd.cs.findbugs.workflow.UnionResults">
<Description>Merge analysis results from disjoint components</Description>
</FindBugsMain>
<FindBugsMain cmd="merge" class="edu.umd.cs.findbugs.workflow.Update">
<Description>Combine analysis results from different versions of software to produce multi-version analysis results </Description>
</FindBugsMain>
<FindBugsMain cmd="dis" class="edu.umd.cs.findbugs.workflow.PrintClass">
<Description>Disassemble a class file</Description>
</FindBugsMain>
<FindBugsMain cmd="errors" class="edu.umd.cs.findbugs.workflowListErrors">
<Description>List analysis errors stored in results file
</Description>
</FindBugsMain>
<!-- On changing this, please also update default cloud id in FindbugsPlugin -->
<Cloud id="edu.umd.cs.findbugs.cloud.doNothingCloud">
<Description>(cloud disabled)</Description>
<Details>Bug reviews are disabled when using this plugin.</Details>
</Cloud>
<PluginComponent id="edu.umd.cs.findbugs.bugReporter.SuppressMultithreaded">
<Description>Suppress multithreaded correctness issues</Description>
<Details>Suppress all multithreaded correctness issues</Details>
</PluginComponent>
<PluginComponent id="edu.umd.cs.findbugs.bugReporter.SuppressI18N">
<Description>Suppress internationalization issues</Description>
<Details>Suppress all internationalization issues</Details>
</PluginComponent>
<PluginComponent id="edu.umd.cs.findbugs.bugReporter.SelectivelySuppressI18N">
<Description>Suppress internationalization issues in all but selected packages</Description>
<Details>Suppress all internationalization issues except those specified in the i18n.properties resource</Details>
</PluginComponent>
<PluginComponent id="edu.umd.cs.findbugs.bugReporter.MaxRank14">
<Description>Suppress all issues with rank higher than 14</Description>
<Details>Suppress all issues with rank higher than 14</Details>
</PluginComponent>
<PluginComponent id="edu.umd.cs.findbugs.bugReporter.SuppressMalicious">
<Description>Suppress warnings about vulnerabilities to malicious code</Description>
<Details>Suppress warnings about vulnerabilities to malicious code</Details>
</PluginComponent>
<!--
**********************************************************************
Categories (replacing the BugCategoryDescriptions.properties file)
**********************************************************************
-->
<BugCategory category="CORRECTNESS">
<Description>Correctness</Description>
<Abbreviation>C</Abbreviation>
<Details>Probable bug - an apparent coding mistake
resulting in code that was probably not what the
developer intended. We strive for a low false positive rate.</Details>
</BugCategory>
<BugCategory category="NOISE">
<Description>Bogus random noise</Description>
<Abbreviation>N</Abbreviation>
<Details>Bogus random noise: intended to be useful
as a control in data mining experiments, not in finding actual bugs in software
</Details>
</BugCategory>
<BugCategory category="SECURITY">
<Description>Security</Description>
<Abbreviation>S</Abbreviation>
<Details>A use of untrusted input in a way that could create a remotely exploitable security vulnerability.
</Details>
</BugCategory>
<BugCategory category="BAD_PRACTICE">
<Description>Bad practice</Description>
<Abbreviation>B</Abbreviation>
<Details>Violations of recommended and essential
coding practice. Examples include hash code and equals
problems, cloneable idiom, dropped exceptions,
Serializable problems, and misuse of finalize.
We strive to make this analysis accurate,
although some groups may
not care about some of the bad practices.</Details>
</BugCategory>
<BugCategory category="STYLE">
<Description>Dodgy code</Description>
<Abbreviation>D</Abbreviation>
<Details>code that is confusing, anomalous, or
written in a way that leads itself to errors.
Examples include dead local stores, switch fall through,
unconfirmed casts, and redundant null check of value
known to be null.
More false positives accepted.
In previous versions of FindBugs, this category was known as Style.
</Details>
</BugCategory>
<BugCategory category="PERFORMANCE">
<Description>Performance</Description>
<Abbreviation>P</Abbreviation>
<Details>code that is not necessarily incorrect but may be inefficient</Details>
</BugCategory>
<BugCategory category="MALICIOUS_CODE">
<Description>Malicious code vulnerability</Description>
<Abbreviation>V</Abbreviation>
<Details>code that is vulnerable to attacks from untrusted code</Details>
</BugCategory>
<BugCategory category="MT_CORRECTNESS">
<Description>Multithreaded correctness</Description>
<Abbreviation>M</Abbreviation>
<Details>code flaws having to do with threads, locks, and volatiles</Details>
</BugCategory>
<BugCategory category="I18N">
<Description>Internationalization</Description>
<Abbreviation>I</Abbreviation>
<Details>code flaws having to do with internationalization and locale</Details>
<!-- DM_CONVERT_CASE is the only core bug pattern in this category -->
</BugCategory>
<BugCategory category="EXPERIMENTAL">
<Description>Experimental</Description>
<Abbreviation>X</Abbreviation>
<Details>Experimental and not fully vetted bug patterns</Details>
<!-- DM_CONVERT_CASE is the only core bug pattern in this category -->
</BugCategory>
<!--
**********************************************************************
Detectors
**********************************************************************
-->
<Detector class="edu.umd.cs.findbugs.detect.InitializeNonnullFieldsInConstructor">
<Details>
<![CDATA[
<p> Finds nonnull fields that are not written to in constructors.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.IntCast2LongAsInstant">
<Details>
<![CDATA[
<p> Finds uses of 32-bit values to describe milliseconds since the epoc.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TrainLongInstantfParams">
<Details>
<![CDATA[
<p> Builds database of parameters that take a 64 bit value describing
milliseconds since the epoc.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InconsistentAnnotations">
<Details>
<![CDATA[
<p> This detector finds inconsistencies between type qualifiers directly
applied to method parameters and uses of those method parameters. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.AtomicityProblem">
<Details>
<![CDATA[
<p> Finds sequences of operations (e.g., get/put) on a concurrent abstraction
that will not be executed atomically.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SynchronizationOnSharedBuiltinConstant">
<Details>
<![CDATA[
<p> This detector looks for synchronization on a shared builtin constant (such as a String).</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SynchronizeAndNullCheckField">
<Details>
<![CDATA[
<p> This detector looks for a field that is synchronized on and then null checked.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CheckImmutableAnnotation">
<Details>
<![CDATA[
<p> Looks for violations of the rules for classes annotated as net.jcip.annotations.Immutable or javax.annotation.concurrent.Immutable.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.VarArgsProblems">
<Details>
<![CDATA[
<p> Looks for problems with arising from Java 1.5 var args.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteJCIPAnnotation">
<Details>
<![CDATA[
<p> Record annotations from the net.jcip.annotations package.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteDirectlyRelevantTypeQualifiers">
<Details>
<![CDATA[
<p> Note the type qualifiers relevant to analyzing a method.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BuildInterproceduralCallGraph">
<Details>
<![CDATA[
<p>Builds the interprocedural call graph.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BuildObligationPolicyDatabase">
<Details>
<![CDATA[
<p>Builds the database of obligation types and methods used by the FindUnsatisfiedObligation detector.
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteSuppressedWarnings">
<Details>
<![CDATA[
<p> Suppresses warnings based on use of the edu.umd.cs.findbugs.annotations.NoteSuppressWarnings annotation.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteAnnotationRetention">
<Details>
<![CDATA[
<p> Records annotation retention.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteSyntheticElements">
<Details>
<![CDATA[
<p>Records synthetic classes, methods, fields, etc.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.Methods">
<Details>
<![CDATA[
<p> Builds of database of all methods defined in analyzed classes, for use
by other detectors.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ReflectiveClasses">
<Details>
<![CDATA[
<p> Try to determine which classes have constant references to their .class objects. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CalledMethods">
<Details>
<![CDATA[
<p> Builds of database of all methods invoked in analyzed classes, for use
by other detectors.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FunctionsThatMightBeMistakenForProcedures">
<Details>
<![CDATA[
<p> Looks for immutable classes with methods that return new instances of that class,
where people might accidently think those methods mutate the instance they are invoked on.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ConfusionBetweenInheritedAndOuterMethod">
<Details>
<![CDATA[
<p> Looks for potential confusion between inherited and outer methods.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteCheckReturnValueAnnotations">
<Details>
<![CDATA[
<p> Looks for annotations to check return values of a method.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SynchronizeOnClassLiteralNotGetClass">
<Details>
<![CDATA[
<p> Look for code that synchronizes on the results of getClass rather than on class
literals.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FieldItemSummary">
<Details>
<![CDATA[
<p>
This detector produces summary information for what is stored
into fields.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteNonNullAnnotations">
<Details>
<![CDATA[
<p>
Looks for @NonNull annotations on methods, fields, and parameters.
These can be used by the FindNullDeref detector to generate warnings
when a possibly-null value is used in a context where only
non-null values should be used.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteUnconditionalParamDerefs">
<Details>
<![CDATA[
<p>
Analyze all methods in the application to determine which
dereference parameters unconditionally. This information is used in
a later analysis pass to find call sites where null values may
be passed to those methods.
</p>
<p>
This is a slow detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoteNonnullReturnValues">
<Details>
<![CDATA[
<p>
Analyze all methods in the application to determine which
methods always return nonnull values.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BooleanReturnNull">
<Details>
<![CDATA[
<p> Looks for methods with Boolean return type that return explicit null values.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BadUseOfReturnValue">
<Details>
<![CDATA[
<p> Looks for cases where the return value of a function is discarded
after being checked for non-null. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InheritanceUnsafeGetResource">
<Details>
<![CDATA[
<p> Looks for uses of this.getClass().getResource(...), which can give
unexpected results if the class is extended by a class in
another package. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InfiniteRecursiveLoop">
<Details>
<![CDATA[
<p> Looks for an infinite recursive loop. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InfiniteLoop">
<Details>
<![CDATA[
<p> Looks for an infinite loop. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.VolatileUsage">
<Details>
<![CDATA[
<p> Looks for bug patterns in the usage of volatile fields. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.EmptyZipFileEntry">
<Details>
<![CDATA[
<p> This looks for creation of empty zip file entries. It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.UncallableMethodOfAnonymousClass">
<Details>
<![CDATA[
<p> This detector looks for anonymous inner classes that define methods
that are probably intended to but do not override methods in a superclass.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DontUseEnum">
<Details>
<![CDATA[
<p>Checks that fields and methods don't use the name assert or enum as they are keywords in Java 5.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.URLProblems">
<Details>
<![CDATA[
<p> The equals and hashCode method on <code>java.net.URL</code> resolve
the domain name. As a result, these operations can be very expensive, and this
detector looks for places where those methods might be invoked.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FinalizerNullsFields">
<Details>
<![CDATA[
<p> This detector looks for finalizers that null out fields of a class.
This does not help the garbage collector in any way, the nulling out of fields has no effect.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CrossSiteScripting">
<Details>
<![CDATA[
<p> This detector looks for obvious/blatant cases of cross site scripting vulnerabilities.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.RepeatedConditionals">
<Details>
<![CDATA[
<p> This detector looks for code containing repeated conditional tests, such as (x == 5 || x == 5).
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CallToUnsupportedMethod">
<Details>
<![CDATA[
<p> This detector looks for calls to methods that are unsupported.
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FormatStringChecker">
<Details>
<![CDATA[
<p> Checks for incorrect format strings.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.EqualsOperandShouldHaveClassCompatibleWithThis">
<Details>
<![CDATA[
<p> Checks for equals methods that check for their operand being an instance of a class
that is not compatible with the class defining the equals method.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TestingGround">
<Details>
<![CDATA[
<p> This detector is just a hook for testing new detectors.
Normally, this detector does nothing.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TestingGround2">
<Details>
<![CDATA[
<p> This detector is just a hook for testing new detectors.
Normally, this detector does nothing.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.LostLoggerDueToWeakReference">
<Details>
<![CDATA[
<p> This detector finds code that behaves differently under OpenJDK 1.6, where
weak references are used to hold onto Loggers.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TestingGround2">
<Details>
<![CDATA[
<p> This detector is just a hook for testing new detectors.
Normally, this detector does nothing.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.Noise">
<Details>
<![CDATA[
<p> This detector generates a random signal: warnings that are just based on
hash values of the operations performed by methods.
These warnings are bogus random noise, intended to be useful
as a control in data mining experiments, not in finding actual bugs in software
This detector is just a hook for testing new detectors.
Normally, this detector does nothing.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NoiseNullDeref">
<Details>
<![CDATA[
<p> Noisy detector for null dereferences. Intended to be used as a control in experiments
about the validity or predictive ability of warnings, not as a way to find problems in code.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.HugeSharedStringConstants">
<Details>
<![CDATA[
<p> This detector looks for string constants that are duplicated across multiple classfiles.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DoInsideDoPrivileged">
<Details>
<![CDATA[
<p> Look for code that should be executed inside doPrivileged blocks.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ResolveAllReferences">
<Details>
<![CDATA[
<p> Checks that all references call be resolved. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SwitchFallthrough">
<Details>
<![CDATA[
<p> This detector looks for switch statements containing fall through.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindFieldSelfAssignment">
<Details>
<![CDATA[
<p> This detector looks for places where a field is assigned
by reading the value of the same field. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindSelfComparison">
<Details>
<![CDATA[
<p> This detector looks for places where a value is compared with itself.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindSelfComparison2">
<Details>
<![CDATA[
<p> This detector looks for places where a value is compared with itself.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindNonShortCircuit">
<Details>
<![CDATA[
<p> This detector looks for suspicious uses of non-short-circuiting
boolean operators (<code>|</code> and <code>&</code> instead of
<code>||</code> and <code>&&</code>).</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DontCatchIllegalMonitorStateException">
<Details>
<![CDATA[
<p> This detector looks for try-catch blocks that catch an IllegalMonitorStateException.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindFloatMath">
<Details>
<![CDATA[
<p> This detector looks for uses of floating point math. It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CloneIdiom">
<Details>
<![CDATA[
<p> This detector looks for violations of the idioms for writing
cloneable classes. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ComparatorIdiom">
<Details>
<![CDATA[
<p> This detector looks for violations of the idioms for writing
classes that implement <code>Comparator</code>. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DroppedException">
<Details>
<![CDATA[
<p> This detector looks for code where an exception is caught,
but nothing is done to handle the exception. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.LoadOfKnownNullValue">
<Details>
<![CDATA[
<p> Looks for loads of values known to be null.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DumbMethodInvocations">
<Details>
<![CDATA[
<p> This detector looks for bad arguments being passed to methods
(e.g., substring(0)).
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DumbMethods">
<Details>
<![CDATA[
<p> This detector looks for calls to pointless methods,
such as the no-argument String constructor.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.NumberConstructor">
<Details>
<![CDATA[
<p> Looks for calls to Number constructors with primitive arguments.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindDoubleCheck">
<Details>
<![CDATA[
<p> This detector looks for instances of double checked locking.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindFinalizeInvocations">
<Details>
<![CDATA[
<p> This detector looks for calls to finalize() and other finalizer-related
issues. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindHEmismatch">
<Details>
<![CDATA[
<p> This detector looks for problems in the definition of the hashCode() and equals()
methods. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.OverridingEqualsNotSymmetrical">
<Details>
<![CDATA[
<p> Looks for equals methods that override equals methods in a superclass where the equivalence relationship might not be symmetrical.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindNakedNotify">
<Details>
<![CDATA[
<p> This detector looks for calls to notify() that don't seem
to modify mutable object state. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindReturnRef">
<Details>
<![CDATA[
<p> This detector looks for methods that return mutable static data.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindRunInvocations">
<Details>
<![CDATA[
<p> This detector looks for calls to Thread.run(). It is a fast
detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindSpinLoop">
<Details>
<![CDATA[
<p> This detector looks for loops that spin reading from a field.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindTwoLockWait">
<Details>
<![CDATA[
<p> This detector looks for calls to wait() with two (or more) locks held.
It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUnconditionalWait">
<Details>
<![CDATA[
<p> This detector looks for calls to wait() not in a conditional or loop.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUninitializedGet">
<Details>
<![CDATA[
<p> This detector looks for reads of uninitialized fields in constructors.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUnsyncGet">
<Details>
<![CDATA[
<p> This detector looks for get and set methods where the get is unsynchronized
while the set is synchronized. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InitializationChain">
<Details>
<![CDATA[
<p> This detector looks for potentially circular class initialization
dependencies. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.IteratorIdioms">
<Details>
<![CDATA[
<p> This iterator looks for problems in how Iterator classes are defined.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.LockedFields">
<Details>
<![CDATA[
<p> This detector looks for fields that are accessed in an inconsistent manner
with respect to locking. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.EqStringTest">
<Details>
<![CDATA[
<p> This detector looks for comparisons of String objects using the == or !=
operators.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.MutableLock">
<Details>
<![CDATA[
<p> This detector looks for synchronization on objects read from
modified fields. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SynchronizingOnContentsOfFieldToProtectField">
<Details>
<![CDATA[
<p> This detector looks for code that seems to be synchronizing on a field in order
to guard updates of that field.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.MutableStaticFields">
<Details>
<![CDATA[
<p> This detector looks for static fields that may be modified by
malicious code. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.Naming">
<Details>
<![CDATA[
<p> This detector looks for suspiciously-named methods. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ReadReturnShouldBeChecked">
<Details>
<![CDATA[
<p> This detector looks for calls to InputStream.read() or InputStream.skip() where the
return value is ignored. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SerializableIdiom">
<Details>
<![CDATA[
<p> This detector looks for potential problems in the implementation
of Serializable classes. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.StartInConstructor">
<Details>
<![CDATA[
<p> This detector looks for constructors that start threads. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindBadForLoop">
<Details>
<![CDATA[
<p> This detector looks for incorrect for loops.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ExplicitSerialization">
<Details>
<![CDATA[
<p> Looks for explicit serialization via readObject and
writeObject as evidence
that this class is, indeed, serialized. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.UnreadFields">
<Details>
<![CDATA[
<p> This detector looks for fields whose value is never read. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.WaitInLoop">
<Details>
<![CDATA[
<p> This detector looks for calls to wait() that are not in a loop.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BCPMethodReturnCheck">
<Details>
<![CDATA[
<p> This detector looks for calls to methods where the return value
is suspiciously ignored. It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindNullDeref">
<Details>
<![CDATA[
<p> This detector looks for places where a null pointer exception might
occur. It also looks for redundant comparisons of reference values against
null. It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindNullDerefsInvolvingNonShortCircuitEvaluation">
<Details>
<![CDATA[
<p> This detector looks for places where a null pointer exception might
occur, and the use of non-short-circuit evaluation causes the usual techniques to fail.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindOpenStream">
<Details>
<![CDATA[
<p> This detector looks for IO stream objects which do not escape the
method and do not appear to be closed on all paths out of the method.
It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.PreferZeroLengthArrays">
<Details>
<![CDATA[
<p> This detector looks for methods that return either arrays or an explicit null reference.
Returning a zero length array is generally preferred in this context to returning a null reference.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUselessControlFlow">
<Details>
<![CDATA[
<p> This detector looks for control flow statements which have no effect.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUnreleasedLock">
<Details>
<![CDATA[
<p> This detector looks for JSR-166 (<code>java.util.concurrent</code>)
locks which are acquired, but not released on all paths out of the method.
It is a moderately fast detector. Note that in order to use this
detector, you need to have the <code>java.util.concurrent</code> package
in the auxiliary classpath (or be analyzing the package itself).</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindRefComparison">
<Details>
<![CDATA[
<p> This detector looks for places where two reference values are compared
with the == or != operator, and the class is of a type (such as <code>java.lang.String</code>)
where comparing reference values is generally an error. It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindMismatchedWaitOrNotify">
<Details>
<![CDATA[
<p> This detector looks for calls to wait(), notify(), or notifyAll()
which do not appear to be made on an object which is currently locked.
It is a moderately fast detector. <b>This detector is disabled because
it is still under development, and produces too many false positives.</b></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindEmptySynchronizedBlock">
<Details>
<![CDATA[
<p> This detector looks for empty synchronized blocks.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindInconsistentSync2">
<Details>
<![CDATA[
<p> This detector looks for fields that are accessed in an inconsistent manner
with respect to locking. It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindLocalSelfAssignment2">
<Details>
<![CDATA[
<p> This detector looks for self assignments of local variables.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.IncompatMask">
<Details>
<![CDATA[
<p> This detector looks for suspicious bitwise logical expressions.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.LazyInit">
<Details>
<![CDATA[
<p> This detector looks for lazy field initialization where the
field is not volatile. It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindJSR166LockMonitorenter">
<Details>
<![CDATA[
<p> This detector looks for ordinary synchronization performed
on JSR166 locks. It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUncalledPrivateMethods">
<Details>
<![CDATA[
<p> This detector looks for private methods that are never called.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.StringConcatenation">
<Details>
<![CDATA[
<p> This detector looks for String concatenation in loops using +.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InefficientToArray">
<Details>
<![CDATA[
<p> This detector looks for code that converts Collections to arrays
using the toArray() method that takes a prototype array, passing
an array argument which is zero-length.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InvalidJUnitTest">
<Details>
<![CDATA[
<p> This detector looks for JUnit tests that are malformed.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BadlyOverriddenAdapter">
<Details>
<![CDATA[
<p> This detector looks for code that extends an Adapter class and overrides a Listener
method with the wrong signature. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BadResultSetAccess">
<Details>
<![CDATA[
<p> This detector looks for calls to getXXX or setXXX methods of a result set where the
field index is 0. As ResultSet fields start at index 1, this is always a mistake.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SuperfluousInstanceOf">
<Details>
<![CDATA[
<p> This detector looks for type checks using the instanceof operator where the determination
can be done statically. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BadAppletConstructor">
<Details>
<![CDATA[
<p>
This detector looks for Applet constructors that call methods in the parent
Applet that rely on the Applet stub. Since this stub isn't initialized until just
before the init() method, these methods will fail in the constructor.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.SuspiciousThreadInterrupted">
<Details>
<![CDATA[
<p>
This detector looks for calls to Thread.interrupted() from a non static context. If it is called from
Thread.currentThread().interrupted(), then it is just a useless exercise, just use Thread.interrupted().
However if it is called on an arbitrary thread object, it is most probably an error, as interrupted()
is always called on the current thread.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindSqlInjection">
<Details>
<![CDATA[
<p>
This detector uses data flow analysis to look for invocations of execute methods
on SQL statements in switch something other than a constant string is passed as an argument.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindDeadLocalStores">
<Details>
<![CDATA[
<p>
This detector looks for assignments to local variables that
are never subsequently read. It is a moderately fast detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindMaskedFields">
<Details>
<![CDATA[
<p> This detector looks for class level fields that are masked by
local fields defined in methods.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.WrongMapIterator">
<Details>
<![CDATA[
<p> This detector looks for accessing the value of a Map entry, using a key that was retrieved from
a keySet iterator. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InstantiateStaticClass">
<Details>
<![CDATA[
<p> This detector looks for code that creates objects based on classes that only define static methods.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.RuntimeExceptionCapture">
<Details>
<![CDATA[
<p> This detector looks for catch clauses that catch Exception,
when no code in the block throws Exception. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindFloatEquality">
<Details>
<![CDATA[
<p> Looks for floating point equality expressions. A fast detector. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUnsatisfiedObligation">
<Details>
<![CDATA[
<p>This detector looks for I/O streams and database resources that
are not cleaned up on all paths out of a method. This is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.UnnecessaryMath">
<Details>
<![CDATA[
<p>This detector looks for code that calls java.lang.Math static methods on constant values,
where the resultant value is a statically known constant. It is faster, and sometimes more
accurate, to use the constant instead.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindCircularDependencies">
<Details>
<![CDATA[
<p>This detector looks circular dependencies among classes. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.RedundantInterfaces">
<Details>
<![CDATA[
<p>This detector looks for classes that declare they implement the same interface
as a super class. This is redundant, if a superclass implements an interface, so does
the subclass.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.MultithreadedInstanceAccess">
<Details>
<![CDATA[
<p>This detector looks for potential problems in implementing the Struts framework.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.PublicSemaphores">
<Details>
<![CDATA[
<p>This detector looks for public classes that synchronize and use wait(), notify() or notifyAll()
on <b>this</b>. This exposes a synchronization implementation as a public artifact of the class.
Clients of the class may use an instance of the class as it's own synchronizing object, and cause
havoc to the base implementation.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.MethodReturnCheck">
<Details>
<![CDATA[
<p> This detector looks for calls to methods where the return value
is suspiciously ignored. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.IDivResultCastToDouble">
<Details>
<![CDATA[
<p>
This detector looks for places where the result of integer division is
cast to double. Often, what was meant was to cast the integer operands
to double and then perform the division.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindBadCast2">
<Details>
<![CDATA[
<p>
This detector looks for bad casts of object references using data flow analysis.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindNonSerializableStoreIntoSession">
<Details>
<![CDATA[
<p>
This detector looks for stores of non Serializable objects into HTTP sessions.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUseOfNonSerializableValue">
<Details>
<![CDATA[
<p>
This detector looks for uses of of non Serializable objects in contexts that require them to be serializable.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindNonSerializableValuePassedToWriteObject">
<Details>
<![CDATA[
<p>
This detector looks for non Serializable objects passed to the writeObject method of
an ObjectOutput.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.BadSyntaxForRegularExpression">
<Details>
<![CDATA[
<p> This detector looks for regular expressions that have invalid syntax. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindPuzzlers">
<Details>
<![CDATA[
<p> This detector problems looks for miscellaneous small errors
mentioned by Joshua Bloch and Neal Gafter in
their work on Programming Puzzlers.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindSleepWithLockHeld">
<Details>
<![CDATA[
<p>
This detector looks for calls to Thread.sleep() made with
a lock held. It is a slow detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DuplicateBranches">
<Details>
<![CDATA[
<p> This detector looks for if/else or switch statements that have the
same code for two branches, thus rendering the test useless. This often
is caused by copying and pasting the two branches, causing incorrect logic
for the one branch.</p><p></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.InefficientMemberAccess">
<Details>
<![CDATA[
<p> This detector looks for internal classes that write to member variables of the
owning class, when that member variable is private. In this case, a special compiler
generated accessor method needs to be used to write to this variable. Relaxing the
visibility to protected will allow the field to be directly written.</p>
<p></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.XMLFactoryBypass">
<Details>
<![CDATA[
<p> This detector looks for direct allocations of implementations of XML interfaces.
This ties the code to a specific implementation, rather than using the supplied
factory pattern to create these objects.</p>
<p></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.UselessSubclassMethod">
<Details>
<![CDATA[
<p>
This detector looks for subclasses that implement methods defined in the super
class, that only pass the parameters untouched to the parent class method.
These methods can just be removed.
</p>
<p></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.ConfusedInheritance">
<Details>
<![CDATA[
<p>
This detector for final classes that declare protected members. As this
class can not be derived from, the use of protected access for members is
incorrect. The access should be changed to public or private to represent
the correct intention of the field. This was probably caused by a change in
use for this class, without completely changing all of the class to the new
paradigm.
</p>
<p></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.QuestionableBooleanAssignment">
<Details>
<![CDATA[
<p>
This detector looks for simple assignments of literal boolean values to variables in
conditional expressions.
</p>
<p></p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TrainNullReturnValues">
<Details>
<![CDATA[
<p>
TrainNullReturnValues determines which methods may return null and saves
them to a file. The resulting file may be used in a subsequent
pass to improve the precision of the null-dereference detector.
Since this is just a training pass, no warnings are reported.
</p>
<p>
This is a slow detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TrainUnconditionalDerefParams">
<Details>
<![CDATA[
<p>
TrainUnconditionalParamDerefs determines which methods may
unconditionally dereference parameters and saves them to a file.
The resulting file may be used in a subsequent
pass to improve the precision of the null-dereference detector.
Since this is just a training pass, no warnings are reported.
</p>
<p>
This is a slow detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TrainFieldStoreTypes">
<Details>
<![CDATA[
<p>
TrainFieldStoreTypes analyzes the types stored into fields
and stores them to a database. The database may be used in a later
pass to make type analysis more precise.
</p>
<p>
This is a slow detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TrainNonNullAnnotations">
<Details>
<![CDATA[
<p>
TrainNonNullAnnotations collects @NonNull and @PossiblyNull annotations
and stores them to database files. This is a fast detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CheckCalls">
<Details>
<![CDATA[
<p>This detector is just for debugging method call resolution in FindBugs.
Don't enable it.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindBugsSummaryStats">
<Details>
<![CDATA[
<p> This detector just collects summary statistics information about the analysis process. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TestASM">
<Details>
<![CDATA[
<p>
This detector is a code example showing how to write a FindBugs
detector using the ASM bytecode analysis framework.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.FindUnrelatedTypesInGenericContainer">
<Details>
<![CDATA[
<p> This detector looks at the arguments of calls to generic
collection methods that receive a <code>java.lang.Object</code>
to see if the argument's type is related to the collection's
parameter. Arguments with unrelated class types are never going
to be in the collection. For example, if <code>foo</code> is a
<code>List<String></code> and <code>bar</code> is a
<code>StringBuffer</code>, the call <code>foo.contains(bar)</code>
will always return false. This is a fast detector.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.StaticCalendarDetector">
<Details>
<![CDATA[
<p>This detector warns about static fields of type java.util.Calendar or java.text.DateFormat (and subclasses) because
Calendars are inherently unsafe for multithreaded use.
</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.TestDataflowAnalysis">
<Details>
<![CDATA[
<p>This is an internal detector used only for testing dataflow analyses.
It is not enabled by default.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CheckTypeQualifiers">
<Details>
<![CDATA[
<p>Check for violations of properties specified by JSR-305
type qualifier annotations.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.AppendingToAnObjectOutputStream">
<Details>
<![CDATA[
<p>Looks for an attempt to append to an object output stream</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CheckExpectedWarnings">
<Details>
<![CDATA[
<p>Checks @ExpectedWarning and @NoWarning annotations.
This detector is used only for testing FindBugs.</p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DontIgnoreResultOfPutIfAbsent">
<Details>
<![CDATA[
<p>Checks that if the result of putIfAbsent is ignored,
the value passed as the second argument is not reused. </p>
]]>
</Details>
</Detector>
<Detector
class="edu.umd.cs.findbugs.detect.ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass">
<Details>
<![CDATA[
<p>Checks for methods invoked from constructors for superclasses. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.DefaultEncodingDetector">
<Details>
<![CDATA[
<p> Checks for calls to methods which perform a byte to String (or String to byte) conversion using the user's default
platform encoding. This can cause the application behaviour to vary between platforms. </p>
]]>
</Details>
</Detector>
<Detector class="edu.umd.cs.findbugs.detect.CheckRelaxingNullnessAnnotation">
<Details>
<![CDATA[
<p>Checks that overriding methods do not relax @Nonnull (made @CheckForNull) on return values
or @CheckForNull (made @Nonnull) on parameters.</p>
]]>
</Details>
</Detector>
<!--
**********************************************************************
BugPatterns
**********************************************************************
-->
<BugPattern type="SKIPPED_CLASS_TOO_BIG">
<ShortDescription>Class too big for analysis</ShortDescription>
<LongDescription>{0} is too big for analysis</LongDescription>
<Details>
<![CDATA[
<p>This class is bigger than can be effectively handled, and was not fully analyzed for errors.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NOISE_NULL_DEREFERENCE">
<ShortDescription>Bogus warning about a null pointer dereference</ShortDescription>
<LongDescription>Bogus warning about a null pointer dereference in {1}</LongDescription>
<Details>
<![CDATA[
<p>Bogus warning.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NOISE_METHOD_CALL">
<ShortDescription>Bogus warning about a method call</ShortDescription>
<LongDescription>Bogus warning about a method call {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>Bogus warning.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NOISE_FIELD_REFERENCE">
<ShortDescription>Bogus warning about a field reference</ShortDescription>
<LongDescription>Bogus warning about a reference to {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>Bogus warning.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NOISE_OPERATION">
<ShortDescription>Bogus warning about an operation</ShortDescription>
<LongDescription>Bogus warning about an operation {1}</LongDescription>
<Details>
<![CDATA[
<p>Bogus warning.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">
<ShortDescription>BigDecimal constructed from double that isn't represented precisely</ShortDescription>
<LongDescription>BigDecimal constructed from {4} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code creates a BigDecimal from a double value that doesn't translate well to a
decimal number.
For example, one might assume that writing new BigDecimal(0.1) in Java creates a BigDecimal which is exactly equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625.
You probably want to use the BigDecimal.valueOf(double d) method, which uses the String representation
of the double to create the BigDecimal (e.g., BigDecimal.valueOf(0.1) gives 0.1).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_DOH">
<ShortDescription>D'oh! A nonsensical method invocation</ShortDescription>
<LongDescription>D'oh! A nonsensical invocation of {2.nameAndSignature} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This partical method invocation doesn't make sense, for reasons that should be apparent from inspection.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">
<ShortDescription>Useless/vacuous call to EasyMock method</ShortDescription>
<LongDescription>Useless/vacuous call to {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS">
<ShortDescription>Creation of ScheduledThreadPoolExecutor with zero core threads</ShortDescription>
<LongDescription>Creation of ScheduledThreadPoolExecutor with zero core threads in {1}</LongDescription>
<Details>
<![CDATA[
<p>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html#ScheduledThreadPoolExecutor(int)">Javadoc</a>)
A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR">
<ShortDescription>Futile attempt to change max pool size of ScheduledThreadPoolExecutor</ShortDescription>
<LongDescription>Futile attempt to change max pool size of ScheduledThreadPoolExecutor in {1}</LongDescription>
<Details>
<![CDATA[
<p>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html">Javadoc</a>)
While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_UNSUPPORTED_METHOD">
<ShortDescription>Call to unsupported method</ShortDescription>
<LongDescription>Call to unsupported method {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>All targets of this method invocation throw an UnsupportedOperationException.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_EMPTY_DB_PASSWORD">
<ShortDescription>Empty database password</ShortDescription>
<LongDescription>Empty database password in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_CONSTANT_DB_PASSWORD">
<ShortDescription>Hardcoded constant database password</ShortDescription>
<LongDescription>Hardcoded constant database password in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can
easily learn the password.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="HRS_REQUEST_PARAMETER_TO_COOKIE">
<ShortDescription>HTTP cookie formed from untrusted input</ShortDescription>
<LongDescription>HTTP cookie formed from untrusted input in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting
vulnerability. See <a href="http://en.wikipedia.org/wiki/HTTP_response_splitting">http://en.wikipedia.org/wiki/HTTP_response_splitting</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of HTTP response splitting.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">
<ShortDescription>HTTP Response splitting vulnerability</ShortDescription>
<LongDescription>HTTP parameter directly written to HTTP header output in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting
vulnerability. See <a href="http://en.wikipedia.org/wiki/HTTP_response_splitting">http://en.wikipedia.org/wiki/HTTP_response_splitting</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of HTTP response splitting.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="PT_RELATIVE_PATH_TRAVERSAL">
<ShortDescription>Relative path traversal in servlet</ShortDescription>
<LongDescription>Relative path traversal in {1}</LongDescription>
<Details>
<![CDATA[
<p>The software uses an HTTP request parameter to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.
See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org/data/definitions/23.html</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of relative path traversal.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
vulnerabilities that FindBugs doesn't report. If you are concerned about relative path traversal, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="PT_ABSOLUTE_PATH_TRAVERSAL">
<ShortDescription>Absolute path traversal in servlet</ShortDescription>
<LongDescription>Absolute path traversal in {1}</LongDescription>
<Details>
<![CDATA[
<p>The software uses an HTTP request parameter to construct a pathname that should be within a restricted directory,
but it does not properly neutralize absolute path sequences such as "/abs/path" that can resolve to a location that is outside of that directory.
See <a href="http://cwe.mitre.org/data/definitions/36.html">http://cwe.mitre.org/data/definitions/36.html</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of absolute path traversal.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
vulnerabilities that FindBugs doesn't report. If you are concerned about absolute path traversal, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">
<ShortDescription>Servlet reflected cross site scripting vulnerability</ShortDescription>
<LongDescription>HTTP parameter written to Servlet output in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting
vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="XSS_REQUEST_PARAMETER_TO_SEND_ERROR">
<ShortDescription>Servlet reflected cross site scripting vulnerability in error page</ShortDescription>
<LongDescription>HTTP parameter written to Servlet error page in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows
for a reflected cross site scripting
vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="XSS_REQUEST_PARAMETER_TO_JSP_WRITER">
<ShortDescription>JSP reflected cross site scripting vulnerability</ShortDescription>
<LongDescription>HTTP parameter directly written to JSP output, giving reflected XSS vulnerability in {1.class}</LongDescription>
<Details>
<![CDATA[
<p>This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting
vulnerability. See <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a>
for more information.</p>
<p>FindBugs looks only for the most blatant, obvious cases of cross site scripting.
If FindBugs found <em>any</em>, you <em>almost certainly</em> have more cross site scripting
vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously
consider using a commercial static analysis or pen-testing tool.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">
<ShortDescription>Certain swing methods needs to be invoked in Swing thread</ShortDescription>
<LongDescription>Call to swing method in {1} needs to be performed in Swing event thread</LongDescription>
<Details>
<![CDATA[
<p>(<a href="http://web.archive.org/web/20090526170426/http://java.sun.com/developer/JDCTechTips/2003/tt1208.html">From JDC Tech Tip</a>): The Swing methods
show(), setVisible(), and pack() will create the associated peer for the frame.
With the creation of the peer, the system creates the event dispatch thread.
This makes things problematic because the event dispatch thread could be notifying
listeners while pack and validate are still processing. This situation could result in
two threads going through the Swing component-based GUI -- it's a serious flaw that
could result in deadlocks or other related threading issues. A pack call causes
components to be realized. As they are being realized (that is, not necessarily
visible), they could trigger listener notification on the event dispatch thread.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IL_INFINITE_LOOP">
<ShortDescription>An apparent infinite loop</ShortDescription>
<LongDescription>There is an apparent infinite loop in {1}</LongDescription>
<Details>
<![CDATA[
<p>This loop doesn't seem to have a way to terminate (other than by perhaps
throwing an exception).</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IL_INFINITE_RECURSIVE_LOOP">
<ShortDescription>An apparent infinite recursive loop</ShortDescription>
<LongDescription>There is an apparent infinite recursive loop in {1}</LongDescription>
<Details>
<![CDATA[
<p>This method unconditionally invokes itself. This would seem to indicate
an infinite recursive loop that will result in a stack overflow.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IL_CONTAINER_ADDED_TO_ITSELF">
<ShortDescription>A collection is added to itself</ShortDescription>
<LongDescription>A collection is added to itself in {1}</LongDescription>
<Details>
<![CDATA[
<p>A collection is added to itself. As a result, computing the hashCode of this
set will throw a StackOverflowException.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VO_VOLATILE_REFERENCE_TO_ARRAY">
<ShortDescription>A volatile reference to an array doesn't treat the array elements as volatile</ShortDescription>
<LongDescription>{1} is a volatile reference to an array; the array elements are non-volatile</LongDescription>
<Details>
<![CDATA[
<p>This declares a volatile reference to an array, which might not be what
you want. With a volatile reference to an array, reads and writes of
the reference to the array are treated as volatile, but the array elements
are non-volatile. To get volatile array elements, you will need to use
one of the atomic array classes in java.util.concurrent (provided
in Java 5.0).</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VO_VOLATILE_INCREMENT">
<ShortDescription>An increment to a volatile field isn't atomic</ShortDescription>
<LongDescription>Increment of volatile field {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code increments a volatile field. Increments of volatile fields aren't
atomic. If more than one thread is incrementing the field at the same time,
increments could be lost.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UI_INHERITANCE_UNSAFE_GETRESOURCE">
<ShortDescription>Usage of GetResource may be unsafe if class is extended</ShortDescription>
<LongDescription>Usage of GetResource in {1} may be unsafe if class is extended</LongDescription>
<Details>
<![CDATA[
<p>Calling <code>this.getClass().getResource(...)</code> could give
results other than expected if this class is extended by a class in
another package.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_BOOLEAN_RETURN_NULL">
<ShortDescription>Method with Boolean return type returns explicit null</ShortDescription>
<LongDescription>{1} has Boolean return type and returns explicit null</LongDescription>
<Details>
<![CDATA[
<p>
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen.
This method can be invoked as though it returned a value of type boolean, and
the compiler will insert automatic unboxing of the Boolean value. If a null value is returned,
this will result in a NullPointerException.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">
<ShortDescription>Nonnull field is not initialized</ShortDescription>
<LongDescription>Nonnull field {2.name} is not initialized by {1}</LongDescription>
<Details>
<![CDATA[
<p> The field is marked as nonnull, but isn't written to by the constructor.
The field might be initialized elsewhere during constructor, or might always
be initialized before use.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_SYNC_AND_NULL_CHECK_FIELD">
<ShortDescription>Synchronize and null check on the same field.</ShortDescription>
<LongDescription>In {1} the field {2.givenClass} is synchronized on and then checked if null.</LongDescription>
<Details>
<![CDATA[
<p>Since the field is synchronized on, it seems not likely to be null.
If it is null and then synchronized on a NullPointerException will be
thrown and the check would be pointless. Better to synchronize on
another field.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RpC_REPEATED_CONDITIONAL_TEST">
<ShortDescription>Repeated conditional tests</ShortDescription>
<LongDescription>Repeated conditional test in {1}</LongDescription>
<Details>
<![CDATA[
<p>The code contains a conditional test is performed twice, one right after the other
(e.g., <code>x == 0 || x == 0</code>). Perhaps the second occurrence is intended to be something else
(e.g., <code>x == 0 || y == 0</code>).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TESTING">
<ShortDescription>Testing</ShortDescription>
<LongDescription>Test warning generated in {1}</LongDescription>
<Details>
<![CDATA[
<p>This bug pattern is only generated by new, incompletely implemented
bug detectors.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TESTING1">
<ShortDescription>Testing 1 </ShortDescription>
<LongDescription>Test warning 1 generated in {1}</LongDescription>
<Details>
<![CDATA[
<p>This bug pattern is only generated by new, incompletely implemented
bug detectors.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TESTING2">
<ShortDescription>Testing 2</ShortDescription>
<LongDescription>Test warning 2 generated in {1}</LongDescription>
<Details>
<![CDATA[
<p>This bug pattern is only generated by new, incompletely implemented
bug detectors.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TESTING3">
<ShortDescription>Testing 3</ShortDescription>
<LongDescription>Test warning 3 generated in {1}</LongDescription>
<Details>
<![CDATA[
<p>This bug pattern is only generated by new, incompletely implemented
bug detectors.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UNKNOWN">
<ShortDescription>Unknown bug pattern</ShortDescription>
<LongDescription>Unknown bug pattern BUG_PATTERN in {1}</LongDescription>
<Details>
<![CDATA[
<p>A warning was recorded, but findbugs can't find the description of this bug pattern
and so can't describe it. This should occur only in cases of a bug in FindBugs or its configuration,
or perhaps if an analysis was generated using a plugin, but that plugin is not currently loaded.
.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="AM_CREATES_EMPTY_ZIP_FILE_ENTRY">
<ShortDescription>Creates an empty zip file entry</ShortDescription>
<LongDescription>Empty zip file entry created in {1}</LongDescription>
<Details>
<![CDATA[
<p>The code calls <code>putNextEntry()</code>, immediately
followed by a call to <code>closeEntry()</code>. This results
in an empty ZipFile entry. The contents of the entry
should be written to the ZipFile between the calls to
<code>putNextEntry()</code> and
<code>closeEntry()</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="AM_CREATES_EMPTY_JAR_FILE_ENTRY">
<ShortDescription>Creates an empty jar file entry</ShortDescription>
<LongDescription>Empty jar file entry created in {1}</LongDescription>
<Details>
<![CDATA[
<p>The code calls <code>putNextEntry()</code>, immediately
followed by a call to <code>closeEntry()</code>. This results
in an empty JarFile entry. The contents of the entry
should be written to the JarFile between the calls to
<code>putNextEntry()</code> and
<code>closeEntry()</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IMSE_DONT_CATCH_IMSE">
<ShortDescription>Dubious catching of IllegalMonitorStateException</ShortDescription>
<LongDescription>Dubious catching of IllegalMonitorStateException in {1}</LongDescription>
<Details>
<![CDATA[
<p>IllegalMonitorStateException is generally only
thrown in case of a design flaw in your code (calling wait or
notify on an object you do not hold a lock on).</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FL_MATH_USING_FLOAT_PRECISION">
<ShortDescription>Method performs math using floating point precision</ShortDescription>
<LongDescription>{1} performs math using floating point precision</LongDescription>
<Details>
<![CDATA[
<p>
The method performs math operations using floating point precision.
Floating point precision is very imprecise. For example,
16777216.0f + 1.0f = 16777216.0f. Consider using double math instead.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="CN_IDIOM">
<ShortDescription>Class implements Cloneable but does not define or use clone method</ShortDescription>
<LongDescription>Class {0} implements Cloneable but does not define or use clone method</LongDescription>
<Details>
<![CDATA[
<p>
Class implements Cloneable but does not define or
use the clone method.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">
<ShortDescription>Class defines clone() but doesn't implement Cloneable</ShortDescription>
<LongDescription>{0} defines clone() but doesn't implement Cloneable</LongDescription>
<Details>
<![CDATA[
<p> This class defines a clone() method but the class doesn't implement Cloneable.
There are some situations in which this is OK (e.g., you want to control how subclasses
can clone themselves), but just make sure that this is what you intended.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="CN_IDIOM_NO_SUPER_CALL">
<ShortDescription>clone method does not call super.clone()</ShortDescription>
<LongDescription>{1} does not call super.clone()</LongDescription>
<Details>
<![CDATA[
<p> This non-final class defines a clone() method that does not call super.clone().
If this class ("<i>A</i>") is extended by a subclass ("<i>B</i>"),
and the subclass <i>B</i> calls super.clone(), then it is likely that
<i>B</i>'s clone() method will return an object of type <i>A</i>,
which violates the standard contract for clone().</p>
<p> If all clone() methods call super.clone(), then they are guaranteed
to use Object.clone(), which always returns an object of the correct type.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">
<ShortDescription>Use of identifier that is a keyword in later versions of Java</ShortDescription>
<LongDescription>{1} uses {2} for a variable name, which is a keyword in later versions of Java</LongDescription>
<Details>
<![CDATA[
<p>The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed
in order to compile it in later versions of Java.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER">
<ShortDescription>Use of identifier that is a keyword in later versions of Java</ShortDescription>
<LongDescription>{1} conflicts with a keyword in a more recent version of Java</LongDescription>
<Details>
<![CDATA[
<p>This identifier is used as a keyword in later versions of Java. This code, and
any code that references this API,
will need to be changed in order to compile it in later versions of Java.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DE_MIGHT_DROP">
<ShortDescription>Method might drop exception</ShortDescription>
<LongDescription>{1} might drop {2}</LongDescription>
<Details>
<![CDATA[
<p> This method might drop an exception. In general, exceptions
should be handled or reported in some way, or they should be thrown
out of the method.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DE_MIGHT_IGNORE">
<ShortDescription>Method might ignore exception</ShortDescription>
<LongDescription>{1} might ignore {2}</LongDescription>
<Details>
<![CDATA[
<p> This method might ignore an exception. In general, exceptions
should be handled or reported in some way, or they should be thrown
out of the method.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DP_DO_INSIDE_DO_PRIVILEGED">
<ShortDescription>Method invoked that should be only be invoked inside a doPrivileged block</ShortDescription>
<LongDescription>Invocation of {2}, which should be invoked from within a doPrivileged block, in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code invokes a method that requires a security permission check.
If this code will be granted security permissions, but might be invoked by code that does not
have security permissions, then the invocation needs to occur inside a doPrivileged block.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DP_DO_INSIDE_DO_PRIVILEDGED">
<!-- misspelled for backward compatibility -->
<ShortDescription>Method invoked that should be only be invoked inside a doPrivileged block</ShortDescription>
<LongDescription>Invocation of {2}, which should be invoked from within a doPrivileged block, in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code invokes a method that requires a security permission check.
If this code will be granted security permissions, but might be invoked by code that does not
have security permissions, then the invocation needs to occur inside a doPrivileged block.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">
<ShortDescription>Classloaders should only be created inside doPrivileged block</ShortDescription>
<LongDescription>{1} creates a {2} classloader, which should be performed within a doPrivileged block</LongDescription>
<Details>
<![CDATA[
<p> This code creates a classloader, which needs permission if a security manage is installed.
If this code might be invoked by code that does not
have security permissions, then the classloader creation needs to occur inside a doPrivileged block.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">
<ShortDescription>Fields of immutable classes should be final</ShortDescription>
<LongDescription>{1.givenClass} should be final since {0} is marked as Immutable. </LongDescription>
<Details>
<![CDATA[
<p> The class is annotated with net.jcip.annotations.Immutable or javax.annotation.concurrent.Immutable,
and the rules for those annotations require that all fields are final.
.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">
<ShortDescription>Thread passed where Runnable expected</ShortDescription>
<LongDescription>Thread passed where Runnable expected in {1}</LongDescription>
<Details>
<![CDATA[
<p> A Thread object is passed as a parameter to a method where
a Runnable is expected. This is rather unusual, and may indicate a logic error
or cause unexpected behavior.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_COLLECTION_OF_URLS">
<ShortDescription>Maps and sets of URLs can be performance hogs</ShortDescription>
<LongDescription>{1} is or uses a map or set of URLs, which can be a performance hog</LongDescription>
<Details>
<![CDATA[
<p> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode
method of URL perform domain name resolution, this can result in a big performance hit.
See <a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html</a> for more information.
Consider using <code>java.net.URI</code> instead.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_BLOCKING_METHODS_ON_URL">
<ShortDescription>The equals and hashCode methods of URL are blocking</ShortDescription>
<LongDescription>Invocation of {2}, which blocks to do domain name resolution, in {1}</LongDescription>
<Details>
<![CDATA[
<p> The equals and hashCode
method of URL perform domain name resolution, this can result in a big performance hit.
See <a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html</a> for more information.
Consider using <code>java.net.URI</code> instead.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION">
<ShortDescription>Can't use reflection to check for presence of annotation without runtime retention</ShortDescription>
<LongDescription>Use of reflection to check for the presence the annotation {3} which doesn't have runtime retention, in {1}</LongDescription>
<Details>
<![CDATA[
<p> Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection
(e.g., by using the isAnnotationPresent method).
.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_EXIT">
<ShortDescription>Method invokes System.exit(...)</ShortDescription>
<LongDescription>{1} invokes System.exit(...), which shuts down the entire virtual machine</LongDescription>
<Details>
<![CDATA[
<p> Invoking System.exit shuts down the entire Java virtual machine. This
should only been done when it is appropriate. Such calls make it
hard or impossible for your code to be invoked by other code.
Consider throwing a RuntimeException instead.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_RUN_FINALIZERS_ON_EXIT">
<ShortDescription>Method invokes dangerous method runFinalizersOnExit</ShortDescription>
<LongDescription>{1} invokes dangerous method runFinalizersOnExit</LongDescription>
<Details>
<![CDATA[
<p> <em>Never call System.runFinalizersOnExit
or Runtime.runFinalizersOnExit for any reason: they are among the most
dangerous methods in the Java libraries.</em> -- Joshua Bloch</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_STRING_CTOR">
<ShortDescription>Method invokes inefficient new String(String) constructor</ShortDescription>
<LongDescription>{1} invokes inefficient new String(String) constructor</LongDescription>
<Details>
<![CDATA[
<p> Using the <code>java.lang.String(String)</code> constructor wastes memory
because the object so constructed will be functionally indistinguishable
from the <code>String</code> passed as a parameter. Just use the
argument <code>String</code> directly.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_STRING_VOID_CTOR">
<ShortDescription>Method invokes inefficient new String() constructor</ShortDescription>
<LongDescription>{1} invokes inefficient new String() constructor</LongDescription>
<Details>
<![CDATA[
<p> Creating a new <code>java.lang.String</code> object using the
no-argument constructor wastes memory because the object so created will
be functionally indistinguishable from the empty string constant
<code>""</code>. Java guarantees that identical string constants
will be represented by the same <code>String</code> object. Therefore,
you should just use the empty string constant directly.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_STRING_TOSTRING">
<ShortDescription>Method invokes toString() method on a String</ShortDescription>
<LongDescription>{1} invokes toString() method on a String</LongDescription>
<Details>
<![CDATA[
<p> Calling <code>String.toString()</code> is just a redundant operation.
Just use the String.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_GC">
<ShortDescription>Explicit garbage collection; extremely dubious except in benchmarking code</ShortDescription>
<LongDescription>{1} forces garbage collection; extremely dubious except in benchmarking code</LongDescription>
<Details>
<![CDATA[
<p> Code explicitly invokes garbage collection.
Except for specific use in benchmarking, this is very dubious.</p>
<p>In the past, situations where people have explicitly invoked
the garbage collector in routines such as close or finalize methods
has led to huge performance black holes. Garbage collection
can be expensive. Any situation that forces hundreds or thousands
of garbage collections will bring the machine to a crawl.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_BOOLEAN_CTOR">
<ShortDescription>Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead</ShortDescription>
<LongDescription>{1} invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead</LongDescription>
<Details>
<![CDATA[
<p> Creating new instances of <code>java.lang.Boolean</code> wastes
memory, since <code>Boolean</code> objects are immutable and there are
only two useful values of this type. Use the <code>Boolean.valueOf()</code>
method (or Java 1.5 autoboxing) to create <code>Boolean</code> objects instead.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_NUMBER_CTOR">
<ShortDescription>Method invokes inefficient Number constructor; use static valueOf instead</ShortDescription>
<LongDescription>{1} invokes inefficient {2} constructor; use {3} instead</LongDescription>
<Details>
<![CDATA[
<p>
Using <code>new Integer(int)</code> is guaranteed to always result in a new object whereas
<code>Integer.valueOf(int)</code> allows caching of values to be done by the compiler, class library, or JVM.
Using of cached values avoids object allocation and the code will be faster.
</p>
<p>
Values between -128 and 127 are guaranteed to have corresponding cached instances
and using <code>valueOf</code> is approximately 3.5 times faster than using constructor.
For values outside the constant range the performance of both styles is the same.
</p>
<p>
Unless the class must be compatible with JVMs predating Java 1.5,
use either autoboxing or the <code>valueOf()</code> method when creating instances of
<code>Long</code>, <code>Integer</code>, <code>Short</code>, <code>Character</code>, and <code>Byte</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_FP_NUMBER_CTOR">
<ShortDescription>Method invokes inefficient floating-point Number constructor; use static valueOf instead</ShortDescription>
<LongDescription>{1} invokes inefficient {2} constructor; use {3} instead</LongDescription>
<Details>
<![CDATA[
<p>
Using <code>new Double(double)</code> is guaranteed to always result in a new object whereas
<code>Double.valueOf(double)</code> allows caching of values to be done by the compiler, class library, or JVM.
Using of cached values avoids object allocation and the code will be faster.
</p>
<p>
Unless the class must be compatible with JVMs predating Java 1.5,
use either autoboxing or the <code>valueOf()</code> method when creating instances of <code>Double</code> and <code>Float</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_CONVERT_CASE">
<ShortDescription>Consider using Locale parameterized version of invoked method</ShortDescription>
<LongDescription>Use of non-localized String.toUpperCase() or String.toLowerCase() in {1}</LongDescription>
<Details>
<![CDATA[
<p> A String is being converted to upper or lowercase, using the platform's default encoding. This may
result in improper conversions when used with international characters. Use the </p>
<ul>
<li>String.toUpperCase( Locale l )</li>
<li>String.toLowerCase( Locale l )</li>
</ul>
<p>versions instead.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">
<ShortDescription>Primitive value is unboxed and coerced for ternary operator</ShortDescription>
<LongDescription>Primitive value is unboxed and coerced for ternary operator in {1}</LongDescription>
<Details>
<![CDATA[
<p>A wrapped primitive value is unboxed and converted to another primitive type as part of the
evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> operator). The
semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrapped
numeric values, the values are unboxed and converted/coerced to their common type (e.g,
if <code>e1</code> is of type <code>Integer</code>
and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unboxed,
converted to a floating point value, and boxed. See JLS Section 15.25.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BX_BOXING_IMMEDIATELY_UNBOXED">
<ShortDescription>Primitive value is boxed and then immediately unboxed</ShortDescription>
<LongDescription>Primitive value is boxed and then immediately unboxed in {1}</LongDescription>
<Details>
<![CDATA[
<p>A primitive is boxed, and then immediately unboxed. This probably is due to a manual
boxing in a place where an unboxed value is required, thus forcing the compiler
to immediately undo the work of the boxing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BX_UNBOXING_IMMEDIATELY_REBOXED">
<ShortDescription>Boxed value is unboxed and then immediately reboxed</ShortDescription>
<LongDescription>Boxed value is unboxed and then immediately reboxed in {1}</LongDescription>
<Details>
<![CDATA[
<p>A boxed value is unboxed and then immediately reboxed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">
<ShortDescription>Primitive value is boxed then unboxed to perform primitive coercion</ShortDescription>
<LongDescription>Primitive value is boxed then unboxed to perform primitive coercion in {1}</LongDescription>
<Details>
<![CDATA[
<p>A primitive boxed value constructed and then immediately converted into a different primitive type
(e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coercion (e.g., <code>(int) d</code>).</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_BOXED_PRIMITIVE_TOSTRING">
<ShortDescription>Method allocates a boxed primitive just to call toString</ShortDescription>
<LongDescription>Primitive boxed just to call toString in {1}</LongDescription>
<Details>
<![CDATA[
<p>A boxed primitive is allocated just to call toString(). It is more effective to just use the static
form of toString which takes the primitive value. So,</p>
<table>
<tr><th>Replace...</th><th>With this...</th></tr>
<tr><td>new Integer(1).toString()</td><td>Integer.toString(1)</td></tr>
<tr><td>new Long(1).toString()</td><td>Long.toString(1)</td></tr>
<tr><td>new Float(1.0).toString()</td><td>Float.toString(1.0)</td></tr>
<tr><td>new Double(1.0).toString()</td><td>Double.toString(1.0)</td></tr>
<tr><td>new Byte(1).toString()</td><td>Byte.toString(1)</td></tr>
<tr><td>new Short(1).toString()</td><td>Short.toString(1)</td></tr>
<tr><td>new Boolean(true).toString()</td><td>Boolean.toString(true)</td></tr>
</table>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_BOXED_PRIMITIVE_FOR_PARSING">
<ShortDescription>Boxing/unboxing to parse a primitive</ShortDescription>
<LongDescription>Boxing/unboxing to parse a primitive {1}</LongDescription>
<Details>
<![CDATA[
<p>A boxed primitive is created from a String, just to extract the unboxed primitive value.
It is more efficient to just call the static parseXXX method.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_NEW_FOR_GETCLASS">
<ShortDescription>Method allocates an object, only to get the class object</ShortDescription>
<LongDescription>{1} allocates an object, only to get the class object</LongDescription>
<Details>
<![CDATA[
<p>This method allocates an object just to call getClass() on it, in order to
retrieve the Class object for it. It is simpler to just access the .class property of the class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_MONITOR_WAIT_ON_CONDITION">
<ShortDescription>Monitor wait() called on Condition</ShortDescription>
<LongDescription>Monitor wait() called on a Condition in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method calls <code>wait()</code> on a
<code>java.util.concurrent.locks.Condition</code> object.
Waiting for a <code>Condition</code> should be done using one of the <code>await()</code>
methods defined by the <code>Condition</code> interface.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_01_TO_INT">
<ShortDescription>Random value from 0 to 1 is coerced to the integer 0</ShortDescription>
<LongDescription>{1} uses generates a random value from 0 to 1 and then coerces that value to the integer 0</LongDescription>
<Details>
<![CDATA[
<p>A random value from 0 to 1 is being coerced to the integer value 0. You probably
want to multiple the random value by something else before coercing it to an integer, or use the <code>Random.nextInt(n)</code> method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_NEXTINT_VIA_NEXTDOUBLE">
<ShortDescription>Use the nextInt method of Random rather than nextDouble to generate a random integer</ShortDescription>
<LongDescription>{1} uses the nextDouble method of Random to generate a random integer; using nextInt is more efficient</LongDescription>
<Details>
<![CDATA[
<p>If <code>r</code> is a <code>java.util.Random</code>, you can generate a random number from <code>0</code> to <code>n-1</code>
using <code>r.nextInt(n)</code>, rather than using <code>(int)(r.nextDouble() * n)</code>.
</p>
<p>The argument to nextInt must be positive. If, for example, you want to generate a random
value from -99 to 0, use <code>-r.nextInt(100)</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">
<ShortDescription>Nonconstant string passed to execute method on an SQL statement</ShortDescription>
<LongDescription>{1} passes a nonconstant String to an execute method on an SQL statement</LongDescription>
<Details>
<![CDATA[
<p>The method invokes the execute method on an SQL statement with a String that seems
to be dynamically generated. Consider using
a prepared statement instead. It is more efficient and less vulnerable to
SQL injection attacks.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">
<ShortDescription>A prepared statement is generated from a nonconstant String</ShortDescription>
<LongDescription>A prepared statement is generated from a nonconstant String in {1} </LongDescription>
<Details>
<![CDATA[
<p>The code creates an SQL prepared statement from a nonconstant String.
If unchecked, tainted data from a user is used in building this String, SQL injection could
be used to make the prepared statement do something unexpected and undesirable.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DM_USELESS_THREAD">
<ShortDescription>A thread was created using the default empty run method</ShortDescription>
<LongDescription>{1} creates a thread using the default empty run method</LongDescription>
<Details>
<![CDATA[
<p>This method creates a thread without specifying a run method either by deriving from the Thread class, or
by passing a Runnable object. This thread, then, does nothing but waste time.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DC_DOUBLECHECK">
<ShortDescription>Possible double check of field</ShortDescription>
<LongDescription>Possible doublecheck on {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method may contain an instance of double-checked locking.
This idiom is not correct according to the semantics of the Java memory
model. For more information, see the web page
<a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html"
>http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FI_FINALIZER_NULLS_FIELDS">
<ShortDescription>Finalizer nulls fields</ShortDescription>
<LongDescription>{3} is set to null inside finalize method in {1.class}</LongDescription>
<Details>
<![CDATA[
<p> This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection,
and the object is going to be garbage collected anyway.
]]>
</Details>
</BugPattern>
<BugPattern type="FI_FINALIZER_ONLY_NULLS_FIELDS">
<ShortDescription>Finalizer only nulls fields</ShortDescription>
<LongDescription>{1} only nulls fields</LongDescription>
<Details>
<![CDATA[
<p> This finalizer does nothing except null out fields. This is completely pointless, and requires that
the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize
method.
]]>
</Details>
</BugPattern>
<BugPattern type="FI_PUBLIC_SHOULD_BE_PROTECTED">
<ShortDescription>Finalizer should be protected, not public</ShortDescription>
<LongDescription>{1} is public; should be protected</LongDescription>
<Details>
<![CDATA[
<p> A class's <code>finalize()</code> method should have protected access,
not public.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FI_EMPTY">
<ShortDescription>Empty finalizer should be deleted</ShortDescription>
<LongDescription>{1} is empty and should be deleted</LongDescription>
<Details>
<![CDATA[
<p> Empty <code>finalize()</code> methods are useless, so they should
be deleted.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FI_NULLIFY_SUPER">
<ShortDescription>Finalizer nullifies superclass finalizer</ShortDescription>
<LongDescription>{1} is nullifying {2}.finalize(); is this intended?</LongDescription>
<Details>
<![CDATA[
<p> This empty <code>finalize()</code> method explicitly negates the
effect of any finalizer defined by its superclass. Any finalizer
actions defined for the superclass will not be performed.
Unless this is intended, delete this method.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FI_USELESS">
<ShortDescription>Finalizer does nothing but call superclass finalizer</ShortDescription>
<LongDescription>{1} does nothing except call super.finalize(); delete it</LongDescription>
<Details>
<![CDATA[
<p> The only thing this <code>finalize()</code> method does is call
the superclass's <code>finalize()</code> method, making it
redundant. Delete it.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FI_MISSING_SUPER_CALL">
<ShortDescription>Finalizer does not call superclass finalizer</ShortDescription>
<LongDescription>{1} missing call to super.finalize(), so {2}.finalize() doesn't get called</LongDescription>
<Details>
<![CDATA[
<p> This <code>finalize()</code> method does not make a call to its
superclass's <code>finalize()</code> method. So, any finalizer
actions defined for the superclass will not be performed.
Add a call to <code>super.finalize()</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FI_EXPLICIT_INVOCATION">
<ShortDescription>Explicit invocation of finalizer</ShortDescription>
<LongDescription>Explicit invocation of {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains an explicit invocation of the <code>finalize()</code>
method on an object. Because finalizer methods are supposed to be
executed once, and only by the VM, this is a bad idea.</p>
<p>If a connected set of objects beings finalizable, then the VM will invoke the
finalize method on all the finalizable object, possibly at the same time in different threads.
Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize
on objects referenced by X, because they may already be getting finalized in a separate thread.
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS">
<ShortDescription>Equals checks for incompatible operand</ShortDescription>
<LongDescription>{1} checks for operand being a {2.givenClass} </LongDescription>
<Details>
<![CDATA[
<p> This equals method is checking to see if the argument is some incompatible type
(i.e., a class that is neither a supertype nor subtype of the class that defines
the equals method). For example, the Foo class might have an equals method
that looks like:
</p>
<pre>
public boolean equals(Object o) {
if (o instanceof Foo)
return name.equals(((Foo)o).name);
else if (o instanceof String)
return name.equals(o);
else return false;
</pre>
<p>This is considered bad practice, as it makes it very hard to implement an equals method that
is symmetric and transitive. Without those properties, very unexpected behavoirs are possible.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_DONT_DEFINE_EQUALS_FOR_ENUM">
<ShortDescription>Covariant equals() method defined for enum</ShortDescription>
<LongDescription>Enum {0} defines equals({0.givenClass})</LongDescription>
<Details>
<![CDATA[
<p> This class defines an enumeration, and equality on enumerations are defined
using object identity. Defining a covariant equals method for an enumeration
value is exceptionally bad practice, since it would likely result
in having two different enumeration values that compare as equals using
the covariant enum method, and as not equal when compared normally.
Don't do it.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_SELF_USE_OBJECT">
<ShortDescription>Covariant equals() method defined, Object.equals(Object) inherited</ShortDescription>
<LongDescription>{0} defines equals({0.givenClass}) method and uses Object.equals(Object)</LongDescription>
<Details>
<![CDATA[
<p> This class defines a covariant version of the <code>equals()</code>
method, but inherits the normal <code>equals(Object)</code> method
defined in the base <code>java.lang.Object</code> class.
The class should probably define a <code>boolean equals(Object)</code> method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_OTHER_USE_OBJECT">
<ShortDescription>equals() method defined that doesn't override Object.equals(Object)</ShortDescription>
<LongDescription>{0} defines {1.givenClass} method and uses Object.equals(Object)</LongDescription>
<Details>
<![CDATA[
<p> This class defines an <code>equals()</code>
method, that doesn't override the normal <code>equals(Object)</code> method
defined in the base <code>java.lang.Object</code> class.
The class should probably define a <code>boolean equals(Object)</code> method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_OTHER_NO_OBJECT">
<ShortDescription>equals() method defined that doesn't override equals(Object)</ShortDescription>
<LongDescription>{0} defines {1.givenClass} method that doesn't override equals(Object)</LongDescription>
<Details>
<![CDATA[
<p> This class defines an <code>equals()</code>
method, that doesn't override the normal <code>equals(Object)</code> method
defined in the base <code>java.lang.Object</code> class. Instead, it
inherits an <code>equals(Object)</code> method from a superclass.
The class should probably define a <code>boolean equals(Object)</code> method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_DOESNT_OVERRIDE_EQUALS">
<ShortDescription>Class doesn't override equals in superclass</ShortDescription>
<LongDescription>{0} doesn't override {1.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> This class extends a class that defines an equals method and adds fields, but doesn't
define an equals method itself. Thus, equality on instances of this class will
ignore the identity of the subclass and the added fields. Be sure this is what is intended,
and that you don't need to override the equals method. Even if you don't need to override
the equals method, consider overriding it anyway to document the fact
that the equals method for the subclass just return the result of
invoking super.equals(o).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_SELF_NO_OBJECT">
<ShortDescription>Covariant equals() method defined</ShortDescription>
<LongDescription>{0} defines equals({0.givenClass}) method but not equals(Object)</LongDescription>
<Details>
<![CDATA[
<p> This class defines a covariant version of <code>equals()</code>.
To correctly override the <code>equals()</code> method in
<code>java.lang.Object</code>, the parameter of <code>equals()</code>
must have type <code>java.lang.Object</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">
<ShortDescription>equals method overrides equals in superclass and may not be symmetric</ShortDescription>
<LongDescription>{1.class} overrides equals in {2.class.givenClass} and may not be symmetric</LongDescription>
<Details>
<![CDATA[
<p> This class defines an equals method that overrides an equals method in a superclass. Both equals methods
methods use <code>instanceof</code> in the determination of whether two objects are equal. This is fraught with peril,
since it is important that the equals method is symmetrical (in other words, <code>a.equals(b) == b.equals(a)</code>).
If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method
checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these
methods is not symmetric.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_GETCLASS_AND_CLASS_CONSTANT">
<ShortDescription>equals method fails for subtypes</ShortDescription>
<LongDescription>{1} fails for subtypes</LongDescription>
<Details>
<![CDATA[
<p> This class has an equals method that will be broken if it is inherited by subclasses.
It compares a class literal with the class of the argument (e.g., in class <code>Foo</code>
it might check if <code>Foo.class == o.getClass()</code>).
It is better to check if <code>this.getClass() == o.getClass()</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_UNUSUAL">
<ShortDescription>Unusual equals method </ShortDescription>
<LongDescription>{1} is unusual</LongDescription>
<Details>
<![CDATA[
<p> This class doesn't do any of the patterns we recognize for checking that the type of the argument
is compatible with the type of the <code>this</code> object. There might not be anything wrong with
this code, but it is worth reviewing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_COMPARING_CLASS_NAMES">
<ShortDescription>equals method compares class names rather than class objects</ShortDescription>
<LongDescription>{1} compares class names rather than class objects</LongDescription>
<Details>
<![CDATA[
<p> This method checks to see if two objects are the same class by checking to see if the names
of their classes are equal. You can have different classes with the same name if they are loaded by
different class loaders. Just check to see if the class objects are the same.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_ALWAYS_TRUE">
<ShortDescription>equals method always returns true</ShortDescription>
<LongDescription>{1} always returns true</LongDescription>
<Details>
<![CDATA[
<p> This class defines an equals method that always returns true. This is imaginative, but not very smart.
Plus, it means that the equals method is not symmetric.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_ALWAYS_FALSE">
<ShortDescription>equals method always returns false</ShortDescription>
<LongDescription>{1} always returns false</LongDescription>
<Details>
<![CDATA[
<p> This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means
that equals is not reflexive, one of the requirements of the equals method.</p>
<p>The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class <code>Object</code>. If you need to override an equals inherited from a different
superclass, you can use use:</p>
<pre>
public boolean equals(Object o) { return this == o; }
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="HSC_HUGE_SHARED_STRING_CONSTANT">
<ShortDescription>Huge string constants is duplicated across multiple class files</ShortDescription>
<LongDescription>{1} is initialized to a string constant {2} characters long that is duplicated in {3} other class files</LongDescription>
<Details>
<![CDATA[
<p>
A large String constant is duplicated across multiple class files.
This is likely because a final field is initialized to a String constant, and the Java language
mandates that all references to a final field from other classes be inlined into
that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6447475">JDK bug 6447475</a>
for a description of an occurrence of this bug in the JDK and how resolving it reduced
the size of the JDK by 1 megabyte.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_ARGUMENT_MIGHT_BE_NULL">
<ShortDescription>Method does not check for null argument</ShortDescription>
<LongDescription>{1} does not check for null argument</LongDescription>
<Details>
<![CDATA[
<p>
A parameter to this method has been identified as a value that should
always be checked to see whether or not it is null, but it is being dereferenced
without a preceding null check.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">
<ShortDescription>equals() method does not check for null argument</ShortDescription>
<LongDescription>{1} does not check for null argument</LongDescription>
<Details>
<![CDATA[
<p>
This implementation of equals(Object) violates the contract defined
by java.lang.Object.equals() because it does not check for null
being passed as the argument. All equals() methods should return
false if passed a null value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_NEGATING_RESULT_OF_COMPARETO">
<ShortDescription>Negating the result of compareTo()/compare()</ShortDescription>
<LongDescription>{1} negates the return value of {2}</LongDescription>
<Details>
<![CDATA[
<p> This code negatives the return value of a compareTo or compare method.
This is a questionable or bad programming practice, since if the return
value is Integer.MIN_VALUE, negating the return value won't
negate the sign of the result. You can achieve the same intended result
by reversing the order of the operands rather than by negating the results.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="CO_COMPARETO_RESULTS_MIN_VALUE">
<ShortDescription>compareTo()/compare() returns Integer.MIN_VALUE</ShortDescription>
<LongDescription>{1} returns Integer.MIN_VALUE, which can't be negated</LongDescription>
<Details>
<![CDATA[
<p> In some situation, this compareTo or compare method returns
the constant Integer.MIN_VALUE, which is an exceptionally bad practice.
The only thing that matters about the return value of compareTo is the sign of the result.
But people will sometimes negate the return value of compareTo, expecting that this will negate
the sign of the result. And it will, except in the case where the value returned is Integer.MIN_VALUE.
So just return -1 rather than Integer.MIN_VALUE.
]]>
</Details>
</BugPattern>
<BugPattern type="CO_SELF_NO_OBJECT">
<ShortDescription>Covariant compareTo() method defined</ShortDescription>
<LongDescription>{0} defines compareTo({0.givenClass}) method but not compareTo(Object)</LongDescription>
<Details>
<![CDATA[
<p> This class defines a covariant version of <code>compareTo()</code>.
To correctly override the <code>compareTo()</code> method in the
<code>Comparable</code> interface, the parameter of <code>compareTo()</code>
must have type <code>java.lang.Object</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS">
<ShortDescription>Signature declares use of unhashable class in hashed construct</ShortDescription>
<LongDescription>{2} doesn't define a hashCode() method but it is used in a hashed context in {1}</LongDescription>
<Details>
<![CDATA[
<p> A method, field or class declares a generic signature where a non-hashable class
is used in context where a hashable class is required.
A class that declares an equals method but inherits a hashCode() method
from Object is unhashable, since it doesn't fulfill the requirement that
equal objects have equal hashCodes.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="HE_USE_OF_UNHASHABLE_CLASS">
<ShortDescription>Use of class without a hashCode() method in a hashed data structure</ShortDescription>
<LongDescription>{2} doesn't define a hashCode() method but is used in a hashed data structure in {1}</LongDescription>
<Details>
<![CDATA[
<p> A class defines an equals(Object) method but not a hashCode() method,
and thus doesn't fulfill the requirement that equal objects have equal hashCodes.
An instance of this class is used in a hash data structure, making the need to
fix this problem of highest importance.
]]>
</Details>
</BugPattern>
<BugPattern type="HE_HASHCODE_USE_OBJECT_EQUALS">
<ShortDescription>Class defines hashCode() and uses Object.equals()</ShortDescription>
<LongDescription>{0} defines hashCode and uses Object.equals()</LongDescription>
<Details>
<![CDATA[
<p> This class defines a <code>hashCode()</code> method but inherits its
<code>equals()</code> method from <code>java.lang.Object</code>
(which defines equality by comparing object references). Although
this will probably satisfy the contract that equal objects must have
equal hashcodes, it is probably not what was intended by overriding
the <code>hashCode()</code> method. (Overriding <code>hashCode()</code>
implies that the object's identity is based on criteria more complicated
than simple reference equality.)</p>
<p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
the recommended <code>hashCode</code> implementation to use is:</p>
<pre>public int hashCode() {
assert false : "hashCode not designed";
return 42; // any arbitrary constant will do
}</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_COMPARETO_USE_OBJECT_EQUALS">
<ShortDescription>Class defines compareTo(...) and uses Object.equals()</ShortDescription>
<LongDescription>{0} defines {1.givenClass} and uses Object.equals()</LongDescription>
<Details>
<![CDATA[
<p> This class defines a <code>compareTo(...)</code> method but inherits its
<code>equals()</code> method from <code>java.lang.Object</code>.
Generally, the value of compareTo should return zero if and only if
equals returns true. If this is violated, weird and unpredictable
failures will occur in classes such as PriorityQueue.
In Java 5 the PriorityQueue.remove method uses the compareTo method,
while in Java 6 it uses the equals method.
<p>From the JavaDoc for the compareTo method in the Comparable interface:
<blockquote>
It is strongly recommended, but not strictly required that <code>(x.compareTo(y)==0) == (x.equals(y))</code>.
Generally speaking, any class that implements the Comparable interface and violates this condition
should clearly indicate this fact. The recommended language
is "Note: this class has a natural ordering that is inconsistent with equals."
</blockquote>
]]>
</Details>
</BugPattern>
<BugPattern type="HE_HASHCODE_NO_EQUALS">
<ShortDescription>Class defines hashCode() but not equals()</ShortDescription>
<LongDescription>{0} defines hashCode but not equals</LongDescription>
<Details>
<![CDATA[
<p> This class defines a <code>hashCode()</code> method but not an
<code>equals()</code> method. Therefore, the class may
violate the invariant that equal objects must have equal hashcodes.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="HE_EQUALS_USE_HASHCODE">
<ShortDescription>Class defines equals() and uses Object.hashCode()</ShortDescription>
<LongDescription>{0} defines equals and uses Object.hashCode()</LongDescription>
<Details>
<![CDATA[
<p> This class overrides <code>equals(Object)</code>, but does not
override <code>hashCode()</code>, and inherits the implementation of
<code>hashCode()</code> from <code>java.lang.Object</code> (which returns
the identity hash code, an arbitrary value assigned to the object
by the VM). Therefore, the class is very likely to violate the
invariant that equal objects must have equal hashcodes.</p>
<p>If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
the recommended <code>hashCode</code> implementation to use is:</p>
<pre>public int hashCode() {
assert false : "hashCode not designed";
return 42; // any arbitrary constant will do
}</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="HE_INHERITS_EQUALS_USE_HASHCODE">
<ShortDescription>Class inherits equals() and uses Object.hashCode()</ShortDescription>
<LongDescription>{0} inherits equals and uses Object.hashCode()</LongDescription>
<Details>
<![CDATA[
<p> This class inherits <code>equals(Object)</code> from an abstract
superclass, and <code>hashCode()</code> from
<code>java.lang.Object</code> (which returns
the identity hash code, an arbitrary value assigned to the object
by the VM). Therefore, the class is very likely to violate the
invariant that equal objects must have equal hashcodes.</p>
<p>If you don't want to define a hashCode method, and/or don't
believe the object will ever be put into a HashMap/Hashtable,
define the <code>hashCode()</code> method
to throw <code>UnsupportedOperationException</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="HE_EQUALS_NO_HASHCODE">
<ShortDescription>Class defines equals() but not hashCode()</ShortDescription>
<LongDescription>{0} defines equals but not hashCode</LongDescription>
<Details>
<![CDATA[
<p> This class overrides <code>equals(Object)</code>, but does not
override <code>hashCode()</code>. Therefore, the class may violate the
invariant that equal objects must have equal hashcodes.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EQ_ABSTRACT_SELF">
<ShortDescription>Abstract class defines covariant equals() method</ShortDescription>
<LongDescription>Abstract {0} defines equals({0.givenClass}) method</LongDescription>
<Details>
<![CDATA[
<p> This class defines a covariant version of <code>equals()</code>.
To correctly override the <code>equals()</code> method in
<code>java.lang.Object</code>, the parameter of <code>equals()</code>
must have type <code>java.lang.Object</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ES_COMPARING_STRINGS_WITH_EQ">
<ShortDescription>Comparison of String objects using == or !=</ShortDescription>
<LongDescription>Comparison of String objects using == or != in {1} </LongDescription>
<Details>
<![CDATA[
<p>This code compares <code>java.lang.String</code> objects for reference
equality using the == or != operators.
Unless both strings are either constants in a source file, or have been
interned using the <code>String.intern()</code> method, the same string
value may be represented by two different String objects. Consider
using the <code>equals(Object)</code> method instead.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ES_COMPARING_PARAMETER_STRING_WITH_EQ">
<ShortDescription>Comparison of String parameter using == or !=</ShortDescription>
<LongDescription>Comparison of String parameter using == or != in {1} </LongDescription>
<Details>
<![CDATA[
<p>This code compares a <code>java.lang.String</code> parameter for reference
equality using the == or != operators. Requiring callers to
pass only String constants or interned strings to a method is unnecessarily
fragile, and rarely leads to measurable performance gains. Consider
using the <code>equals(Object)</code> method instead.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="CO_ABSTRACT_SELF">
<ShortDescription>Abstract class defines covariant compareTo() method</ShortDescription>
<LongDescription>Abstract {0} defines compareTo({0.givenClass}) method</LongDescription>
<Details>
<![CDATA[
<p> This class defines a covariant version of <code>compareTo()</code>.
To correctly override the <code>compareTo()</code> method in the
<code>Comparable</code> interface, the parameter of <code>compareTo()</code>
must have type <code>java.lang.Object</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IS_FIELD_NOT_GUARDED">
<ShortDescription>Field not guarded against concurrent access</ShortDescription>
<LongDescription>{1.givenClass} not guarded against concurrent access; locked {2}% of time</LongDescription>
<Details>
<![CDATA[
<p> This field is annotated with net.jcip.annotations.GuardedBy or javax.annotation.concurrent.GuardedBy,
but can be accessed in a way that seems to violate those annotations.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MSF_MUTABLE_SERVLET_FIELD">
<ShortDescription>Mutable servlet field</ShortDescription>
<LongDescription>{1} is a mutable servlet field</LongDescription>
<Details>
<![CDATA[
<p>A web server generally only creates one instance of servlet or jsp class (i.e., treats
the class as a Singleton),
and will
have multiple threads invoke methods on that instance to service multiple
simultaneous requests.
Thus, having a mutable instance field generally creates race conditions.
]]>
</Details>
</BugPattern>
<BugPattern type="IS2_INCONSISTENT_SYNC">
<ShortDescription>Inconsistent synchronization</ShortDescription>
<LongDescription>Inconsistent synchronization of {1}; locked {2}% of time</LongDescription>
<Details>
<![CDATA[
<p> The fields of this class appear to be accessed inconsistently with respect
to synchronization. This bug report indicates that the bug pattern detector
judged that
</p>
<ul>
<li> The class contains a mix of locked and unlocked accesses,</li>
<li> The class is <b>not</b> annotated as javax.annotation.concurrent.NotThreadSafe,</li>
<li> At least one locked access was performed by one of the class's own methods, and</li>
<li> The number of unsynchronized field accesses (reads and writes) was no more than
one third of all accesses, with writes being weighed twice as high as reads</li>
</ul>
<p> A typical bug matching this bug pattern is forgetting to synchronize
one of the methods in a class that is intended to be thread-safe.</p>
<p> You can select the nodes labeled "Unsynchronized access" to show the
code locations where the detector believed that a field was accessed
without synchronization.</p>
<p> Note that there are various sources of inaccuracy in this detector;
for example, the detector cannot statically detect all situations in which
a lock is held. Also, even when the detector is accurate in
distinguishing locked vs. unlocked accesses, the code in question may still
be correct.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NN_NAKED_NOTIFY">
<ShortDescription>Naked notify</ShortDescription>
<LongDescription>Naked notify in {1}</LongDescription>
<Details>
<![CDATA[
<p> A call to <code>notify()</code> or <code>notifyAll()</code>
was made without any (apparent) accompanying
modification to mutable object state. In general, calling a notify
method on a monitor is done because some condition another thread is
waiting for has become true. However, for the condition to be meaningful,
it must involve a heap object that is visible to both threads.</p>
<p> This bug does not necessarily indicate an error, since the change to
mutable object state may have taken place in a method which then called
the method containing the notification.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_EXPOSE_REP">
<ShortDescription>Public static method may expose internal representation by returning array</ShortDescription>
<LongDescription>Public static {1} may expose internal representation by returning {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> A public static method returns a reference to
an array that is part of the static state of the class.
Any code that calls this method can freely modify
the underlying array.
One fix is to return a copy of the array.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EI_EXPOSE_REP">
<ShortDescription>May expose internal representation by returning reference to mutable object</ShortDescription>
<LongDescription>{1} may expose internal representation by returning {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> Returning a reference to a mutable object value stored in one of the object's fields
exposes the internal representation of the object.
If instances
are accessed by untrusted code, and unchecked changes to
the mutable object would compromise security or other
important properties, you will need to do something different.
Returning a new copy of the object is better approach in many situations.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EI_EXPOSE_REP2">
<ShortDescription>May expose internal representation by incorporating reference to mutable object</ShortDescription>
<LongDescription>{1} may expose internal representation by storing an externally mutable object into {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> This code stores a reference to an externally mutable object into the
internal representation of the object.
If instances
are accessed by untrusted code, and unchecked changes to
the mutable object would compromise security or other
important properties, you will need to do something different.
Storing a copy of the object is better approach in many situations.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EI_EXPOSE_STATIC_REP2">
<ShortDescription>May expose internal static state by storing a mutable object into a static field</ShortDescription>
<LongDescription>{1} may expose internal static state by storing a mutable object into a static field {2}</LongDescription>
<Details>
<![CDATA[
<p> This code stores a reference to an externally mutable object into a static
field.
If unchecked changes to
the mutable object would compromise security or other
important properties, you will need to do something different.
Storing a copy of the object is better approach in many situations.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RU_INVOKE_RUN">
<ShortDescription>Invokes run on a thread (did you mean to start it instead?)</ShortDescription>
<LongDescription>{1} explicitly invokes run on a thread (did you mean to start it instead?)</LongDescription>
<Details>
<![CDATA[
<p> This method explicitly invokes <code>run()</code> on an object.
In general, classes implement the <code>Runnable</code> interface because
they are going to have their <code>run()</code> method invoked in a new thread,
in which case <code>Thread.start()</code> is the right method to call.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SP_SPIN_ON_FIELD">
<ShortDescription>Method spins on field</ShortDescription>
<LongDescription>Spinning on {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method spins in a loop which reads a field. The compiler
may legally hoist the read out of the loop, turning the code into an
infinite loop. The class should be changed so it uses proper
synchronization (including wait and notify calls).</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NS_DANGEROUS_NON_SHORT_CIRCUIT">
<ShortDescription>Potentially dangerous use of non-short-circuit logic</ShortDescription>
<LongDescription>Potentially dangerous use of non-short-circuit logic in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code seems to be using non-short-circuit logic (e.g., &
or |)
rather than short-circuit logic (&& or ||). In addition,
it seem possible that, depending on the value of the left hand side, you might not
want to evaluate the right hand side (because it would have side effects, could cause an exception
or could be expensive.</p>
<p>
Non-short-circuit logic causes both sides of the expression
to be evaluated even when the result can be inferred from
knowing the left-hand side. This can be less efficient and
can result in errors if the left-hand side guards cases
when evaluating the right-hand side can generate an error.
</p>
<p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22.2">the Java
Language Specification</a> for details
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NS_NON_SHORT_CIRCUIT">
<ShortDescription>Questionable use of non-short-circuit logic</ShortDescription>
<LongDescription>Questionable use of non-short-circuit logic in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code seems to be using non-short-circuit logic (e.g., &
or |)
rather than short-circuit logic (&& or ||).
Non-short-circuit logic causes both sides of the expression
to be evaluated even when the result can be inferred from
knowing the left-hand side. This can be less efficient and
can result in errors if the left-hand side guards cases
when evaluating the right-hand side can generate an error.
<p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.22.2">the Java
Language Specification</a> for details
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TLW_TWO_LOCK_WAIT">
<ShortDescription>Wait with two locks held</ShortDescription>
<LongDescription>wait() with two locks held in {1}</LongDescription>
<Details>
<![CDATA[
<p> Waiting on a monitor while two locks are held may cause
deadlock.
Performing a wait only releases the lock on the object
being waited on, not any other locks.
This not necessarily a bug, but is worth examining
closely.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TLW_TWO_LOCK_NOTIFY" deprecated="true">
<!-- never generated -->
<ShortDescription>Notify with two locks held</ShortDescription>
<LongDescription>notify() or notifyAll*() with two locks held in {1}</LongDescription>
<Details>
<![CDATA[
<p> The code calls notify() or notifyAll() while two locks
are held. If this notification is intended to wake up a wait()
that is holding the same locks, it may deadlock, since the wait
will only give up one lock and the notify will be unable to get both locks,
and thus the notify will not succeed.
If there is also a warning about a two lock wait, the
probably of a bug is quite high.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UW_UNCOND_WAIT">
<ShortDescription>Unconditional wait</ShortDescription>
<LongDescription>Unconditional wait in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a call to <code>java.lang.Object.wait()</code> which
is not guarded by conditional control flow. The code should
verify that condition it intends to wait for is not already satisfied
before calling wait; any previous notifications will be ignored.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UR_UNINIT_READ">
<ShortDescription>Uninitialized read of field in constructor</ShortDescription>
<LongDescription>Uninitialized read of {2.name} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This constructor reads a field which has not yet been assigned a value.
This is often caused when the programmer mistakenly uses the field instead
of one of the constructor's parameters.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR">
<ShortDescription>Uninitialized read of field method called from constructor of superclass</ShortDescription>
<LongDescription>{2.name} isn't initialized in {1} when invoked from constructor for superclass</LongDescription>
<Details>
<![CDATA[
<p> This method is invoked in the constructor of of the superclass. At this point,
the fields of the class have not yet initialized.</p>
<p>To make this more concrete, consider the following classes:</p>
<pre>abstract class A {
int hashCode;
abstract Object getValue();
A() {
hashCode = getValue().hashCode();
}
}
class B extends A {
Object value;
B(Object v) {
this.value = v;
}
Object getValue() {
return value;
}
}</pre>
<p>When a <code>B</code> is constructed,
the constructor for the <code>A</code> class is invoked
<em>before</em> the constructor for <code>B</code> sets <code>value</code>.
Thus, when the constructor for <code>A</code> invokes <code>getValue</code>,
an uninitialized value is read for <code>value</code>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UG_SYNC_SET_UNSYNC_GET">
<ShortDescription>Unsynchronized get method, synchronized set method</ShortDescription>
<LongDescription>{1} is unsynchronized, {2} is synchronized</LongDescription>
<Details>
<![CDATA[
<p> This class contains similarly-named get and set
methods where the set method is synchronized and the get method is not.
This may result in incorrect behavior at runtime, as callers of the get
method will not necessarily see a consistent state for the object.
The get method should be made synchronized.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IC_INIT_CIRCULARITY">
<ShortDescription>Initialization circularity</ShortDescription>
<LongDescription>Initialization circularity between {0} and {1}</LongDescription>
<Details>
<![CDATA[
<p> A circularity was detected in the static initializers of the two
classes referenced by the bug instance. Many kinds of unexpected
behavior may arise from such circularity.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION">
<ShortDescription>Superclass uses subclass during initialization</ShortDescription>
<LongDescription>Initialization of {0} accesses class {2}, which isn't initialized yet</LongDescription>
<Details>
<![CDATA[
<p> During the initialization of a class, the class makes an active use of a subclass.
That subclass will not yet be initialized at the time of this use.
For example, in the following code, <code>foo</code> will be null.</p>
<pre>
public class CircularClassInitialization {
static class InnerClassSingleton extends CircularClassInitialization {
static InnerClassSingleton singleton = new InnerClassSingleton();
}
static CircularClassInitialization foo = InnerClassSingleton.singleton;
}
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="IT_NO_SUCH_ELEMENT">
<ShortDescription>Iterator next() method can't throw NoSuchElementException</ShortDescription>
<LongDescription>{1} can't throw NoSuchElementException</LongDescription>
<Details>
<![CDATA[
<p> This class implements the <code>java.util.Iterator</code> interface.
However, its <code>next()</code> method is not capable of throwing
<code>java.util.NoSuchElementException</code>. The <code>next()</code>
method should be changed so it throws <code>NoSuchElementException</code>
if is called when there are no more elements to return.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">
<ShortDescription>Synchronization on interned String </ShortDescription>
<LongDescription>Synchronization on interned String in {1}</LongDescription>
<Details>
<![CDATA[
<p> The code synchronizes on interned String.</p>
<pre>
private static String LOCK = "LOCK";
...
synchronized(LOCK) { ...}
...
</pre>
<p>Constant Strings are interned and shared across all other classes loaded by the JVM. Thus, this could
is locking on something that other code might also be locking. This could result in very strange and hard to diagnose
blocking and deadlock behavior. See <a href="http://www.javalobby.org/java/forums/t96352.html">http://www.javalobby.org/java/forums/t96352.html</a> and <a href="http://jira.codehaus.org/browse/JETTY-352">http://jira.codehaus.org/browse/JETTY-352</a>.
</p>
<p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DL_SYNCHRONIZATION_ON_BOOLEAN">
<ShortDescription>Synchronization on Boolean</ShortDescription>
<LongDescription>Synchronization on Boolean in {1}</LongDescription>
<Details>
<![CDATA[
<p> The code synchronizes on a boxed primitive constant, such as an Boolean.</p>
<pre>
private static Boolean inited = Boolean.FALSE;
...
synchronized(inited) {
if (!inited) {
init();
inited = Boolean.TRUE;
}
}
...
</pre>
<p>Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness
and possible deadlock</p>
<p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE">
<ShortDescription>Synchronization on boxed primitive values</ShortDescription>
<LongDescription>Synchronization on {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> The code synchronizes on an apparently unshared boxed primitive,
such as an Integer.</p>
<pre>
private static final Integer fileLock = new Integer(1);
...
synchronized(fileLock) {
.. do something ..
}
...
</pre>
<p>It would be much better, in this code, to redeclare fileLock as</p>
<pre>
private static final Object fileLock = new Object();
</pre>
<p>
The existing code might be OK, but it is confusing and a
future refactoring, such as the "Remove Boxing" refactoring in IntelliJ,
might replace this with the use of an interned Integer object shared
throughout the JVM, leading to very confusing behavior and potential deadlock.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">
<ShortDescription>Synchronization on boxed primitive</ShortDescription>
<LongDescription>Synchronization on {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> The code synchronizes on a boxed primitive constant, such as an Integer.</p>
<pre>
private static Integer count = 0;
...
synchronized(count) {
count++;
}
...
</pre>
<p>Since Integer objects can be cached and shared,
this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness
and possible deadlock</p>
<p>See CERT <a href="https://www.securecoding.cert.org/confluence/display/java/CON08-J.+Do+not+synchronize+on+objects+that+may+be+reused">CON08-J. Do not synchronize on objects that may be reused</a> for more information.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ESync_EMPTY_SYNC">
<ShortDescription>Empty synchronized block</ShortDescription>
<LongDescription>Empty synchronized block in {1}</LongDescription>
<Details>
<![CDATA[
<p> The code contains an empty synchronized block:</p>
<pre>
synchronized() {}
</pre>
<p>Empty synchronized blocks are far more subtle and hard to use correctly
than most people recognize, and empty synchronized blocks
are almost never a better solution
than less contrived solutions.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IS_INCONSISTENT_SYNC">
<ShortDescription>Inconsistent synchronization</ShortDescription>
<LongDescription>Inconsistent synchronization of {1}; locked {2}% of the time</LongDescription>
<Details>
<![CDATA[
<p> The fields of this class appear to be accessed inconsistently with respect
to synchronization. This bug report indicates that the bug pattern detector
judged that
</p>
<ul>
<li> The class contains a mix of locked and unlocked accesses,</li>
<li> At least one locked access was performed by one of the class's own methods, and</li>
<li> The number of unsynchronized field accesses (reads and writes) was no more than
one third of all accesses, with writes being weighed twice as high as reads</li>
</ul>
<p> A typical bug matching this bug pattern is forgetting to synchronize
one of the methods in a class that is intended to be thread-safe.</p>
<p> Note that there are various sources of inaccuracy in this detector;
for example, the detector cannot statically detect all situations in which
a lock is held. Also, even when the detector is accurate in
distinguishing locked vs. unlocked accesses, the code in question may still
be correct.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD">
<ShortDescription>Synchronization on field in futile attempt to guard that field</ShortDescription>
<LongDescription>Synchronization on {2.givenClass} in futile attempt to guard it</LongDescription>
<Details>
<![CDATA[
<p> This method synchronizes on a field in what appears to be an attempt
to guard against simultaneous updates to that field. But guarding a field
gets a lock on the referenced object, not on the field. This may not
provide the mutual exclusion you need, and other threads might
be obtaining locks on the referenced objects (for other purposes). An example
of this pattern would be:</p>
<pre>
private Long myNtfSeqNbrCounter = new Long(0);
private Long getNotificationSequenceNumber() {
Long result = null;
synchronized(myNtfSeqNbrCounter) {
result = new Long(myNtfSeqNbrCounter.longValue() + 1);
myNtfSeqNbrCounter = new Long(result.longValue());
}
return result;
}
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="ML_SYNC_ON_UPDATED_FIELD">
<ShortDescription>Method synchronizes on an updated field</ShortDescription>
<LongDescription>{1} synchronizes on updated field {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> This method synchronizes on an object
referenced from a mutable field.
This is unlikely to have useful semantics, since different
threads may be synchronizing on different objects.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_OOI_PKGPROTECT">
<ShortDescription>Field should be moved out of an interface and made package protected</ShortDescription>
<LongDescription>{1} should be moved out of an interface and made package protected</LongDescription>
<Details>
<![CDATA[
<p>
A final static field that is
defined in an interface references a mutable
object such as an array or hashtable.
This mutable object could
be changed by malicious code or
by accident from another package.
To solve this, the field needs to be moved to a class
and made package protected
to avoid
this vulnerability.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_FINAL_PKGPROTECT">
<ShortDescription>Field should be both final and package protected</ShortDescription>
<LongDescription>{1} should be both final and package protected</LongDescription>
<Details>
<![CDATA[
<p>
A mutable static field could be changed by malicious code or
by accident from another package.
The field could be made package protected and/or made final
to avoid
this vulnerability.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">
<ShortDescription>Field isn't final but should be refactored to be so</ShortDescription>
<LongDescription>{1} isn't final but should be refactored to be so</LongDescription>
<Details>
<![CDATA[
<p>
This static field public but not final, and
could be changed by malicious code or
by accident from another package.
The field could be made final to avoid
this vulnerability. However, the static initializer contains more than one write
to the field, so doing so will require some refactoring.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_SHOULD_BE_FINAL">
<ShortDescription>Field isn't final but should be</ShortDescription>
<LongDescription>{1} isn't final but should be</LongDescription>
<Details>
<![CDATA[
<p>
This static field public but not final, and
could be changed by malicious code or
by accident from another package.
The field could be made final to avoid
this vulnerability.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_PKGPROTECT">
<ShortDescription>Field should be package protected</ShortDescription>
<LongDescription>{1} should be package protected</LongDescription>
<Details>
<![CDATA[
<p> A mutable static field could be changed by malicious code or
by accident.
The field could be made package protected to avoid
this vulnerability.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_MUTABLE_HASHTABLE">
<ShortDescription>Field is a mutable Hashtable</ShortDescription>
<LongDescription>{1} is a mutable Hashtable</LongDescription>
<Details>
<![CDATA[
<p>A final static field references a Hashtable
and can be accessed by malicious code or
by accident from another package.
This code can freely modify the contents of the Hashtable.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_MUTABLE_ARRAY">
<ShortDescription>Field is a mutable array</ShortDescription>
<LongDescription>{1} is a mutable array</LongDescription>
<Details>
<![CDATA[
<p> A final static field references an array
and can be accessed by malicious code or
by accident from another package.
This code can freely modify the contents of the array.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MS_CANNOT_BE_FINAL">
<ShortDescription>Field isn't final and can't be protected from malicious code</ShortDescription>
<LongDescription>{1} isn't final and can't be protected from malicious code </LongDescription>
<Details>
<![CDATA[
<p>
A mutable static field could be changed by malicious code or
by accident from another package.
Unfortunately, the way the field is used doesn't allow
any easy fix to this problem.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">
<ShortDescription>Potentially ambiguous invocation of either an inherited or outer method</ShortDescription>
<LongDescription>Potentially ambiguous invocation of either an outer or inherited method {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class.
For example, you invoke <code>foo(17)</code>, which is defined in both a superclass and in an outer method.
By the Java semantics,
it will be resolved to invoke the inherited method, but this may not be want
you intend.
</p>
<p>If you really intend to invoke the inherited method,
invoke it by invoking the method on super (e.g., invoke super.foo(17)), and
thus it will be clear to other readers of your code and to FindBugs
that you want to invoke the inherited method, not the method in the outer class.
</p>
<p>If you call <code>this.foo(17)</code>, then the inherited method will be invoked. However, since FindBugs only looks at
classfiles, it
can't tell the difference between an invocation of <code>this.foo(17)</code> and <code>foo(17)</code>, it will still
complain about a potential ambiguous invocation.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">
<ShortDescription>Class names shouldn't shadow simple name of superclass</ShortDescription>
<LongDescription>The class name {0} shadows the simple name of the superclass {1}</LongDescription>
<Details>
<![CDATA[
<p> This class has a simple name that is identical to that of its superclass, except
that its superclass is in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
This can be exceptionally confusing, create lots of situations in which you have to look at import statements
to resolve references and creates many
opportunities to accidently define methods that do not override methods in their superclasses.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_SAME_SIMPLE_NAME_AS_INTERFACE">
<ShortDescription>Class names shouldn't shadow simple name of implemented interface</ShortDescription>
<LongDescription>The class name {0} shadows the simple name of implemented interface {1}</LongDescription>
<Details>
<![CDATA[
<p> This class/interface has a simple name that is identical to that of an implemented/extended interface, except
that the interface is in a different package (e.g., <code>alpha.Foo</code> extends <code>beta.Foo</code>).
This can be exceptionally confusing, create lots of situations in which you have to look at import statements
to resolve references and creates many
opportunities to accidently define methods that do not override methods in their superclasses.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_CLASS_NAMING_CONVENTION">
<ShortDescription>Class names should start with an upper case letter</ShortDescription>
<LongDescription>The class name {0} doesn't start with an upper case letter</LongDescription>
<Details>
<![CDATA[
<p> Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_METHOD_NAMING_CONVENTION">
<ShortDescription>Method names should start with a lower case letter</ShortDescription>
<LongDescription>The method name {1} doesn't start with a lower case letter</LongDescription>
<Details>
<![CDATA[
<p>
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_FIELD_NAMING_CONVENTION">
<ShortDescription>Field names should start with a lower case letter</ShortDescription>
<LongDescription>The field name {1} doesn't start with a lower case letter</LongDescription>
<Details>
<![CDATA[
<p>
Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_VERY_CONFUSING">
<ShortDescription>Very confusing method names</ShortDescription>
<LongDescription>VERY confusing to have methods {1} and {3}</LongDescription>
<Details>
<![CDATA[
<p> The referenced methods have names that differ only by capitalization.
This is very confusing because if the capitalization were
identical then one of the methods would override the other.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_VERY_CONFUSING_INTENTIONAL">
<ShortDescription>Very confusing method names (but perhaps intentional)</ShortDescription>
<LongDescription>VERY confusing (but perhaps intentional) to have methods {1} and {3}</LongDescription>
<Details>
<![CDATA[
<p> The referenced methods have names that differ only by capitalization.
This is very confusing because if the capitalization were
identical then one of the methods would override the other. From the existence of other methods, it
seems that the existence of both of these methods is intentional, but is sure is confusing.
You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_WRONG_PACKAGE">
<ShortDescription>Method doesn't override method in superclass due to wrong package for parameter</ShortDescription>
<LongDescription>{1} doesn't override method in superclass because parameter type {4} doesn't match superclass parameter type {5}</LongDescription>
<Details>
<![CDATA[
<p> The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
the type of the corresponding parameter in the superclass. For example, if you have:</p>
<blockquote>
<pre>
import alpha.Foo;
public class A {
public int f(Foo x) { return 17; }
}
----
import beta.Foo;
public class B extends A {
public int f(Foo x) { return 42; }
}
</pre>
</blockquote>
<p>The <code>f(Foo)</code> method defined in class <code>B</code> doesn't
override the
<code>f(Foo)</code> method defined in class <code>A</code>, because the argument
types are <code>Foo</code>'s from different packages.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_WRONG_PACKAGE_INTENTIONAL">
<ShortDescription>Method doesn't override method in superclass due to wrong package for parameter</ShortDescription>
<LongDescription>{1} doesn't override method in superclass because parameter type {4} doesn't match superclass parameter type {5}</LongDescription>
<Details>
<![CDATA[
<p> The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
the type of the corresponding parameter in the superclass. For example, if you have:</p>
<blockquote>
<pre>
import alpha.Foo;
public class A {
public int f(Foo x) { return 17; }
}
----
import beta.Foo;
public class B extends A {
public int f(Foo x) { return 42; }
public int f(alpha.Foo x) { return 27; }
}
</pre>
</blockquote>
<p>The <code>f(Foo)</code> method defined in class <code>B</code> doesn't
override the
<code>f(Foo)</code> method defined in class <code>A</code>, because the argument
types are <code>Foo</code>'s from different packages.
</p>
<p>In this case, the subclass does define a method with a signature identical to the method in the superclass,
so this is presumably understood. However, such methods are exceptionally confusing. You should strongly consider
removing or deprecating the method with the similar but not identical signature.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_CONFUSING">
<ShortDescription>Confusing method names</ShortDescription>
<LongDescription>Confusing to have methods {1} and {3}</LongDescription>
<Details>
<![CDATA[
<p> The referenced methods have names that differ only by capitalization.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_METHOD_CONSTRUCTOR_CONFUSION">
<ShortDescription>Apparent method/constructor confusion</ShortDescription>
<LongDescription>{1} was probably intended to be a constructor</LongDescription>
<Details>
<![CDATA[
<p> This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor.
If it was intended to be a constructor, remove the declaration of a void return value.
If you had accidently defined this method, realized the mistake, defined a proper constructor
but can't get rid of this method due to backwards compatibility, deprecate the method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_LCASE_HASHCODE">
<ShortDescription>Class defines hashcode(); should it be hashCode()?</ShortDescription>
<LongDescription>Class {0} defines hashcode(); should it be hashCode()?</LongDescription>
<Details>
<![CDATA[
<p> This class defines a method called <code>hashcode()</code>. This method
does not override the <code>hashCode()</code> method in <code>java.lang.Object</code>,
which is probably what was intended.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_LCASE_TOSTRING">
<ShortDescription>Class defines tostring(); should it be toString()?</ShortDescription>
<LongDescription>Class {0} defines tostring(); should it be toString()?</LongDescription>
<Details>
<![CDATA[
<p> This class defines a method called <code>tostring()</code>. This method
does not override the <code>toString()</code> method in <code>java.lang.Object</code>,
which is probably what was intended.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_BAD_EQUAL">
<ShortDescription>Class defines equal(Object); should it be equals(Object)?</ShortDescription>
<LongDescription>Class {0} defines equal(Object); should it be equals(Object)?</LongDescription>
<Details>
<![CDATA[
<p> This class defines a method <code>equal(Object)</code>. This method does
not override the <code>equals(Object)</code> method in <code>java.lang.Object</code>,
which is probably what was intended.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NM_CLASS_NOT_EXCEPTION">
<ShortDescription>Class is not derived from an Exception, even though it is named as such</ShortDescription>
<LongDescription>Class {0} is not derived from an Exception, even though it is named as such</LongDescription>
<Details>
<![CDATA[
<p> This class is not derived from another exception, but ends with 'Exception'. This will
be confusing to users of this class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RR_NOT_CHECKED">
<ShortDescription>Method ignores results of InputStream.read()</ShortDescription>
<LongDescription>{1} ignores result of {2}</LongDescription>
<Details>
<![CDATA[
<p> This method ignores the return value of one of the variants of
<code>java.io.InputStream.read()</code> which can return multiple bytes.
If the return value is not checked, the caller will not be able to correctly
handle the case where fewer bytes were read than the caller requested.
This is a particularly insidious kind of bug, because in many programs,
reads from input streams usually do read the full amount of data requested,
causing the program to fail only sporadically.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SR_NOT_CHECKED">
<ShortDescription>Method ignores results of InputStream.skip()</ShortDescription>
<LongDescription>{1} ignores result of {2}</LongDescription>
<Details>
<![CDATA[
<p> This method ignores the return value of
<code>java.io.InputStream.skip()</code> which can skip multiple bytes.
If the return value is not checked, the caller will not be able to correctly
handle the case where fewer bytes were skipped than the caller requested.
This is a particularly insidious kind of bug, because in many programs,
skips from input streams usually do skip the full amount of data requested,
causing the program to fail only sporadically. With Buffered streams, however,
skip() will only skip data in the buffer, and will routinely fail to skip the
requested number of bytes.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_READ_RESOLVE_IS_STATIC">
<ShortDescription>The readResolve method must not be declared as a static method. </ShortDescription>
<LongDescription>{1} should be declared as an instance method rather than a static method</LongDescription>
<Details>
<![CDATA[
<p> In order for the readResolve method to be recognized by the serialization
mechanism, it must not be declared as a static method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">
<ShortDescription>Private readResolve method not inherited by subclasses</ShortDescription>
<LongDescription>Private readResolve method in {0} not inherited by subclasses.</LongDescription>
<Details>
<![CDATA[
<p> This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses.
This might be intentional and OK, but should be reviewed to ensure it is what is intended.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_READ_RESOLVE_MUST_RETURN_OBJECT">
<ShortDescription>The readResolve method must be declared with a return type of Object. </ShortDescription>
<LongDescription>The method {1} must be declared with a return type of Object rather than {1.returnType}</LongDescription>
<Details>
<![CDATA[
<p> In order for the readResolve method to be recognized by the serialization
mechanism, it must be declared to have a return type of Object.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS">
<ShortDescription>Transient field of class that isn't Serializable. </ShortDescription>
<LongDescription>{1.givenClass} is transient but {0} isn't Serializable</LongDescription>
<Details>
<![CDATA[
<p> The field is marked as transient, but the class isn't Serializable, so marking it as transient
has absolutely no effect.
This may be leftover marking from a previous version of the code in which the class was transient, or
it may indicate a misunderstanding of how serialization works.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_TRANSIENT_FIELD_NOT_RESTORED">
<ShortDescription>Transient field that isn't set by deserialization. </ShortDescription>
<LongDescription>The field {1} is transient but isn't set by deserialization</LongDescription>
<Details>
<![CDATA[
<p> This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any
deserialized instance of the class.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_METHOD_MUST_BE_PRIVATE">
<ShortDescription>Method must be private in order for serialization to work</ShortDescription>
<LongDescription>The method {1.givenClass} must be private to be invoked in serialization/deserialization of {0}</LongDescription>
<Details>
<![CDATA[
<p> This class implements the <code>Serializable</code> interface, and defines a method
for custom serialization/deserialization. But since that method isn't declared private,
it will be silently ignored by the serialization/deserialization API.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION">
<ShortDescription>Class is Externalizable but doesn't define a void constructor</ShortDescription>
<LongDescription>{0} is Externalizable but doesn't define a void constructor</LongDescription>
<Details>
<![CDATA[
<p> This class implements the <code>Externalizable</code> interface, but does
not define a void constructor. When Externalizable objects are deserialized,
they first need to be constructed by invoking the void
constructor. Since this class does not have one,
serialization and deserialization will fail at runtime.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_NO_SUITABLE_CONSTRUCTOR">
<ShortDescription>Class is Serializable but its superclass doesn't define a void constructor</ShortDescription>
<LongDescription>{0} is Serializable but its superclass doesn't define an accessible void constructor</LongDescription>
<Details>
<![CDATA[
<p> This class implements the <code>Serializable</code> interface
and its superclass does not. When such an object is deserialized,
the fields of the superclass need to be initialized by
invoking the void constructor of the superclass.
Since the superclass does not have one,
serialization and deserialization will fail at runtime.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_NO_SERIALVERSIONID">
<ShortDescription>Class is Serializable, but doesn't define serialVersionUID</ShortDescription>
<LongDescription>{0} is Serializable; consider declaring a serialVersionUID</LongDescription>
<Details>
<![CDATA[
<p> This class implements the <code>Serializable</code> interface, but does
not define a <code>serialVersionUID</code> field.
A change as simple as adding a reference to a .class object
will add synthetic fields to the class,
which will unfortunately change the implicit
serialVersionUID (e.g., adding a reference to <code>String.class</code>
will generate a static field <code>class$java$lang$String</code>).
Also, different source code to bytecode compilers may use different
naming conventions for synthetic variables generated for
references to class objects or inner classes.
To ensure interoperability of Serializable across versions,
consider adding an explicit serialVersionUID.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">
<ShortDescription>Comparator doesn't implement Serializable</ShortDescription>
<LongDescription>{0} implements Comparator but not Serializable</LongDescription>
<Details>
<![CDATA[
<p> This class implements the <code>Comparator</code> interface. You
should consider whether or not it should also implement the <code>Serializable</code>
interface. If a comparator is used to construct an ordered collection
such as a <code>TreeMap</code>, then the <code>TreeMap</code>
will be serializable only if the comparator is also serializable.
As most comparators have little or no state, making them serializable
is generally easy and good defensive programming.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SF_SWITCH_FALLTHROUGH">
<ShortDescription>Switch statement found where one case falls through to the next case</ShortDescription>
<LongDescription>Switch statement found in {1} where one case falls through to the next case</LongDescription>
<Details>
<![CDATA[
<p> This method contains a switch statement where one case branch will fall through to the next case.
Usually you need to end this case with a break or return.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SF_SWITCH_NO_DEFAULT">
<ShortDescription>Switch statement found where default case is missing</ShortDescription>
<LongDescription>Switch statement found in {1} where default case is missing</LongDescription>
<Details>
<![CDATA[
<p> This method contains a switch statement where default case is missing.
Usually you need to provide a default case.</p>
<p>Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if
the default case is at the end of the switch statement and doesn't end with a break statement.
]]>
</Details>
</BugPattern>
<BugPattern type="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">
<ShortDescription>Dead store due to switch statement fall through</ShortDescription>
<LongDescription>Value of {2.givenClass} from previous case is overwritten here due to switch statement fall through</LongDescription>
<Details>
<![CDATA[
<p> A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that
you forgot to put a break or return at the end of the previous case.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW">
<ShortDescription>Dead store due to switch statement fall through to throw</ShortDescription>
<LongDescription>Value of {2.givenClass} from previous case is lost here due to switch statement fall through to throw</LongDescription>
<Details>
<![CDATA[
<p> A value stored in the previous switch case is ignored here due to a switch fall through to a place where
an exception is thrown. It is likely that
you forgot to put a break or return at the end of the previous case.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="WS_WRITEOBJECT_SYNC">
<ShortDescription>Class's writeObject() method is synchronized but nothing else is</ShortDescription>
<LongDescription>{0}'s writeObject method is synchronized but nothing else is</LongDescription>
<Details>
<![CDATA[
<p> This class has a <code>writeObject()</code> method which is synchronized;
however, no other method of the class is synchronized.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RS_READOBJECT_SYNC">
<ShortDescription>Class's readObject() method is synchronized</ShortDescription>
<LongDescription>{0}'s readObject method is synchronized</LongDescription>
<Details>
<![CDATA[
<p> This serializable class defines a <code>readObject()</code> which is
synchronized. By definition, an object created by deserialization
is only reachable by one thread, and thus there is no need for
<code>readObject()</code> to be synchronized. If the <code>readObject()</code>
method itself is causing the object to become visible to another thread,
that is an example of very dubious coding style.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_NONSTATIC_SERIALVERSIONID">
<ShortDescription>serialVersionUID isn't static</ShortDescription>
<LongDescription>{1} isn't static</LongDescription>
<Details>
<![CDATA[
<p> This class defines a <code>serialVersionUID</code> field that is not static.
The field should be made static
if it is intended to specify
the version UID for purposes of serialization.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_NONFINAL_SERIALVERSIONID">
<ShortDescription>serialVersionUID isn't final</ShortDescription>
<LongDescription>{1} isn't final</LongDescription>
<Details>
<![CDATA[
<p> This class defines a <code>serialVersionUID</code> field that is not final.
The field should be made final
if it is intended to specify
the version UID for purposes of serialization.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_NONLONG_SERIALVERSIONID">
<ShortDescription>serialVersionUID isn't long</ShortDescription>
<LongDescription>{1} isn't long</LongDescription>
<Details>
<![CDATA[
<p> This class defines a <code>serialVersionUID</code> field that is not long.
The field should be made long
if it is intended to specify
the version UID for purposes of serialization.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_BAD_FIELD">
<ShortDescription>Non-transient non-serializable instance field in serializable class</ShortDescription>
<LongDescription>Class {0} defines non-transient non-serializable instance field {1.name}</LongDescription>
<Details>
<![CDATA[
<p> This Serializable class defines a non-primitive instance field which is neither transient,
Serializable, or <code>java.lang.Object</code>, and does not appear to implement
the <code>Externalizable</code> interface or the
<code>readObject()</code> and <code>writeObject()</code> methods.
Objects of this class will not be deserialized correctly if a non-Serializable
object is stored in this field.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SE_BAD_FIELD_INNER_CLASS">
<ShortDescription>Non-serializable class has a serializable inner class</ShortDescription>
<LongDescription>{0} is serializable but also an inner class of a non-serializable class</LongDescription>
<Details>
<![CDATA[
<p> This Serializable class is an inner class of a non-serializable class.
Thus, attempts to serialize it will also attempt to associate instance of the outer
class with which it is associated, leading to a runtime error.
</p>
<p>If possible, making the inner class a static inner class should solve the
problem. Making the outer class serializable might also work, but that would
mean serializing an instance of the inner class would always also serialize the instance
of the outer class, which it often not what you really want.
]]>
</Details>
</BugPattern>
<BugPattern type="SE_INNER_CLASS">
<ShortDescription>Serializable inner class</ShortDescription>
<LongDescription>{0} is serializable and an inner class</LongDescription>
<Details>
<![CDATA[
<p> This Serializable class is an inner class. Any attempt to serialize
it will also serialize the associated outer instance. The outer instance is serializable,
so this won't fail, but it might serialize a lot more data than intended.
If possible, making the inner class a static inner class (also known as a nested class) should solve the
problem.
]]>
</Details>
</BugPattern>
<BugPattern type="SE_BAD_FIELD_STORE">
<ShortDescription>Non-serializable value stored into instance field of a serializable class</ShortDescription>
<LongDescription>{2} stored into non-transient field {1.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> A non-serializable value is stored into a non-transient field
of a serializable class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SC_START_IN_CTOR">
<ShortDescription>Constructor invokes Thread.start()</ShortDescription>
<LongDescription>{1} invokes {2}</LongDescription>
<Details>
<![CDATA[
<p> The constructor starts a thread. This is likely to be wrong if
the class is ever extended/subclassed, since the thread will be started
before the subclass constructor is started.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SS_SHOULD_BE_STATIC">
<ShortDescription>Unread field: should this field be static?</ShortDescription>
<LongDescription>Unread field: {1}; should this field be static?</LongDescription>
<Details>
<![CDATA[
<p> This class contains an instance final field that
is initialized to a compile-time static value.
Consider making the field static.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UUF_UNUSED_FIELD">
<ShortDescription>Unused field</ShortDescription>
<LongDescription>Unused field: {1}</LongDescription>
<Details>
<![CDATA[
<p> This field is never used. Consider removing it from the class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="URF_UNREAD_FIELD">
<ShortDescription>Unread field</ShortDescription>
<LongDescription>Unread field: {1}</LongDescription>
<Details>
<![CDATA[
<p> This field is never read. Consider removing it from the class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">
<ShortDescription>Unused public or protected field</ShortDescription>
<LongDescription>Unused public or protected field: {1}</LongDescription>
<Details>
<![CDATA[
<p> This field is never used.
The field is public or protected, so perhaps
it is intended to be used with classes not seen as part of the analysis. If not,
consider removing it from the class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">
<ShortDescription>Unread public/protected field</ShortDescription>
<LongDescription>Unread public/protected field: {1}</LongDescription>
<Details>
<![CDATA[
<p> This field is never read.
The field is public or protected, so perhaps
it is intended to be used with classes not seen as part of the analysis. If not,
consider removing it from the class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="QF_QUESTIONABLE_FOR_LOOP">
<ShortDescription>Complicated, subtle or wrong increment in for-loop </ShortDescription>
<LongDescription>Complicated, subtle or wrong increment in for-loop {1} </LongDescription>
<Details>
<![CDATA[
<p>Are you sure this for loop is incrementing the correct variable?
It appears that another variable is being initialized and checked
by the for loop.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UWF_NULL_FIELD">
<ShortDescription>Field only ever set to null</ShortDescription>
<LongDescription>Field only ever set to null: {1}</LongDescription>
<Details>
<![CDATA[
<p> All writes to this field are of the constant value null, and thus
all reads of the field will return null.
Check for errors, or remove it if it is useless.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">
<ShortDescription>Unwritten public or protected field</ShortDescription>
<LongDescription>Unwritten public or protected field: {1}</LongDescription>
<Details>
<![CDATA[
<p> No writes were seen to this public/protected field. All reads of it will return the default
value. Check for errors (should it have been initialized?), or remove it if it is useless.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UWF_UNWRITTEN_FIELD">
<ShortDescription>Unwritten field</ShortDescription>
<LongDescription>Unwritten field: {1}</LongDescription>
<Details>
<![CDATA[
<p> This field is never written. All reads of it will return the default
value. Check for errors (should it have been initialized?), or remove it if it is useless.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">
<ShortDescription>Write to static field from instance method</ShortDescription>
<LongDescription>Write to static field {2} from instance method {1}</LongDescription>
<Details>
<![CDATA[
<p> This instance method writes to a static field. This is tricky to get
correct if multiple instances are being manipulated,
and generally bad practice.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_LOAD_OF_KNOWN_NULL_VALUE">
<ShortDescription>Load of known null value</ShortDescription>
<LongDescription>Load of known null value in {1}</LongDescription>
<Details>
<![CDATA[
<p> The variable referenced at this point is known to be null due to an earlier
check against null. Although this is valid, it might be a mistake (perhaps you
intended to refer to a different variable, or perhaps the earlier check to see if the
variable is null should have been a check to see if it was nonnull).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_DEREFERENCE_OF_READLINE_VALUE">
<ShortDescription>Dereference of the result of readLine() without nullcheck</ShortDescription>
<LongDescription>Dereference of the result of readLine() without nullcheck in {1}</LongDescription>
<Details>
<![CDATA[
<p> The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text
to read, readLine() will return null and dereferencing that will generate a null pointer exception.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_IMMEDIATE_DEREFERENCE_OF_READLINE">
<ShortDescription>Immediate dereference of the result of readLine()</ShortDescription>
<LongDescription>Immediate dereference of the result of readLine() in {1}</LongDescription>
<Details>
<![CDATA[
<p> The result of invoking readLine() is immediately dereferenced. If there are no more lines of text
to read, readLine() will return null and dereferencing that will generate a null pointer exception.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_UNWRITTEN_FIELD">
<ShortDescription>Read of unwritten field</ShortDescription>
<LongDescription>Read of unwritten field {2.name} in {1}</LongDescription>
<Details>
<![CDATA[
<p> The program is dereferencing a field that does not seem to ever have a non-null value written to it.
Unless the field is initialized via some mechanism not seen by the analysis,
dereferencing this value will generate a null pointer exception.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">
<ShortDescription>Read of unwritten public or protected field</ShortDescription>
<LongDescription>Read of unwritten public or protected field {2.name} in {1}</LongDescription>
<Details>
<![CDATA[
<p> The program is dereferencing a public or protected
field that does not seem to ever have a non-null value written to it.
Unless the field is initialized via some mechanism not seen by the analysis,
dereferencing this value will generate a null pointer exception.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SIC_THREADLOCAL_DEADLY_EMBRACE">
<ShortDescription>Deadly embrace of non-static inner class and thread local</ShortDescription>
<LongDescription>{0} needs to be _static_ to avoid a deadly embrace with {1}</LongDescription>
<Details>
<![CDATA[
<p> This class is an inner class, but should probably be a static inner class.
As it is, there is a serious danger of a deadly embrace between the inner class
and the thread local in the outer class. Because the inner class isn't static,
it retains a reference to the outer class.
If the thread local contains a reference to an instance of the inner
class, the inner and outer instance will both be reachable
and not eligible for garbage collection.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SIC_INNER_SHOULD_BE_STATIC">
<ShortDescription>Should be a static inner class</ShortDescription>
<LongDescription>Should {0} be a _static_ inner class?</LongDescription>
<Details>
<![CDATA[
<p> This class is an inner class, but does not use its embedded reference
to the object which created it. This reference makes the instances
of the class larger, and may keep the reference to the creator object
alive longer than necessary. If possible, the class should be
made static.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">
<ShortDescription>Field not initialized in constructor but dereferenced without null check</ShortDescription>
<LongDescription>{1.givenClass} not initialized in constructor and dereferenced in {2}</LongDescription>
<Details>
<![CDATA[
<p> This field is never initialized within any constructor, and is therefore could be null after
the object is constructed. Elsewhere, it is loaded and dereferenced without a null check.
This could be a either an error or a questionable design, since
it means a null pointer exception will be generated if that field is dereferenced
before being initialized.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SIC_INNER_SHOULD_BE_STATIC_ANON">
<ShortDescription>Could be refactored into a named static inner class</ShortDescription>
<LongDescription>The class {0} could be refactored into a named _static_ inner class</LongDescription>
<Details>
<![CDATA[
<p> This class is an inner class, but does not use its embedded reference
to the object which created it. This reference makes the instances
of the class larger, and may keep the reference to the creator object
alive longer than necessary. If possible, the class should be
made into a <em>static</em> inner class. Since anonymous inner
classes cannot be marked as static, doing this will require refactoring
the inner class so that it is a named inner class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">
<ShortDescription>Could be refactored into a static inner class</ShortDescription>
<LongDescription>The class {0} could be refactored into a _static_ inner class</LongDescription>
<Details>
<![CDATA[
<p> This class is an inner class, but does not use its embedded reference
to the object which created it except during construction of the
inner object. This reference makes the instances
of the class larger, and may keep the reference to the creator object
alive longer than necessary. If possible, the class should be
made into a <em>static</em> inner class. Since the reference to the
outer object is required during construction of the inner instance,
the inner class will need to be refactored so as to
pass a reference to the outer instance to the constructor
for the inner class.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="WA_NOT_IN_LOOP">
<ShortDescription>Wait not in loop </ShortDescription>
<LongDescription>Wait not in loop in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a call to <code>java.lang.Object.wait()</code>
which is not in a loop. If the monitor is used for multiple conditions,
the condition the caller intended to wait for might not be the one
that actually occurred.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="WA_AWAIT_NOT_IN_LOOP">
<ShortDescription>Condition.await() not in loop </ShortDescription>
<LongDescription>Condition.await() not in loop in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a call to <code>java.util.concurrent.await()</code>
(or variants)
which is not in a loop. If the object is used for multiple conditions,
the condition the caller intended to wait for might not be the one
that actually occurred.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NO_NOTIFY_NOT_NOTIFYALL">
<ShortDescription>Using notify() rather than notifyAll()</ShortDescription>
<LongDescription>Using notify rather than notifyAll in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls <code>notify()</code> rather than <code>notifyAll()</code>.
Java monitors are often used for multiple conditions. Calling <code>notify()</code>
only wakes up one thread, meaning that the thread woken up might not be the
one waiting for the condition that the caller just satisfied.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_CHECK_FOR_POSITIVE_INDEXOF">
<ShortDescription>Method checks to see if result of String.indexOf is positive</ShortDescription>
<LongDescription>{1} checks to see if result of String.indexOf is positive</LongDescription>
<Details>
<![CDATA[
<p> The method invokes String.indexOf and checks to see if the result is positive or non-positive.
It is much more typical to check to see if the result is negative or non-negative. It is
positive only if the substring checked for occurs at some place other than at the beginning of
the String.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_DONT_JUST_NULL_CHECK_READLINE">
<ShortDescription>Method discards result of readLine after checking if it is nonnull</ShortDescription>
<LongDescription>{1} discards result of readLine after checking if it is nonnull</LongDescription>
<Details>
<![CDATA[
<p> The value returned by readLine is discarded after checking to see if the return
value is non-null. In almost all situations, if the result is non-null, you will want
to use that non-null value. Calling readLine again will give you a different line.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_RETURN_VALUE_IGNORED_INFERRED">
<ShortDescription>Method ignores return value, is this OK?</ShortDescription>
<LongDescription>Return value of {2.givenClass} ignored, is this OK in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code calls a method and ignores the return value. The return value
is the same type as the type the method is invoked on, and from our analysis it looks
like the return value might be important (e.g., like ignoring the
return value of <code>String.toLowerCase()</code>).
</p>
<p>We are guessing that ignoring the return value might be a bad idea just from
a simple analysis of the body of the method. You can use a @CheckReturnValue annotation
to instruct FindBugs as to whether ignoring the return value of this method
is important or acceptable.
</p>
<p>Please investigate this closely to decide whether it is OK to ignore the return value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_RETURN_VALUE_IGNORED">
<ShortDescription>Method ignores return value</ShortDescription>
<LongDescription>Return value of {2.givenClass} ignored in {1}</LongDescription>
<Details>
<![CDATA[
<p> The return value of this method should be checked. One common
cause of this warning is to invoke a method on an immutable object,
thinking that it updates the object. For example, in the following code
fragment,</p>
<blockquote>
<pre>
String dateString = getHeaderField(name);
dateString.trim();
</pre>
</blockquote>
<p>the programmer seems to be thinking that the trim() method will update
the String referenced by dateString. But since Strings are immutable, the trim()
function returns a new String value, which is being ignored here. The code
should be corrected to: </p>
<blockquote>
<pre>
String dateString = getHeaderField(name);
dateString = dateString.trim();
</pre>
</blockquote>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">
<ShortDescription>Method ignores exceptional return value</ShortDescription>
<LongDescription>Exceptional return value of {2} ignored in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method returns a value that is not checked. The return value should be checked
since it can indicate an unusual or unexpected function execution. For
example, the <code>File.delete()</code> method returns false
if the file could not be successfully deleted (rather than
throwing an Exception).
If you don't check the result, you won't notice if the method invocation
signals unexpected behavior by returning an atypical return value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE">
<ShortDescription>Code checks for specific values returned by compareTo</ShortDescription>
<LongDescription>Check to see if return value of {2.givenClass} is equal to {3}</LongDescription>
<Details>
<![CDATA[
<p> This code invoked a compareTo or compare method, and checks to see if the return value is a specific value,
such as 1 or -1. When invoking these methods, you should only check the sign of the result, not for any specific
non-zero value. While many or most compareTo and compare methods only return -1, 0 or 1, some of them
will return other values.
]]>
</Details>
</BugPattern>
<BugPattern type="RV_EXCEPTION_NOT_THROWN">
<ShortDescription>Exception created and dropped rather than thrown</ShortDescription>
<LongDescription>{2.givenClass} not thrown in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code creates an exception (or error) object, but doesn't do anything with it. For example,
something like </p>
<blockquote>
<pre>
if (x < 0)
new IllegalArgumentException("x must be nonnegative");
</pre>
</blockquote>
<p>It was probably the intent of the programmer to throw the created exception:</p>
<blockquote>
<pre>
if (x < 0)
throw new IllegalArgumentException("x must be nonnegative");
</pre>
</blockquote>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_ALWAYS_NULL">
<ShortDescription>Null pointer dereference</ShortDescription>
<LongDescription>Null pointer dereference of {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> A null pointer is dereferenced here. This will lead to a
<code>NullPointerException</code> when the code is executed.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_CLOSING_NULL">
<ShortDescription>close() invoked on a value that is always null</ShortDescription>
<LongDescription>Can't close {2.givenClass} since it is always null in {1}</LongDescription>
<Details>
<![CDATA[
<p> close() is being invoked on a value that is always null. If this statement is executed,
a null pointer exception will occur. But the big risk here you never close
something that should be closed.
]]>
</Details>
</BugPattern>
<BugPattern type="NP_STORE_INTO_NONNULL_FIELD">
<ShortDescription>Store of null value into field annotated NonNull</ShortDescription>
<LongDescription>Store of null value into field {2.givenClass} annotated NonNull in {1}</LongDescription>
<Details>
<![CDATA[
<p> A value that could be null is stored into a field that has been annotated as NonNull. </p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_ALWAYS_NULL_EXCEPTION">
<ShortDescription>Null pointer dereference in method on exception path</ShortDescription>
<LongDescription>Null pointer dereference of {2.givenClass} in {1} on exception path</LongDescription>
<Details>
<![CDATA[
<p> A pointer which is null on an exception path is dereferenced here.
This will lead to a <code>NullPointerException</code> when the code is executed.
Note that because FindBugs currently does not prune infeasible exception paths,
this may be a false warning.</p>
<p> Also note that FindBugs considers the default case of a switch statement to
be an exception path, since the default case is often infeasible.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">
<ShortDescription>Parameter must be nonnull but is marked as nullable</ShortDescription>
<LongDescription>{2} must be nonnull but is marked as nullable</LongDescription>
<Details>
<![CDATA[
<p> This parameter is always used in a way that requires it to be nonnull,
but the parameter is explicitly annotated as being Nullable. Either the use
of the parameter or the annotation is wrong.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_ON_SOME_PATH">
<ShortDescription>Possible null pointer dereference</ShortDescription>
<LongDescription>Possible null pointer dereference of {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> There is a branch of statement that, <em>if executed,</em> guarantees that
a null value will be dereferenced, which
would generate a <code>NullPointerException</code> when the code is executed.
Of course, the problem might be that the branch or statement is infeasible and that
the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">
<ShortDescription>Possible null pointer dereference on branch that might be infeasible</ShortDescription>
<LongDescription>Possible null pointer dereference of {2.givenClass} on branch that might be infeasible in {1}</LongDescription>
<Details>
<![CDATA[
<p> There is a branch of statement that, <em>if executed,</em> guarantees that
a null value will be dereferenced, which
would generate a <code>NullPointerException</code> when the code is executed.
Of course, the problem might be that the branch or statement is infeasible and that
the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
Due to the fact that this value had been previously tested for nullness,
this is a definite possibility.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_ON_SOME_PATH_EXCEPTION">
<ShortDescription>Possible null pointer dereference in method on exception path</ShortDescription>
<LongDescription>Possible null pointer dereference of {2.givenClass} in {1} on exception path</LongDescription>
<Details>
<![CDATA[
<p> A reference value which is null on some exception control path is
dereferenced here. This may lead to a <code>NullPointerException</code>
when the code is executed.
Note that because FindBugs currently does not prune infeasible exception paths,
this may be a false warning.</p>
<p> Also note that FindBugs considers the default case of a switch statement to
be an exception path, since the default case is often infeasible.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">
<ShortDescription>Possible null pointer dereference due to return value of called method</ShortDescription>
<LongDescription>Possible null pointer dereference in {1} due to return value of called method</LongDescription>
<Details>
<![CDATA[
<p> The return value from a method is dereferenced without a null check,
and the return value of that method is one that should generally be checked
for null. This may lead to a <code>NullPointerException</code> when the code is executed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_PARAM_DEREF_NONVIRTUAL">
<ShortDescription>Non-virtual method call passes null for nonnull parameter</ShortDescription>
<LongDescription>Non-virtual method call in {1} passes null for nonnull parameter of {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p>
A possibly-null value is passed to a nonnull method parameter.
Either the parameter is annotated as a parameter that should
always be nonnull, or analysis has shown that it will always be
dereferenced.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">
<ShortDescription>Method call passes null for nonnull parameter</ShortDescription>
<LongDescription>Null passed for nonnull parameter of {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
A possibly-null value is passed at a call site where all known
target methods require the parameter to be nonnull.
Either the parameter is annotated as a parameter that should
always be nonnull, or analysis has shown that it will always be
dereferenced.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_PARAM_DEREF">
<ShortDescription>Method call passes null for nonnull parameter</ShortDescription>
<LongDescription>Null passed for nonnull parameter of {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method call passes a null value for a nonnull method parameter.
Either the parameter is annotated as a parameter that should
always be nonnull, or analysis has shown that it will always be
dereferenced.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NONNULL_PARAM_VIOLATION">
<ShortDescription>Method call passes null to a nonnull parameter </ShortDescription>
<LongDescription>Null passed for nonnull parameter of {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method passes a null value as the parameter of a method which
must be nonnull. Either this parameter has been explicitly marked
as @Nonnull, or analysis has determined that this parameter is
always dereferenced.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NONNULL_RETURN_VIOLATION">
<ShortDescription>Method may return null, but is declared @NonNull</ShortDescription>
<LongDescription>{1} may return null, but is declared @NonNull</LongDescription>
<Details>
<![CDATA[
<p>
This method may return a null value, but the method (or a superclass method
which it overrides) is declared to return @NonNull.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_CLONE_COULD_RETURN_NULL">
<ShortDescription>Clone method may return null</ShortDescription>
<LongDescription>{1} may return null</LongDescription>
<Details>
<![CDATA[
<p>
This clone method seems to return null in some circumstances, but clone is never
allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError
instead.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_TOSTRING_COULD_RETURN_NULL">
<ShortDescription>toString method may return null</ShortDescription>
<LongDescription>{1} may return null</LongDescription>
<Details>
<![CDATA[
<p>
This toString method seems to return null in some circumstances. A liberal reading of the
spec could be interpreted as allowing this, but it is probably a bad idea and could cause
other code to break. Return the empty string or some other appropriate string rather than null.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_GUARANTEED_DEREF">
<ShortDescription>Null value is guaranteed to be dereferenced</ShortDescription>
<LongDescription>{2.givenClass} could be null and is guaranteed to be dereferenced in {1}</LongDescription>
<Details>
<![CDATA[
<p>
There is a statement or branch that if executed guarantees that
a value is null at this point, and that
value that is guaranteed to be dereferenced
(except on forward paths involving runtime exceptions).
</p>
<p>Note that a check such as
<code>if (x == null) throw new NullPointerException();</code>
is treated as a dereference of <code>x</code>.
]]>
</Details>
</BugPattern>
<BugPattern type="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">
<ShortDescription>Value is null and guaranteed to be dereferenced on exception path</ShortDescription>
<LongDescription>{2.name} is null guaranteed to be dereferenced in {1} on exception path</LongDescription>
<Details>
<![CDATA[
<p>
There is a statement or branch on an exception path
that if executed guarantees that
a value is null at this point, and that
value that is guaranteed to be dereferenced
(except on forward paths involving runtime exceptions).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SI_INSTANCE_BEFORE_FINALS_ASSIGNED">
<ShortDescription>Static initializer creates instance before all static final fields assigned</ShortDescription>
<LongDescription>Static initializer for {0} creates instance before all static final fields assigned</LongDescription>
<Details>
<![CDATA[
<p> The class's static initializer creates an instance of the class
before all of the static final fields are assigned.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="OS_OPEN_STREAM">
<ShortDescription>Method may fail to close stream</ShortDescription>
<LongDescription>{1} may fail to close stream</LongDescription>
<Details>
<![CDATA[
<p> The method creates an IO stream object, does not assign it to any
fields, pass it to other methods that might close it,
or return it, and does not appear to close
the stream on all paths out of the method. This may result in
a file descriptor leak. It is generally a good
idea to use a <code>finally</code> block to ensure that streams are
closed.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="OS_OPEN_STREAM_EXCEPTION_PATH">
<ShortDescription>Method may fail to close stream on exception</ShortDescription>
<LongDescription>{1} may fail to close stream on exception</LongDescription>
<Details>
<![CDATA[
<p> The method creates an IO stream object, does not assign it to any
fields, pass it to other methods, or return it, and does not appear to close
it on all possible exception paths out of the method.
This may result in a file descriptor leak. It is generally a good
idea to use a <code>finally</code> block to ensure that streams are
closed.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="PZLA_PREFER_ZERO_LENGTH_ARRAYS">
<ShortDescription>Consider returning a zero length array rather than null</ShortDescription>
<LongDescription>Should {1} return a zero length array rather than null?</LongDescription>
<Details>
<![CDATA[
<p> It is often a better design to
return a length zero array rather than a null reference to indicate that there
are no results (i.e., an empty list of results).
This way, no explicit check for null is needed by clients of the method.</p>
<p>On the other hand, using null to indicate
"there is no answer to this question" is probably appropriate.
For example, <code>File.listFiles()</code> returns an empty list
if given a directory containing no files, and returns null if the file
is not a directory.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UCF_USELESS_CONTROL_FLOW">
<ShortDescription>Useless control flow</ShortDescription>
<LongDescription>Useless control flow in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a useless control flow statement, where
control flow continues onto the same place regardless of whether or not
the branch is taken. For example,
this is caused by having an empty statement
block for an <code>if</code> statement:</p>
<pre>
if (argv.length == 0) {
// TODO: handle this case
}
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="UCF_USELESS_CONTROL_FLOW_NEXT_LINE">
<ShortDescription>Useless control flow to next line</ShortDescription>
<LongDescription>Useless control flow to next line in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a useless control flow statement in which control
flow follows to the same or following line regardless of whether or not
the branch is taken.
Often, this is caused by inadvertently using an empty statement as the
body of an <code>if</code> statement, e.g.:</p>
<pre>
if (argv.length == 1);
System.out.println("Hello, " + argv[0]);
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE">
<ShortDescription>Nullcheck of value previously dereferenced</ShortDescription>
<LongDescription>Nullcheck of {2.givenClass} at {4.lineNumber} of value previously dereferenced in {1}</LongDescription>
<Details>
<![CDATA[
<p> A value is checked here to see whether it is null, but this value can't
be null because it was previously dereferenced and if it were null a null pointer
exception would have occurred at the earlier dereference.
Essentially, this code and the previous dereference
disagree as to whether this value is allowed to be null. Either the check is redundant
or the previous dereference is erroneous.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">
<ShortDescription>Redundant nullcheck of value known to be null</ShortDescription>
<LongDescription>Redundant nullcheck of {2} which is known to be null in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a redundant check of a known null value against
the constant null.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">
<ShortDescription>Redundant nullcheck of value known to be non-null</ShortDescription>
<LongDescription>Redundant nullcheck of {2}, which is known to be non-null in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a redundant check of a known non-null value against
the constant null.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">
<ShortDescription>Redundant comparison of two null values</ShortDescription>
<LongDescription>Redundant comparison of two null values in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a redundant comparison of two references known to
both be definitely null.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE">
<ShortDescription>Redundant comparison of non-null value to null</ShortDescription>
<LongDescription>Redundant comparison of non-null value to null in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a reference known to be non-null with another reference
known to be null.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RCN_REDUNDANT_CHECKED_NULL_COMPARISON" deprecated="true">
<!-- deprecated in favor of two separate RCN_ patterns -->
<ShortDescription>Redundant comparison to null of previously checked value</ShortDescription>
<LongDescription>Redundant comparison to null of previously checked {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a redundant comparison of a reference value
to null. Two types of redundant comparison are reported:
</p>
<ul>
<li> Both values compared are definitely null</li>
<li> One value is definitely null and the other is definitely not null</li>
</ul>
<p> This particular warning generally indicates that a
value known not to be null was checked against null.
While the check is not necessary, it may simply be a case
of defensive programming.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UL_UNRELEASED_LOCK">
<ShortDescription>Method does not release lock on all paths</ShortDescription>
<LongDescription>{1} does not release lock on all paths</LongDescription>
<Details>
<![CDATA[
<p> This method acquires a JSR-166 (<code>java.util.concurrent</code>) lock,
but does not release it on all paths out of the method. In general, the correct idiom
for using a JSR-166 lock is:
</p>
<pre>
Lock l = ...;
l.lock();
try {
// do something
} finally {
l.unlock();
}
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="UL_UNRELEASED_LOCK_EXCEPTION_PATH">
<ShortDescription>Method does not release lock on all exception paths</ShortDescription>
<LongDescription>{1} does not release lock on all exception paths</LongDescription>
<Details>
<![CDATA[
<p> This method acquires a JSR-166 (<code>java.util.concurrent</code>) lock,
but does not release it on all exception paths out of the method. In general, the correct idiom
for using a JSR-166 lock is:
</p>
<pre>
Lock l = ...;
l.lock();
try {
// do something
} finally {
l.unlock();
}
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="RC_REF_COMPARISON">
<ShortDescription>Suspicious reference comparison</ShortDescription>
<LongDescription>Suspicious comparison of {2} references in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares two reference values using the == or != operator,
where the correct way to compare instances of this type is generally
with the equals() method.
It is possible to create distinct instances that are equal but do not compare as == since
they are different objects.
Examples of classes which should generally
not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RC_REF_COMPARISON_BAD_PRACTICE">
<ShortDescription>Suspicious reference comparison to constant</ShortDescription>
<LongDescription>Suspicious comparison of a {2} reference to constant in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares a reference value to a constant using the == or != operator,
where the correct way to compare instances of this type is generally
with the equals() method.
It is possible to create distinct instances that are equal but do not compare as == since
they are different objects.
Examples of classes which should generally
not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">
<ShortDescription>Suspicious reference comparison of Boolean values</ShortDescription>
<LongDescription>Suspicious comparison of Boolean references in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares two Boolean values using the == or != operator.
Normally, there are only two Boolean values (Boolean.TRUE and Boolean.FALSE),
but it is possible to create other Boolean objects using the <code>new Boolean(b)</code>
constructor. It is best to avoid such objects, but if they do exist,
then checking Boolean objects for equality using == or != will give results
than are different than you would get using <code>.equals(...)</code>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">
<ShortDescription>Using pointer equality to compare different types</ShortDescription>
<LongDescription>Using pointer equality to compare a {2.givenClass} with a {3.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method uses using pointer equality to compare two references that seem to be of
different types. The result of this comparison will always be false at runtime.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_UNRELATED_TYPES">
<ShortDescription>Call to equals() comparing different types</ShortDescription>
<LongDescription>Call to {3.simpleClass}.equals({2.simpleClass}) in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls equals(Object) on two references of different
class types with no common subclasses.
Therefore, the objects being compared
are unlikely to be members of the same class at runtime
(unless some application classes were not analyzed, or dynamic class
loading can occur at runtime).
According to the contract of equals(),
objects of different
classes should always compare as unequal; therefore, according to the
contract defined by java.lang.Object.equals(Object),
the result of this comparison will always be false at runtime.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_UNRELATED_INTERFACES">
<ShortDescription>Call to equals() comparing different interface types</ShortDescription>
<LongDescription>Call to {3.simpleClass}.equals({2.simpleClass}) in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls equals(Object) on two references of unrelated
interface types, where neither is a subtype of the other,
and there are no known non-abstract classes which implement both interfaces.
Therefore, the objects being compared
are unlikely to be members of the same class at runtime
(unless some application classes were not analyzed, or dynamic class
loading can occur at runtime).
According to the contract of equals(),
objects of different
classes should always compare as unequal; therefore, according to the
contract defined by java.lang.Object.equals(Object),
the result of this comparison will always be false at runtime.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_UNRELATED_CLASS_AND_INTERFACE">
<ShortDescription>Call to equals() comparing unrelated class and interface</ShortDescription>
<LongDescription>Call to {3.simpleClass}.equals({2.simpleClass}) in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method calls equals(Object) on two references, one of which is a class
and the other an interface, where neither the class nor any of its
non-abstract subclasses implement the interface.
Therefore, the objects being compared
are unlikely to be members of the same class at runtime
(unless some application classes were not analyzed, or dynamic class
loading can occur at runtime).
According to the contract of equals(),
objects of different
classes should always compare as unequal; therefore, according to the
contract defined by java.lang.Object.equals(Object),
the result of this comparison will always be false at runtime.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_NULL_ARG">
<ShortDescription>Call to equals(null)</ShortDescription>
<LongDescription>Call to equals(null) in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls equals(Object), passing a null value as
the argument. According to the contract of the equals() method,
this call should always return <code>false</code>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MWN_MISMATCHED_WAIT">
<ShortDescription>Mismatched wait()</ShortDescription>
<LongDescription>Mismatched wait() in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls Object.wait() without obviously holding a lock
on the object. Calling wait() without a lock held will result in
an <code>IllegalMonitorStateException</code> being thrown.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MWN_MISMATCHED_NOTIFY">
<ShortDescription>Mismatched notify()</ShortDescription>
<LongDescription>Mismatched notify() in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls Object.notify() or Object.notifyAll() without obviously holding a lock
on the object. Calling notify() or notifyAll() without a lock held will result in
an <code>IllegalMonitorStateException</code> being thrown.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">
<ShortDescription>Self assignment of local rather than assignment to field</ShortDescription>
<LongDescription>Self assignment of {2} rather than assigned to field in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a self assignment of a local variable, and there
is a field with an identical name.
assignment appears to have been ; e.g.</p>
<pre>
int foo;
public void setFoo(int foo) {
foo = foo;
}
</pre>
<p>The assignment is useless. Did you mean to assign to the field instead?</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_LOCAL_SELF_ASSIGNMENT">
<ShortDescription>Self assignment of local variable</ShortDescription>
<LongDescription>Self assignment of {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a self assignment of a local variable; e.g.</p>
<pre>
public void foo() {
int x = 3;
x = x;
}
</pre>
<p>
Such assignments are useless, and may indicate a logic error or typo.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_FIELD_SELF_ASSIGNMENT">
<ShortDescription>Self assignment of field</ShortDescription>
<LongDescription>Self assignment of field {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a self assignment of a field; e.g.
</p>
<pre>
int x;
public void foo() {
x = x;
}
</pre>
<p>Such assignments are useless, and may indicate a logic error or typo.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_FIELD_DOUBLE_ASSIGNMENT">
<ShortDescription>Double assignment of field</ShortDescription>
<LongDescription>Double assignment of field {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a double assignment of a field; e.g.
</p>
<pre>
int x,y;
public void foo() {
x = x = 17;
}
</pre>
<p>Assigning to a field twice is useless, and may indicate a logic error or typo.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_LOCAL_DOUBLE_ASSIGNMENT">
<ShortDescription>Double assignment of local variable </ShortDescription>
<LongDescription>Double assignment of {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains a double assignment of a local variable; e.g.
</p>
<pre>
public void foo() {
int x,y;
x = x = 17;
}
</pre>
<p>Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_FIELD_SELF_COMPUTATION">
<ShortDescription>Nonsensical self computation involving a field (e.g., x & x)</ShortDescription>
<LongDescription>Nonsensical self computation of {2.givenClass} with itself in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method performs a nonsensical computation of a field with another
reference to the same field (e.g., x&x or x-x). Because of the nature
of the computation, this operation doesn't seem to make sense,
and may indicate a typo or
a logic error. Double check the computation.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_LOCAL_SELF_COMPUTATION">
<ShortDescription>Nonsensical self computation involving a variable (e.g., x & x)</ShortDescription>
<LongDescription>Nonsensical self computation of {2} with itself in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method performs a nonsensical computation of a local variable with another
reference to the same variable (e.g., x&x or x-x). Because of the nature
of the computation, this operation doesn't seem to make sense,
and may indicate a typo or
a logic error. Double check the computation.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_FIELD_SELF_COMPARISON">
<ShortDescription>Self comparison of field with itself</ShortDescription>
<LongDescription>Self comparison of {2.givenClass} with itself in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares a field with itself, and may indicate a typo or
a logic error. Make sure that you are comparing the right things.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SA_LOCAL_SELF_COMPARISON">
<ShortDescription>Self comparison of value with itself</ShortDescription>
<LongDescription>Self comparison of {2} with itself {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares a local variable with itself, and may indicate a typo or
a logic error. Make sure that you are comparing the right things.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">
<ShortDescription>Double.longBitsToDouble invoked on an int</ShortDescription>
<LongDescription>Double.longBitsToDouble invoked on an int in {1}</LongDescription>
<Details>
<![CDATA[
<p> The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed
as an argument. This almostly certainly is not intended and is unlikely
to give the intended result.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_ARGUMENTS_WRONG_ORDER">
<ShortDescription>Reversed method arguments</ShortDescription>
<LongDescription>Arguments in wrong order for invocation of {2.name} in {1}</LongDescription>
<Details>
<![CDATA[
<p> The arguments to this method call seem to be in the wrong order.
For example, a call <code>Preconditions.checkNotNull("message", message)</code>
has reserved arguments: the value to be checked is the first argument.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_RANDOM_USED_ONLY_ONCE">
<ShortDescription>Random object created and used only once</ShortDescription>
<LongDescription>Random object created and used only once in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code creates a java.util.Random object, uses it to generate one random number, and then discards
the Random object. This produces mediocre quality random numbers and is inefficient.
If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number
is required invoke a method on the existing Random object to obtain it.
</p>
<p>If it is important that the generated Random numbers not be guessable, you <em>must</em> not create a new Random for each random
number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead
(and avoid allocating a new SecureRandom for each random number needed).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_ABSOLUTE_VALUE_OF_RANDOM_INT">
<ShortDescription>Bad attempt to compute absolute value of signed random integer</ShortDescription>
<LongDescription>Bad attempt to compute absolute value of signed random integer in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code generates a random signed integer and then computes
the absolute value of that random integer. If the number returned by the random number
generator is <code>Integer.MIN_VALUE</code>, then the result will be negative as well (since
<code>Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE</code>). (Same problem arised for long values as well).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_ABSOLUTE_VALUE_OF_HASHCODE">
<ShortDescription>Bad attempt to compute absolute value of signed 32-bit hashcode </ShortDescription>
<LongDescription>Bad attempt to compute absolute value of signed 32-bit hashcode in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code generates a hashcode and then computes
the absolute value of that hashcode. If the hashcode
is <code>Integer.MIN_VALUE</code>, then the result will be negative as well (since
<code>Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE</code>).
</p>
<p>One out of 2^32 strings have a hashCode of Integer.MIN_VALUE,
including "polygenelubricants" "GydZG_" and ""DESIGNING WORKHOUSES".
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_REM_OF_RANDOM_INT">
<ShortDescription>Remainder of 32-bit signed random integer</ShortDescription>
<LongDescription>Remainder of 32-bit signed random integer computed in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code generates a random signed integer and then computes
the remainder of that value modulo another value. Since the random
number can be negative, the result of the remainder operation
can also be negative. Be sure this is intended, and strongly
consider using the Random.nextInt(int) method instead.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_REM_OF_HASHCODE">
<ShortDescription>Remainder of hashCode could be negative</ShortDescription>
<LongDescription>Remainder of hashCode could be negative in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code computes a hashCode, and then computes
the remainder of that value modulo another value. Since the hashCode
can be negative, the result of the remainder operation
can also be negative. </p>
<p> Assuming you want to ensure that the result of your computation is nonnegative,
you may need to change your code.
If you know the divisor is a power of 2,
you can use a bitwise and operator instead (i.e., instead of
using <code>x.hashCode()%n</code>, use <code>x.hashCode()&(n-1)</code>.
This is probably faster than computing the remainder as well.
If you don't know that the divisor is a power of 2, take the absolute
value of the result of the remainder operation (i.e., use
<code>Math.abs(x.hashCode()%n)</code>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">
<ShortDescription>Bad comparison of nonnegative value with negative constant</ShortDescription>
<LongDescription>Bad comparison of nonnegative value with {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code compares a value that is guaranteed to be non-negative with a negative constant.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">
<ShortDescription>Bad comparison of signed byte</ShortDescription>
<LongDescription>Bad comparison of signed byte with {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> Signed bytes can only have a value in the range -128 to 127. Comparing
a signed byte with a value outside that range is vacuous and likely to be incorrect.
To convert a signed byte <code>b</code> to an unsigned value in the range 0..255,
use <code>0xff & b</code>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="INT_BAD_COMPARISON_WITH_INT_VALUE">
<ShortDescription>Bad comparison of int value with long constant</ShortDescription>
<LongDescription>Bad comparison of int with {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This code compares an int value with a long constant that is outside
the range of values that can be represented as an int value.
This comparison is vacuous and possibily to be incorrect.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="INT_VACUOUS_BIT_OPERATION">
<ShortDescription>Vacuous bit mask operation on integer value</ShortDescription>
<LongDescription>Vacuous {2} operation on {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This is an integer bit operation (and, or, or exclusive or) that doesn't do any useful work
(e.g., <code>v & 0xffffffff</code>).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="INT_VACUOUS_COMPARISON">
<ShortDescription>Vacuous comparison of integer value</ShortDescription>
<LongDescription>Vacuous comparison of integer value {1} </LongDescription>
<Details>
<![CDATA[
<p> There is an integer comparison that always returns
the same value (e.g., x <= Integer.MAX_VALUE).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="INT_BAD_REM_BY_1">
<ShortDescription>Integer remainder modulo 1</ShortDescription>
<LongDescription>Integer remainder modulo 1 computed in {1} </LongDescription>
<Details>
<![CDATA[
<p> Any expression (exp % 1) is guaranteed to always return zero.
Did you mean (exp & 1) or (exp % 2) instead?
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_IOR_OF_SIGNED_BYTE">
<ShortDescription>Bitwise OR of signed byte value</ShortDescription>
<LongDescription>Bitwise OR of signed byte value computed in {1} </LongDescription>
<Details>
<![CDATA[
<p> Loads a byte value (e.g., a value loaded from a byte array or returned by a method
with return type byte) and performs a bitwise OR with
that value. Byte values are sign extended to 32 bits
before any any bitwise operations are performed on the value.
Thus, if <code>b[0]</code> contains the value <code>0xff</code>, and
<code>x</code> is initially 0, then the code
<code>((x << 8) | b[0])</code> will sign extend <code>0xff</code>
to get <code>0xffffffff</code>, and thus give the value
<code>0xffffffff</code> as the result.
</p>
<p>In particular, the following code for packing a byte array into an int is badly wrong: </p>
<pre>
int result = 0;
for(int i = 0; i < 4; i++)
result = ((result << 8) | b[i]);
</pre>
<p>The following idiom will work instead: </p>
<pre>
int result = 0;
for(int i = 0; i < 4; i++)
result = ((result << 8) | (b[i] & 0xff));
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_ADD_OF_SIGNED_BYTE">
<ShortDescription>Bitwise add of signed byte value</ShortDescription>
<LongDescription>Bitwise add of signed byte value computed in {1} </LongDescription>
<Details>
<![CDATA[
<p> Adds a byte value and a value which is known to have the 8 lower bits clear.
Values loaded from a byte array are sign extended to 32 bits
before any any bitwise operations are performed on the value.
Thus, if <code>b[0]</code> contains the value <code>0xff</code>, and
<code>x</code> is initially 0, then the code
<code>((x << 8) + b[0])</code> will sign extend <code>0xff</code>
to get <code>0xffffffff</code>, and thus give the value
<code>0xffffffff</code> as the result.
</p>
<p>In particular, the following code for packing a byte array into an int is badly wrong: </p>
<pre>
int result = 0;
for(int i = 0; i < 4; i++)
result = ((result << 8) + b[i]);
</pre>
<p>The following idiom will work instead: </p>
<pre>
int result = 0;
for(int i = 0; i < 4; i++)
result = ((result << 8) + (b[i] & 0xff));
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_AND">
<ShortDescription>Incompatible bit masks</ShortDescription>
<LongDescription>Incompatible bit masks in (e & {2} == {3}) yields a constant result in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares an expression of the form (e & C) to D,
which will always compare unequal
due to the specific values of constants C and D.
This may indicate a logic error or typo.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_SIGNED_CHECK">
<ShortDescription>Check for sign of bitwise operation</ShortDescription>
<LongDescription>Check for sign of bitwise operation in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares an expression such as</p>
<pre>((event.detail & SWT.SELECTED) > 0)</pre>.
<p>Using bit arithmetic and then comparing with the greater than operator can
lead to unexpected results (of course depending on the value of
SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
for a bug. Even when SWT.SELECTED is not negative, it seems good practice
to use '!= 0' instead of '> 0'.
</p>
<p>
<em>Boris Bokowski</em>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_SIGNED_CHECK_HIGH_BIT">
<ShortDescription>Check for sign of bitwise operation</ShortDescription>
<LongDescription>Check for sign of bitwise operation in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares an expression such as</p>
<pre>((event.detail & SWT.SELECTED) > 0)</pre>.
<p>Using bit arithmetic and then comparing with the greater than operator can
lead to unexpected results (of course depending on the value of
SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
for a bug. Even when SWT.SELECTED is not negative, it seems good practice
to use '!= 0' instead of '> 0'.
</p>
<p>
<em>Boris Bokowski</em>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_AND_ZZ">
<ShortDescription>Check to see if ((...) & 0) == 0</ShortDescription>
<LongDescription>Check to see if ((...) & 0) == 0 in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares an expression of the form (e & 0) to 0,
which will always compare equal.
This may indicate a logic error or typo.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BIT_IOR">
<ShortDescription>Incompatible bit masks</ShortDescription>
<LongDescription>Incompatible bit masks in (e | {2} == {3}) yields constant result in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method compares an expression of the form (e | C) to D.
which will always compare unequal
due to the specific values of constants C and D.
This may indicate a logic error or typo.</p>
<p> Typically, this bug occurs because the code wants to perform
a membership test in a bit set, but uses the bitwise OR
operator ("|") instead of bitwise AND ("&").</p>
]]>
</Details>
</BugPattern>
<BugPattern type="LI_LAZY_INIT_INSTANCE" deprecated="true">
<!-- never generated? -->
<ShortDescription>Incorrect lazy initialization of instance field</ShortDescription>
<LongDescription>Incorrect lazy initialization of instance field {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains an unsynchronized lazy initialization of a non-volatile field.
Because the compiler or processor may reorder instructions,
threads are not guaranteed to see a completely initialized object,
<em>if the method can be called by multiple threads</em>.
You can make the field volatile to correct the problem.
For more information, see the
<a href="http://www.cs.umd.edu/~pugh/java/memoryModel/">Java Memory Model web site</a>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="LI_LAZY_INIT_STATIC">
<ShortDescription>Incorrect lazy initialization of static field</ShortDescription>
<LongDescription>Incorrect lazy initialization of static field {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains an unsynchronized lazy initialization of a non-volatile static field.
Because the compiler or processor may reorder instructions,
threads are not guaranteed to see a completely initialized object,
<em>if the method can be called by multiple threads</em>.
You can make the field volatile to correct the problem.
For more information, see the
<a href="http://www.cs.umd.edu/~pugh/java/memoryModel/">Java Memory Model web site</a>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="LI_LAZY_INIT_UPDATE_STATIC">
<ShortDescription>Incorrect lazy initialization and update of static field</ShortDescription>
<LongDescription>Incorrect lazy initialization and update of static field {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method contains an unsynchronized lazy initialization of a static field.
After the field is set, the object stored into that location is further updated or accessed.
The setting of the field is visible to other threads as soon as it is set. If the
futher accesses in the method that set the field serve to initialize the object, then
you have a <em>very serious</em> multithreading bug, unless something else prevents
any other thread from accessing the stored object until it is fully initialized.
</p>
<p>Even if you feel confident that the method is never called by multiple
threads, it might be better to not set the static field until the value
you are setting it to is fully populated/initialized.
]]>
</Details>
</BugPattern>
<BugPattern type="JLM_JSR166_LOCK_MONITORENTER">
<ShortDescription>Synchronization performed on Lock</ShortDescription>
<LongDescription>Synchronization performed on {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method performs synchronization an object that implements
java.util.concurrent.locks.Lock. Such an object is locked/unlocked
using
<code>acquire()</code>/<code>release()</code> rather
than using the <code>synchronized (...)</code> construct.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">
<ShortDescription>Using monitor style wait methods on util.concurrent abstraction</ShortDescription>
<LongDescription>Calling {2.name} rather than {3.name} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method calls
<code>wait()</code>,
<code>notify()</code> or
<code>notifyAll()()</code>
on an object that also provides an
<code>await()</code>,
<code>signal()</code>,
<code>signalAll()</code> method (such as util.concurrent Condition objects).
This probably isn't what you want, and even if you do want it, you should consider changing
your design, as other developers will find it exceptionally confusing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="JLM_JSR166_UTILCONCURRENT_MONITORENTER">
<ShortDescription>Synchronization performed on util.concurrent instance</ShortDescription>
<LongDescription>Synchronization performed on {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This method performs synchronization an object that is an instance of
a class from the java.util.concurrent package (or its subclasses). Instances
of these classes have their own concurrency control mechanisms that are orthogonal to
the synchronization provided by the Java keyword <code>synchronized</code>. For example,
synchronizing on an <code>AtomicBoolean</code> will not prevent other threads
from modifying the <code>AtomicBoolean</code>.</p>
<p>Such code may be correct, but should be carefully reviewed and documented,
and may confuse people who have to maintain the code at a later date.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UPM_UNCALLED_PRIVATE_METHOD">
<ShortDescription>Private method is never called</ShortDescription>
<LongDescription>Private method {1} is never called</LongDescription>
<Details>
<![CDATA[
<p> This private method is never called. Although it is
possible that the method will be invoked through reflection,
it is more likely that the method is never used, and should be
removed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">
<ShortDescription>Uncallable method defined in anonymous class</ShortDescription>
<LongDescription>Uncallable method {1} defined in anonymous class</LongDescription>
<Details>
<![CDATA[
<p> This anonymous class defined a method that is not directly invoked and does not override
a method in a superclass. Since methods in other classes cannot directly invoke methods
declared in an anonymous class, it seems that this method is uncallable. The method
might simply be dead code, but it is also possible that the method is intended to
override a method declared in a superclass, and due to an typo or other error the method does not,
in fact, override the method it is intended to.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ODR_OPEN_DATABASE_RESOURCE">
<ShortDescription>Method may fail to close database resource</ShortDescription>
<LongDescription>{1} may fail to close {2.excludingPackage}</LongDescription>
<Details>
<![CDATA[
<p> The method creates a database resource (such as a database connection
or row set), does not assign it to any
fields, pass it to other methods, or return it, and does not appear to close
the object on all paths out of the method. Failure to
close database resources on all paths out of a method may
result in poor performance, and could cause the application to
have problems communicating with the database.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">
<ShortDescription>Method may fail to close database resource on exception</ShortDescription>
<LongDescription>{1} may fail to close database resource on exception</LongDescription>
<Details>
<![CDATA[
<p> The method creates a database resource (such as a database connection
or row set), does not assign it to any
fields, pass it to other methods, or return it, and does not appear to close
the object on all exception paths out of the method. Failure to
close database resources on all paths out of a method may
result in poor performance, and could cause the application to
have problems communicating with the database.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SBSC_USE_STRINGBUFFER_CONCATENATION">
<ShortDescription>Method concatenates strings using + in a loop</ShortDescription>
<LongDescription>{1} concatenates strings using + in a loop</LongDescription>
<Details>
<![CDATA[
<p> The method seems to be building a String using concatenation in a loop.
In each iteration, the String is converted to a StringBuffer/StringBuilder,
appended to, and converted back to a String.
This can lead to a cost quadratic in the number of iterations,
as the growing string is recopied in each iteration. </p>
<p>Better performance can be obtained by using
a StringBuffer (or StringBuilder in Java 1.5) explicitly.</p>
<p> For example:</p>
<pre>
// This is bad
String s = "";
for (int i = 0; i < field.length; ++i) {
s = s + field[i];
}
// This is better
StringBuffer buf = new StringBuffer();
for (int i = 0; i < field.length; ++i) {
buf.append(field[i]);
}
String s = buf.toString();
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="ITA_INEFFICIENT_TO_ARRAY">
<ShortDescription>Method uses toArray() with zero-length array argument</ShortDescription>
<LongDescription>{1} uses Collection.toArray() with zero-length array argument</LongDescription>
<Details>
<![CDATA[
<p> This method uses the toArray() method of a collection derived class, and passes
in a zero-length prototype array argument. It is more efficient to use
<code>myCollection.toArray(new Foo[myCollection.size()])</code>
If the array passed in is big enough to store all of the
elements of the collection, then it is populated and returned
directly. This avoids the need to create a second array
(by reflection) to return as the result.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">
<ShortDescription>JUnit assertion in run method will not be noticed by JUnit</ShortDescription>
<LongDescription>JUnit assertion in {1} will not be noticed by JUnit</LongDescription>
<Details>
<![CDATA[
<p> A JUnit assertion is performed in a run method. Failed JUnit assertions
just result in exceptions being thrown.
Thus, if this exception occurs in a thread other than the thread that invokes
the test method, the exception will terminate the thread but not result
in the test failing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IJU_SETUP_NO_SUPER">
<ShortDescription>TestCase defines setUp that doesn't call super.setUp()</ShortDescription>
<LongDescription>TestCase {0} defines setUp that doesn't call super.setUp()</LongDescription>
<Details>
<![CDATA[
<p> Class is a JUnit TestCase and implements the setUp method. The setUp method should call
super.setUp(), but doesn't.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IJU_TEARDOWN_NO_SUPER">
<ShortDescription>TestCase defines tearDown that doesn't call super.tearDown()</ShortDescription>
<LongDescription>TestCase {0} defines tearDown that doesn't call super.tearDown()</LongDescription>
<Details>
<![CDATA[
<p> Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call
super.tearDown(), but doesn't.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IJU_SUITE_NOT_STATIC">
<ShortDescription>TestCase implements a non-static suite method </ShortDescription>
<LongDescription>TestCase {0} implements a non-static suite method</LongDescription>
<Details>
<![CDATA[
<p> Class is a JUnit TestCase and implements the suite() method.
The suite method should be declared as being static, but isn't.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IJU_BAD_SUITE_METHOD">
<ShortDescription>TestCase declares a bad suite method </ShortDescription>
<LongDescription>Bad declaration for suite method in {0}</LongDescription>
<Details>
<![CDATA[
<p> Class is a JUnit TestCase and defines a suite() method.
However, the suite method needs to be declared as either</p>
<pre>public static junit.framework.Test suite()</pre>
or
<pre>public static junit.framework.TestSuite suite()</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="IJU_NO_TESTS">
<ShortDescription>TestCase has no tests</ShortDescription>
<LongDescription>TestCase {0} has no tests</LongDescription>
<Details>
<![CDATA[
<p> Class is a JUnit TestCase but has not implemented any test methods</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BOA_BADLY_OVERRIDDEN_ADAPTER">
<ShortDescription>Class overrides a method implemented in super class Adapter wrongly</ShortDescription>
<LongDescription>Class {0} overrides a method {1} implemented in super class Adapter wrongly</LongDescription>
<Details>
<![CDATA[
<p> This method overrides a method found in a parent class, where that class is an Adapter that implements
a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not
get called when the event occurs.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BRSA_BAD_RESULTSET_ACCESS" deprecated="true">
<!-- deprecated in favor of SQL_BAD_RESULTSET_ACCESS -->
<ShortDescription>Method attempts to access a result set field with index 0</ShortDescription>
<LongDescription>{1} attempts to access a result set field with index 0</LongDescription>
<Details>
<![CDATA[
<p> A call to getXXX or updateXXX methods of a result set was made where the
field index is 0. As ResultSet fields start at index 1, this is always a mistake.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SQL_BAD_RESULTSET_ACCESS">
<ShortDescription>Method attempts to access a result set field with index 0</ShortDescription>
<LongDescription>{1} attempts to access a result set field with index 0</LongDescription>
<Details>
<![CDATA[
<p> A call to getXXX or updateXXX methods of a result set was made where the
field index is 0. As ResultSet fields start at index 1, this is always a mistake.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SQL_BAD_PREPARED_STATEMENT_ACCESS">
<ShortDescription>Method attempts to access a prepared statement parameter with index 0</ShortDescription>
<LongDescription>{1} attempts to access a prepared statement parameter with index 0</LongDescription>
<Details>
<![CDATA[
<p> A call to a setXXX method of a prepared statement was made where the
parameter index is 0. As parameter indexes start at index 1, this is always a mistake.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SIO_SUPERFLUOUS_INSTANCEOF">
<ShortDescription>Unnecessary type check done using instanceof operator</ShortDescription>
<LongDescription>{1} does an unnecessary type check using instanceof operator when it can be determined statically</LongDescription>
<Details>
<![CDATA[
<p> Type check performed using the instanceof operator where it can be statically determined whether the object
is of the type requested. </p>
]]>
</Details>
</BugPattern>
<BugPattern type="BAC_BAD_APPLET_CONSTRUCTOR">
<ShortDescription>Bad Applet Constructor relies on uninitialized AppletStub</ShortDescription>
<LongDescription>Bad Applet Constructor relies on uninitialized AppletStub</LongDescription>
<Details>
<![CDATA[
<p>
This constructor calls methods in the parent Applet that rely on the AppletStub. Since the AppletStub
isn't initialized until the init() method of this applet is called, these methods will not perform
correctly.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_ARRAY_AND_NONARRAY">
<ShortDescription>equals() used to compare array and nonarray</ShortDescription>
<LongDescription>Calling {3.simpleClass}.equals({2.simpleClass}) in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem
to be an array. If things being compared are of different types, they are guaranteed to be unequal
and the comparison is almost certainly an error. Even if they are both arrays, the equals method
on arrays only determines of the two arrays are the same object.
To compare the
contents of the arrays, use java.util.Arrays.equals(Object[], Object[]).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_BAD_ARRAY_COMPARE">
<ShortDescription>Invocation of equals() on an array, which is equivalent to ==</ShortDescription>
<LongDescription>Using .equals to compare two {2.simpleClass}'s, (equivalent to ==) in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals
method of Object, calling equals on an array is the same as comparing their addresses. To compare the
contents of the arrays, use <code>java.util.Arrays.equals(Object[], Object[])</code>.
To compare the addresses of the arrays, it would be
less confusing to explicitly check pointer equality using <code>==</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="EC_INCOMPATIBLE_ARRAY_COMPARE">
<ShortDescription>equals(...) used to compare incompatible arrays</ShortDescription>
<LongDescription>Using equals to compare a {2.simpleClass} and a {3.simpleClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method invokes the .equals(Object o) to compare two arrays, but the arrays of
of incompatible types (e.g., String[] and StringBuffer[], or String[] and int[]).
They will never be equal. In addition, when equals(...) is used to compare arrays it
only checks to see if they are the same array, and ignores the contents of the arrays.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="STI_INTERRUPTED_ON_CURRENTTHREAD">
<ShortDescription>Unneeded use of currentThread() call, to call interrupted() </ShortDescription>
<LongDescription>{1} makes an unneeded call to currentThread() just to call interrupted()</LongDescription>
<Details>
<![CDATA[
<p>
This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a
static method, is more simple and clear to use Thread.interrupted().
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="STI_INTERRUPTED_ON_UNKNOWNTHREAD">
<ShortDescription>Static Thread.interrupted() method invoked on thread instance</ShortDescription>
<LongDescription>{1} invokes static Thread.interrupted() method on thread instance</LongDescription>
<Details>
<![CDATA[
<p>
This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is
not the current thread. As the interrupted() method is static, the interrupted method will be called on a different
object than the one the author intended.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">
<ShortDescription>A parameter is dead upon entry to a method but overwritten</ShortDescription>
<LongDescription>The parameter {2} to {1} is dead upon entry but overwritten</LongDescription>
<Details>
<![CDATA[
<p>
The initial value of this parameter is ignored, and the parameter
is overwritten here. This often indicates a mistaken belief that
the write to the parameter will be conveyed back to
the caller.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">
<ShortDescription>Dead store to local variable that shadows field</ShortDescription>
<LongDescription>Dead store to {2} rather than field with same name in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This instruction assigns a value to a local variable,
but the value is not read or used in any subsequent instruction.
Often, this indicates an error, because the value computed is never
used. There is a field with the same name as the local variable. Did you
mean to assign to that variable instead?
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_DEAD_LOCAL_STORE">
<ShortDescription>Dead store to local variable</ShortDescription>
<LongDescription>Dead store to {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This instruction assigns a value to a local variable,
but the value is not read or used in any subsequent instruction.
Often, this indicates an error, because the value computed is never
used.
</p>
<p>
Note that Sun's javac compiler often generates dead stores for
final local variables. Because FindBugs is a bytecode-based tool,
there is no easy way to eliminate these false positives.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_DEAD_LOCAL_STORE_IN_RETURN">
<ShortDescription>Useless assignment in return statement</ShortDescription>
<LongDescription>Useless assignment in return from {1}</LongDescription>
<Details>
<![CDATA[
<p>
This statement assigns to a local variable in a return statement. This assignment
has effect. Please verify that this statement does the right thing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">
<ShortDescription>Useless increment in return statement</ShortDescription>
<LongDescription>Useless increment in return from {1}</LongDescription>
<Details>
<![CDATA[
<p>This statement has a return such as <code>return x++;</code>.
A postfix increment/decrement does not impact the value of the expression,
so this increment/decrement has no effect.
Please verify that this statement does the right thing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_DEAD_STORE_OF_CLASS_LITERAL">
<ShortDescription>Dead store of class literal</ShortDescription>
<LongDescription>Dead store of {3}.class in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This instruction assigns a class literal to a variable and then never uses it.
<a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">The behavior of this differs in Java 1.4 and in Java 5.</a>
In Java 1.4 and earlier, a reference to <code>Foo.class</code> would force the static initializer
for <code>Foo</code> to be executed, if it has not been executed already.
In Java 5 and later, it does not.
</p>
<p>See Sun's <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">article on Java SE compatibility</a>
for more details and examples, and suggestions on how to force class initialization in Java 5.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_DEAD_LOCAL_STORE_OF_NULL">
<ShortDescription>Dead store of null to local variable</ShortDescription>
<LongDescription>Dead store of null to {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>The code stores null into a local variable, and the stored value is not
read. This store may have been introduced to assist the garbage collector, but
as of Java SE 6.0, this is no longer needed or useful.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MF_METHOD_MASKS_FIELD">
<ShortDescription>Method defines a variable that obscures a field</ShortDescription>
<LongDescription>{1} defines a variable that obscures field {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> This method defines a local variable with the same name as a field
in this class or a superclass. This may cause the method to
read an uninitialized value from the field, leave the field uninitialized,
or both.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MF_CLASS_MASKS_FIELD">
<ShortDescription>Class defines field that masks a superclass field</ShortDescription>
<LongDescription>Field {1.givenClass} masks field in superclass {2.class}</LongDescription>
<Details>
<![CDATA[
<p> This class defines a field with the same name as a visible
instance field in a superclass. This is confusing, and
may indicate an error if methods update or access one of
the fields when they wanted the other.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="WMI_WRONG_MAP_ITERATOR">
<ShortDescription>Inefficient use of keySet iterator instead of entrySet iterator</ShortDescription>
<LongDescription>{1} makes inefficient use of keySet iterator instead of entrySet iterator</LongDescription>
<Details>
<![CDATA[
<p> This method accesses the value of a Map entry, using a key that was retrieved from
a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the
Map.get(key) lookup.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ISC_INSTANTIATE_STATIC_CLASS">
<ShortDescription>Needless instantiation of class that only supplies static methods</ShortDescription>
<LongDescription>{1} needlessly instantiates a class that only supplies static methods</LongDescription>
<Details>
<![CDATA[
<p> This class allocates an object that is based on a class that only supplies static methods. This object
does not need to be created, just access the static methods directly using the class name as a qualifier.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="REC_CATCH_EXCEPTION">
<ShortDescription>Exception is caught when Exception is not thrown</ShortDescription>
<LongDescription>Exception is caught when Exception is not thrown in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This method uses a try-catch block that catches Exception objects, but Exception is not
thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to
say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception
each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well,
masking potential bugs.
</p>
<p>A better approach is to either explicitly catch the specific exceptions that are thrown,
or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:</p>
<pre>
try {
...
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
... deal with all non-runtime exceptions ...
}</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">
<ShortDescription>Doomed test for equality to NaN</ShortDescription>
<LongDescription>Doomed test for equality to NaN in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code checks to see if a floating point value is equal to the special
Not A Number value (e.g., <code>if (x == Double.NaN)</code>). However,
because of the special semantics of <code>NaN</code>, no value
is equal to <code>Nan</code>, including <code>NaN</code>. Thus,
<code>x == Double.NaN</code> always evaluates to false.
To check to see if a value contained in <code>x</code>
is the special Not A Number value, use
<code>Double.isNaN(x)</code> (or <code>Float.isNaN(x)</code> if
<code>x</code> is floating point precision).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FE_FLOATING_POINT_EQUALITY">
<ShortDescription>Test for floating point equality</ShortDescription>
<LongDescription>Test for floating point equality in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This operation compares two floating point values for equality.
Because floating point calculations may involve rounding,
calculated float and double values may not be accurate.
For values that must be precise, such as monetary values,
consider using a fixed-precision type such as BigDecimal.
For values that need not be precise, consider comparing for equality
within some range, for example:
<code>if ( Math.abs(x - y) < .0000001 )</code>.
See the Java Language Specification, section 4.2.4.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="UM_UNNECESSARY_MATH">
<ShortDescription>Method calls static Math class method on a constant value</ShortDescription>
<LongDescription>Method calls static Math class method on a constant value</LongDescription>
<Details>
<![CDATA[
<p> This method uses a static method from java.lang.Math on a constant value. This method's
result in this case, can be determined statically, and is faster and sometimes more accurate to
just use the constant. Methods detected are:
</p>
<table>
<tr>
<th>Method</th> <th>Parameter</th>
</tr>
<tr>
<td>abs</td> <td>-any-</td>
</tr>
<tr>
<td>acos</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>asin</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>atan</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>atan2</td> <td>0.0</td>
</tr>
<tr>
<td>cbrt</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>ceil</td> <td>-any-</td>
</tr>
<tr>
<td>cos</td> <td>0.0</td>
</tr>
<tr>
<td>cosh</td> <td>0.0</td>
</tr>
<tr>
<td>exp</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>expm1</td> <td>0.0</td>
</tr>
<tr>
<td>floor</td> <td>-any-</td>
</tr>
<tr>
<td>log</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>log10</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>rint</td> <td>-any-</td>
</tr>
<tr>
<td>round</td> <td>-any-</td>
</tr>
<tr>
<td>sin</td> <td>0.0</td>
</tr>
<tr>
<td>sinh</td> <td>0.0</td>
</tr>
<tr>
<td>sqrt</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>tan</td> <td>0.0</td>
</tr>
<tr>
<td>tanh</td> <td>0.0</td>
</tr>
<tr>
<td>toDegrees</td> <td>0.0 or 1.0</td>
</tr>
<tr>
<td>toRadians</td> <td>0.0</td>
</tr>
</table>
]]>
</Details>
</BugPattern>
<BugPattern type="CD_CIRCULAR_DEPENDENCY">
<ShortDescription>Test for circular dependencies among classes</ShortDescription>
<LongDescription>Class {0} has a circular dependency with other classes</LongDescription>
<Details>
<![CDATA[
<p>
This class has a circular dependency with other classes. This makes building these classes
difficult, as each is dependent on the other to build correctly. Consider using interfaces
to break the hard dependency.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RI_REDUNDANT_INTERFACES">
<ShortDescription>Class implements same interface as superclass</ShortDescription>
<LongDescription>Class {0} implements same interface as superclass</LongDescription>
<Details>
<![CDATA[
<p>
This class declares that it implements an interface that is also implemented by a superclass.
This is redundant because once a superclass implements an interface, all subclasses by default also
implement this interface. It may point out that the inheritance hierarchy has changed since
this class was created, and consideration should be given to the ownership of
the interface's implementation.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">
<ShortDescription>Class extends Struts Action class and uses instance variables</ShortDescription>
<LongDescription>Class {0} extends Struts Action class and uses instance variables</LongDescription>
<Details>
<![CDATA[
<p>
This class extends from a Struts Action class, and uses an instance member variable. Since only
one instance of a struts Action class is created by the Struts framework, and used in a
multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider
only using method local variables. Only instance fields that are written outside of a monitor
are reported.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">
<ShortDescription>Class extends Servlet class and uses instance variables</ShortDescription>
<LongDescription>Class {0} extends Servlet class and uses instance variables</LongDescription>
<Details>
<![CDATA[
<p>
This class extends from a Servlet class, and uses an instance member variable. Since only
one instance of a Servlet class is created by the J2EE framework, and used in a
multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider
only using method local variables.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="PS_PUBLIC_SEMAPHORES">
<ShortDescription>Class exposes synchronization and semaphores in its public interface</ShortDescription>
<LongDescription>Class {0} exposes synchronization and semaphores in its public interface</LongDescription>
<Details>
<![CDATA[
<p>
This class uses synchronization along with wait(), notify() or notifyAll() on itself (the this
reference). Client classes that use this class, may, in addition, use an instance of this class
as a synchronizing object. Because two classes are using the same object for synchronization,
Multithread correctness is suspect. You should not synchronize nor call semaphore methods on
a public reference. Consider using a internal private member variable to control synchronization.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">
<ShortDescription>Result of integer multiplication cast to long</ShortDescription>
<LongDescription>Result of integer multiplication cast to long in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code performs integer multiply and then converts the result to a long,
as in:</p>
<pre>
long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; }
</pre>
<p>
If the multiplication is done using long arithmetic, you can avoid
the possibility that the result will overflow. For example, you
could fix the above code to:</p>
<pre>
long convertDaysToMilliseconds(int days) { return 1000L*3600*24*days; }
</pre>
or
<pre>
static final long MILLISECONDS_PER_DAY = 24L*3600*1000;
long convertDaysToMilliseconds(int days) { return days * MILLISECONDS_PER_DAY; }
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_INT_2_LONG_AS_INSTANT">
<ShortDescription>int value converted to long and used as absolute time</ShortDescription>
<LongDescription>int converted to long and passed as absolute time to {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code converts a 32-bit int value to a 64-bit long value, and then
passes that value for a method parameter that requires an absolute time value.
An absolute time value is the number
of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
For example, the following method, intended to convert seconds since the epoc into a Date, is badly
broken:</p>
<pre>
Date getDate(int seconds) { return new Date(seconds * 1000); }
</pre>
<p>The multiplication is done using 32-bit arithmetic, and then converted to a 64-bit value.
When a 32-bit value is converted to 64-bits and used to express an absolute time
value, only dates in December 1969 and January 1970 can be represented.</p>
<p>Correct implementations for the above method are:</p>
<pre>
// Fails for dates after 2037
Date getDate(int seconds) { return new Date(seconds * 1000L); }
// better, works for all dates
Date getDate(long seconds) { return new Date(seconds * 1000); }
</pre>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">
<ShortDescription>int value cast to float and then passed to Math.round</ShortDescription>
<LongDescription>int value cast to float and then passed to Math.round in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code converts an int value to a float precision
floating point number and then
passing the result to the Math.round() function, which returns the int/long closest
to the argument. This operation should always be a no-op,
since the converting an integer to a float should give a number with no fractional part.
It is likely that the operation that generated the value to be passed
to Math.round was intended to be performed using
floating point arithmetic.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">
<ShortDescription>Integral value cast to double and then passed to Math.ceil</ShortDescription>
<LongDescription>Integral value cast to double and then passed to Math.ceil in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code converts an integral value (e.g., int or long)
to a double precision
floating point number and then
passing the result to the Math.ceil() function, which rounds a double to
the next higher integer value. This operation should always be a no-op,
since the converting an integer to a double should give a number with no fractional part.
It is likely that the operation that generated the value to be passed
to Math.ceil was intended to be performed using double precision
floating point arithmetic.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_IDIV_CAST_TO_DOUBLE">
<ShortDescription>Integral division result cast to double or float</ShortDescription>
<LongDescription>Integral division result cast to double or float in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code casts the result of an integral division (e.g., int or long division)
operation to double or
float.
Doing division on integers truncates the result
to the integer value closest to zero. The fact that the result
was cast to double suggests that this precision should have been retained.
What was probably meant was to cast one or both of the operands to
double <em>before</em> performing the division. Here is an example:
</p>
<blockquote>
<pre>
int x = 2;
int y = 5;
// Wrong: yields result 0.0
double value1 = x / y;
// Right: yields result 0.4
double value2 = x / (double) y;
</pre>
</blockquote>
]]>
</Details>
</BugPattern>
<BugPattern type="J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION">
<ShortDescription>Store of non serializable object into HttpSession</ShortDescription>
<LongDescription>Store of non serializable {2} into HttpSession in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code seems to be storing a non-serializable object into an HttpSession.
If this session is passivated or migrated, an error will result.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_NONSERIALIZABLE_OBJECT_WRITTEN">
<ShortDescription>Non serializable object written to ObjectOutput</ShortDescription>
<LongDescription>Non serializable {2} written to ObjectOutput in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method.
If the object is, indeed, non-serializable, an error will result.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">
<ShortDescription>No previous argument for format string</ShortDescription>
<LongDescription>No previous argument for format string argument to {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The format string specifies a relative index to request that the argument for the previous format specifier
be reused. However, there is no previous argument.
For example,
</p>
<p><code>formatter.format("%<s %s", "a", "b")</code>
</p>
<p>would throw a MissingFormatArgumentException when executed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_USES_NEWLINE">
<ShortDescription>Format string should use %n rather than \n</ShortDescription>
<LongDescription>Format string should use %n rather than \n in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This format string include a newline character (\n). In format strings, it is generally
preferable better to use %n, which will produce the platform-specific line separator.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_BAD_CONVERSION">
<ShortDescription>The type of a supplied argument doesn't match format specifier</ShortDescription>
<LongDescription>Argument of type {3} can't be handled by format specifier {4} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
One of the arguments is uncompatible with the corresponding format string specifier.
As a result, this will generate a runtime exception when executed.
For example, <code>String.format("%d", "1")</code> will generate an exception, since
the String "1" is incompatible with the format specifier %d.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">
<ShortDescription>Non-Boolean argument formatted using %b format specifier</ShortDescription>
<LongDescription>Non-Boolean argument formatted using %b format specifier in {1}</LongDescription>
<Details>
<![CDATA[
<p>
An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an
exception; instead, it will print true for any nonnull value, and false for null.
This feature of format strings is strange, and may not be what you intended.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">
<ShortDescription>Array formatted in useless way using format string</ShortDescription>
<LongDescription>Argument of type {3} formatted in useless way in {1}</LongDescription>
<Details>
<![CDATA[
<p>
One of the arguments being formatted with a format string is an array. This will be formatted
using a fairly useless format, such as [I@304282, which doesn't actually show the contents
of the array.
Consider wrapping the array using <code>Arrays.asList(...)</code> before handling it off to a formatted.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_ARG_MISMATCH">
<ShortDescription>Number of format-string arguments does not correspond to number of placeholders</ShortDescription>
<LongDescription>Format-string method {2} called with format string "{3}" wants {4} arguments but is given {5} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
A format-string method with a variable number of arguments is called,
but the number of arguments passed does not match with the number of
% placeholders in the format string. This is probably not what the
author intended.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED">
<ShortDescription>MessageFormat supplied where printf style format expected</ShortDescription>
<LongDescription>{2} needs printf-style format but called with MessageFormat</LongDescription>
<Details>
<![CDATA[
<p>
A method is called that expects a Java printf format string and a list of arguments.
However, the format string doesn't contain any format specifiers (e.g., %s) but
does contain message format elements (e.g., {0}). It is likely
that the code is supplying a MessageFormat string when a printf-style format string
is required. At runtime, all of the arguments will be ignored
and the format string will be returned exactly as provided without any formatting.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">
<ShortDescription>More arguments are passed than are actually used in the format string</ShortDescription>
<LongDescription>Format-string method {2} called with format string "{3}" wants {4} arguments but is given {5} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
A format-string method with a variable number of arguments is called,
but more arguments are passed than are actually used by the format string.
This won't cause a runtime exception, but the code may be silently omitting
information that was intended to be included in the formatted string.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_ILLEGAL">
<ShortDescription>Illegal format string</ShortDescription>
<LongDescription>Illegal format string "{3}" in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The format string is syntactically invalid,
and a runtime exception will occur when
this statement is executed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_MISSING_ARGUMENT">
<ShortDescription>Format string references missing argument</ShortDescription>
<LongDescription>Format string "{3}" needs argument {5} but only {6} are provided in {1}</LongDescription>
<Details>
<![CDATA[
<p>
Not enough arguments are passed to satisfy a placeholder in the format string.
A runtime exception will occur when
this statement is executed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_FORMAT_STRING_BAD_ARGUMENT">
<ShortDescription>Format string placeholder incompatible with passed argument</ShortDescription>
<LongDescription>The placeholder {4} is incompatible with
corresponding argument in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The format string placeholder is incompatible with the corresponding
argument. For example,
<code>
System.out.println("%d\n", "hello");
</code>
<p>The %d placeholder requires a numeric argument, but a string value is
passed instead.
A runtime exception will occur when
this statement is executed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">
<ShortDescription>Primitive array passed to function expecting a variable number of object arguments</ShortDescription>
<LongDescription>{2} passed to varargs method {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code passes a primitive array to a function that takes a variable number of object arguments.
This creates an array of length one to hold the primitive array and passes it to the function.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">
<ShortDescription>Equals method should not assume anything about the type of its argument</ShortDescription>
<LongDescription>Equals method for {0} assumes the argument is of type {0.givenClass}</LongDescription>
<Details>
<![CDATA[
<p>
The <code>equals(Object o)</code> method shouldn't make any assumptions
about the type of <code>o</code>. It should simply return
false if <code>o</code> is not the same type as <code>this</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_BAD_CAST_TO_ABSTRACT_COLLECTION">
<ShortDescription>Questionable cast to abstract collection </ShortDescription>
<LongDescription>Questionable cast from Collection to abstract class {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code casts a Collection to an abstract collection
(such as <code>List</code>, <code>Set</code>, or <code>Map</code>).
Ensure that you are guaranteed that the object is of the type
you are casting to. If all you need is to be able
to iterate through a collection, you don't need to cast it to a Set or List.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_IMPOSSIBLE_CAST_PRIMITIVE_ARRAY">
<ShortDescription>Impossible cast involving primitive array</ShortDescription>
<LongDescription>Impossible cast involving primitive array in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This cast will always throw a ClassCastException.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_IMPOSSIBLE_CAST">
<ShortDescription>Impossible cast</ShortDescription>
<LongDescription>Impossible cast from {2} to {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This cast will always throw a ClassCastException.
FindBugs tracks type information from instanceof checks,
and also uses more precise information about the types
of values returned from methods and loaded from fields.
Thus, it may have more precise information that just
the declared type of a variable, and can use this to determine
that a cast will always throw an exception at runtime.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_IMPOSSIBLE_DOWNCAST">
<ShortDescription>Impossible downcast</ShortDescription>
<LongDescription>Impossible downcast from {2} to {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This cast will always throw a ClassCastException.
The analysis believes it knows
the precise type of the value being cast, and the attempt to
downcast it to a subtype will always fail by throwing a ClassCastException.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">
<ShortDescription>Impossible downcast of toArray() result</ShortDescription>
<LongDescription>Impossible downcast of toArray() result to {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code is casting the result of calling <code>toArray()</code> on a collection
to a type more specific than <code>Object[]</code>, as in:</p>
<pre>
String[] getAsArray(Collection<String> c) {
return (String[]) c.toArray();
}
</pre>
<p>This will usually fail by throwing a ClassCastException. The <code>toArray()</code>
of almost all collections return an <code>Object[]</code>. They can't really do anything else,
since the Collection object has no reference to the declared generic type of the collection.
<p>The correct way to do get an array of a specific type from a collection is to use
<code>c.toArray(new String[]);</code>
or <code>c.toArray(new String[c.size()]);</code> (the latter is slightly more efficient).
<p>There is one common/known exception exception to this. The <code>toArray()</code>
method of lists returned by <code>Arrays.asList(...)</code> will return a covariantly
typed array. For example, <code>Arrays.asArray(new String[] { "a" }).toArray()</code>
will return a <code>String []</code>. FindBugs attempts to detect and suppress
such cases, but may miss some.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_NULL_INSTANCEOF">
<ShortDescription>A known null value is checked to see if it is an instance of a type</ShortDescription>
<LongDescription>A known null value is checked to see if it is an instance of {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This instanceof test will always return false, since the value being checked is guaranteed to be null.
Although this is safe, make sure it isn't
an indication of some misunderstanding or some other logic error.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_NULL_INSTANCEOF" deprecated="true">
<!-- deprecated in favor of NP_NULL_INSTANCEOF -->
<ShortDescription>A known null value is checked to see if it is an instance of a type</ShortDescription>
<LongDescription>A known null value is checked to see if it is an instance of {2} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This instanceof test will always return false, since the value being checked is guaranteed to be null.
Although this is safe, make sure it isn't
an indication of some misunderstanding or some other logic error.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_IMPOSSIBLE_INSTANCEOF">
<ShortDescription>instanceof will always return false</ShortDescription>
<LongDescription>instanceof will always return false in {1}, since a {2} can't be a {3}</LongDescription>
<Details>
<![CDATA[
<p>
This instanceof test will always return false. Although this is safe, make sure it isn't
an indication of some misunderstanding or some other logic error.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_VACUOUS_INSTANCEOF">
<ShortDescription>instanceof will always return true</ShortDescription>
<LongDescription>instanceof will always return true for all nonnull values in {1}, since all {2} are instances of {3}</LongDescription>
<Details>
<![CDATA[
<p>
This instanceof test will always return true (unless the value being tested is null).
Although this is safe, make sure it isn't
an indication of some misunderstanding or some other logic error.
If you really want to test the value for being null, perhaps it would be clearer to do
better to do a null test rather than an instanceof test.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_UNCONFIRMED_CAST">
<ShortDescription>Unchecked/unconfirmed cast</ShortDescription>
<LongDescription>Unchecked/unconfirmed cast from {2} to {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This cast is unchecked, and not all instances of the type casted from can be cast to
the type it is being cast to. Check that your program logic ensures that this
cast will not fail.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">
<ShortDescription>Unchecked/unconfirmed cast of return value from method</ShortDescription>
<LongDescription>Unchecked/unconfirmed cast from {2} to {3} of return value in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code performs an unchecked cast of the return value of a method.
The code might be calling the method in such a way that the cast is guaranteed to be
safe, but FindBugs is unable to verify that the cast is safe. Check that your program logic ensures that this
cast will not fail.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="BC_BAD_CAST_TO_CONCRETE_COLLECTION">
<ShortDescription>Questionable cast to concrete collection</ShortDescription>
<LongDescription>Questionable cast from {2} to {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code casts an abstract collection (such as a Collection, List, or Set)
to a specific concrete implementation (such as an ArrayList or HashSet).
This might not be correct, and it may make your code fragile, since
it makes it harder to switch to other concrete implementations at a future
point. Unless you have a particular reason to do so, just use the abstract
collection class.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RE_POSSIBLE_UNINTENDED_PATTERN">
<ShortDescription>"." or "|" used for regular expression</ShortDescription>
<LongDescription>"." or "|" used for regular expression in {1}</LongDescription>
<Details>
<![CDATA[
<p>
A String function is being invoked and "." or "|" is being passed
to a parameter that takes a regular expression as an argument. Is this what you intended?
For example
<li>s.replaceAll(".", "/") will return a String in which <em>every</em> character has been replaced by a '/' character
<li>s.split(".") <em>always</em> returns a zero length array of String
<li>"ab|cd".replaceAll("|", "/") will return "/a/b/|/c/d/"
<li>"ab|cd".split("|") will return array with six (!) elements: [, a, b, |, c, d]
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">
<ShortDescription>Invalid syntax for regular expression</ShortDescription>
<LongDescription>Invalid syntax for regular expression in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code here uses a regular expression that is invalid according to the syntax
for regular expressions. This statement will throw a PatternSyntaxException when
executed.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION">
<ShortDescription>File.separator used for regular expression</ShortDescription>
<LongDescription>File.separator used for regular expression in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code here uses <code>File.separator</code>
where a regular expression is required. This will fail on Windows
platforms, where the <code>File.separator</code> is a backslash, which is interpreted in a
regular expression as an escape character. Amoung other options, you can just use
<code>File.separatorChar=='\\' ? "\\\\" : File.separator</code> instead of
<code>File.separator</code>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DLS_OVERWRITTEN_INCREMENT">
<ShortDescription>Overwritten increment</ShortDescription>
<LongDescription>Overwritten increment in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code performs an increment operation (e.g., <code>i++</code>) and then
immediately overwrites it. For example, <code>i = i++</code> immediately
overwrites the incremented value with the original value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">
<ShortDescription>Unsigned right shift cast to short/byte</ShortDescription>
<LongDescription>Unsigned right shift cast to short/byte in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code performs an unsigned right shift, whose result is then
cast to a short or byte, which discards the upper bits of the result.
Since the upper bits are discarded, there may be no difference between
a signed and unsigned right shift (depending upon the size of the shift).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="ICAST_BAD_SHIFT_AMOUNT">
<ShortDescription>32 bit int shifted by an amount not in the range -31..31</ShortDescription>
<LongDescription>32 bit int shifted by {2} bits in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code performs shift of a 32 bit int by a constant amount outside
the range -31..31.
The effect of this is to use the lower 5 bits of the integer
value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits,
and shifting by 32 bits is the same as shifting by zero bits). This probably isn't what was expected,
and it is at least confusing.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IM_MULTIPLYING_RESULT_OF_IREM">
<ShortDescription>Integer multiply of result of integer remainder</ShortDescription>
<LongDescription>Integer multiple of result of integer remainder in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code multiplies the result of an integer remaining by an integer constant.
Be sure you don't have your operator precedence confused. For example
i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000).
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_INVOKING_HASHCODE_ON_ARRAY">
<ShortDescription>Invocation of hashCode on an array</ShortDescription>
<LongDescription>Invocation of hashCode on array in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code invokes hashCode on an array. Calling hashCode on
an array returns the same value as System.identityHashCode, and ingores
the contents and length of the array. If you need a hashCode that
depends on the contents of an array <code>a</code>,
use <code>java.util.Arrays.hashCode(a)</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_INVOKING_TOSTRING_ON_ARRAY">
<ShortDescription>Invocation of toString on an array</ShortDescription>
<LongDescription>Invocation of toString on {2.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code invokes toString on an array, which will generate a fairly useless result
such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable
String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">
<ShortDescription>Invocation of toString on an unnamed array</ShortDescription>
<LongDescription>Invocation of toString on an unnamed array in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result
such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable
String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">
<ShortDescription>Computation of average could overflow</ShortDescription>
<LongDescription>Computation of average could overflow in {1}</LongDescription>
<Details>
<![CDATA[
<p>The code computes the average of two integers using either division or signed right shift,
and then uses the result as the index of an array.
If the values being averaged are very large, this can overflow (resulting in the computation
of a negative average). Assuming that the result is intended to be nonnegative, you
can use an unsigned right shift instead. In other words, rather that using <code>(low+high)/2</code>,
use <code>(low+high) >>> 1</code>
</p>
<p>This bug exists in many earlier implementations of binary search and merge sort.
Martin Buchholz <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6412541">found and fixed it</a>
in the JDK libraries, and Joshua Bloch
<a href="http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html">widely
publicized the bug pattern</a>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IM_BAD_CHECK_FOR_ODD">
<ShortDescription>Check for oddness that won't work for negative numbers </ShortDescription>
<LongDescription>Check for oddness that won't work for negative numbers in {1}</LongDescription>
<Details>
<![CDATA[
<p>
The code uses x % 2 == 1 to check to see if a value is odd, but this won't work
for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check
for oddness, consider using x & 1 == 1, or x % 2 != 0.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_HARDCODED_ABSOLUTE_FILENAME">
<ShortDescription>Code contains a hard coded reference to an absolute pathname</ShortDescription>
<LongDescription>Hard coded reference to an absolute pathname in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code constructs a File object using a hard coded to an absolute pathname
(e.g., <code>new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment");</code>
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_BAD_MONTH">
<ShortDescription>Bad constant value for month</ShortDescription>
<LongDescription>Bad month value of {2} passed to {3} in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code passes a constant month
value outside the expected range of 0..11 to a method.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_USELESS_SUBSTRING">
<ShortDescription>Invocation of substring(0), which returns the original value</ShortDescription>
<LongDescription>{1} invokes substring(0), which returns the original value</LongDescription>
<Details>
<![CDATA[
<p>
This code invokes substring(0) on a String, which returns the original value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_CALLING_NEXT_FROM_HASNEXT">
<ShortDescription>hasNext method invokes next</ShortDescription>
<LongDescription>{1} invokes {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p>
The hasNext() method invokes the next() method. This is almost certainly wrong,
since the hasNext() method is not supposed to change the state of the iterator,
and the next method is supposed to change the state of the iterator.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="SWL_SLEEP_WITH_LOCK_HELD">
<ShortDescription>Method calls Thread.sleep() with a lock held</ShortDescription>
<LongDescription>{1} calls Thread.sleep() with a lock held</LongDescription>
<Details>
<![CDATA[
<p>
This method calls Thread.sleep() with a lock held. This may result
in very poor performance and scalability, or a deadlock, since other threads may
be waiting to acquire the lock. It is a much better idea to call
wait() on the lock, which releases the lock and allows other threads
to run.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DB_DUPLICATE_BRANCHES">
<ShortDescription>Method uses the same code for two branches</ShortDescription>
<LongDescription>{1} uses the same code for two branches</LongDescription>
<Details>
<![CDATA[
<p>
This method uses the same code to implement two branches of a conditional branch.
Check to ensure that this isn't a coding mistake.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DB_DUPLICATE_SWITCH_CLAUSES">
<ShortDescription>Method uses the same code for two switch clauses</ShortDescription>
<LongDescription>{1} uses the same code for two switch clauses</LongDescription>
<Details>
<![CDATA[
<p>
This method uses the same code to implement two clauses of a switch statement.
This could be a case of duplicate code, but it might also indicate
a coding mistake.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IMA_INEFFICIENT_MEMBER_ACCESS">
<ShortDescription>Method accesses a private member variable of owning class</ShortDescription>
<LongDescription>{1} accesses to a private member variable of owning class</LongDescription>
<Details>
<![CDATA[
<p>
This method of an inner class reads from or writes to a private member variable of the owning class,
or calls a private method of the owning class. The compiler must generate a special method to access this
private member, causing this to be less efficient. Relaxing the protection of the member variable or method
will allow the compiler to treat this as a normal access.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="XFB_XML_FACTORY_BYPASS">
<ShortDescription>Method directly allocates a specific implementation of xml interfaces</ShortDescription>
<LongDescription>{1} directly allocates a specific implementation of xml interfaces</LongDescription>
<Details>
<![CDATA[
<p>
This method allocates a specific implementation of an xml interface. It is preferable to use
the supplied factory classes to create these objects so that the implementation can be
changed at runtime. See
</p>
<ul>
<li>javax.xml.parsers.DocumentBuilderFactory</li>
<li>javax.xml.parsers.SAXParserFactory</li>
<li>javax.xml.transform.TransformerFactory</li>
<li>org.w3c.dom.Document.create<i>XXXX</i></li>
</ul>
<p>for details.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="USM_USELESS_SUBCLASS_METHOD">
<ShortDescription>Method superfluously delegates to parent class method</ShortDescription>
<LongDescription>{1} superfluously delegates to parent class method</LongDescription>
<Details>
<![CDATA[
<p>
This derived method merely calls the same superclass method passing in the exact parameters
received. This method can be removed, as it provides no additional value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="USM_USELESS_ABSTRACT_METHOD">
<ShortDescription>Abstract Method is already defined in implemented interface</ShortDescription>
<LongDescription>Abstract Method {1} is already defined in implemented interface</LongDescription>
<Details>
<![CDATA[
<p>
This abstract method is already defined in an interface that is implemented by this abstract
class. This method can be removed, as it provides no additional value.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="CI_CONFUSED_INHERITANCE">
<ShortDescription>Class is final but declares protected field</ShortDescription>
<LongDescription>Class {0} is final but declares protected field {1}</LongDescription>
<Details>
<![CDATA[
<p>
This class is declared to be final, but declares fields to be protected. Since the class
is final, it can not be derived from, and the use of protected is confusing. The access
modifier for the field should be changed to private or public to represent the true
use for the field.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">
<ShortDescription>Method assigns boolean literal in boolean expression</ShortDescription>
<LongDescription>{1} assigns boolean literal in boolean expression</LongDescription>
<Details>
<![CDATA[
<p>
This method assigns a literal boolean value (true or false) to a boolean variable inside
an if or while expression. Most probably this was supposed to be a boolean comparison using
==, not an assignment using =.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="VR_UNRESOLVABLE_REFERENCE">
<ShortDescription>Class makes reference to unresolvable class or method</ShortDescription>
<LongDescription>Unresolvable reference to {1} by {0}</LongDescription>
<Details>
<![CDATA[
<p>
This class makes a reference to a class or method that can not be
resolved using against the libraries it is being analyzed with.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="GC_UNCHECKED_TYPE_IN_GENERIC_CALL">
<ShortDescription>Unchecked type in generic call</ShortDescription>
<LongDescription>Unchecked argument of type Object provided where type {3.givenClass} is expected in {1}</LongDescription>
<Details>
<![CDATA[
<p> This call to a generic collection method passes an argument
while compile type Object where a specific type from
the generic type parameters is expected.
Thus, neither the standard Java type system nor static analysis
can provide useful information on whether the
object being passed as a parameter is of an appropriate type.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="GC_UNRELATED_TYPES">
<ShortDescription>No relationship between generic parameter and method argument</ShortDescription>
<LongDescription>{2.givenClass} is incompatible with expected argument type {3.givenClass} in {1}</LongDescription>
<Details>
<![CDATA[
<p> This call to a generic collection method contains an argument
with an incompatible class from that of the collection's parameter
(i.e., the type of the argument is neither a supertype nor a subtype
of the corresponding generic type argument).
Therefore, it is unlikely that the collection contains any objects
that are equal to the method argument used here.
Most likely, the wrong value is being passed to the method.</p>
<p>In general, instances of two unrelated classes are not equal.
For example, if the <code>Foo</code> and <code>Bar</code> classes
are not related by subtyping, then an instance of <code>Foo</code>
should not be equal to an instance of <code>Bar</code>.
Among other issues, doing so will likely result in an equals method
that is not symmetrical. For example, if you define the <code>Foo</code> class
so that a <code>Foo</code> can be equal to a <code>String</code>,
your equals method isn't symmetrical since a <code>String</code> can only be equal
to a <code>String</code>.
</p>
<p>In rare cases, people do define nonsymmetrical equals methods and still manage to make
their code work. Although none of the APIs document or guarantee it, it is typically
the case that if you check if a <code>Collection<String></code> contains
a <code>Foo</code>, the equals method of argument (e.g., the equals method of the
<code>Foo</code> class) used to perform the equality checks.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES">
<ShortDescription>Collections should not contain themselves</ShortDescription>
<LongDescription>Collections should not contain themselves in call to {2.givenClass}</LongDescription>
<Details>
<![CDATA[
<p> This call to a generic collection's method would only make sense if a collection contained
itself (e.g., if <code>s.contains(s)</code> were true). This is unlikely to be true and would cause
problems if it were true (such as the computation of the hash code resulting in infinite recursion).
It is likely that the wrong value is being passed as a parameter.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_VACUOUS_SELF_COLLECTION_CALL">
<ShortDescription>Vacuous call to collections</ShortDescription>
<LongDescription>For any collection c, calling c.{2.name}(c) doesn't make sense </LongDescription>
<Details>
<![CDATA[
<p> This call doesn't make sense. For any collection <code>c</code>, calling <code>c.containsAll(c)</code> should
always be true, and <code>c.retainAll(c)</code> should have no effect.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">
<ShortDescription>Don't reuse entry objects in iterators</ShortDescription>
<LongDescription>{0} is both an Iterator and a Map.Entry </LongDescription>
<Details>
<![CDATA[
<p> The entrySet() method is allowed to return a view of the
underlying Map in which an Iterator and Map.Entry. This clever
idea was used in several Map implementations, but introduces the possibility
of nasty coding mistakes. If a map <code>m</code> returns
such an iterator for an entrySet, then
<code>c.addAll(m.entrySet())</code> will go badly wrong. All of
the Map implementations in OpenJDK 1.7 have been rewritten to avoid this,
you should to.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">
<ShortDescription>Adding elements of an entry set may fail due to reuse of Entry objects</ShortDescription>
<LongDescription>Adding elements of an entry set may fail due to reuse of {2.simpleClass}.Entry object in {1}</LongDescription>
<Details>
<![CDATA[
<p> The entrySet() method is allowed to return a view of the
underlying Map in which a single Entry object is reused and returned
during the iteration. As of Java 1.6, both IdentityHashMap
and EnumMap did so. When iterating through such a Map,
the Entry value is only valid until you advance to the next iteration.
If, for example, you try to pass such an entrySet to an addAll method,
things will go badly wrong.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">
<ShortDescription>Don't use removeAll to clear a collection</ShortDescription>
<LongDescription>removeAll used to clear a collection in {1}</LongDescription>
<Details>
<![CDATA[
<p> If you want to remove all elements from a collection <code>c</code>, use <code>c.clear</code>,
not <code>c.removeAll(c)</code>. Calling <code>c.removeAll(c)</code> to clear a collection
is less clear, susceptible to errors from typos, less efficient and
for some collections, might throw a <code>ConcurrentModificationException</code>.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="STCAL_STATIC_CALENDAR_INSTANCE">
<ShortDescription>Static Calendar field</ShortDescription>
<LongDescription>{1} is static field of type java.util.Calendar, which isn't thread safe</LongDescription>
<Details>
<![CDATA[
<p>Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use.
Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the
application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see
random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate().</p>
<p>You may also experience serialization problems.</p>
<p>Using an instance field is recommended.</p>
<p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">
<ShortDescription>Call to static Calendar</ShortDescription>
<LongDescription>Call to method of static java.util.Calendar in {1}</LongDescription>
<Details>
<![CDATA[
<p>Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use.
The detector has found a call to an instance of Calendar that has been obtained via a static
field. This looks suspicous.</p>
<p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">
<ShortDescription>Static DateFormat</ShortDescription>
<LongDescription>{1} is a static field of type java.text.DateFormat, which isn't thread safe</LongDescription>
<Details>
<![CDATA[
<p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use.
Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the
application.</p>
<p>You may also experience serialization problems.</p>
<p>Using an instance field is recommended.</p>
<p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE">
<ShortDescription>Call to static DateFormat</ShortDescription>
<LongDescription>Call to method of static java.text.DateFormat in {1}</LongDescription>
<Details>
<![CDATA[
<p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use.
The detector has found a call to an instance of DateFormat that has been obtained via a static
field. This looks suspicous.</p>
<p>For more information on this see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579">Sun Bug #6231579</a>
and <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997">Sun Bug #6178997</a>.</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_QUALIFIERS">
<ShortDescription>Comparing values with incompatible type qualifiers</ShortDescription>
<LongDescription>Value annotated as having the type qualifier {2.simpleName} is compared for equality with a value that never has that qualifier </LongDescription>
<Details>
<![CDATA[
<p>
A value specified as carrying a type qualifier annotation is
compared with a value that doesn't ever carry that qualifier.
</p>
<p>
More precisely, a value annotated with a type qualifier specifying when=ALWAYS
is compared with a value that where the same type qualifier specifies when=NEVER.
</p>
<p>
For example, say that @NonNegative is a nickname for
the type qualifier annotation @Negative(when=When.NEVER).
The following code will generate this warning because
the return statement requires a @NonNegative value,
but receives one that is marked as @Negative.
</p>
<blockquote>
<pre>
public boolean example(@Negative Integer value1, @NonNegative Integer value2) {
return value1.equals(value2);
}
</pre>
</blockquote>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">
<ShortDescription>Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required</ShortDescription>
<LongDescription>Value annotated as carrying type qualifier {2.simpleName} used where a value that must not carry that qualifier is required</LongDescription>
<Details>
<![CDATA[
<p>
A value specified as carrying a type qualifier annotation is
consumed in a location or locations requiring that the value not
carry that annotation.
</p>
<p>
More precisely, a value annotated with a type qualifier specifying when=ALWAYS
is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER.
</p>
<p>
For example, say that @NonNegative is a nickname for
the type qualifier annotation @Negative(when=When.NEVER).
The following code will generate this warning because
the return statement requires a @NonNegative value,
but receives one that is marked as @Negative.
</p>
<blockquote>
<pre>
public @NonNegative Integer example(@Negative Integer value) {
return value;
}
</pre>
</blockquote>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_REQUIRED">
<ShortDescription>Value without a type qualifier used where a value is required to have that qualifier</ShortDescription>
<LongDescription>Value without a type qualifier is used in a place that requires a {2.simpleName} annotation</LongDescription>
<Details>
<![CDATA[
<p>
A value is being used in a way that requires the value be annotation with a type qualifier.
The type qualifier is strict, so the tool rejects any values that do not have
the appropriate annotation.
</p>
<p>
To coerce a value to have a strict annotation, define an identity function where the return value is annotated
with the strict annotation.
This is the only way to turn a non-annotated value into a value with a strict type qualifier annotation.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">
<ShortDescription>Value annotated as never carrying a type qualifier used where value carrying that qualifier is required</ShortDescription>
<LongDescription>Value annotated as never carrying type qualifier {2.simpleName} used where value carrying that qualifier is required</LongDescription>
<Details>
<![CDATA[
<p>
A value specified as not carrying a type qualifier annotation is guaranteed
to be consumed in a location or locations requiring that the value does
carry that annotation.
</p>
<p>
More precisely, a value annotated with a type qualifier specifying when=NEVER
is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS.
</p>
<p>
TODO: example
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">
<ShortDescription>Value that might not carry a type qualifier is always used in a way requires that type qualifier</ShortDescription>
<LongDescription>Value that might not carry the {2.simpleName} annotation is always used in a way that requires that type qualifier</LongDescription>
<Details>
<![CDATA[
<p>
A value that is annotated as possibility not being an instance of
the values denoted by the type qualifier, and the value is guaranteed to be used
in a way that requires values denoted by that type qualifier.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">
<ShortDescription>Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier</ShortDescription>
<LongDescription>Value that might carry the {2.simpleName} annotation is always used in a way that prohibits it from having that type qualifier</LongDescription>
<Details>
<![CDATA[
<p>
A value that is annotated as possibility being an instance of
the values denoted by the type qualifier, and the value is guaranteed to be used
in a way that prohibits values denoted by that type qualifier.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">
<ShortDescription>Value required to not have type qualifier, but marked as unknown</ShortDescription>
<LongDescription>Value is required never be {2.simpleName}, but is explicitly annotated as unknown with regards to {2.simpleName}</LongDescription>
<Details>
<![CDATA[
<p>
A value is used in a way that requires it to be never be a value denoted by a type qualifier, but
there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier.
Either the usage or the annotation is incorrect.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK">
<ShortDescription>Value required to have type qualifier, but marked as unknown</ShortDescription>
<LongDescription>Value is required to always be {2.simpleName}, but is explicitly annotated as unknown with regards to {2.simpleName}</LongDescription>
<Details>
<![CDATA[
<p>
A value is used in a way that requires it to be always be a value denoted by a type qualifier, but
there is an explicit annotation stating that it is not known where the value is required to have that type qualifier.
Either the usage or the annotation is incorrect.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">
<ShortDescription>Doomed attempt to append to an object output stream</ShortDescription>
<LongDescription>Doomed attempt to append to an object output stream in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This code opens a file in append mode and then wraps the result in an object output stream.
This won't allow you to append to an existing object output stream stored in a file. If you want to be
able to append to an object output stream, you need to keep the object output stream open.
</p>
<p>The only situation in which opening a file in append mode and the writing an object output stream
could work is if on reading the file you plan to open it in random access mode and seek to the byte offset
where the append started.
</p>
<p>
TODO: example.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL">
<ShortDescription>Synchronization on getClass rather than class literal</ShortDescription>
<LongDescription>Synchronization on getClass rather than class literal in {1}</LongDescription>
<Details>
<![CDATA[
<p>
This instance method synchronizes on <code>this.getClass()</code>. If this class is subclassed,
subclasses will synchronize on the class object for the subclass, which isn't likely what was intended.
For example, consider this code from java.awt.Label:</p>
<pre>
private static final String base = "label";
private static int nameCounter = 0;
String constructComponentName() {
synchronized (getClass()) {
return base + nameCounter++;
}
}
</pre>
<p>Subclasses of <code>Label</code> won't synchronize on the same subclass, giving rise to a datarace.
Instead, this code should be synchronizing on <code>Label.class</code></p>
<pre>
private static final String base = "label";
private static int nameCounter = 0;
String constructComponentName() {
synchronized (Label.class) {
return base + nameCounter++;
}
}
</pre>
<p>Bug pattern contributed by Jason Mehrens</p>
]]>
</Details>
</BugPattern>
<BugPattern type="OBL_UNSATISFIED_OBLIGATION">
<ShortDescription>Method may fail to clean up stream or resource</ShortDescription>
<LongDescription>{1} may fail to clean up {2}</LongDescription>
<Details>
<![CDATA[
<p>
This method may fail to clean up (close, dispose of) a stream,
database object, or other
resource requiring an explicit cleanup operation.
</p>
<p>
In general, if a method opens a stream or other resource,
the method should use a try/finally block to ensure that
the stream or resource is cleaned up before the method
returns.
</p>
<p>
This bug pattern is essentially the same as the
OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE
bug patterns, but is based on a different
(and hopefully better) static analysis technique.
We are interested is getting feedback about the
usefulness of this bug pattern.
To send feedback, either:
</p>
<ul>
<li>send email to findbugs@cs.umd.edu</li>
<li>file a bug report: <a href="http://findbugs.sourceforge.net/reportingBugs.html">http://findbugs.sourceforge.net/reportingBugs.html</a></li>
</ul>
<p>
In particular,
the false-positive suppression heuristics for this
bug pattern have not been extensively tuned, so
reports about false positives are helpful to us.
</p>
<p>
See Weimer and Necula, <i>Finding and Preventing Run-Time Error Handling Mistakes</i>, for
a description of the analysis technique.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">
<ShortDescription>Method may fail to clean up stream or resource on checked exception</ShortDescription>
<LongDescription>{1} may fail to clean up {2} on checked exception</LongDescription>
<Details>
<![CDATA[
<p>
This method may fail to clean up (close, dispose of) a stream,
database object, or other
resource requiring an explicit cleanup operation.
</p>
<p>
In general, if a method opens a stream or other resource,
the method should use a try/finally block to ensure that
the stream or resource is cleaned up before the method
returns.
</p>
<p>
This bug pattern is essentially the same as the
OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE
bug patterns, but is based on a different
(and hopefully better) static analysis technique.
We are interested is getting feedback about the
usefulness of this bug pattern.
To send feedback, either:
</p>
<ul>
<li>send email to findbugs@cs.umd.edu</li>
<li>file a bug report: <a href="http://findbugs.sourceforge.net/reportingBugs.html">http://findbugs.sourceforge.net/reportingBugs.html</a></li>
</ul>
<p>
In particular,
the false-positive suppression heuristics for this
bug pattern have not been extensively tuned, so
reports about false positives are helpful to us.
</p>
<p>
See Weimer and Necula, <i>Finding and Preventing Run-Time Error Handling Mistakes</i>, for
a description of the analysis technique.
</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FB_UNEXPECTED_WARNING">
<ShortDescription>Unexpected/undesired warning from FindBugs</ShortDescription>
<LongDescription>Unexpected/undesired {2} FindBugs warning in {1}</LongDescription>
<Details>
<![CDATA[
<p>FindBugs generated a warning that, according to a @NoWarning annotated,
is unexpected or undesired</p>
]]>
</Details>
</BugPattern>
<BugPattern type="FB_MISSING_EXPECTED_WARNING">
<ShortDescription>Missing expected or desired warning from FindBugs</ShortDescription>
<LongDescription>Missing expected or desired {2} FindBugs warning in {1}</LongDescription>
<Details>
<![CDATA[
<p>FindBugs didn't generate generated a warning that, according to a @ExpectedWarning annotated,
is expected or desired</p>
]]>
</Details>
</BugPattern>
<BugPattern type="RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">
<ShortDescription>Return value of putIfAbsent ignored, value passed to putIfAbsent reused</ShortDescription>
<LongDescription>Return value of putIfAbsent is ignored, but {4} is reused in {1}</LongDescription>
<Details>
<![CDATA[
The <code>putIfAbsent</code> method is typically used to ensure that a
single value is associated with a given key (the first value for which put
if absent succeeds).
If you ignore the return value and retain a reference to the value passed in,
you run the risk of retaining a value that is not the one that is associated with the key in the map.
If it matters which one you use and you use the one that isn't stored in the map,
your program will behave incorrectly.
]]>
</Details>
</BugPattern>
<BugPattern type="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">
<ShortDescription>Potential lost logger changes due to weak reference in OpenJDK</ShortDescription>
<LongDescription>Changes to logger could be lost in {1}</LongDescription>
<Details>
<![CDATA[
<p>OpenJDK introduces a potential incompatibility.
In particular, the java.util.logging.Logger behavior has
changed. Instead of using strong references, it now uses weak references
internally. That's a reasonable change, but unfortunately some code relies on
the old behavior - when changing logger configuration, it simply drops the
logger reference. That means that the garbage collector is free to reclaim
that memory, which means that the logger configuration is lost. For example,
consider:
</p>
<pre>public static void initLogging() throws Exception {
Logger logger = Logger.getLogger("edu.umd.cs");
logger.addHandler(new FileHandler()); // call to change logger configuration
logger.setUseParentHandlers(false); // another call to change logger configuration
}</pre>
<p>The logger reference is lost at the end of the method (it doesn't
escape the method), so if you have a garbage collection cycle just
after the call to initLogging, the logger configuration is lost
(because Logger only keeps weak references).</p>
<pre>public static void main(String[] args) throws Exception {
initLogging(); // adds a file handler to the logger
System.gc(); // logger configuration lost
Logger.getLogger("edu.umd.cs").info("Some message"); // this isn't logged to the file as expected
}</pre>
<p><em>Ulf Ochsenfahrt and Eric Fellheimer</em></p>
]]>
</Details>
</BugPattern>
<BugPattern type="AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION">
<ShortDescription>Sequence of calls to concurrent abstraction may not be atomic</ShortDescription>
<LongDescription>Sequence of calls to {2} may not be atomic in {1}</LongDescription>
<Details>
<![CDATA[
<p>This code contains a sequence of calls to a concurrent abstraction
(such as a concurrent hash map).
These calls will not be executed atomically.
]]>
</Details>
</BugPattern>
<BugPattern type="DM_DEFAULT_ENCODING">
<ShortDescription>Reliance on default encoding</ShortDescription>
<LongDescription>Found reliance on default encoding in {1}: {2}</LongDescription>
<Details>
<![CDATA[
<p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>
]]>
</Details>
</BugPattern>
<BugPattern type="NP_METHOD_PARAMETER_RELAXING_ANNOTATION">
<ShortDescription>Method tightens nullness annotation on parameter</ShortDescription>
<LongDescription>Method {1} overrides the nullness annotation relaxing the ancestor method requirements on parameter.</LongDescription>
<Details>
<![CDATA[<p>
A method should always implement the contract of a method it overrides. Thus, if a method takes a parameter
that is marked as @Nullable, you shouldn't override that method in a subclass with a method where that parameter is @Nonnull.
Doing so violates the contract that the method should handle a null parameter.
</p>]]>
</Details>
</BugPattern>
<BugPattern type="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">
<ShortDescription>Method tightens nullness annotation on parameter</ShortDescription>
<LongDescription>Method {1} overrides the nullness annotation of parameter {2} in an incompatible way</LongDescription>
<Details>
<![CDATA[<p>
A method should always implement the contract of a method it overrides. Thus, if a method takes a parameter
that is marked as @Nullable, you shouldn't override that method in a subclass with a method where that parameter is @Nonnull.
Doing so violates the contract that the method should handle a null parameter.
</p>]]>
</Details>
</BugPattern>
<BugPattern type="NP_METHOD_RETURN_RELAXING_ANNOTATION">
<ShortDescription>Method relaxes nullness annotation on return value</ShortDescription>
<LongDescription>Method {1} overrides the return value nullness annotation in an incompatible way.</LongDescription>
<Details>
<![CDATA[<p>
A method should always implement the contract of a method it overrides. Thus, if a method takes is annotated
as returning a @Nonnull value,
you shouldn't override that method in a subclass with a method annotated as returning a @Nullable or @CheckForNull value.
Doing so violates the contract that the method shouldn't return null.
</p>]]>
</Details>
</BugPattern>
<!--
**********************************************************************
BugCodes
**********************************************************************
-->
<BugCode abbrev="FS">Format string problem</BugCode>
<BugCode abbrev="SKIPPED">Analysis skipped</BugCode>
<BugCode abbrev="IL">Infinite Loop</BugCode>
<BugCode abbrev="VO">Use of volatile</BugCode>
<BugCode abbrev="UI">Unsafe inheritance</BugCode>
<BugCode abbrev="FL">Use of floating point precision</BugCode>
<BugCode abbrev="TEST">Testing prototype and incomplete bug pattern</BugCode>
<BugCode abbrev="IMSE">Dubious catching of IllegalMonitorStateException</BugCode>
<BugCode abbrev="CN">Bad implementation of cloneable idiom</BugCode>
<BugCode abbrev="AT">Possible atomicity violation</BugCode>
<BugCode abbrev="FI">Incorrect use of finalizers</BugCode>
<BugCode abbrev="ES">Checking String equality using == or !=</BugCode>
<BugCode abbrev="ML">Synchronization on updated field (Mutable Lock)</BugCode>
<BugCode abbrev="UG">Unsynchronized get method, synchronized set method</BugCode>
<BugCode abbrev="IO">Input/Output problem</BugCode>
<BugCode abbrev="IC">Initialization circularity</BugCode>
<BugCode abbrev="SI">Suspicious static initializer</BugCode>
<BugCode abbrev="MSF">Mutable servlet field</BugCode>
<BugCode abbrev="IS">Inconsistent synchronization</BugCode>
<BugCode abbrev="Eq">Problems with implementation of equals()</BugCode>
<BugCode abbrev="Co">Problems with implementation of compareTo()</BugCode>
<BugCode abbrev="HE">Equal objects must have equal hashcodes</BugCode>
<BugCode abbrev="AM">API misuse</BugCode>
<BugCode abbrev="Dm">Dubious method used</BugCode>
<BugCode abbrev="Bx">Questionable Boxing of primitive value</BugCode>
<BugCode abbrev="UR">Uninitialized read of field in constructor</BugCode>
<BugCode abbrev="RR">Method ignores results of InputStream.read()</BugCode>
<BugCode abbrev="NN">Naked notify</BugCode>
<BugCode abbrev="UW">Unconditional wait</BugCode>
<BugCode abbrev="SP">Method spins on field</BugCode>
<BugCode abbrev="DC">Possible double check of field</BugCode>
<BugCode abbrev="Wa">Wait not in loop</BugCode>
<BugCode abbrev="No">Using notify() rather than notifyAll()</BugCode>
<BugCode abbrev="DE">Dropped or ignored exception</BugCode>
<BugCode abbrev="Ru">Method invokes run()</BugCode>
<BugCode abbrev="It">Incorrect definition of Iterator</BugCode>
<BugCode abbrev="SnVI">Serializable class with no Version ID</BugCode>
<BugCode abbrev="Se">Incorrect definition of Serializable class</BugCode>
<BugCode abbrev="WS">Class's writeObject() method is synchronized but nothing else is</BugCode>
<BugCode abbrev="RS">Class's readObject() method is synchronized</BugCode>
<BugCode abbrev="SC">Constructor invokes Thread.start()</BugCode>
<BugCode abbrev="MS">Mutable static field</BugCode>
<BugCode abbrev="EI">Method returning array may expose internal representation</BugCode>
<BugCode abbrev="Nm">Confusing method name</BugCode>
<BugCode abbrev="SS">Unread field should be static</BugCode>
<BugCode abbrev="UuF">Unused field</BugCode>
<BugCode abbrev="UrF">Unread field</BugCode>
<BugCode abbrev="UwF">Unwritten field</BugCode>
<BugCode abbrev="SIC">Inner class could be made static</BugCode>
<BugCode abbrev="TLW">Wait with two locks held</BugCode>
<BugCode abbrev="RV">Bad use of return value from method</BugCode>
<BugCode abbrev="LG">Logger problem</BugCode>
<BugCode abbrev="IA">Ambiguous invocation</BugCode>
<BugCode abbrev="HSC">Huge String constants</BugCode>
<BugCode abbrev="HRS">HTTP Response splitting vulnerability</BugCode>
<BugCode abbrev="PT">Path traversal</BugCode>
<BugCode abbrev="XSS">Cross site scripting vulnerability</BugCode>
<BugCode abbrev="NP">Null pointer dereference</BugCode>
<BugCode abbrev="NOISE">Bogus random warning</BugCode>
<BugCode abbrev="RpC">Repeated conditional test</BugCode>
<BugCode abbrev="OS">Stream not closed on all paths</BugCode>
<BugCode abbrev="PZLA">Prefer zero length arrays to null to indicate no results</BugCode>
<BugCode abbrev="UCF">Useless control flow</BugCode>
<BugCode abbrev="RCN">Redundant comparison to null</BugCode>
<BugCode abbrev="UL">Lock not released on all paths</BugCode>
<BugCode abbrev="RC">Questionable use of reference equality rather than calling equals</BugCode>
<BugCode abbrev="EC">Comparing incompatible types for equality</BugCode>
<BugCode abbrev="MWN">Mismatched wait() or notify()</BugCode>
<BugCode abbrev="SA">Useless self-operation</BugCode>
<BugCode abbrev="INT">Suspicious integer expression</BugCode>
<BugCode abbrev="BIT">Suspicious bitwise logical expression</BugCode>
<BugCode abbrev="LI">Unsynchronized Lazy Initialization</BugCode>
<BugCode abbrev="JLM">Synchronization on java.util.concurrent objects</BugCode>
<BugCode abbrev="UPM">Private method is never called</BugCode>
<BugCode abbrev="UMAC">Uncallable method of anonymous class</BugCode>
<BugCode abbrev="EI2">Storing reference to mutable object</BugCode>
<BugCode abbrev="NS">Suspicious use of non-short-circuit boolean operator</BugCode>
<BugCode abbrev="ODR">Database resource not closed on all paths</BugCode>
<BugCode abbrev="SBSC">String concatenation in loop using + operator</BugCode>
<BugCode abbrev="ITA">Inefficient use of collection.toArray(new Foo[0])</BugCode>
<BugCode abbrev="SW">Swing coding rules</BugCode>
<BugCode abbrev="IJU">Improperly implemented JUnit TestCase</BugCode>
<BugCode abbrev="BOA">Badly Overridden Adapter</BugCode>
<BugCode abbrev="SF">Switch case falls through</BugCode>
<BugCode abbrev="SIO">Superfluous instanceof</BugCode>
<BugCode abbrev="BAC">Bad Applet Constructor</BugCode>
<BugCode abbrev="UOE">Use Object Equals</BugCode>
<BugCode abbrev="STI">Suspicious Thread Interrupted</BugCode>
<BugCode abbrev="DLS">Dead local store</BugCode>
<BugCode abbrev="IP">Ignored parameter</BugCode>
<BugCode abbrev="MF">Masked Field</BugCode>
<BugCode abbrev="WMI">Inefficient Map Iterator</BugCode>
<BugCode abbrev="ISC">Instantiated Static Class</BugCode>
<BugCode abbrev="REC">RuntimeException capture</BugCode>
<BugCode abbrev="FE">Test for floating point equality</BugCode>
<BugCode abbrev="UM">Unnecessary Math on constants</BugCode>
<BugCode abbrev="CD">Circular Dependencies</BugCode>
<BugCode abbrev="RI">Redundant Interfaces</BugCode>
<BugCode abbrev="MTIA">Multithreaded Instance Access</BugCode>
<BugCode abbrev="PS">Public Semaphores</BugCode>
<BugCode abbrev="BSHIFT">Bad shift</BugCode>
<BugCode abbrev="ICAST">Casting from integer values</BugCode>
<BugCode abbrev="RE">Regular expressions</BugCode>
<BugCode abbrev="SQL">Potential SQL Problem</BugCode>
<BugCode abbrev="WL">Possible locking on wrong object</BugCode>
<BugCode abbrev="ESync">Empty Synchronized blocks</BugCode>
<BugCode abbrev="QF">Questionable for loops</BugCode>
<BugCode abbrev="VA">Var arg problems</BugCode>
<BugCode abbrev="BC">Bad casts of object references</BugCode>
<BugCode abbrev="IM">Questionable integer math</BugCode>
<BugCode abbrev="ST">Misuse of static fields</BugCode>
<BugCode abbrev="JCIP">Violation of net.jcip annotations</BugCode>
<BugCode abbrev="USELESS_STRING">Useless/non-informative string generated</BugCode>
<BugCode abbrev="DMI">Dubious method invocation</BugCode>
<BugCode abbrev="PZ">Warning inspired by Josh Bloch's and Neal Gafter's Programming Puzzlers</BugCode>
<BugCode abbrev="SWL">Sleep with lock held</BugCode>
<BugCode abbrev="J2EE">J2EE error</BugCode>
<BugCode abbrev="DB">Duplicate Branches</BugCode>
<BugCode abbrev="IMA">Inefficient Member Access</BugCode>
<BugCode abbrev="XFB">XML Factory Bypass</BugCode>
<BugCode abbrev="USM">Useless Subclass Method</BugCode>
<BugCode abbrev="CI">Confused Inheritance</BugCode>
<BugCode abbrev="QBA">Questionable Boolean Assignment</BugCode>
<BugCode abbrev="VR">Version compatibility issue</BugCode>
<BugCode abbrev="DP">Use doPrivileged</BugCode>
<BugCode abbrev="GC">Suspicious calls to generic collection methods</BugCode>
<BugCode abbrev="STCAL">Static use of type Calendar or DateFormat</BugCode>
<BugCode abbrev="TQ">Inconsistent use of type qualifier annotations</BugCode>
<BugCode abbrev="OBL">Unsatisfied obligation to clean up stream or resource</BugCode>
<BugCode abbrev="FB">FindBugs did not produce the expected warnings on a method</BugCode>
<BugCode abbrev="DL">Unintended contention or possible deadlock due to locking on shared objects</BugCode>
</MessageCollection>
|