adutra commented on code in PR #889: URL: https://github.com/apache/polaris/pull/889#discussion_r1931237540
########## polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java: ########## @@ -96,37 +97,40 @@ private void initializeForRealm( } @Override - public synchronized Map<String, PrincipalSecretsResult> bootstrapRealms( - List<String> realms, PolarisCredentialsBootstrap credentialsBootstrap) { - Map<String, PrincipalSecretsResult> results = new HashMap<>(); - - for (String realm : realms) { - RealmId realmId = RealmId.newRealmId(realm); - if (!metaStoreManagerMap.containsKey(realmId.id())) { - initializeForRealm(realmId, credentialsBootstrap); + public synchronized Map<RealmId, PrincipalSecretsResult> bootstrapRealms( + List<RealmId> realms, PolarisCredentialsBootstrap credentialsBootstrap) { + Map<RealmId, PrincipalSecretsResult> results = new HashMap<>(); + + for (RealmId realm : realms) { + if (!metaStoreManagerMap.containsKey(realm.id())) { + initializeForRealm(realm, credentialsBootstrap); PrincipalSecretsResult secretsResult = bootstrapServiceAndCreatePolarisPrincipalForRealm( - realmId, metaStoreManagerMap.get(realmId.id())); - results.put(realmId.id(), secretsResult); + realm, metaStoreManagerMap.get(realm.id())); + results.put(ImmutableRealmId.copyOf(realm), secretsResult); Review Comment: It's potentially a CDI bean, and these are poor choices as map keys: the CDI specs do not say anything about how CDI proxies should handle equals() and hashCode(). Such beans can have surprising effects when put in a set or a map. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org