< prev index next >

src/java.base/share/classes/java/util/regex/PrintPattern.java

Print this page

        

@@ -193,17 +193,11 @@
                 String pstr = pmap.get(gcp.predicate);
                 if (pstr == null)
                     pstr = gcp.predicate.toString();
                 else
                     pstr = "Single \"" + pstr + "\"";
-                str = name + " " + pstr;
-                if (gcp.cmin == 0)
-                    str += "*";
-                else if (gcp.cmin == 1)
-                    str += "+";
-                else
-                    str += "{" + gcp.cmin + ",}";
+                str = name + " " + pstr + ((gcp.cmin == 0) ? "*" : "+");
                 print(node, str, depth);
             } else if (node instanceof Pattern.BackRef) {
                 str = "GroupBackRef " + ((Pattern.BackRef)node).groupIndex / 2;
                 print(node, str, depth);
             } else if (node instanceof Pattern.LastNode) {
< prev index next >