slfan1989 commented on code in PR #4457:
URL: https://github.com/apache/hadoop/pull/4457#discussion_r947366781


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java:
##########
@@ -663,8 +662,7 @@ private HttpServer2 checkBindAddress(String host, int port, 
boolean findPort)
     HttpServer2 server = createServer(host, port);
     try {
       // not bound, ephemeral should return requested port (0 for ephemeral)
-      List<?> listeners = (List<?>) Whitebox.getInternalState(server,
-          "listeners");
+      List<?> listeners = server.getListeners();
       ServerConnector listener = (ServerConnector)listeners.get(0);

Review Comment:
   Thank you very much for your help reviewing the code, I will modify the code.



##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java:
##########
@@ -740,8 +738,7 @@ public void testBacklogSize() throws Exception
     Configuration conf = new Configuration();
     conf.setInt(HttpServer2.HTTP_SOCKET_BACKLOG_SIZE_KEY, backlogSize);
     HttpServer2 srv = createServer("test", conf);
-    List<?> listeners = (List<?>) Whitebox.getInternalState(srv,
-            "listeners");
+    List<?> listeners = srv.getListeners();
     ServerConnector listener = (ServerConnector)listeners.get(0);

Review Comment:
   I will fix it.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to