← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20118: minor fixes, use j8 stream s in appmanager

 

------------------------------------------------------------
revno: 20118
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-09-14 14:22:16 +0700
message:
  minor fixes, use j8 stream s in appmanager
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.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/appmanager/DefaultAppManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java	2015-08-18 20:10:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/appmanager/DefaultAppManager.java	2015-09-14 07:22:16 +0000
@@ -47,8 +47,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
+import java.util.stream.Collectors;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
@@ -98,7 +98,7 @@
     public App getApp( String key )
     {
         List<App> apps = getApps();
-        
+
         for ( App app : apps )
         {
             if ( key.equals( app.getKey() ) )
@@ -106,27 +106,14 @@
                 return app;
             }
         }
-        
+
         return null;
     }
 
     @Override
     public List<App> getAccessibleApps()
     {
-        List<App> applications = new ArrayList<>( getApps() );
-        Iterator<App> iterator = applications.iterator();
-
-        while ( iterator.hasNext() )
-        {
-            App app = iterator.next();
-
-            if ( !isAccessible( app ) )
-            {
-                iterator.remove();
-            }
-        }
-
-        return applications;
+        return getApps().stream().filter( this::isAccessible ).collect( Collectors.toList() );
     }
 
     @Override

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/webportal/module/DefaultModuleManager.java	2015-09-14 07:22:16 +0000
@@ -75,9 +75,6 @@
     @Autowired
     private AppManager appManager;
 
-    @Autowired
-    private CurrentUserService currentUserService;
-
     private ActionAccessResolver actionAccessResolver;
 
     public void setActionAccessResolver( ActionAccessResolver actionAccessResolver )