Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-424

ReflectionUtils.resolveType does not work with child type not directly extending the passed type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.2-milestone-1
    • None
    • None
    • Unit
    • N/A
    • N/A

    Description

      Here is a failing test:

          private static interface TestInterface<A, B>
          {
      
          }
      
          private static interface TestInterface2<A, B> extends TestInterface<A, B>
          {
      
          }
      
          private static class TestClass<A, B> implements TestInterface2<A, B>
          {
      
          }
      
          private static class TestClass2<A> extends TestClass<A, Integer>
          {
      
          }
      
          private static class TestClass3 extends TestClass2<List<String>>
          {
      
          }
      
          @Test
          public void testResolveType()
          {
              Assert.assertEquals(new DefaultParameterizedType(ReflectionUtilsTest.class, TestInterface.class,
                  new DefaultParameterizedType(null, List.class, String.class), Integer.class), ReflectionUtils.resolveType(
                  TestInterface.class, TestClass3.class));
          }
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: