------------------------------------------------------------
revno: 5125
committer: Lars Helge Overland <[email protected]>
branch nick: dhis2
timestamp: Tue 2011-11-08 09:56:01 +0100
message:
  Applied patch from Jason, fixes unnecessary fallback to zero values instead 
of using nulls in org unit structure resource table generation
modified:
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.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-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2011-03-17 19:31:16 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2011-11-08 08:56:01 +0000
@@ -147,7 +147,7 @@
 
             for ( OrganisationUnit unit : units )
             {
-                List<String> structure = new ArrayList<String>();
+                List<Object> structure = new ArrayList<Object>();
 
                 structure.add( String.valueOf( unit.getId() ) );
                 structure.add( String.valueOf( level ) );
@@ -161,14 +161,14 @@
                     unit = unit.getParent();
                 }
 
-                structure.add( String.valueOf( identifiers.get( 1 ) != null ? identifiers.get( 1 ) : "0" ) ); //TODO improve
-                structure.add( String.valueOf( identifiers.get( 2 ) != null ? identifiers.get( 2 ) : "0" ) );
-                structure.add( String.valueOf( identifiers.get( 3 ) != null ? identifiers.get( 3 ) : "0" ) );
-                structure.add( String.valueOf( identifiers.get( 4 ) != null ? identifiers.get( 4 ) : "0" ) );
-                structure.add( String.valueOf( identifiers.get( 5 ) != null ? identifiers.get( 5 ) : "0" ) );
-                structure.add( String.valueOf( identifiers.get( 6 ) != null ? identifiers.get( 6 ) : "0" ) );
-                structure.add( String.valueOf( identifiers.get( 7 ) != null ? identifiers.get( 7 ) : "0" ) );
-                structure.add( String.valueOf( identifiers.get( 8 ) != null ? identifiers.get( 8 ) : "0" ) );
+                structure.add( identifiers.get( 1 ) );
+                structure.add( identifiers.get( 2 ) );
+                structure.add( identifiers.get( 3 ) );
+                structure.add( identifiers.get( 4 ) );
+                structure.add( identifiers.get( 5 ) );
+                structure.add( identifiers.get( 6 ) );
+                structure.add( identifiers.get( 7 ) );
+                structure.add( identifiers.get( 8 ) );
 
                 batchHandler.addObject( structure );
             }

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to