This is an automated email from the ASF dual-hosted git repository.

panyuepeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit f9ed1d2de96963f4c6c0431ce5ebc867f1dda1ce
Author: Yuepeng Pan <[email protected]>
AuthorDate: Thu Apr 9 20:20:42 2026 +0800

    [hotfix][test] Use Long#compare to replace equivalent statements to improve 
readability.
---
 .../apache/flink/runtime/operators/hash/CompactingHashTableTest.java    | 2 +-
 .../java/org/apache/flink/runtime/operators/hash/HashTableTest.java     | 2 +-
 .../flink/runtime/operators/hash/InPlaceMutableHashTableTest.java       | 2 +-
 .../org/apache/flink/test/manual/HashTableRecordWidthCombinations.java  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/CompactingHashTableTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/CompactingHashTableTest.java
index 61846a8afe6..757cf5d549b 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/CompactingHashTableTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/CompactingHashTableTest.java
@@ -70,7 +70,7 @@ class CompactingHashTableTest extends 
MutableHashTableTestBase {
                     public int compareToReference(Tuple2<Long, String> 
candidate) {
                         long x = ref;
                         long y = candidate.f0;
-                        return (x < y) ? -1 : ((x == y) ? 0 : 1);
+                        return Long.compare(x, y);
                     }
                 };
     }
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/HashTableTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/HashTableTest.java
index b948dae8342..3fce3955dcd 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/HashTableTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/HashTableTest.java
@@ -99,7 +99,7 @@ class HashTableTest {
                     public int compareToReference(Tuple2<Long, byte[]> 
candidate) {
                         long x = ref;
                         long y = candidate.f0;
-                        return (x < y) ? -1 : ((x == y) ? 0 : 1);
+                        return Long.compare(x, y);
                     }
                 };
     }
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTableTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTableTest.java
index 418814ff99c..3a944bac709 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTableTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTableTest.java
@@ -118,7 +118,7 @@ class InPlaceMutableHashTableTest extends 
MutableHashTableTestBase {
                     public int compareToReference(Tuple2<Long, String> 
candidate) {
                         long x = ref;
                         long y = candidate.f0;
-                        return (x < y) ? -1 : ((x == y) ? 0 : 1);
+                        return Long.compare(x, y);
                     }
                 };
     }
diff --git 
a/flink-tests/src/test/java/org/apache/flink/test/manual/HashTableRecordWidthCombinations.java
 
b/flink-tests/src/test/java/org/apache/flink/test/manual/HashTableRecordWidthCombinations.java
index 9988134755b..5cc613b351d 100644
--- 
a/flink-tests/src/test/java/org/apache/flink/test/manual/HashTableRecordWidthCombinations.java
+++ 
b/flink-tests/src/test/java/org/apache/flink/test/manual/HashTableRecordWidthCombinations.java
@@ -83,7 +83,7 @@ public class HashTableRecordWidthCombinations {
                     public int compareToReference(Tuple2<Long, byte[]> 
candidate) {
                         long x = ref;
                         long y = candidate.f0;
-                        return (x < y) ? -1 : ((x == y) ? 0 : 1);
+                        return Long.compare(x, y);
                     }
                 };
 

Reply via email to