summaryrefslogtreecommitdiff
path: root/lib/java/src/main/java/org/apache/thrift/TEnumHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'lib/java/src/main/java/org/apache/thrift/TEnumHelper.java')
-rw-r--r--lib/java/src/main/java/org/apache/thrift/TEnumHelper.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/java/src/main/java/org/apache/thrift/TEnumHelper.java b/lib/java/src/main/java/org/apache/thrift/TEnumHelper.java
index 84aa82e8d..b003346e7 100644
--- a/lib/java/src/main/java/org/apache/thrift/TEnumHelper.java
+++ b/lib/java/src/main/java/org/apache/thrift/TEnumHelper.java
@@ -19,12 +19,14 @@
package org.apache.thrift;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/** Utility class with static methods for interacting with TEnum */
public class TEnumHelper {
+ /* no instantiation */
+ private TEnumHelper() {}
+
/**
* Given a TEnum class and integer value, this method will return the associated constant from the
* given TEnum class. This method MUST be modified should the name of the 'findByValue' method
@@ -38,11 +40,7 @@ public class TEnumHelper {
try {
Method method = enumClass.getMethod("findByValue", int.class);
return (TEnum) method.invoke(null, value);
- } catch (NoSuchMethodException nsme) {
- return null;
- } catch (IllegalAccessException iae) {
- return null;
- } catch (InvocationTargetException ite) {
+ } catch (ReflectiveOperationException nsme) {
return null;
}
}