pvary commented on code in PR #539:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/539#discussion_r1120839501


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/diff/DiffResult.java:
##########
@@ -59,18 +63,48 @@ public String toString() {
             return "";
         }
 
-        final ToStringBuilder lhsBuilder =
-                new ToStringBuilder(left, ToStringStyle.SHORT_PREFIX_STYLE);
-        final ToStringBuilder rhsBuilder =
-                new ToStringBuilder(right, ToStringStyle.SHORT_PREFIX_STYLE);
+        final StringBuilder builder = new StringBuilder();
+        builder.append(left.getClass().getSimpleName()).append("[");
 
         diffList.forEach(
                 diff -> {
-                    lhsBuilder.append(diff.getFieldName(), diff.getLeft());
-                    rhsBuilder.append(diff.getFieldName(), diff.getRight());
+                    try {
+                        JsonNode before =
+                                objectMapper.readTree(
+                                        
objectMapper.writeValueAsString(diff.getLeft()));
+                        JsonNode after =
+                                objectMapper.readTree(
+                                        
objectMapper.writeValueAsString(diff.getRight()));
+                        JsonNode jsonDiff = JsonDiff.asJson(before, after);
+                        jsonDiff.forEach(
+                                row -> {

Review Comment:
   Again, I am not sure what part do you think would merit its own method?
   The block should be quite easy to understand, just an if statement with a 
bunch of append statements.
   I am not sure that putting it into a method would help with readability



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

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

Reply via email to