diff --git a/core/src/main/java/org/apache/shiro/realm/text/TextConfigurationRealm.java b/core/src/main/java/org/apache/shiro/realm/text/TextConfigurationRealm.java index 84c74b62bd..0439f93bb1 100644 --- a/core/src/main/java/org/apache/shiro/realm/text/TextConfigurationRealm.java +++ b/core/src/main/java/org/apache/shiro/realm/text/TextConfigurationRealm.java @@ -148,8 +148,9 @@ protected void processRoleDefinitions(Map roleDefs) { if (roleDefs == null || roleDefs.isEmpty()) { return; } - for (String rolename : roleDefs.keySet()) { - String value = roleDefs.get(rolename); + for (Map.Entry entry : roleDefs.entrySet()) { + String rolename = entry.getKey(); + String value = entry.getValue(); SimpleRole role = getRole(rolename); if (role == null) { @@ -177,9 +178,9 @@ protected void processUserDefinitions(Map userDefs) { if (userDefs == null || userDefs.isEmpty()) { return; } - for (String username : userDefs.keySet()) { - - String value = userDefs.get(username); + for (Map.Entry entry : userDefs.entrySet()) { + String username = entry.getKey(); + String value = entry.getValue(); String[] passwordAndRolesArray = StringUtils.split(value);