From 59f1d51d99722e560cc754dc2c6c69b4fe5ef178 Mon Sep 17 00:00:00 2001 From: wentch <22250530@qq.com> Date: Wed, 23 Dec 2015 15:11:49 +0800 Subject: [PATCH] --- .../src/org/redkale/convert/Factory.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/android-jdk6-redkale/src/org/redkale/convert/Factory.java b/android-jdk6-redkale/src/org/redkale/convert/Factory.java index a719860d7..e8cba848e 100644 --- a/android-jdk6-redkale/src/org/redkale/convert/Factory.java +++ b/android-jdk6-redkale/src/org/redkale/convert/Factory.java @@ -281,6 +281,28 @@ public abstract class Factory { if (type instanceof ParameterizedType) { final ParameterizedType pts = (ParameterizedType) type; clazz = (Class) (pts).getRawType(); + } else if (type instanceof TypeVariable) { // e.g. + final TypeVariable tv = (TypeVariable) type; + Class cz = tv.getBounds().length == 0 ? Object.class : null; + for (Type f : tv.getBounds()) { + if (f instanceof Class) { + cz = (Class) f; + break; + } + } + clazz = cz; + if (cz == null) throw new ConvertException("not support the type (" + type + ")"); + } else if (type instanceof WildcardType) { // e.g. + final WildcardType wt = (WildcardType) type; + Class cz = null; + for (Type f : wt.getUpperBounds()) { + if (f instanceof Class) { + cz = (Class) f; + break; + } + } + clazz = cz; + if (cz == null) throw new ConvertException("not support the type (" + type + ")"); } else if (type instanceof Class) { clazz = (Class) type; } else {