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


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/JerseyTestBase.java:
##########
@@ -40,6 +40,6 @@ public void setUp() throws Exception {
   }
 
   public final WebTarget targetWithJsonObject() {
-    return target().register(new JettisonObjectProvider.App());
+    return target();

Review Comment:
   We introduced `targetWithJsonObject()` mainly to keep compatibility with 
existing calls, such as those in the `MapReduce` and `NodeManager` modules, 
which still use:
   
   ```
   response.readEntity(JSONObject.class);
   ```
   
   Without this method, we would have to change it to:
   
   ```
   String res = response.readEntity(String.class);
   JSONObject jsonObject = new JSONObject(res);
   ```
   
   That would affect other modules and make the code less consistent, so 
keeping the original interface is a safer choice.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to