From 2067020f9c6a808362ea14f76beb4ed9973fa0af Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 8 Feb 2012 09:37:18 +0000 Subject: [PATCH] deal with enum values --- .../gwt/query/rebind/JsonBuilderGenerator.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java index ea358f90..3fcb79bf 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsonBuilderGenerator.java @@ -44,10 +44,8 @@ public class JsonBuilderGenerator extends Generator { static JClassType jsonBuilderType; static JClassType stringType; static JClassType jsType; - static JClassType listType; + static JClassType listType; static JClassType functionType; - static JClassType enumType; - public String generate(TreeLogger treeLogger, GeneratorContext generatorContext, String requestedClass) @@ -57,9 +55,8 @@ public class JsonBuilderGenerator extends Generator { jsonBuilderType = oracle.findType(JsonBuilder.class.getName()); stringType = oracle.findType(String.class.getName()); jsType = oracle.findType(JavaScriptObject.class.getName()); - listType = oracle.findType(List.class.getName()); + listType = oracle.findType(List.class.getName()); functionType = oracle.findType(Function.class.getName()); - enumType = oracle.findType(Enum.class.getName()); String t[] = generateClassName(clazz); @@ -156,10 +153,9 @@ public class JsonBuilderGenerator extends Generator { sw.println("return " + ret + ";"); } else { sw.println("return Arrays.asList(" + ret + ");"); - } - } else if (isTypeAssignableTo(method.getReturnType(), enumType)){ - sw.println("return "+method.getReturnType().getQualifiedSourceName()+".valueOf(p.getStr(\"" + name + "\"));"); - }else { + } + + } else { sw.println("System.err.println(\"JsonBuilderGenerator WARN: unknown return type " + retType + " " + ifaceName + "." + methName + "()\"); "); // We return the object because probably the user knows how to handle it -- 2.39.5