philipnee commented on code in PR #16724:
URL: https://github.com/apache/kafka/pull/16724#discussion_r1697480402


##########
clients/src/main/java/org/apache/kafka/common/security/authenticator/LoginManager.java:
##########
@@ -55,13 +59,17 @@ public class LoginManager {
     private int refCount;
 
     private LoginManager(JaasContext jaasContext, String saslMechanism, 
Map<String, ?> configs,
-                         LoginMetadata<?> loginMetadata) throws LoginException 
{
+                 LoginMetadata<?> loginMetadata) throws LoginException {
         this.loginMetadata = loginMetadata;
         this.login = Utils.newInstance(loginMetadata.loginClass);
         loginCallbackHandler = 
Utils.newInstance(loginMetadata.loginCallbackClass);
         loginCallbackHandler.configure(configs, saslMechanism, 
jaasContext.configurationEntries());
         login.configure(configs, jaasContext.name(), 
jaasContext.configuration(), loginCallbackHandler);
-        login.login();
+        try (AutoCloseable loginResources = this::closeResources) {

Review Comment:
   I was wondering about that, i think that's a sounded suggestion.



-- 
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]

Reply via email to