mjsax commented on code in PR #22612:
URL: https://github.com/apache/kafka/pull/22612#discussion_r3448881782


##########
streams/test-utils/src/main/java/org/apache/kafka/streams/test/TestRecord.java:
##########
@@ -228,14 +303,11 @@ public boolean equals(final Object o) {
             return false;
         }
         final TestRecord<?, ?> that = (TestRecord<?, ?>) o;

Review Comment:
   Should we cast to `TestRecord<K, V>` here allowing is to also use types 
generics for `equalsFields(...)` constructors?
   
   We will get an "unchecked" warning, but seems fine with me to just suppress 
it? `<?, ?>` says "we don't care about the generic types", but that's not 
really correct; we do care (even if we don't get a proper type check due to 
type erasure.



##########
streams/test-utils/src/main/java/org/apache/kafka/streams/test/TestRecord.java:
##########
@@ -228,14 +303,11 @@ public boolean equals(final Object o) {
             return false;
         }
         final TestRecord<?, ?> that = (TestRecord<?, ?>) o;
-        return Objects.equals(headers, that.headers) &&
-            Objects.equals(key, that.key) &&
-            Objects.equals(value, that.value) &&
-            Objects.equals(recordTime, that.recordTime);
+        return  equalsFields(that) && partition == that.partition;

Review Comment:
   ```suggestion
           return equalsFields(that) && partition == that.partition;
   ```



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