java.text.ParseException.getStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(135)

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

ParseException.getStackTrace介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

/**
 * Remove the exception factory method from the stack trace. The factory is not the place where
 * the failure occurs; the error occurs in the factory's caller.
 *
 * @param factory The name of the factory method.
 * @param exception The exception to trim.
 * @return {@code exception} for convenience.
 */
private static ParseException trim(final String factory, final ParseException exception) {
  StackTraceElement[] trace = exception.getStackTrace();
  if (trace != null && trace.length != 0) {
    if (factory.equals(trace[0].getMethodName())) {
      trace = XArray.remove(trace, 0, 1);
      exception.setStackTrace(trace);
    }
  }
  return exception;
}

代码示例来源:origin: geotools/geotools

adjusted.setStackTrace(exception.getStackTrace());
adjusted.initCause(exception.getCause());
throw adjusted;

代码示例来源:origin: org.motechproject/motech-server-core

public Date asDate() {
    DateFormat formatter = new SimpleDateFormat("dd-M-yyyy");
    try {
      return formatter.parse(value);
    } catch (ParseException e) {
      log.error("Error while parsing date:" + e.getStackTrace());
    }
    return null;
  }
}

代码示例来源:origin: org.jvnet.hudson.plugins/clearcase

IOException ioe = new IOException(
                 "Could not parse cleartool output");
ioe.setStackTrace(ex.getStackTrace());
throw ioe;

相关文章