RFR 8235930 : java.util.regex.PrintPattern does not print a link to the next node

Ivan Gerasimov ivan.gerasimov at oracle.com
Sat Dec 14 19:42:24 UTC 2019

Thank you Martin for looking at this!

On 12/14/19 6:58 AM, Martin Buchholz wrote:
> Hi Ivan,
> Did you mean to change from System.err to System.out?
Yes.  The first string that this utility prints in main() goes to 
Not sure why the rest would need to go to another stream.

> I might have fixed the overloading by giving one of the overloaded 
> methods a better name.  How about
> private static void printIndented(String s, int depth)

Now, after removing the overload `print(String fmt, Object ... args)` 
(which was just an alias of printf(String fmt, Object ... args)), we 
have two print() methods, and both of them indent the text.

I am not planning to invest much into this utility, just wanted to fix 
that annoying glitch.

With kind regards,

> On Fri, Dec 13, 2019 at 12:11 PM Ivan Gerasimov 
> <ivan.gerasimov at oracle.com <mailto:ivan.gerasimov at oracle.com>> wrote:
>     Hello!
>     The java.util.regex package contains a debugging utility PrintPattern
>     which is used to display the internal representation structure of a
>     compiled regex pattern.
>     When it prints a node that is linked to another node that has already
>     been printed, it is supposed to print a link, but fails.
>     The error is due to ambigous overloading of print() method.
>     Would you please help review a trivial fix?
>     No regression test because the utility is not something officially
>     supported.
>     BUGURL: https://bugs.openjdk.java.net/browse/JDK-8235930
>     WEBREV: http://cr.openjdk.java.net/~igerasim/8235930/00/webrev/
>     -- 
>     With kind regards,
>     Ivan Gerasimov
With kind regards,
Ivan Gerasimov

More information about the core-libs-dev mailing list