← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16254: Import, vfixed bug, validation rule expressions not imported properly

 

------------------------------------------------------------
revno: 16254
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-07-27 15:15:50 +0200
message:
  Import, vfixed bug, validation rule expressions not imported properly
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2014-07-14 05:03:38 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2014-07-27 13:15:50 +0000
@@ -252,9 +252,11 @@
 
         private Expression extractExpression( T object, String fieldName )
         {
+            Expression expression = null;
+            
             if ( ReflectionUtils.findGetterMethod( fieldName, object ) != null )
             {
-                Object expression = ReflectionUtils.invokeGetterMethod( fieldName, object );
+                expression = ReflectionUtils.invokeGetterMethod( fieldName, object );
 
                 if ( expression != null && Expression.class.isAssignableFrom( expression.getClass() ) )
                 {
@@ -262,7 +264,7 @@
                 }
             }
 
-            return null;
+            return expression;
         }
 
         private Set<DataElementOperand> extractDataElementOperands( T object, String fieldName )