markap14 commented on code in PR #8132:
URL: https://github.com/apache/nifi/pull/8132#discussion_r1419434681


##########
nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/WriteJsonResult.java:
##########
@@ -173,9 +175,12 @@ private void writeRecord(final Record record, final 
RecordSchema writeSchema, fi
             final SerializedForm form = serializedForm.get();
             if (form.getMimeType().equals(getMimeType()) && 
record.getSchema().equals(writeSchema)) {
                 final Object serialized = form.getSerialized();
-                if (serialized instanceof String) {
-                    generator.writeRawValue((String) serialized);
-                    return;
+                if (serialized instanceof final String serializedString) {
+                    final boolean serializedPretty = 
serializedString.contains("\n");
+                    if (serializedPretty == this.prettyPrint) {

Review Comment:
   These are not equivalent. I'm not checking if they are both true - I am 
checking if they are equal.



-- 
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...@nifi.apache.org

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

Reply via email to