Author: alessio.soldano(a)jboss.com
Date: 2014-01-08 08:09:49 -0500 (Wed, 08 Jan 2014)
New Revision: 597
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
Log:
[WISE-211] Properly consider @XmlElement(name=...) when getting getters from fields
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2014-01-08
13:09:39 UTC (rev 596)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2014-01-08
13:09:49 UTC (rev 597)
@@ -165,6 +165,7 @@
fieldName = refAnnotation.name();
namespace = refAnnotation.namespace();
}
+ final String xmlName = fieldName;
if (fieldName == null) {
fieldName = field.getName();
}
@@ -172,7 +173,7 @@
Object fieldValue = null;
if (obj != null) {
try {
- Method getter = cl.getMethod(ReflectionUtils.getGetter(field), (Class[]) null);
+ Method getter = cl.getMethod(ReflectionUtils.getGetter(field, xmlName), (Class[])
null);
fieldValue = getter.invoke(obj, (Object[]) null);
} catch (Exception e) {
throw new WiseRuntimeException("Error calling getter method for field " +
field, e);
Show replies by date