snuyanzin commented on code in PR #24868:
URL: https://github.com/apache/flink/pull/24868#discussion_r1618885971


##########
flink-core/src/main/java/org/apache/flink/api/dag/Transformation.java:
##########
@@ -638,29 +637,15 @@ public boolean equals(Object o) {
         }
 
         Transformation<?> that = (Transformation<?>) o;
-
-        if (bufferTimeout != that.bufferTimeout) {
-            return false;
-        }
-        if (id != that.id) {
-            return false;
-        }
-        if (parallelism != that.parallelism) {
-            return false;
-        }
-        if (!name.equals(that.name)) {
-            return false;
-        }
-        return outputType != null ? outputType.equals(that.outputType) : 
that.outputType == null;
+        return Objects.equals(bufferTimeout, that.bufferTimeout)
+                && Objects.equals(id, that.id)
+                && Objects.equals(parallelism, that.parallelism)
+                && Objects.equals(name, that.name)
+                && Objects.equals(outputType, that.outputType);
     }
 
     @Override
     public int hashCode() {
-        int result = id;
-        result = 31 * result + name.hashCode();
-        result = 31 * result + (outputType != null ? outputType.hashCode() : 
0);
-        result = 31 * result + parallelism;
-        result = 31 * result + (int) (bufferTimeout ^ (bufferTimeout >>> 32));
-        return result;
+        return Objects.hash(id, name, outputType, parallelism, bufferTimeout);

Review Comment:
   Not sure how critical it is here
   however it seems `Objects#hash` for more than one arg could cost more
   more details at https://bugs.openjdk.org/browse/JDK-8332840



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