From: Manolo Carrasco Date: Mon, 16 Dec 2013 03:40:12 +0000 (-0800) Subject: Dont change name annotation names. Fixes issue #230 X-Git-Tag: gwtquery-project-1.4.3~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ba808b506a381c12a3371abcc1e59dc4889f3079;p=gwtquery.git Dont change name annotation names. Fixes issue #230 --- 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 50d609f4..717fee32 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 @@ -95,7 +95,9 @@ public class JsonBuilderGenerator extends Generator { String name = nameAnnotation != null ? nameAnnotation.value() : methName.replaceFirst("^(get|set)", ""); - name = name.substring(0, 1).toLowerCase() + name.substring(1); + if (nameAnnotation != null) { + name = name.substring(0, 1).toLowerCase() + name.substring(1); + } attrs.add(name); generateMethod(sw, method, name, treeLogger); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java index 1c70815b..e8bc27c0 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/XmlBuilderGenerator.java @@ -83,7 +83,11 @@ public class XmlBuilderGenerator extends Generator { throws UnableToCompleteException { Name nameAnnotation = method.getAnnotation(Name.class); String name = nameAnnotation != null ? nameAnnotation.value() - : method.getName().replaceFirst("^(get|set)", "").toLowerCase(); + : method.getName().replaceFirst("^(get|set)", ""); + + if (nameAnnotation != null) { + name = name.substring(0, 1).toLowerCase() + name.substring(1); + } String retType = method.getReturnType().getParameterizedQualifiedSourceName();