JimmyWang6 commented on code in PR #20783:
URL: https://github.com/apache/kafka/pull/20783#discussion_r2689212142
##########
server/src/main/java/org/apache/kafka/network/Session.java:
##########
@@ -21,14 +21,8 @@
import java.net.InetAddress;
-public class Session {
- public final KafkaPrincipal principal;
- public final InetAddress clientAddress;
- public final String sanitizedUser;
-
- public Session(KafkaPrincipal principal, InetAddress clientAddress) {
- this.principal = principal;
- this.clientAddress = clientAddress;
- this.sanitizedUser = Sanitizer.sanitize(principal.getName());
+public record Session(KafkaPrincipal principal, InetAddress clientAddress) {
+ public String sanitizedUser() {
+ return Sanitizer.sanitize(principal.getName());
Review Comment:
That's a great point, I've updated the code and thanks for catching that!
--
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]