From cec30fd8a498d9f0456cf8e43294fa0071a661e3 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Tue, 8 Jul 2014 15:13:52 -0700 Subject: [PATCH] HBASE-11444 Remove use of reflection for User#getShortName --- .../main/java/org/apache/hadoop/hbase/security/User.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java index 6b6c583b1a7..03d8df90ce9 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java @@ -256,15 +256,12 @@ public abstract class User { @Override public String getShortName() { if (shortName != null) return shortName; - try { - shortName = (String)call(ugi, "getShortUserName", null, null); + shortName = ugi.getShortUserName(); return shortName; - } catch (RuntimeException re) { - throw re; } catch (Exception e) { - throw new UndeclaredThrowableException(e, - "Unexpected error getting user short name"); + throw new RuntimeException("Unexpected error getting user short name", + e); } }