HBASE-13026: Wrong error message in case incorrect snapshot name OR Incorrect table name

Signed-off-by: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
This commit is contained in:
Bhupendra 2015-02-12 15:36:07 +05:30 committed by Matteo Bertozzi
parent aca9aacfb4
commit 38de2d2276
1 changed files with 5 additions and 4 deletions

View File

@ -180,10 +180,11 @@ public final class TableName implements Comparable<TableName> {
} }
if (qualifierName[start] == '.' || qualifierName[start] == '-') { if (qualifierName[start] == '.' || qualifierName[start] == '-') {
throw new IllegalArgumentException("Illegal first character <" + qualifierName[0] + throw new IllegalArgumentException("Illegal first character <" + qualifierName[start] +
"> at 0. Namespaces can only start with alphanumeric " + "> at 0. " + (isSnapshot ? "Snapshot" : "User-space table") +
" qualifiers can only start with 'alphanumeric " +
"characters': i.e. [a-zA-Z_0-9]: " + "characters': i.e. [a-zA-Z_0-9]: " +
Bytes.toString(qualifierName)); Bytes.toString(qualifierName, start, end));
} }
for (int i = start; i < end; i++) { for (int i = start; i < end; i++) {
if (Character.isLetterOrDigit(qualifierName[i]) || if (Character.isLetterOrDigit(qualifierName[i]) ||
@ -194,7 +195,7 @@ public final class TableName implements Comparable<TableName> {
} }
throw new IllegalArgumentException("Illegal character code:" + qualifierName[i] + throw new IllegalArgumentException("Illegal character code:" + qualifierName[i] +
", <" + (char) qualifierName[i] + "> at " + i + ", <" + (char) qualifierName[i] + "> at " + i +
". " + (isSnapshot ? "snapshot" : "User-space table") + ". " + (isSnapshot ? "Snapshot" : "User-space table") +
" qualifiers can only contain " + " qualifiers can only contain " +
"'alphanumeric characters': i.e. [a-zA-Z_0-9-.]: " + "'alphanumeric characters': i.e. [a-zA-Z_0-9-.]: " +
Bytes.toString(qualifierName, start, end)); Bytes.toString(qualifierName, start, end));