浏览代码

jfinal 4.1 release ^_^

James 6 年之前
父节点
当前提交
b5d3eb564a

+ 6 - 7
src/main/java/com/jfinal/proxy/ProxyGenerator.java

@@ -84,6 +84,7 @@ public class ProxyGenerator {
 			
 			
 			Kv method = Kv.create();
 			Kv method = Kv.create();
 			method.set("returnType", getReturnType(m));
 			method.set("returnType", getReturnType(m));
+			method.set("returnTypeName", m.getGenericReturnType().getTypeName());
 			method.set("name", m.getName());
 			method.set("name", m.getName());
 			
 			
 			Parameter[] paras = m.getParameters();
 			Parameter[] paras = m.getParameters();
@@ -208,13 +209,11 @@ public class ProxyGenerator {
 				}
 				}
 			} else {
 			} else {
 				for (int j=0; j<bounds.length; j++) {
 				for (int j=0; j<bounds.length; j++) {
-					if (bounds[j] != Object.class) {
-						String tn = bounds[j].getTypeName();
-						if (j > 0) {
-							ret.append(" & ").append(tn);
-						} else {
-							ret.append(" extends ").append(tn);
-						}
+					String tn = bounds[j].getTypeName();
+					if (j > 0) {
+						ret.append(" & ").append(tn);
+					} else {
+						ret.append(" extends ").append(tn);
 					}
 					}
 				}
 				}
 			}
 			}

+ 1 - 1
src/main/java/com/jfinal/proxy/proxy_class_template.jf

@@ -35,7 +35,7 @@ public class #(name)#(classTypeVars) extends #(targetName)#(classTypeVars) {
 		#end
 		#end
 		
 		
 		inv.invoke();
 		inv.invoke();
-		#if (x.returnType != "void")
+		#if (x.returnTypeName != "void")
 		
 		
 		return inv.getReturnValue();
 		return inv.getReturnValue();
 		#end
 		#end