< prev index next >

src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java

Print this page

523             case 'S':
524                 type = "short";
525                 break;
526             case 'C':
527                 type = "char";
528                 break;
529             case 'B':
530                 type = "byte";
531                 break;
532             default:
533                 type = "<unknown-descriptor-type>";
534             }
535             descriptors.add(type + arrayBrackets);
536         }
537         return descriptors;
538     }
539 
540     private void printThread(RecordedThread thread, String postFix) {
541         long javaThreadId = thread.getJavaThreadId();
542         if (javaThreadId > 0) {
543             println("\"" + thread.getJavaName() + "\" (javaThreadId = " + thread.getJavaThreadId() + ")" + postFix);
544         } else {
545             println("\"" + thread.getOSName() + "\" (osThreadId = " + thread.getOSThreadId() + ")" + postFix);
546         }
547     }
548 
549     private boolean printFormatted(ValueDescriptor field, Object value) {
550         if (value instanceof Duration d) {
551             if (d.getSeconds() == Long.MIN_VALUE && d.getNano() == 0)  {
552                 println("N/A");
553                 return true;
554             }
555             println(Utils.formatDuration(d));
556             return true;
557         }
558         if (value instanceof OffsetDateTime odt) {
559             if (odt.equals(OffsetDateTime.MIN))  {
560                 println("N/A");
561                 return true;
562             }
563             println(TIME_FORMAT.format(odt));

523             case 'S':
524                 type = "short";
525                 break;
526             case 'C':
527                 type = "char";
528                 break;
529             case 'B':
530                 type = "byte";
531                 break;
532             default:
533                 type = "<unknown-descriptor-type>";
534             }
535             descriptors.add(type + arrayBrackets);
536         }
537         return descriptors;
538     }
539 
540     private void printThread(RecordedThread thread, String postFix) {
541         long javaThreadId = thread.getJavaThreadId();
542         if (javaThreadId > 0) {
543             println("\"" + thread.getJavaName() + "\" (javaThreadId = " + thread.getJavaThreadId() + ", virtual = " + thread.isVirtual() + ")" + postFix);
544         } else {
545             println("\"" + thread.getOSName() + "\" (osThreadId = " + thread.getOSThreadId() + ")" + postFix);
546         }
547     }
548 
549     private boolean printFormatted(ValueDescriptor field, Object value) {
550         if (value instanceof Duration d) {
551             if (d.getSeconds() == Long.MIN_VALUE && d.getNano() == 0)  {
552                 println("N/A");
553                 return true;
554             }
555             println(Utils.formatDuration(d));
556             return true;
557         }
558         if (value instanceof OffsetDateTime odt) {
559             if (odt.equals(OffsetDateTime.MIN))  {
560                 println("N/A");
561                 return true;
562             }
563             println(TIME_FORMAT.format(odt));
< prev index next >