[ 
https://issues.apache.org/jira/browse/TAPESTRY-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jun Tsai reopened TAPESTRY-1410:
--------------------------------



public class GenericsMethodSignatureImplTest extends Assert {
        public static abstract class BaseTest<T> {

        }

        public static abstract class MyTest<T, E extends BaseTest<T>> extends 
BaseTest<T> {
                
                public abstract E getRelativeObject();
                public abstract void setRelativeObject(E e);

        }

        @Test
        public void test_generic() {
                Class testClass = MyTest.class;
                Method[] methods = testClass.getMethods();
                for (Method method : methods) {
                        MethodSignatureImpl msi = new 
GenericsMethodSignatureImpl(
                                        testClass, method);
                        if (method.getName().equals("getRelativeObject")) {
                                assertEquals(msi.getReturnType(), 
Object.class); 
                        }
                }
        }
}


fail to run the test.

EXCEPTION:

java.lang.ClassCastException: 
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
        at 
org.apache.tapestry.enhance.GenericsMethodSignatureImpl.findReturnType(GenericsMethodSignatureImpl.java:57)
        at 
org.apache.tapestry.enhance.GenericsMethodSignatureImpl.<init>(GenericsMethodSignatureImpl.java:32)


> fail to test GenericsMethodSignatureImpl class.
> -----------------------------------------------
>
>                 Key: TAPESTRY-1410
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1410
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 4.1.2
>         Environment: jdk1.5
>            Reporter: Jun Tsai
>         Assigned To: Jesse Kuhnert
>            Priority: Blocker
>             Fix For: 4.1.2
>
>
> fail to test GenericsMethodSignatureImpl class.
> public class GenericsMethodSignatureImplTest {
>       public static abstract class BaseTest<T>{
>               
>       }
>       public static abstract class MyTest<T,E>extends BaseTest<T>   {
>               public abstract E getRelativeObject();
>               public abstract void setRelativeObject(E e);
>               
>       }
>       
>       @Test
>       public void test_generic() {
>               Class testClass=MyTest.class;
>               Method[] methods = testClass.getMethods();
>               for (Method method : methods) {
>                       MethodSignatureImpl msi = new 
> GenericsMethodSignatureImpl(testClass,method);
>                       msi.hashCode();
>               }
>       }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to