← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20278: minor changes to object bridge

 

------------------------------------------------------------
revno: 20278
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-22 12:03:02 +0700
message:
  minor changes to object bridge
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.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-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2015-09-16 14:49:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2015-09-22 05:03:02 +0000
@@ -37,15 +37,12 @@
 
 /**
  * @author Abyot Asalefew Gizaw
- * @version $Id$
  */
 public interface TrackedEntityInstanceStore
     extends GenericIdentifiableObjectStore<TrackedEntityInstance>
 {
     String ID = TrackedEntityInstanceStore.class.getName();
 
-    int MAX_RESULTS = 50000;
-
     int countTrackedEntityInstances( TrackedEntityInstanceQueryParams params );
 
     List<TrackedEntityInstance> getTrackedEntityInstances( TrackedEntityInstanceQueryParams params );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2015-09-13 21:54:23 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2015-09-22 05:03:02 +0000
@@ -61,6 +61,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -131,11 +132,7 @@
     {
         registeredTypes.add( PeriodType.class );
         registeredTypes.add( UserCredentials.class );
-
-        for ( Schema schema : schemaService.getMetadataSchemas() )
-        {
-            registeredTypes.add( schema.getKlass() );
-        }
+        registeredTypes.addAll( schemaService.getMetadataSchemas().stream().map( Schema::getKlass ).collect( Collectors.toList() ) );
     }
 
     @Override
@@ -286,13 +283,9 @@
         {
             Collection<UserCredentials> allUserCredentials = userService.getAllUserCredentials();
 
-            for ( UserCredentials userCredentials : allUserCredentials )
-            {
-                if ( userCredentials.getUsername() != null )
-                {
-                    usernameMap.put( userCredentials.getUsername(), userCredentials );
-                }
-            }
+            allUserCredentials.stream().filter( userCredentials -> userCredentials.getUsername() != null ).forEach( userCredentials -> {
+                usernameMap.put( userCredentials.getUsername(), userCredentials );
+            } );
         }
     }