Skip to content

Commit

Permalink
Fix compile error (#1004)
Browse files Browse the repository at this point in the history
KeycloakModelUtils.runJobInTransactionWithResult() method changed it
signature

Signed-off-by: Pedro Ruivo <pruivo@redhat.com>
  • Loading branch information
pruivo authored Oct 9, 2024
1 parent 3d270de commit 9fe0b03
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import org.keycloak.models.GroupProvider;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.models.KeycloakSessionTask;
import org.keycloak.models.KeycloakSessionTaskWithResult;
import org.keycloak.models.KeycloakUriInfo;
import org.keycloak.models.PasswordPolicy;
import org.keycloak.models.RealmModel;
Expand Down Expand Up @@ -251,7 +249,7 @@ private Long getGroupsCount(String realmName) {
return KeycloakModelUtils.runJobInTransactionWithResult(baseSession.getKeycloakSessionFactory(), baseSession.getContext(), session -> {
RealmModel realm = session.realms().getRealmByName(realmName);
return session.groups().getGroupsCount(realm, false);
}, false);
}, false, "dataset:get-groups-count");
}

protected Response handleDatasetException(DatasetException de) {
Expand Down Expand Up @@ -723,7 +721,7 @@ private void removeRealmsImpl(Task task, DatasetConfig config) {
realmIds.addAll(session.getProvider(RealmProvider.class).getRealmsStream()
.filter(realm -> realm.getName().startsWith(config.getRealmPrefix()))
.map(RealmModel::getId)
.collect(Collectors.toList()));
.toList());

task.info(logger, "Will delete %d realms.", realmIds.size());
} else {
Expand Down Expand Up @@ -1195,7 +1193,7 @@ private void cacheRealmAndPopulateContext(RealmContext context) {
logger.debugf("CACHE: After obtain default roles in realm %s", realm.getName());

// Just obtain first 20 clients for assign client roles - to avoid unecessary DB calls here to load all the clients and then their roles
List<ClientModel> clients = realm.getClientsStream(0, 20).collect(Collectors.toList());
List<ClientModel> clients = realm.getClientsStream(0, 20).toList();
logger.debugf("CACHE: After realm.getClients in realm %s", realm.getName());

List<RoleModel> sortedClientRoles = new ArrayList<>();
Expand All @@ -1206,7 +1204,7 @@ private void cacheRealmAndPopulateContext(RealmContext context) {
String name2 = client2.getClientId().substring(config.getClientPrefix().length());
return Integer.parseInt(name1) - Integer.parseInt(name2);
})
.collect(Collectors.toList());
.toList();

sortedClients.forEach(client -> {
// Sort client roles and add to the shared list
Expand All @@ -1219,7 +1217,7 @@ private void cacheRealmAndPopulateContext(RealmContext context) {
String name2 = role2.getName().substring(index2);
return Integer.parseInt(name1) - Integer.parseInt(name2);
})
.collect(Collectors.toList());
.toList();
sortedClientRoles.addAll(currentClientRoles);
});

Expand Down

0 comments on commit 9fe0b03

Please sign in to comment.