Hello,
I am having trouble using the generator since its creating arguments
as arg0, arg1 as such and not like before param1, par,
Can someone help me with this bug in GWT 2.1.1
Here is the method code which i found in 2.1.1 to differ from 2.0.4
2.1.1
private void genMethod(TreeLogger logger, JMethod method, GwtLocale
locale)
throws UnableToCompleteException {
String name = method.getName();
String returnType =
method.getReturnType().getParameterizedQualifiedSourceName();
getWriter().print("public " + returnType + " " + name + "(");
JParameter[] params = method.getParameters();
for (int i = 0; i < params.length; i++) {
if (i != 0) {
getWriter().print(",");
}
if (method.isVarArgs() && i == params.length - 1) {
JArrayType arrayType = params[i].getType().isArray();
getWriter().print(
arrayType.getComponentType().getParameterizedQualifiedSourceName()
+ "... arg" + (i));
} else {
getWriter().print(
params[i].getType().getParameterizedQualifiedSourceName()
+ " arg"
+ (i));
}
}
getWriter().println(") {");
getWriter().indent();
String methodName = method.getName();
TreeLogger branch = branch(logger, "Generating method body for "
+ methodName + "()");
try {
emitMethodBody(branch, method, locale);
} catch (MissingResourceException e) {
throw logMissingResource(branch, null, e);
}
getWriter().outdent();
getWriter().println("}");
}
In 2.0.4 you may see that the getName is called.
private void genMethod(TreeLogger logger, JMethod method, GwtLocale
locale)
throws UnableToCompleteException {
String name = method.getName();
String returnType =
method.getReturnType().getParameterizedQualifiedSourceName();
getWriter().print("public " + returnType + " " + name + "(");
JParameter[] params = method.getParameters();
for (int i = 0; i < params.length; i++) {
if (i != 0) {
getWriter().print(",");
}
getWriter().print(
params[i].getType().getParameterizedQualifiedSourceName() +
" "
+ params[i].getName());
}
getWriter().println(") {");
getWriter().indent();
String methodName = method.getName();
TreeLogger branch = branch(logger, "Generating method body for "
+ methodName + "()");
try {
emitMethodBody(branch, method, locale);
} catch (MissingResourceException e) {
throw logMissingResource(branch, null, e);
}
getWriter().outdent();
getWriter().println("}");
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.