diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java index 0fa90ad258cd..fb80e1b40615 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java @@ -83,15 +83,19 @@ public static Constructor findConstructor(Class type, Object... paramT boolean match = true; for (int i = 0; i < ctorParamTypes.length && match; ++i) { - Class paramType = paramTypes[i].getClass(); - match = (!ctorParamTypes[i].isPrimitive()) ? ctorParamTypes[i].isAssignableFrom(paramType) : - ((int.class.equals(ctorParamTypes[i]) && Integer.class.equals(paramType)) || - (long.class.equals(ctorParamTypes[i]) && Long.class.equals(paramType)) || - (double.class.equals(ctorParamTypes[i]) && Double.class.equals(paramType)) || - (char.class.equals(ctorParamTypes[i]) && Character.class.equals(paramType)) || - (short.class.equals(ctorParamTypes[i]) && Short.class.equals(paramType)) || - (boolean.class.equals(ctorParamTypes[i]) && Boolean.class.equals(paramType)) || - (byte.class.equals(ctorParamTypes[i]) && Byte.class.equals(paramType))); + if (paramTypes[i] == null) { + match = !ctorParamTypes[i].isPrimitive(); + } else { + Class paramType = paramTypes[i].getClass(); + match = (!ctorParamTypes[i].isPrimitive()) ? ctorParamTypes[i].isAssignableFrom(paramType) + : ((int.class.equals(ctorParamTypes[i]) && Integer.class.equals(paramType)) || + (long.class.equals(ctorParamTypes[i]) && Long.class.equals(paramType)) || + (double.class.equals(ctorParamTypes[i]) && Double.class.equals(paramType)) || + (char.class.equals(ctorParamTypes[i]) && Character.class.equals(paramType)) || + (short.class.equals(ctorParamTypes[i]) && Short.class.equals(paramType)) || + (boolean.class.equals(ctorParamTypes[i]) && Boolean.class.equals(paramType)) || + (byte.class.equals(ctorParamTypes[i]) && Byte.class.equals(paramType))); + } } if (match) {