From ba808b506a381c12a3371abcc1e59dc4889f3079 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Sun, 15 Dec 2013 19:40:12 -0800 Subject: [PATCH] Dont change name annotation names. Fixes issue #230 --- .../com/google/gwt/query/rebind/JsonBuilderGenerator.java | 4 +++- .../com/google/gwt/query/rebind/XmlBuilderGenerator.java | 6 +++++- 2 files changed, 8 insertions(+), 2 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 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(); -- 2.39.5