wise SVN: r597 - webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement.
by wise-commits@lists.jboss.org
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);
10 years, 11 months
wise SVN: r596 - in core/trunk/core/src/main/java/org/jboss/wise: tree/impl and 1 other directory.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2014-01-08 08:09:39 -0500 (Wed, 08 Jan 2014)
New Revision: 596
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java
core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
Log:
[WISE-211] Properly consider @XmlElement(name=...) when getting getters from fields
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java 2014-01-08 13:07:54 UTC (rev 595)
+++ core/trunk/core/src/main/java/org/jboss/wise/core/utils/ReflectionUtils.java 2014-01-08 13:09:39 UTC (rev 596)
@@ -91,12 +91,12 @@
* @param field
* @return String
*/
- public static String getGetter( Field field ) {
- Class cl = field.getType();
+ public static String getGetter( Field field, String xmlName ) {
+ Class<?> cl = field.getType();
if (cl.isPrimitive()) {
cl = JavaUtils.getWrapperType(cl);
}
- String cap = JavaUtils.capitalize(field.getName());
- return cl.getName().equalsIgnoreCase("java.lang.Boolean") ? "is" + cap : "get" + cap;
+ final String m = xmlName != null ? xmlName : JavaUtils.capitalize(field.getName());
+ return cl.getName().equalsIgnoreCase("java.lang.Boolean") ? "is" + m : "get" + m;
}
}
Modified: core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2014-01-08 13:07:54 UTC (rev 595)
+++ core/trunk/core/src/main/java/org/jboss/wise/tree/impl/ElementBuilderImpl.java 2014-01-08 13:09:39 UTC (rev 596)
@@ -163,6 +163,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);
10 years, 11 months
wise SVN: r595 - core/trunk/integration-testsuite.
by wise-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2014-01-08 08:07:54 -0500 (Wed, 08 Jan 2014)
New Revision: 595
Modified:
core/trunk/integration-testsuite/pom.xml
Log:
Use latest WFLY for testing
Modified: core/trunk/integration-testsuite/pom.xml
===================================================================
--- core/trunk/integration-testsuite/pom.xml 2013-10-14 14:58:56 UTC (rev 594)
+++ core/trunk/integration-testsuite/pom.xml 2014-01-08 13:07:54 UTC (rev 595)
@@ -171,7 +171,7 @@
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-webservices-tests-integration</artifactId>
- <version>8.0.0.Beta1</version>
+ <version>8.0.0.CR1</version>
<exclusions>
<exclusion>
<groupId>org.wildfly</groupId>
10 years, 11 months