Reviewers: ,
Please review this at http://gwt-code-reviews.appspot.com/575801/show
Affected files:
user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
Index: user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
===================================================================
--- user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java (revision
8216)
+++ user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java (working copy)
@@ -32,6 +32,7 @@
import com.google.gwt.core.ext.typeinfo.JParameterizedType;
import com.google.gwt.core.ext.typeinfo.JPrimitiveType;
import com.google.gwt.core.ext.typeinfo.JType;
+import com.google.gwt.core.ext.typeinfo.JTypeParameter;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.dev.generator.NameFactory;
@@ -402,13 +403,35 @@
w.println();
// Write the method signature
- JType asyncReturnType = asyncMethod.getReturnType().getErasedType();
w.print("public ");
- w.print(asyncReturnType.getQualifiedSourceName());
+
+ // Handle any type parameters that are required
+ JTypeParameter[] asyncTypeParams = asyncMethod.getTypeParameters();
+ if (asyncTypeParams.length > 0) {
+ w.print("<");
+ }
+
+ boolean needsComma = false;
+ for (int i = 0; i < asyncTypeParams.length; ++i) {
+ JTypeParameter param = asyncTypeParams[i];
+ if (needsComma) {
+ w.print(", ");
+ } else {
+ needsComma = true;
+ }
+ w.print(param.getQualifiedSourceName());
+ }
+
+ if (asyncTypeParams.length > 0) {
+ w.print("> ");
+ }
+
+ JType asyncReturnType = asyncMethod.getReturnType();
+ w.print(asyncReturnType.getParameterizedQualifiedSourceName());
w.print(" ");
w.print(asyncMethod.getName() + "(");
- boolean needsComma = false;
+ needsComma = false;
NameFactory nameFactory = new NameFactory();
JParameter[] asyncParams = asyncMethod.getParameters();
for (int i = 0; i < asyncParams.length; ++i) {
@@ -425,9 +448,8 @@
* SerializationStreamWriter.writeObject we need a try catch block
*/
JType paramType = param.getType();
- paramType = paramType.getErasedType();
- w.print(paramType.getQualifiedSourceName());
+ w.print(paramType.getParameterizedQualifiedSourceName());
w.print(" ");
String paramName = param.getName();
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors