You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lianetm (via GitHub)" <gi...@apache.org> on 2023/09/15 16:47:25 UTC

[GitHub] [kafka] lianetm commented on a diff in pull request #14391: MINOR: Implement toStringBase to avoid duplicated code

lianetm commented on code in PR #14391:
URL: https://github.com/apache/kafka/pull/14391#discussion_r1327555113


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEvent.java:
##########
@@ -21,18 +21,27 @@
  */
 abstract public class ApplicationEvent {
     public final Type type;
+    protected final String owner;
 
-    protected ApplicationEvent(Type type) {
+    protected ApplicationEvent(Type type, String owner) {

Review Comment:
   As a simplification, this is not needed I would say. We could just remove the owner var and constructor param, and leave only a simple `toStringBase` like this:
   ```
   protected String toStringBase() {
           return "owner='" + getClass().getSimpleName() + '\'' +
               ", type=" + type;
    }
   ```
   It would end up returning the simple name of the child class, which is what we want in the end. 



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org