gemmellr commented on code in PR #6205:
URL: https://github.com/apache/artemis/pull/6205#discussion_r2763806144
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java:
##########
@@ -1040,6 +1040,20 @@ public void addJaasConfig(JaasAppConfiguration config) {
jaasConfigs.put(config.getName(), config);
}
+ @Override
+ public Configuration setJaasConfigs(Map<String, JaasAppConfiguration>
configs) {
+ jaasConfigs.putAll(configs);
+ // prune removed entries after update to retain existing entries, this
is live config referenced by jaas
+ // see
org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.getAppConfigurationEntry
+ for (Iterator<String> iterator = jaasConfigs.keySet().iterator();
iterator.hasNext();) {
+ String entry = iterator.next();
+ if (!configs.containsKey(entry)) {
+ iterator.remove();
+ }
+ }
Review Comment:
I agree with Tim that this method seems questionable as a setter.
That said, depending on what else is using/modifying it (which seems like
should not be allowed concurrently..maybe synchronized method?), something like
`jaasConfigs.keySet().retainAll(configs);` would seem equivalent to this.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]