Skip to content

use correct error key for out-of-range hex escape in RegexParser#68

Open
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:regex-hex-escape-error-key
Open

use correct error key for out-of-range hex escape in RegexParser#68
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:regex-hex-escape-error-key

Conversation

@aizu-m

@aizu-m aizu-m commented Jun 22, 2026

Copy link
Copy Markdown
java.util.MissingResourceException: Can't find resource for bundle
java.util.PropertyResourceBundle, key parser.descappe.4

Turned up while feeding the engine out-of-range escapes through the public RegularExpression API. A \v escape reads six hex digits; when the value is above U+10FFFF the parser means to reject it, but the key handed to ex() is parser.descappe.4, which is not in message.properties. The real key is parser.descape.4. ex() looks the key up with ResourceBundle.getString, so the lookup throws MissingResourceException rather than the ParseException the rest of the parser raises.

So \v110000 and \vFFFFFF leave the parser as MissingResourceException instead of a clean ParseException. The \x{...} branch just above reports the same overflow correctly via parser.descape.4, which is what flagged the typo.

One character on the key. Regression test sits next to the quantifier-overflow one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant