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

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


The following commit(s) were added to refs/heads/master by this push:
     new 65f0af09fa7 HDDS-14445. Remove dependency on jetty-util-ajax (#9643)
65f0af09fa7 is described below

commit 65f0af09fa7c65fa00d7df06f232159f61edde98
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Tue Jan 20 14:30:06 2026 +0100

    HDDS-14445. Remove dependency on jetty-util-ajax (#9643)
---
 hadoop-hdds/framework/pom.xml                      |  5 ----
 .../hadoop/hdds/conf/TestHddsConfServlet.java      | 29 +++++++++++-----------
 pom.xml                                            |  5 ----
 3 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/hadoop-hdds/framework/pom.xml b/hadoop-hdds/framework/pom.xml
index 27654930c41..5d252a33051 100644
--- a/hadoop-hdds/framework/pom.xml
+++ b/hadoop-hdds/framework/pom.xml
@@ -334,11 +334,6 @@
         </exclusion>
       </exclusions>
     </dependency>
-    <dependency>
-      <groupId>org.eclipse.jetty</groupId>
-      <artifactId>jetty-util-ajax</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
diff --git 
a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/conf/TestHddsConfServlet.java
 
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/conf/TestHddsConfServlet.java
index 99ab4599b29..85bb5e0cf85 100644
--- 
a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/conf/TestHddsConfServlet.java
+++ 
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/conf/TestHddsConfServlet.java
@@ -25,6 +25,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.fasterxml.jackson.databind.JsonNode;
 import com.google.common.base.Strings;
 import java.io.PrintWriter;
 import java.io.StringReader;
@@ -39,10 +40,10 @@
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import org.apache.hadoop.hdds.JsonTestUtils;
+import org.apache.hadoop.hdds.server.JsonUtils;
 import org.apache.hadoop.hdds.server.http.HttpServer2;
 import org.apache.hadoop.hdds.utils.HttpServletUtils;
 import org.apache.hadoop.util.XMLUtils;
-import org.eclipse.jetty.util.ajax.JSON;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.w3c.dom.Document;
@@ -103,7 +104,6 @@ public void testGetPropertyWithCmd() throws Exception {
   }
 
   @Test
-  @SuppressWarnings("unchecked")
   public void testWriteJson() throws Exception {
     StringWriter sw = new StringWriter();
     PrintWriter pw = new PrintWriter(sw);
@@ -111,19 +111,18 @@ public void testWriteJson() throws Exception {
     when(response.getWriter()).thenReturn(pw);
 
     OzoneConfiguration conf = getTestConf();
-    HttpServletUtils.writeResponse(response, 
HttpServletUtils.ResponseFormat.JSON, (out) -> {
-      OzoneConfiguration.dumpConfiguration(conf, null, out);
-    }, IllegalArgumentException.class);
+    HttpServletUtils.writeResponse(response, 
HttpServletUtils.ResponseFormat.JSON,
+        out -> OzoneConfiguration.dumpConfiguration(conf, null, out),
+        IllegalArgumentException.class);
 
     String json = sw.toString();
     boolean foundSetting = false;
-    Object parsed = JSON.parse(json);
-    Object[] properties = ((Map<String, Object[]>) parsed).get("properties");
-    for (Object o : properties) {
-      Map<String, Object> propertyInfo = (Map<String, Object>) o;
-      String key = (String) propertyInfo.get("key");
-      String val = (String) propertyInfo.get("value");
-      String resource = (String) propertyInfo.get("resource");
+    JsonNode parsed = JsonUtils.readTree(json);
+    JsonNode properties = parsed.path("properties");
+    for (JsonNode propertyInfo : properties) {
+      String key = propertyInfo.path("key").asText();
+      String val = propertyInfo.path("value").asText();
+      String resource = propertyInfo.path("resource").asText();
       if (TEST_KEY.equals(key) && TEST_VAL.equals(val)
           && "programmatically".equals(resource)) {
         foundSetting = true;
@@ -140,9 +139,9 @@ public void testWriteXml() throws Exception {
     when(response.getWriter()).thenReturn(pw);
 
     OzoneConfiguration conf = getTestConf();
-    HttpServletUtils.writeResponse(response, 
HttpServletUtils.ResponseFormat.XML, (out) -> {
-      conf.writeXml(null, out);
-    }, IllegalArgumentException.class);
+    HttpServletUtils.writeResponse(response, 
HttpServletUtils.ResponseFormat.XML,
+        out -> conf.writeXml(null, out),
+        IllegalArgumentException.class);
 
     String xml = sw.toString();
 
diff --git a/pom.xml b/pom.xml
index e5859829c4a..483591ea13f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1442,11 +1442,6 @@
         <artifactId>jetty-util</artifactId>
         <version>${jetty.version}</version>
       </dependency>
-      <dependency>
-        <groupId>org.eclipse.jetty</groupId>
-        <artifactId>jetty-util-ajax</artifactId>
-        <version>${jetty.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-webapp</artifactId>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to