Lines 3528-3531
Link Here
|
3528 |
}, |
3528 |
}, |
3529 |
"SUCCESS"); |
3529 |
"SUCCESS"); |
3530 |
} |
3530 |
} |
|
|
3531 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302358 |
3532 |
public void test081() { |
3533 |
this.runConformTest( |
3534 |
new String[] { |
3535 |
"C.java", |
3536 |
"class A<ModelType extends D, ValueType> implements I<ModelType, ValueType> {\n" + |
3537 |
" public void doSet(ModelType valueGetter) {\n" + |
3538 |
" this.set((ValueType) valueGetter.getObject());\n" + |
3539 |
" }\n" + |
3540 |
" public void set(Object object) {\n" + |
3541 |
" System.out.println(\"In A.set(Object)\");\n" + |
3542 |
" }\n" + |
3543 |
"}\n" + |
3544 |
"class B extends A<E, CharSequence> {\n" + |
3545 |
" public void set(CharSequence string) {\n" + |
3546 |
" System.out.println(\"In B.set(CharSequence)\");\n" + |
3547 |
" }\n" + |
3548 |
"}\n" + |
3549 |
"public class C extends B {\n" + |
3550 |
" static public void main(String[] args) {\n" + |
3551 |
" C c = new C();\n" + |
3552 |
" c.run();\n" + |
3553 |
" }\n" + |
3554 |
" public void run() {\n" + |
3555 |
" E e = new E<String>(String.class);\n" + |
3556 |
" this.doSet(e);\n" + |
3557 |
" }\n" + |
3558 |
"}\n" + |
3559 |
"class D {\n" + |
3560 |
" public Object getObject() {\n" + |
3561 |
" return null;\n" + |
3562 |
" }\n" + |
3563 |
"}\n" + |
3564 |
"class E<Type extends CharSequence> extends D {\n" + |
3565 |
" private Class<Type> typeClass;\n" + |
3566 |
" public E(Class<Type> typeClass) {\n" + |
3567 |
" this.typeClass = typeClass;\n" + |
3568 |
" }\n" + |
3569 |
" public Type getObject() {\n" + |
3570 |
" try {\n" + |
3571 |
" return (Type) typeClass.newInstance();\n" + |
3572 |
" } catch (Exception e) {\n" + |
3573 |
" throw new RuntimeException(e);\n" + |
3574 |
" }\n" + |
3575 |
" }\n" + |
3576 |
"}\n" + |
3577 |
"interface I<ModelType, ValueType> {\n" + |
3578 |
" public void doSet(ModelType model);\n" + |
3579 |
" public void set(ValueType value);\n" + |
3580 |
"}\n" |
3581 |
|
3582 |
}, |
3583 |
"In B.set(CharSequence)"); |
3584 |
} |
3585 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302358 |
3586 |
public void test082() { |
3587 |
this.runConformTest( |
3588 |
new String[] { |
3589 |
"C.java", |
3590 |
"class A<ModelType extends D, ValueType> extends I<ModelType, ValueType> {\n" + |
3591 |
" public void doSet(ModelType valueGetter) {\n" + |
3592 |
" this.set((ValueType) valueGetter.getObject());\n" + |
3593 |
" }\n" + |
3594 |
" public void set(Object object) {\n" + |
3595 |
" System.out.println(\"In A.set(Object)\");\n" + |
3596 |
" }\n" + |
3597 |
"}\n" + |
3598 |
"class B extends A<E, CharSequence> {\n" + |
3599 |
" public void set(CharSequence string) {\n" + |
3600 |
" System.out.println(\"In B.set(CharSequence)\");\n" + |
3601 |
" }\n" + |
3602 |
"}\n" + |
3603 |
"public class C extends B {\n" + |
3604 |
" static public void main(String[] args) {\n" + |
3605 |
" C c = new C();\n" + |
3606 |
" c.run();\n" + |
3607 |
" }\n" + |
3608 |
" public void run() {\n" + |
3609 |
" E e = new E<String>(String.class);\n" + |
3610 |
" this.doSet(e);\n" + |
3611 |
" }\n" + |
3612 |
"}\n" + |
3613 |
"class D {\n" + |
3614 |
" public Object getObject() {\n" + |
3615 |
" return null;\n" + |
3616 |
" }\n" + |
3617 |
"}\n" + |
3618 |
"class E<Type extends CharSequence> extends D {\n" + |
3619 |
" private Class<Type> typeClass;\n" + |
3620 |
" public E(Class<Type> typeClass) {\n" + |
3621 |
" this.typeClass = typeClass;\n" + |
3622 |
" }\n" + |
3623 |
" public Type getObject() {\n" + |
3624 |
" try {\n" + |
3625 |
" return (Type) typeClass.newInstance();\n" + |
3626 |
" } catch (Exception e) {\n" + |
3627 |
" throw new RuntimeException(e);\n" + |
3628 |
" }\n" + |
3629 |
" }\n" + |
3630 |
"}\n" + |
3631 |
"abstract class I<ModelType, ValueType> {\n" + |
3632 |
" public abstract void doSet(ModelType model);\n" + |
3633 |
" public abstract void set(ValueType value);\n" + |
3634 |
"}\n" |
3635 |
|
3636 |
}, |
3637 |
"In B.set(CharSequence)"); |
3638 |
} |
3639 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302358 |
3640 |
public void test083() { |
3641 |
this.runConformTest( |
3642 |
new String[] { |
3643 |
"C.java", |
3644 |
"class A<ModelType extends D, ValueType> implements I<ModelType, ValueType> {\n" + |
3645 |
" public void doSet(ModelType valueGetter) {\n" + |
3646 |
" this.set((ValueType) valueGetter.getObject());\n" + |
3647 |
" }\n" + |
3648 |
" public void set(Object object) {\n" + |
3649 |
" System.out.println(\"In A.set(Object)\");\n" + |
3650 |
" }\n" + |
3651 |
"}\n" + |
3652 |
"class B extends A<E, CharSequence> implements I<E, CharSequence> {\n" + |
3653 |
" public void set(CharSequence string) {\n" + |
3654 |
" System.out.println(\"In B.set(CharSequence)\");\n" + |
3655 |
" }\n" + |
3656 |
"}\n" + |
3657 |
"public class C extends B {\n" + |
3658 |
" static public void main(String[] args) {\n" + |
3659 |
" C c = new C();\n" + |
3660 |
" c.run();\n" + |
3661 |
" }\n" + |
3662 |
" public void run() {\n" + |
3663 |
" E e = new E<String>(String.class);\n" + |
3664 |
" this.doSet(e);\n" + |
3665 |
" }\n" + |
3666 |
"}\n" + |
3667 |
"class D {\n" + |
3668 |
" public Object getObject() {\n" + |
3669 |
" return null;\n" + |
3670 |
" }\n" + |
3671 |
"}\n" + |
3672 |
"class E<Type extends CharSequence> extends D {\n" + |
3673 |
" private Class<Type> typeClass;\n" + |
3674 |
" public E(Class<Type> typeClass) {\n" + |
3675 |
" this.typeClass = typeClass;\n" + |
3676 |
" }\n" + |
3677 |
" public Type getObject() {\n" + |
3678 |
" try {\n" + |
3679 |
" return (Type) typeClass.newInstance();\n" + |
3680 |
" } catch (Exception e) {\n" + |
3681 |
" throw new RuntimeException(e);\n" + |
3682 |
" }\n" + |
3683 |
" }\n" + |
3684 |
"}\n" + |
3685 |
"interface I<ModelType, ValueType> {\n" + |
3686 |
" public void doSet(ModelType model);\n" + |
3687 |
" public void set(ValueType value);\n" + |
3688 |
"}\n" |
3689 |
|
3690 |
}, |
3691 |
"In B.set(CharSequence)"); |
3692 |
} |
3693 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302358 |
3694 |
public void test084() { |
3695 |
this.runConformTest( |
3696 |
new String[] { |
3697 |
"C.java", |
3698 |
"abstract class A<ModelType extends D, ValueType> implements I<ModelType, ValueType> {\n" + |
3699 |
" public void doSet(ModelType valueGetter) {\n" + |
3700 |
" this.set((ValueType) valueGetter.getObject());\n" + |
3701 |
" }\n" + |
3702 |
" public void set(Object object) {\n" + |
3703 |
" System.out.println(\"In A.set(Object)\");\n" + |
3704 |
" }\n" + |
3705 |
"}\n" + |
3706 |
"class B extends A<E, CharSequence> {\n" + |
3707 |
"}\n" + |
3708 |
"public class C extends B {\n" + |
3709 |
" static public void main(String[] args) {\n" + |
3710 |
" C c = new C();\n" + |
3711 |
" c.run();\n" + |
3712 |
" }\n" + |
3713 |
" public void run() {\n" + |
3714 |
" E e = new E<String>(String.class);\n" + |
3715 |
" this.doSet(e);\n" + |
3716 |
" }\n" + |
3717 |
"}\n" + |
3718 |
"class D {\n" + |
3719 |
" public Object getObject() {\n" + |
3720 |
" return null;\n" + |
3721 |
" }\n" + |
3722 |
"}\n" + |
3723 |
"class E<Type extends CharSequence> extends D {\n" + |
3724 |
" private Class<Type> typeClass;\n" + |
3725 |
" public E(Class<Type> typeClass) {\n" + |
3726 |
" this.typeClass = typeClass;\n" + |
3727 |
" }\n" + |
3728 |
" public Type getObject() {\n" + |
3729 |
" try {\n" + |
3730 |
" return (Type) typeClass.newInstance();\n" + |
3731 |
" } catch (Exception e) {\n" + |
3732 |
" throw new RuntimeException(e);\n" + |
3733 |
" }\n" + |
3734 |
" }\n" + |
3735 |
"}\n" + |
3736 |
"interface I<ModelType, ValueType> {\n" + |
3737 |
" public void doSet(ModelType model);\n" + |
3738 |
" public void set(ValueType value);\n" + |
3739 |
"}\n" |
3740 |
|
3741 |
}, |
3742 |
"In A.set(Object)"); |
3743 |
} |
3744 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302358 |
3745 |
public void test085() { |
3746 |
this.runConformTest( |
3747 |
new String[] { |
3748 |
"C.java", |
3749 |
"class A<ModelType extends D, ValueType> implements I<ModelType, ValueType> {\n" + |
3750 |
" public void doSet(ModelType valueGetter) {\n" + |
3751 |
" this.set((ValueType) valueGetter.getObject());\n" + |
3752 |
" }\n" + |
3753 |
" public void set(Object object) {\n" + |
3754 |
" System.out.println(\"In A.set(Object)\");\n" + |
3755 |
" }\n" + |
3756 |
"}\n" + |
3757 |
"class B extends A<E, CharSequence> {\n" + |
3758 |
"}\n" + |
3759 |
"public class C extends B {\n" + |
3760 |
" static public void main(String[] args) {\n" + |
3761 |
" C c = new C();\n" + |
3762 |
" c.run();\n" + |
3763 |
" }\n" + |
3764 |
" public void run() {\n" + |
3765 |
" E e = new E<String>(String.class);\n" + |
3766 |
" this.doSet(e);\n" + |
3767 |
" }\n" + |
3768 |
"}\n" + |
3769 |
"class D {\n" + |
3770 |
" public Object getObject() {\n" + |
3771 |
" return null;\n" + |
3772 |
" }\n" + |
3773 |
"}\n" + |
3774 |
"class E<Type extends CharSequence> extends D {\n" + |
3775 |
" private Class<Type> typeClass;\n" + |
3776 |
" public E(Class<Type> typeClass) {\n" + |
3777 |
" this.typeClass = typeClass;\n" + |
3778 |
" }\n" + |
3779 |
" public Type getObject() {\n" + |
3780 |
" try {\n" + |
3781 |
" return (Type) typeClass.newInstance();\n" + |
3782 |
" } catch (Exception e) {\n" + |
3783 |
" throw new RuntimeException(e);\n" + |
3784 |
" }\n" + |
3785 |
" }\n" + |
3786 |
"}\n" + |
3787 |
"interface I<ModelType, ValueType> {\n" + |
3788 |
" public void doSet(ModelType model);\n" + |
3789 |
" public void set(ValueType value);\n" + |
3790 |
"}\n" |
3791 |
|
3792 |
}, |
3793 |
"In A.set(Object)"); |
3794 |
} |
3795 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302358 |
3796 |
public void test086() { |
3797 |
this.runConformTest( |
3798 |
new String[] { |
3799 |
"C.java", |
3800 |
"class A<ModelType extends D, ValueType> {\n" + |
3801 |
" public void doSet(ModelType valueGetter) {\n" + |
3802 |
" this.set((ValueType) valueGetter.getObject());\n" + |
3803 |
" }\n" + |
3804 |
" public void set(Object object) {\n" + |
3805 |
" System.out.println(\"In A.set(Object)\");\n" + |
3806 |
" }\n" + |
3807 |
"}\n" + |
3808 |
"class B extends A<E, CharSequence> {\n" + |
3809 |
" public void set(CharSequence string) {\n" + |
3810 |
" System.out.println(\"In B.set(CharSequence)\");\n" + |
3811 |
" }\n" + |
3812 |
"}\n" + |
3813 |
"public class C extends B {\n" + |
3814 |
" static public void main(String[] args) {\n" + |
3815 |
" C c = new C();\n" + |
3816 |
" c.run();\n" + |
3817 |
" }\n" + |
3818 |
" public void run() {\n" + |
3819 |
" E e = new E<String>(String.class);\n" + |
3820 |
" this.doSet(e);\n" + |
3821 |
" }\n" + |
3822 |
"}\n" + |
3823 |
"class D {\n" + |
3824 |
" public Object getObject() {\n" + |
3825 |
" return null;\n" + |
3826 |
" }\n" + |
3827 |
"}\n" + |
3828 |
"class E<Type extends CharSequence> extends D {\n" + |
3829 |
" private Class<Type> typeClass;\n" + |
3830 |
" public E(Class<Type> typeClass) {\n" + |
3831 |
" this.typeClass = typeClass;\n" + |
3832 |
" }\n" + |
3833 |
" public Type getObject() {\n" + |
3834 |
" try {\n" + |
3835 |
" return (Type) typeClass.newInstance();\n" + |
3836 |
" } catch (Exception e) {\n" + |
3837 |
" throw new RuntimeException(e);\n" + |
3838 |
" }\n" + |
3839 |
" }\n" + |
3840 |
"}\n" + |
3841 |
"interface I<ModelType, ValueType> {\n" + |
3842 |
" public void doSet(ModelType model);\n" + |
3843 |
" public void set(ValueType value);\n" + |
3844 |
"}\n" |
3845 |
|
3846 |
}, |
3847 |
"In A.set(Object)"); |
3848 |
} |
3531 |
} |
3849 |
} |