From d847a0422e6c51cb744c81c20d80a8227d80c589 Mon Sep 17 00:00:00 2001 From: mudit-saxena Date: Wed, 29 Jan 2025 16:13:04 +0530 Subject: [PATCH] Upgrade Ambry to Java 11 --- .../java/com/github/ambry/account/AccountContainerTest.java | 1 - .../src/test/java/com/github/ambry/store/BlobStoreTest.java | 3 +-- build.gradle | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java b/ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java index 0fafdfe8d7..dd9a272b33 100644 --- a/ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java +++ b/ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java @@ -20,7 +20,6 @@ import com.github.ambry.quota.QuotaResourceType; import com.github.ambry.utils.TestUtils; import com.github.ambry.utils.Utils; -import com.sun.org.apache.xpath.internal.operations.Bool; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; diff --git a/ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java b/ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java index 229b1b222a..cf9b140a0a 100644 --- a/ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java +++ b/ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java @@ -86,7 +86,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.mockito.Mockito; -import sun.nio.ch.FileChannelImpl; import static com.github.ambry.clustermap.ClusterMapUtils.*; import static com.github.ambry.clustermap.ReplicaState.*; @@ -2977,7 +2976,7 @@ public void testTestStorageAvailability() throws Exception { // general FileDescriptor getFileDescriptorFromFileChannel(FileChannel fileChannel) throws Exception { - Field field = FileChannelImpl.class.getDeclaredField("fd"); + Field field = fileChannel.getClass().getDeclaredField("fd"); field.setAccessible(true); return (FileDescriptor) field.get(fileChannel); } diff --git a/build.gradle b/build.gradle index ea929a848c..4c34ee6723 100644 --- a/build.gradle +++ b/build.gradle @@ -48,8 +48,8 @@ subprojects { apply from: "$rootDir/gradle/java-publishing.gradle" } - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = 11 + targetCompatibility = 11 if (JavaVersion.current().java9Compatible) { // Our consumers still run on java 8, so this flag ensures that our builds are backwards compatible at runtime