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

kezhuw pushed a commit to branch branch-3.9
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.9 by this push:
     new 22dba390aa hotfix: Fix compilation error due to java 9 List.of
22dba390aa is described below

commit 22dba390aaa3580db3485419ac3ff651d63660fc
Author: Kezhu Wang <[email protected]>
AuthorDate: Fri Sep 18 18:56:53 2026 +0800

    hotfix: Fix compilation error due to java 9 List.of
---
 .../src/test/java/org/apache/zookeeper/common/IOUtilsTest.java   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/zookeeper-server/src/test/java/org/apache/zookeeper/common/IOUtilsTest.java 
b/zookeeper-server/src/test/java/org/apache/zookeeper/common/IOUtilsTest.java
index ac6ffd7de0..42e8e0a7c7 100644
--- 
a/zookeeper-server/src/test/java/org/apache/zookeeper/common/IOUtilsTest.java
+++ 
b/zookeeper-server/src/test/java/org/apache/zookeeper/common/IOUtilsTest.java
@@ -24,6 +24,7 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import org.apache.zookeeper.ZKTestCase;
 import org.junit.jupiter.api.Test;
@@ -41,7 +42,7 @@ public void testCloseAllInOrderIgnoringNulls() throws 
IOException {
 
         IOUtils.closeAll(null, () -> closed.add(1), null, () -> closed.add(2));
 
-        assertEquals(List.of(1, 2), closed);
+        assertEquals(Arrays.asList(1, 2), closed);
     }
 
     @Test
@@ -68,7 +69,7 @@ public void 
testCloseAllPreservesFirstFailureAndSuppressesLaterFailures() {
 
         assertSame(first, failure);
         assertArrayEquals(new Throwable[]{second, third}, 
failure.getSuppressed());
-        assertEquals(List.of(1, 2, 3, 4), closed);
+        assertEquals(Arrays.asList(1, 2, 3, 4), closed);
     }
 
     @Test
@@ -85,7 +86,7 @@ public void 
testCloseAllPreservesFailureAfterSuccessfulClose() {
 
         assertSame(expected, failure);
         assertEquals(0, failure.getSuppressed().length);
-        assertEquals(List.of(1, 2), closed);
+        assertEquals(Arrays.asList(1, 2), closed);
     }
 
     @Test
@@ -104,7 +105,7 @@ public void 
testCloseAllDoesNotSuppressAnExceptionOnItself() {
 
         assertSame(expected, failure);
         assertEquals(0, failure.getSuppressed().length);
-        assertEquals(List.of(3), closed);
+        assertEquals(Arrays.asList(3), closed);
     }
 
 }

Reply via email to