From 38de2d227644eaa2818019ec3a216b9ec10d9b1d Mon Sep 17 00:00:00 2001 From: Bhupendra Date: Thu, 12 Feb 2015 15:36:07 +0530 Subject: [PATCH] HBASE-13026: Wrong error message in case incorrect snapshot name OR Incorrect table name Signed-off-by: Matteo Bertozzi --- .../src/main/java/org/apache/hadoop/hbase/TableName.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java index 802319e5953..9925d2c4f45 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java @@ -180,10 +180,11 @@ public final class TableName implements Comparable { } if (qualifierName[start] == '.' || qualifierName[start] == '-') { - throw new IllegalArgumentException("Illegal first character <" + qualifierName[0] + - "> at 0. Namespaces can only start with alphanumeric " + + throw new IllegalArgumentException("Illegal first character <" + qualifierName[start] + + "> at 0. " + (isSnapshot ? "Snapshot" : "User-space table") + + " qualifiers can only start with 'alphanumeric " + "characters': i.e. [a-zA-Z_0-9]: " + - Bytes.toString(qualifierName)); + Bytes.toString(qualifierName, start, end)); } for (int i = start; i < end; i++) { if (Character.isLetterOrDigit(qualifierName[i]) || @@ -194,7 +195,7 @@ public final class TableName implements Comparable { } throw new IllegalArgumentException("Illegal character code:" + qualifierName[i] + ", <" + (char) qualifierName[i] + "> at " + i + - ". " + (isSnapshot ? "snapshot" : "User-space table") + + ". " + (isSnapshot ? "Snapshot" : "User-space table") + " qualifiers can only contain " + "'alphanumeric characters': i.e. [a-zA-Z_0-9-.]: " + Bytes.toString(qualifierName, start, end));