tanishq-chugh commented on code in PR #5404:
URL: https://github.com/apache/hive/pull/5404#discussion_r2048777061


##########
common/src/java/org/apache/hadoop/hive/common/jsonexplain/Vertex.java:
##########
@@ -171,13 +171,13 @@ Op extractOp(JSONObject object, Op parent) throws 
Exception {
         for (String attrName : JSONObject.getNames(attrObj)) {
           if (attrName.equals("children")) {
             Object childrenObj = attrObj.get(attrName);
-            if (childrenObj instanceof JSONObject) {
-              if (((JSONObject) childrenObj).length() != 0) {
-                children.add(extractOp((JSONObject) childrenObj, op));
+            if (childrenObj instanceof JSONObject nObject) {
+              if (nObject.length() != 0) {
+                children.add(extractOp(nObject, op));
               }
-            } else if (childrenObj instanceof JSONArray) {
-              if (((JSONArray) childrenObj).length() != 0) {
-                JSONArray array = ((JSONArray) childrenObj);
+            } else if (childrenObj instanceof JSONArray nArray) {
+              if (nArray.length() != 0) {
+                JSONArray array =nArray;

Review Comment:
   The local variable was indeed not needed here. Thanks for catching this 
@deniskuzZ. Removed in 
[3c521be](https://github.com/apache/hive/pull/5404/commits/3c521be48ade04f17ce3ee69bf588aff0ec8e34a)



-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to