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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2-milestone-1
    • Component/s: None
    • Labels:
    • Tests:
      Unit
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: