HDFS-17022. Fix the exception message to print the Identifier pattern (#5678). Contributed by Nishtha Shah.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
NishthaShah 2023-05-20 14:40:23 +05:30 committed by Ayush Saxena
parent 9029bba5dc
commit adb673fdaf
No known key found for this signature in database
GPG Key ID: D09AE71061AB564D

View File

@ -130,7 +130,7 @@ public static String validIdentifier(String value, int maxLen, String name) {
} }
if (!IDENTIFIER_PATTERN.matcher(value).find()) { if (!IDENTIFIER_PATTERN.matcher(value).find()) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
MessageFormat.format("[{0}] = [{1}] must be '{2}'", name, value, IDENTIFIER_PATTERN_STR)); MessageFormat.format("[{0}] = [{1}] must be \"{2}\"", name, value, IDENTIFIER_PATTERN_STR));
} }
return value; return value;
} }