8253641: Missing newline in the printout of certain JFR events

Co-authored-by: Michael Bien <mbien42@gmail.com>
Reviewed-by: mgronlun
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java
index 102bfa9..aa366f9 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java
@@ -437,13 +437,16 @@
     private void printClassLoader(RecordedClassLoader cl, String postFix) {
         // Purposely not printing class loader name to avoid cluttered output
         RecordedClass clazz = cl.getType();
-        print(clazz == null ? "null" : clazz.getName());
         if (clazz != null) {
+            print(clazz.getName());
             print(" (");
             print("id = ");
             print(String.valueOf(cl.getId()));
-            println(")");
+            print(")");
+        } else {
+            print("null");
         }
+        println(postFix);
     }
 
     private void printJavaFrame(RecordedFrame f, String postFix) {