Skip to content

Commit

Permalink
Replace lambda with method reference
Browse files Browse the repository at this point in the history
  • Loading branch information
steinarb committed May 6, 2023
1 parent 30bca72 commit da08ce4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private void addRolesIfNotpresent() {
var ratatoskroles = Map.of(
RATATOSKRUSER_ROLE, "User of activitypub server ratatoskr",
RATATOSKRADMIN_ROLE, "Administrator of activitypub server ratatoskr");
Set<String> existingroles = useradmin.getRoles().stream().map(r -> r.getRolename()).collect(Collectors.toSet());
Set<String> existingroles = useradmin.getRoles().stream().map(Role::getRolename).collect(Collectors.toSet());
ratatoskroles.entrySet().stream()
.filter(r -> !existingroles.contains(r.getKey()))
.forEach(r -> useradmin.addRole(Role.with().id(-1).rolename(r.getKey()).description(r.getValue()).build()));
Expand Down

0 comments on commit da08ce4

Please sign in to comment.