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);
}
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();