equal
deleted
inserted
replaced
660 } |
660 } |
661 Files.createSymbolicLink(linkedJar.toPath(), origJar.toPath()); |
661 Files.createSymbolicLink(linkedJar.toPath(), origJar.toPath()); |
662 } |
662 } |
663 return linkedJar; |
663 return linkedJar; |
664 } |
664 } |
|
665 |
|
666 // Remove all UL log messages from a JVM's STDOUT (such as those printed by -Xlog:cds) |
|
667 static Pattern logPattern = Pattern.compile("^\\[[0-9. ]*s\\].*"); |
|
668 public static String filterOutLogs(String stdout) { |
|
669 StringBuilder sb = new StringBuilder(); |
|
670 String prefix = ""; |
|
671 for (String line : stdout.split("\n")) { |
|
672 if (logPattern.matcher(line).matches()) { |
|
673 continue; |
|
674 } |
|
675 sb.append(prefix); |
|
676 sb.append(line); |
|
677 prefix = "\n"; |
|
678 } |
|
679 if (stdout.endsWith("\n")) { |
|
680 // String.split("A\n") returns {"A"}, not {"A", ""}. |
|
681 sb.append("\n"); |
|
682 } |
|
683 return sb.toString(); |
|
684 } |
665 } |
685 } |