← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13917: minor fix to getJacksonAlias

 

------------------------------------------------------------
revno: 13917
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-02-03 15:47:12 +0700
message:
  minor fix to getJacksonAlias
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java	2014-02-03 08:04:46 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ReflectionUtils.java	2014-02-03 08:47:12 +0000
@@ -508,16 +508,16 @@
 
         if ( xmlProperty != null )
         {
-            return xmlProperty.localName();
+            return StringUtils.isEmpty( xmlProperty.localName() ) ? fieldName : xmlProperty.localName();
         }
 
         JsonProperty jsonProperty = method.getAnnotation( JsonProperty.class );
 
         if ( jsonProperty != null )
         {
-            return jsonProperty.value();
+            return StringUtils.isEmpty( jsonProperty.value() ) ? fieldName : jsonProperty.value();
         }
 
-        return null;
+        return fieldName;
     }
 }