OpenJDK / jdk / jdk
changeset 56126:a1a8f8fae7d9
8230338: Accurate error message about bad Unicode block name
Reviewed-by: rriggs
author | igerasim |
---|---|
date | Thu, 29 Aug 2019 07:39:06 -0700 |
parents | e8ba7e4f4190 |
children | e29b6ddfd9f4 |
files | src/java.base/share/classes/java/util/regex/Pattern.java |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/java.base/share/classes/java/util/regex/Pattern.java Thu Aug 29 15:59:00 2019 +0200 +++ b/src/java.base/share/classes/java/util/regex/Pattern.java Thu Aug 29 07:39:06 2019 -0700 @@ -2888,12 +2888,12 @@ p = CharPredicates.forUnicodeBlock(name.substring(2)); } else if (name.startsWith("Is")) { // \p{IsGeneralCategory} and \p{IsScriptName} - name = name.substring(2); - p = CharPredicates.forUnicodeProperty(name); + String shortName = name.substring(2); + p = CharPredicates.forUnicodeProperty(shortName); if (p == null) - p = CharPredicates.forProperty(name); + p = CharPredicates.forProperty(shortName); if (p == null) - p = CharPredicates.forUnicodeScript(name); + p = CharPredicates.forUnicodeScript(shortName); } else { if (has(UNICODE_CHARACTER_CLASS)) { p = CharPredicates.forPOSIXName(name); @@ -2902,7 +2902,7 @@ p = CharPredicates.forProperty(name); } if (p == null) - throw error("Unknown character property name {In/Is" + name + "}"); + throw error("Unknown character property name {" + name + "}"); } if (isComplement) { // it might be too expensive to detect if a complement of