josedee commented on code in PR #2347:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/2347#discussion_r3551416198


##########
data-audit/data-audit-common/src/main/java/org/kie/kogito/app/audit/api/DataAuditQuery.java:
##########
@@ -53,12 +53,19 @@ public void setQuery(String query) {
     @Override
     public String toString() {
         return "DataAuditQuery [identifier="
-                + identifier.replace('\n', '_').replace('\r', '_')
+                + sanitize(identifier)
                 + ", graphQLDefinition="
-                + graphQLDefinition.replace('\n', '_').replace('\r', '_')
+                + sanitize(graphQLDefinition)
                 + ", query="
-                + query.replace('\n', '_').replace('\r', '_')
+                + sanitize(query)
                 + "]";
     }
 
+    private static String sanitize(String value) {
+        if (value == null) {
+            return null;
+        }
+        return value.replaceAll("\\R+", "_");
+    }
+

Review Comment:
   Thanks Athira. I haven't looked at the entire code, but this would also fix 
a possible NPE in the code.



-- 
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