← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1954: Improved service method performance

 

------------------------------------------------------------
revno: 1954
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Thu 2010-06-03 10:13:33 +0200
message:
  Improved service method performance
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.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-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2010-05-06 13:24:03 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2010-06-03 08:13:33 +0000
@@ -192,9 +192,15 @@
     public Collection<DataElement> getDataElementsByZeroIsSignificantAndGroup( boolean zeroIsSignificant,
         DataElementGroup dataElementGroup )
     {
-        Collection<DataElement> dataElements = getDataElementsByZeroIsSignificant( zeroIsSignificant );
+        Collection<DataElement> dataElements = new HashSet<DataElement>();
 
-        dataElements.retainAll( dataElementGroup.getMembers() );
+        for ( DataElement element : dataElementGroup.getMembers() )
+        {
+            if ( element.isZeroIsSignificant() )
+            {
+                dataElements.add( element );
+            }
+        }
 
         return dataElements;
     }
@@ -628,5 +634,4 @@
     {
         return dataElementStore.getAllGeneratedOperands( dataElements );
     }
-
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java	2010-06-03 08:13:33 +0000
@@ -130,14 +130,13 @@
     {
         if ( programStage != null )
         {
-
             DataEntryFormAssociation dataAssociation = dataEntryFormAssociationService.getDataEntryFormAssociation(
                 DataEntryFormAssociation.DATAENTRY_ASSOCIATE_PROGRAMSTAGE, programStage.getId() );
+            
             if ( dataAssociation != null )
             {
                 return dataAssociation.getDataEntryForm();
             }
-
         }
 
         return null;