本文整理了Java中azkaban.utils.Utils.getCause()
方法的一些代码示例,展示了Utils.getCause()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getCause()
方法的具体详情如下:
包路径:azkaban.utils.Utils
类名称:Utils
方法名:getCause
[英]Get the root cause of the Exception
[中]获取异常的根本原因
代码示例来源:origin: azkaban/azkaban
/**
* Call the class constructor with the given arguments
*
* @param c The class
* @param args The arguments
* @return The constructed object
*/
public static Object callConstructor(final Class<?> c, final Class<?>[] argTypes,
final Object[] args) {
try {
final Constructor<?> cons = c.getConstructor(argTypes);
return cons.newInstance(args);
} catch (final InvocationTargetException e) {
throw getCause(e);
} catch (final IllegalAccessException e) {
throw new IllegalStateException(e);
} catch (final NoSuchMethodException e) {
throw new IllegalStateException(e);
} catch (final InstantiationException e) {
throw new IllegalStateException(e);
}
}
代码示例来源:origin: com.linkedin.azkaban/az-core
public static Object callConstructor(final Class<?> c, final Class<?>[] argTypes,
final Object[] args) {
try {
final Constructor<?> cons = c.getConstructor(argTypes);
return cons.newInstance(args);
} catch (final InvocationTargetException e) {
throw getCause(e);
} catch (final IllegalAccessException e) {
throw new IllegalStateException(e);
} catch (final NoSuchMethodException e) {
throw new IllegalStateException(e);
} catch (final InstantiationException e) {
throw new IllegalStateException(e);
}
}
代码示例来源:origin: com.linkedin.azkaban/azkaban
/**
* Call the class constructor with the given arguments
*
* @param c The class
* @param args The arguments
* @return The constructed object
*/
public static Object callConstructor(Class<?> c, Class<?>[] argTypes, Object[] args) {
try {
Constructor<?> cons = c.getConstructor(argTypes);
return cons.newInstance(args);
} catch(InvocationTargetException e) {
throw getCause(e);
} catch(IllegalAccessException e) {
throw new IllegalStateException(e);
} catch(NoSuchMethodException e) {
throw new IllegalStateException(e);
} catch(InstantiationException e) {
throw new IllegalStateException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!