=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java 2015-10-08 14:59:36 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java 2015-10-08 15:04:40 +0000 @@ -313,25 +313,15 @@ } /** - * Returns a mapping between the uid and the name of the given identifiable - * objects. + * Returns a mapping between the uid and the display name of the given + * identifiable objects. * * @param objects the identifiable objects. - * @return mapping between the uid and the name of the given objects. + * @return mapping between the uid and the display name of the given objects. */ public static Map getUidNameMap( Collection objects ) - { - Map map = new HashMap<>(); - - if ( objects != null ) - { - for ( IdentifiableObject object : objects ) - { - map.put( object.getUid(), object.getDisplayName() ); - } - } - - return map; + { + return objects.stream().collect( Collectors.toMap( IdentifiableObject::getUid, IdentifiableObject::getDisplayName ) ); } /**