Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-4713

WildcardType support to org.jboss.resteasy.util.Types

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Minor
    • 7.0.1.CR1, 7.0.1.GA
    • None
    • REST
    • None
    • 0
    • 0% 0%
    • EAP 7.0.1

    Description

      I wind up with Unable to determine base class from Type when I use wildcard type. The support just seems to be missing from org.jboss.resteasy.util.Types.getRawType(Type) method and below is my workaround.

      public static Class<?> getRawType(Type type)
      {
            ...
            else if (type instanceof WildcardType)
            {
                WildcardType wildcardType = (WildcardType) type;
                Type[] upperBounds = wildcardType.getUpperBounds();
                if (upperBounds != null && upperBounds.length > 0) {
                    return getRawType(upperBounds[0]);
                }
            }
            throw new RuntimeException(Messages.MESSAGES.unableToDetermineBaseClass());
         }
      }
      

      Attachments

        Issue Links

          Activity

            People

              rsigal@redhat.com Ronald Sigal
              tuomas_kiviaho Tuomas Kiviaho (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: