azkaban.utils.Utils.getCause()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中azkaban.utils.Utils.getCause()方法的一些代码示例,展示了Utils.getCause()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getCause()方法的具体详情如下:
包路径:azkaban.utils.Utils
类名称:Utils
方法名:getCause

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);
  }
}

相关文章