KEYCLOAK-15199 Use stream variant method in jpa/RoleAdapter.getFirstAttribute

This commit is contained in:
Martin Kanis 2020-09-17 10:12:23 +02:00 committed by Hynek Mlnařík
parent 3fd6f0ce10
commit f037dabdc1

View file

@ -158,13 +158,7 @@ public class RoleAdapter implements RoleModel, JpaModel<RoleEntity> {
@Override @Override
public String getFirstAttribute(String name) { public String getFirstAttribute(String name) {
for (RoleAttributeEntity attribute : role.getAttributes()) { return getAttributeStream(name).findFirst().orElse(null);
if (attribute.getName().equals(name)) {
return attribute.getValue();
}
}
return null;
} }
@Override @Override