dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40828
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20782: minor fixes
------------------------------------------------------------
revno: 20782
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-10-20 11:33:01 +0700
message:
minor fixes
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.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/user/UserGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java 2015-10-05 17:45:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java 2015-10-20 04:33:01 +0000
@@ -122,18 +122,11 @@
public void updateUsers( Set<User> updates )
{
- for ( User user : new HashSet<>( members ) )
- {
- if ( !updates.contains( user ) )
- {
- removeUser( user );
- }
- }
+ new HashSet<>( members ).stream()
+ .filter( user -> !updates.contains( user ) )
+ .forEach( this::removeUser );
- for ( User user : updates )
- {
- addUser( user );
- }
+ updates.forEach( this::addUser );
}
public void addManagedGroup( UserGroup group )
@@ -150,18 +143,11 @@
public void updateManagedGroups( Set<UserGroup> updates )
{
- for ( UserGroup group : new HashSet<>( managedGroups ) )
- {
- if ( !updates.contains( group ) )
- {
- removeManagedGroup( group );
- }
- }
+ new HashSet<>( managedGroups ).stream()
+ .filter( group -> !updates.contains( group ) )
+ .forEach( this::removeManagedGroup );
- for ( UserGroup group : updates )
- {
- addManagedGroup( group );
- }
+ updates.forEach( this::addManagedGroup );
}
// -------------------------------------------------------------------------