BridgeMethodsTemplateTest.java 33.4 KB
Newer Older
E
emc 已提交
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
/*
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */
import java.io.IOException;

import org.testng.annotations.Test;

/**
 * BridgeMethodsTemplateTest
 *
 * @author Brian Goetz
 */
@Test
public class BridgeMethodsTemplateTest extends BridgeMethodTestCase {

    /*
     * Cc1(A) -> Cc1(Ac0)
     *
     * 0*: Inherited from A
     * 1: Declared in C
     */
    public void test1() throws IOException, ReflectiveOperationException {
        compileSpec("Cc1(A)");
        assertLinkage("C", LINKAGE_ERROR, "C1");
        recompileSpec("Cc1(Ac0)", "A");
        assertLinkage("C", "A0", "C1");
    }

    /*
     * Cc1(I) -> Cc1(Id0)
     *
     * 0*: Inherited default from I
     * 1: Declared in C
     */
    public void test2() throws IOException, ReflectiveOperationException {
        compileSpec("Cc1(I)");
        assertLinkage("C", LINKAGE_ERROR, "C1");
        recompileSpec("Cc1(Id0)", "I");
        assertLinkage("C", "I0", "C1");
    }

    /*
     * C(Bc1(A)) -> C(Bc1(Ac0))
     *
     * 0*: Inherited from A
     * 1: Inherited from B
     */
    public void test3() throws IOException, ReflectiveOperationException {
        compileSpec("C(Bc1(A))");
        assertLinkage("C", LINKAGE_ERROR, "B1");
        recompileSpec("C(Bc1(Ac0))", "A");
        assertLinkage("C", "A0", "B1");
    }

    /*
     * C(B(Ac0)) -> C(Bc1(Ac0))
     *
     * 0: Inherited from B (through bridge)
     * 1: Inherited from B
     */
    public void test4() throws IOException, ReflectiveOperationException {
        compileSpec("C(B(Ac0))");
        assertLinkage("C", "A0", LINKAGE_ERROR);
        recompileSpec("C(Bc1(Ac0))", "B");
        assertLinkage("C", "B1", "B1");
    }

    /*
     * C(B(A)) -> C(Bc1(Ac0))
     *
     * 0: Inherited from B (through bridge)
     * 1: Inherited from B
     */
    public void test5() throws IOException, ReflectiveOperationException {
        compileSpec("C(B(A))");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR);
        recompileSpec("C(Bc1(Ac0))", "A", "B");
        assertLinkage("C", "B1", "B1");
    }

    /*
     * C(Ac1(I)) -> C(Ac1(Id0))
     *
     * 0*: Inherited default from I
     * 1: Inherited from A
     */
    public void test6() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac1(I))");
        assertLinkage("C", LINKAGE_ERROR, "A1");
        recompileSpec("C(Ac1(Id0))", "I");
        assertLinkage("C", "I0", "A1");
    }

    /*
     * C(A(Id0)) -> C(Ac1(Id0))
     *
     * 0: Inherited from A (through bridge)
     * 1: Inherited from A
     */
    public void test7() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0))");
        assertLinkage("C", "I0", LINKAGE_ERROR);
        recompileSpec("C(Ac1(Id0))", "A");
        assertLinkage("C", "A1", "A1");
    }

    /*
     * C(A(I)) -> C(Ac1(Id0))
     *
     * 0*: Inherited from A (through bridge)
     * 1*: Inherited from A
     */
    public void test8() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(I))");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR);
        recompileSpec("C(Ac1(Id0))", "A", "I");
        assertLinkage("C", "A1", "A1");
    }

    /*
     * C(Id1(J)) -> C(Id1(Jd0))
     *
     * 0*: Inherited default from J
     * 1: Inherited default from I
     */
    public void test9() throws IOException, ReflectiveOperationException {
        compileSpec("C(Id1(J))");
        assertLinkage("C", LINKAGE_ERROR, "I1");
        recompileSpec("C(Id1(Jd0))", "J");
        assertLinkage("C", "J0", "I1");
    }

    /*
     * C(I(Jd0)) -> C(Id1(Jd0))
     *
     * 0: Inherited default from I (through bridge)
     * 1: Inherited default from I
     */
    public void test10() throws IOException, ReflectiveOperationException {
        compileSpec("C(I(Jd0))");
        assertLinkage("C", "J0", LINKAGE_ERROR);
        recompileSpec("C(Id1(Jd0))", "I");
        assertLinkage("C", "I1", "I1");
    }

    /*
     * C(I(J)) -> C(Id1(Jd0))
     *
     * 0: Inherited default from I (through bridge)
     * 1: Inherited default from I
     */
    public void test11() throws IOException, ReflectiveOperationException {
        compileSpec("C(I(J))");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR);
        recompileSpec("C(Id1(Jd0))", "I", "J");
        assertLinkage("C", "I1", "I1");
    }

    /*
     * Cc2(B(Ac0)) -> Cc2(Bc1(Ac0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from B
     * 2: Declared in C
     */
    public void test12() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(B(Ac0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Bc1(Ac0))", "B");
        assertLinkage("C", "C2", "B1", "C2");
    }

    /*
     * Cc2(B(Aa0)) -> Cc2(Bc1(Aa0))
     *
     * 0: Bridge in C (through bridge)
     * 1*: Inherited from B
     * 2: Declared in C
     */
    public void test13() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(B(Aa0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Bc1(Aa0))", "B");
        assertLinkage("C", "C2", "B1", "C2");
    }

    /*
     * Cc2(Bc1(A)) -> Cc2(Bc1(Ac0))
     *
     * 0*: Inherited from A
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test14() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Bc1(A))");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Bc1(Ac0))", "A");
        assertLinkage("C", "A0", "C2", "C2");
    }

    /*
     * Cc2(Ba1(A)) -> Cc2(Ba1(Ac0))
     *
     * 0*: Inherited from A
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test15() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Ba1(A))");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Ba1(Ac0))", "A");
        assertLinkage("C", "A0", "C2", "C2");
    }

    /*
     * Cc2(B(A)) -> Cc2(Bc1(Ac0))
     *
     * 0*: Inherited from B (through bridge)
     * 1*: Inherited from B
     * 2: Declared in C
     */
    public void test16() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(B(A))");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Bc1(Ac0))", "B", "A");
        assertLinkage("C", "B1", "B1", "C2");
    }

    /*
     * Cc2(A(Id0)) -> Cc2(Ac1(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test17() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(Id0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1(Id0))", "A");
        assertLinkage("C", "C2", "A1", "C2");
    }

    /*
     * Cc2(A(Ia0)) -> Cc2(Ac1(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test18() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(Ia0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1(Ia0))", "A");
        assertLinkage("C", "C2", "A1", "C2");
    }

    /*
     * Cc2(Ac1(I)) -> Cc2(Ac1(Id0))
     *
     * 0*: Inherited from I
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test19() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Ac1(I))");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Ac1(Id0))", "I");
        assertLinkage("C", "I0", "C2", "C2");
    }

    /*
     * Cc2(Aa1(I)) -> Cc2(Aa1(Id0))
     *
     * 0*: Inherited from I
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test20() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Aa1(I))");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Aa1(Id0))", "I");
        assertLinkage("C", "I0", "C2", "C2");
    }

    /*
     * Cc2(A(I)) -> Cc2(Ac1(Id0))
     *
     * 0*: Inherited from A (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test21() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(I))");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1(Id0))", "A", "I");
        assertLinkage("C", "A1", "A1", "C2");
    }

    /*
     * Cc2(J(Id0)) -> Cc2(Jd1(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test22() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(J(Id0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Jd1(Id0))", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc2(J(Ia0)) -> Cc2(Jd1(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test23() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(J(Ia0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Jd1(Ia0))", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc2(Jd1(I)) -> Cc2(Jd1(Id0))
     *
     * 0*: Inherited default from I
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test24() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Jd1(I))");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Jd1(Id0))", "I");
        assertLinkage("C", "I0", "C2", "C2");
    }

    /*
     * Cc2(Ja1(I)) -> Cc2(Ja1(Id0))
     *
     * 0*: Inherited default from I
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test25() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Ja1(I))");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Ja1(Id0))", "I");
        assertLinkage("C", "I0", "C2", "C2");
    }

    /*
     * Cc2(J(I)) -> Cc2(Jd1(Id0))
     *
     * 0*: Inherited default from J (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test26() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(J(I))");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Jd1(Id0))", "J", "I");
        assertLinkage("C", "J1", "J1", "C2");
    }

    /*
     * C(Ac1, I) -> C(Ac1, Id0)
     *
     * 0*: Inherited default from I
     * 1: Inherited from A
     */
    public void test27() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac1,I)");
        assertLinkage("C", LINKAGE_ERROR, "A1");
        recompileSpec("C(Ac1,Id0)", "I");
        assertLinkage("C", "I0", "A1");
    }

    /*
     * C(A, Id0) -> C(Ac1, Id0)
     *
     * 0*: Inherited default from I
     * 1: Inherited from A
     */
    public void test28() throws IOException, ReflectiveOperationException {
        compileSpec("C(A,Id0)");
        assertLinkage("C", "I0", LINKAGE_ERROR);
        recompileSpec("C(Ac1,Id0)", "A");
        assertLinkage("C", "I0", "A1");
    }

    /*
     * C(A, I) -> C(Ac1, Id0)
     *
     * 0*: Inherited default from I
     * 1: Inherited from A
     */
    public void test29() throws IOException, ReflectiveOperationException {
        compileSpec("C(A,I)");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR);
        recompileSpec("C(Ac1,Id0)", "A", "I");
        assertLinkage("C", "I0", "A1");
    }

    /*
     * Cc2(Ac1, I) -> Cc2(Ac1, Id0)
     *
     * 0*: Inherited default from I
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test30() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Ac1,I)");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Ac1,Id0)", "I");
        assertLinkage("C", "I0", "C2", "C2");
    }

    /*
     * Cc2(Aa1, I) -> Cc2(Aa1, Id0)
     *
     * 0*: Inherited default from I
     * 1: Declared in C (through bridge)
     * 2: Declared in C
     */
    public void test31() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Aa1,I)");
        assertLinkage("C", LINKAGE_ERROR, "C2", "C2");
        recompileSpec("Cc2(Aa1,Id0)", "I");
        assertLinkage("C", "I0", "C2", "C2");
    }

    /*
     * Cc2(A, Id0) -> Cc2(Ac1, Id0)
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test32() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A,Id0)");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1,Id0)", "A");
        assertLinkage("C", "C2", "A1", "C2");
    }

    /*
     * Cc2(A, Ia0) -> Cc2(Ac1, Ia0)
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test33() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A,Ia0)");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1,Ia0)", "A");
        assertLinkage("C", "C2", "A1", "C2");
    }

    /*
     * Cc2(A, I) -> Cc2(Ac1, Id0)
     *
     * 0*: Inherited from A
     * 1*: Inherited default from I
     * 2: Declared in C
     */
    public void test34() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A,I)");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1,Id0)", "A", "I");
        assertLinkage("C", "I0", "A1", "C2");
    }

    /*
     * Cc2(Id0, J) -> Cc2(Id0, Jd1)
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test35() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Id0,J)");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Id0,Jd1)", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc2(Ia0, J) -> Cc2(Ia0, Jd1)
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test36() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(Ia0,J)");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ia0,Jd1)", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc2(I, J) -> Cc2(Id0, Jd1)
     *
     * 0*: Inherited default from I
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test37() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(I,J)");
        assertLinkage("C", LINKAGE_ERROR, LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Id0,Jd1)", "I", "J");
        assertLinkage("C", "I0", "J1", "C2");
    }

    /*
     * C(A(Id0), J(Id0)) -> C(Ac1(Id0), J(Id0))
     *
     * 0: Inherited default from I
     * 0*: Inherited from A (through bridge)
     * 1*: Inherited from A
     */
    public void test38() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0),J(Id0))");
        assertLinkage("C", "I0", LINKAGE_ERROR);
        recompileSpec("C(Ac1(Id0),J(Id0))", "A");
        assertLinkage("C", "A1", "A1");
    }

    /*
     * C(A(Id0), J(Id0)) -> C(A(Id0), Jd1(Id0))
     *
     * 0: Inherited default from I
     * 0: Inherited default from J (through bridge)
     * 1*: Inherited default from J
     */
    public void test39() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0),J(Id0))");
        assertLinkage("C", "I0", LINKAGE_ERROR);
        recompileSpec("C(A(Id0),Jd1(Id0))", "J");
        assertLinkage("C", "J1", "J1");
    }

    /*
     * C(A(Id0), J(Id0)) -> C(Ac2(Id0), Jd1(Id0))
     *
     * 0: Inherited default from I
     * 0*: Inherited from A (new bridge in A beats new bridge in J)
     * 1*: Inherited default from J
     * 2: Inherited from A
     */
    public void test40() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0),J(Id0))");
        assertLinkage("C", "I0", LINKAGE_ERROR);
        recompileSpec("C(Ac2(Id0),Jd1(Id0))", "A", "J");
        assertLinkage("C", "A2", "J1", "A2");
    }

    /*
     * C(J(Id0), K(Id0)) -> C(Jd1(Id0), K(Id0))
     *
     * 0: Inherited from I
     * 0*: Inherited default from J (through bridge)
     * 1: Inherited default from J
     */
    public void test41() throws IOException, ReflectiveOperationException {
        compileSpec("C(J(Id0),K(Id0))");
        assertLinkage("C", "I0", LINKAGE_ERROR);
        recompileSpec("C(Jd1(Id0),K(Id0))", "J");
        assertLinkage("C", "J1", "J1");
    }

    /*
     * C(Ac2(Id0), J(Id0)) -> C(Ac2(Id0), Jd1(Id0))
     *
     * 0: Inherited from A (bridge in A beats new bridge in J)
     * 1*: Inherited default from J
     * 2: Inherited from A
     */
    public void test42() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac2(Id0),J(Id0))");
        assertLinkage("C", "A2", LINKAGE_ERROR, "A2");
        recompileSpec("C(Ac2(Id0),Jd1(Id0))", "J");
        assertLinkage("C", "A2", "J1", "A2");
    }

    /*
     * C(Ac2(Ia0), J(Ia0)) -> C(Ac2(Ia0), Jd1(Ia0))
     *
     * 0: Inherited from A (bridge in A beats new bridge in J)
     * 1*: Inherited default from J
     * 2: Inherited from A
     */
    public void test43() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac2(Ia0),J(Ia0))");
        assertLinkage("C", "A2", LINKAGE_ERROR, "A2");
        recompileSpec("C(Ac2(Ia0),Jd1(Ia0))", "J");
        assertLinkage("C", "A2", "J1", "A2");
    }

    /*
     * C(A(Id0), Jd1(Id0)) -> C(Ac2(Id0), Jd1(Id0))
     *
     * 0: Inherited from J
     * 0*: Inherited from A (new bridge in A beats bridge in J)
     * 1: Inherited default from J
     * 2*: Inherited from A
     */
    public void test44() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0),Jd1(Id0))");
        assertLinkage("C", "J1", "J1", LINKAGE_ERROR);
        recompileSpec("C(Ac2(Id0),Jd1(Id0))", "A");
        assertLinkage("C", "A2", "J1", "A2");
    }

    /*
     * C(A(Ia0), Jd1(Ia0)) -> C(Ac2(Ia0), Jd1(Ia0))
     *
     * 0: Inherited from J
     * 0*: Inherited from A (new bridge in A beats bridge in J)
     * 1: Inherited default from J
     * 2*: Inherited from A
     */
    public void test45() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Ia0),Jd1(Ia0))");
        assertLinkage("C", "J1", "J1", LINKAGE_ERROR);
        recompileSpec("C(Ac2(Ia0),Jd1(Ia0))", "A");
        assertLinkage("C", "A2", "J1", "A2");
    }

    /*
     * Cc2(A(Id0), J(Id0)) -> Cc2(Ac1(Id0), J(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test46() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(Id0),J(Id0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1(Id0),J(Id0))", "A");
        assertLinkage("C", "C2", "A1", "C2");
    }

    /*
     * Cc2(A(Ia0), J(Ia0)) -> Cc2(Ac1(Ia0), J(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C
     */
    public void test47() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(Ia0),J(Ia0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Ac1(Ia0),J(Ia0))", "A");
        assertLinkage("C", "C2", "A1", "C2");
    }

    /*
     * Cc2(A(Id0), J(Id0)) -> Cc2(A(Id0), Jd1(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test48() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(Id0),J(Id0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(A(Id0),Jd1(Id0))", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc2(A(Ia0), J(Ia0)) -> Cc2(A(Ia0), Jd1(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test49() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(A(Ia0),J(Ia0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(A(Ia0),Jd1(Ia0))", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }


    /*
     * Cc3(A(Id0), J(Id0)) -> Cc3(Ac1(Id0), Jd2(Id0))
     *
     * 0: Bridge in C
     * 1*: Inherited from A
     * 2*: Inherited default from J
     * 3: Declared in C
     */
    public void test50() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(A(Id0),J(Id0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Ac1(Id0),Jd2(Id0))", "A", "J");
        assertLinkage("C", "C3", "A1", "J2", "C3");
    }

    /*
     * Cc3(A(Ia0), J(Ia0)) -> Cc3(Ac1(Ia0), Jd2(Ia0))
     *
     * 0: Bridge in C
     * 1*: Inherited from A
     * 2*: Inherited default from J
     * 3: Declared in C
     */
    public void test51() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(A(Ia0),J(Ia0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Ac1(Ia0),Jd2(Ia0))", "A", "J");
        assertLinkage("C", "C3", "A1", "J2", "C3");
    }

    /*
     * Cc2(J(Id0), K(Id0)) -> Cc2(Jd1(Id0), K(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test52() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(J(Id0),K(Id0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Jd1(Id0),K(Id0))", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc2(J(Ia0), K(Ia0)) -> Cc2(Jd1(Ia0), K(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2: Declared in C
     */
    public void test53() throws IOException, ReflectiveOperationException {
        compileSpec("Cc2(J(Ia0),K(Ia0))");
        assertLinkage("C", "C2", LINKAGE_ERROR, "C2");
        recompileSpec("Cc2(Jd1(Ia0),K(Ia0))", "J");
        assertLinkage("C", "C2", "J1", "C2");
    }

    /*
     * Cc3(J(Id0), K(Id0)) -> Cc3(Jd1(Id0), Kd2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2*: Inherited default from K
     * 3: Declared in C
     */
    public void test54() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(J(Id0),K(Id0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Jd1(Id0),Kd2(Id0))", "J", "K");
        assertLinkage("C", "C3", "J1", "K2", "C3");
    }

    /*
     * Cc3(J(Ia0), K(Ia0)) -> Cc3(Jd1(Ia0), Kd2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited default from J
     * 2*: Inherited default from K
     * 3: Declared in C
     */
    public void test55() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(J(Ia0),K(Ia0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Jd1(Ia0),Kd2(Ia0))", "J", "K");
        assertLinkage("C", "C3", "J1", "K2", "C3");
    }

    /*
     * Cc3(Ac1(Id0), J(Id0)) -> Cc3(Ac1(Id0), Jd2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from J
     * 3: Declared in C
     */
    public void test56() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Ac1(Id0),J(Id0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Ac1(Id0),Jd2(Id0))", "J");
        assertLinkage("C", "C3", "C3", "J2", "C3");
    }

    /*
     * Cc3(Ac1(Ia0), J(Ia0)) -> Cc3(Ac1(Ia0), Jd2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from J
     * 3: Declared in C
     */
    public void test57() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Ac1(Ia0),J(Ia0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Ac1(Ia0),Jd2(Ia0))", "J");
        assertLinkage("C", "C3", "C3", "J2", "C3");
    }

    /*
     * Cc3(Aa1(Id0), J(Id0)) -> Cc3(Aa1(Id0), Jd2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from J
     * 3: Declared in C
     */
    public void test58() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Aa1(Id0),J(Id0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Aa1(Id0),Jd2(Id0))", "J");
        assertLinkage("C", "C3", "C3", "J2", "C3");
    }

    /*
     * Cc3(Aa1(Ia0), J(Ia0)) -> Cc3(Aa1(Ia0), Jd2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from J
     * 3: Declared in C
     */
    public void test59() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Aa1(Ia0),J(Ia0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Aa1(Ia0),Jd2(Ia0))", "J");
        assertLinkage("C", "C3", "C3", "J2", "C3");
    }

    /*
     * Cc3(A(Id0), Jd2(Id0)) -> Cc3(Ac1(Id0), Jd2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C (through bridge)
     * 3: Declared in C
     */
    public void test60() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(A(Id0),Jd2(Id0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, "C3", "C3");
        recompileSpec("Cc3(Ac1(Id0),Jd2(Id0))", "A");
        assertLinkage("C", "C3", "A1", "C3", "C3");
    }

    /*
     * Cc3(A(Im0), Jd2(Ia0)) -> Cc3(Ac1(Im0), Jd2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C (through bridge)
     * 3: Declared in C
     */
    public void test61() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(A(Ia0),Jd2(Ia0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, "C3", "C3");
        recompileSpec("Cc3(Ac1(Ia0),Jd2(Ia0))", "A");
        assertLinkage("C", "C3", "A1", "C3", "C3");
    }

    /*
     * Cc3(A(Im0), Ja2(Id0)) -> Cc3(Ac1(Id0), Ja2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C (through bridge)
     * 3: Declared in C
     */
    public void test62() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(A(Id0),Ja2(Id0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, "C3", "C3");
        recompileSpec("Cc3(Ac1(Id0),Ja2(Id0))", "A");
        assertLinkage("C", "C3", "A1", "C3", "C3");
    }

    /*
     * Cc3(A(Im0), Ja2(Ia0)) -> Cc3(Ac1(Ia0), Ja2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1*: Inherited from A
     * 2: Declared in C (through bridge)
     * 3: Declared in C
     */
    public void test63() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(A(Ia0),Ja2(Ia0))");
        assertLinkage("C", "C3", LINKAGE_ERROR, "C3", "C3");
        recompileSpec("Cc3(Ac1(Ia0),Ja2(Ia0))", "A");
        assertLinkage("C", "C3", "A1", "C3", "C3");
    }

    /*
     * Cc3(Jd1(Id0), K(Id0)) -> Cc3(Jd1(Id0), Kd2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from K
     * 3: Declared in C
     */
    public void test64() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Jd1(Id0),K(Id0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Jd1(Id0),Kd2(Id0))", "K");
        assertLinkage("C", "C3", "C3", "K2", "C3");
    }

    /*
     * Cc3(Jd1(Ia0), K(Ia0)) -> Cc3(Jd1(Ia0), Kd2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from K
     * 3: Declared in C
     */
    public void test65() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Jd1(Ia0),K(Ia0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Jd1(Ia0),Kd2(Ia0))", "K");
        assertLinkage("C", "C3", "C3", "K2", "C3");
    }

    /*
     * Cc3(Ja1(Id0), K(Id0)) -> Cc3(Ja1(Id0), Kd2(Id0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from K
     * 3: Declared in C
     */
    public void test66() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Jd1(Id0),K(Id0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Jd1(Id0),Kd2(Id0))", "K");
        assertLinkage("C", "C3", "C3", "K2", "C3");
    }

    /*
     * Cc3(Ja1(Ia0), K(Ia0)) -> Cc3(Ja1(Ia0), Kd2(Ia0))
     *
     * 0: Declared in C (through bridge)
     * 1: Declared in C (through bridge)
     * 2*: Inherited default from K
     * 3: Declared in C
     */
    public void test67() throws IOException, ReflectiveOperationException {
        compileSpec("Cc3(Jd1(Ia0),K(Ia0))");
        assertLinkage("C", "C3", "C3", LINKAGE_ERROR, "C3");
        recompileSpec("Cc3(Jd1(Ia0),Kd2(Ia0))", "K");
        assertLinkage("C", "C3", "C3", "K2", "C3");
    }

    // Dan's set A
    public void testA1() throws IOException, ReflectiveOperationException {
        compileSpec("C(Id0)");
        assertLinkage("C", "I0");
    }

    public void testA2() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0))");
        assertLinkage("C", "I0");
    }

    public void testA3() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0),J)");
        assertLinkage("C", "I0");
    }

    public void testA4() throws IOException, ReflectiveOperationException {
        compileSpec("D(C(Id0),Jd0(Id0))");
        assertLinkage("D", "J0");
        assertLinkage("C", "I0");
    }

    public void testA5() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0),Jd0)",
                    "compiler.err.types.incompatible.unrelated.defaults");
    }

    public void testA6() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Ia0,Jd0))",
                    "compiler.err.does.not.override.abstract",
                    "compiler.err.types.incompatible.abstract.default");
    }

    public void testA7() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Id0,Jd0))",
                    "compiler.err.types.incompatible.unrelated.defaults");
    }

    public void testA8() throws IOException, ReflectiveOperationException {
        compileSpec("C(A(Ia0),J)", "compiler.err.does.not.override.abstract");
    }

    public void testA9() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac0(Id0))");
        assertLinkage("C", "A0");
    }

    public void testA10() throws IOException, ReflectiveOperationException {
        compileSpec("C(Aa0,I)", "compiler.err.does.not.override.abstract");
    }

    public void testA11() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac0,Id0)");
        assertLinkage("C", "A0");
    }

    // Dan's set B

    /* B1 can't be done, needs a second concrete class D
    public void testB1() throws IOException, ReflectiveOperationException {
        compileSpec("Cc1(Dc0)");
        assertLinkage("C", "C1", "C1");
        assertLinkage("D", "A0", LINKAGE_ERROR);
    }
    */

    public void testB2() throws IOException, ReflectiveOperationException {
        compileSpec("Cc1(Ac0)");
        assertLinkage("C", "C1", "C1");
    }

    //??? B3 seems to suggest that we should create an abstract class
    //public void testB3() throws IOException, ReflectiveOperationException {
    //    compileSpec("Ba1(Cc0)");
    //    assertLinkage("B", "C0", "A1");
    //}

    // B4 needs too many classes

    public void testB5() throws IOException, ReflectiveOperationException {
        compileSpec("Cc1(Aa1(Id0))");
        assertLinkage("C", "C1", "C1");
    }

    public void testB6() throws IOException, ReflectiveOperationException {
        compileSpec("C(Ac1(Id0))");
        assertLinkage("C", "A1", "A1");
    }

    public void testB7() throws IOException, ReflectiveOperationException {
        compileSpec("Cc1(Id0)");
        assertLinkage("C", "C1", "C1");
    }

    public void testB8() throws IOException, ReflectiveOperationException {
        compileSpec("C(Jd1(Id0))");
        assertLinkage("C", "J1", "J1");
    }

    // B9 needs too many classes

    // The rest of Dan's tests need generics
}