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

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

      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: