Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1295

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

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Minor Minor
    • 3.0.17.Final
    • 3.0.14.Final
    • None
    • None

      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());
         }
      }
      

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

              Created:
              Updated:
              Resolved: