Skip to content
Permalink
Browse files

8235930: java.util.regex.PrintPattern does not print a link to the ne…

…xt node

Reviewed-by: martin
  • Loading branch information
Ivan Gerasimov
Ivan Gerasimov committed Dec 15, 2019
1 parent 1ae2478 commit f82e4b1b76921be71deeb3a123c48aed04f790aa
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/java.base/share/classes/java/util/regex/PrintPattern.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,18 +40,16 @@
private static void print(Pattern.Node node, String text, int depth) {
if (!ids.containsKey(node))
ids.put(node, ids.size());
print("%6d:%" + (depth==0? "": depth<<1) + "s<%s>", ids.get(node), "", text);
System.out.printf("%6d:%" + (depth==0? "": depth<<1) + "s<%s>",
ids.get(node), "", text);
if (ids.containsKey(node.next))
print(" (=>%d)", ids.get(node.next));
print("%n");
System.out.printf(" (=>%d)", ids.get(node.next));
System.out.printf("%n");
}

private static void print(String s, int depth) {
print(" %" + (depth==0?"":depth<<1) + "s<%s>%n", "", s);
}

private static void print(String fmt, Object ... args) {
System.err.printf(fmt, args);
System.out.printf(" %" + (depth==0?"":depth<<1) + "s<%s>%n",
"", s);
}

private static String toStringCPS(int[] cps) {

0 comments on commit f82e4b1

Please sign in to comment.
You can’t perform that action at this time.