java.lang.NumberFormatException.setStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(112)

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

NumberFormatException.setStackTrace介绍

暂无

代码示例

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

@Override
public final NumberFormatException invalidNumericCharacter() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), invalidNumericCharacter$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String tooBigNumber = "ELY05062: Too big number";

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

@Override
public final NumberFormatException emptyNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), emptyNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String invalidNumericCharacter = "ELY05061: Invalid numeric character";

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

@Override
public final NumberFormatException tooBigNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), tooBigNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String mechCannotGetTwoWayPasswordChars = "ELY05063: Cannot get clear password from two way password";

代码示例来源:origin: com.github.drapostolos/type-parser

@Override
  public BigDecimal parse(String input, ParserHelper helper) {
    try {
      return new BigDecimal(input.trim());
    } catch (NumberFormatException e) {
      /*
       * The NumberFormatException thrown by BigDecimal contains
       * an empty error message. The below is done to address that.
       */
      String message = "NumberFormatException For input string: \"" + input + "\"";
      NumberFormatException e2 = new NumberFormatException(message);
      e2.setStackTrace(e.getStackTrace());
      throw e2;
    }
  }
},

代码示例来源:origin: org.picketbox/common-spi

@Override
public final NumberFormatException illegalBase64Character() {
  final NumberFormatException result = new NumberFormatException(String.format(illegalBase64Character$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String failedToValidateURL = "PBOX00114: Failed to validate %s as a URL, file or classpath resource";

代码示例来源:origin: org.picketbox/picketbox

@Override
public final NumberFormatException illegalBase64Character() {
  final NumberFormatException result = new NumberFormatException(String.format(illegalBase64Character$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String failedToValidateURL = "PBOX00114: Failed to validate %s as a URL, file or classpath resource";

代码示例来源:origin: org.picketbox/jboss-security-spi

@Override
public final NumberFormatException illegalBase64Character() {
  final NumberFormatException result = new NumberFormatException(String.format(illegalBase64Character$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String failedToValidateURL = "PBOX00114: Failed to validate %s as a URL, file or classpath resource";

代码示例来源:origin: org.wildfly.security/wildfly-elytron

@Override
public final NumberFormatException invalidNumericCharacter() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), invalidNumericCharacter$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String tooBigNumber = "ELY05062: Too big number";

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public final NumberFormatException emptyNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), emptyNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String invalidNumericCharacter = "ELY05061: Invalid numeric character";

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.hibernate-validator

@Override
public final NumberFormatException getCharacterIsNotADigitException(final char c) {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), getCharacterIsNotADigitException$str(), c));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String getConstraintParametersCannotStartWithValidException = "HV000073: Parameters starting with 'valid' are not allowed in a constraint.";

代码示例来源:origin: org.wildfly.security/wildfly-elytron-mechanism

@Override
public final NumberFormatException emptyNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), emptyNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String invalidNumericCharacter = "ELY05061: Invalid numeric character";

代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-client

@Override
public final NumberFormatException invalidTimeZoneValueFormat(final String value) {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), invalidTimeZoneValueFormat$str(), value));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String unsupportedTokenType = "JBWS024055: Unsupported token type: %s";

代码示例来源:origin: org.wildfly.security/wildfly-elytron-mechanism

@Override
public final NumberFormatException tooBigNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), tooBigNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String mechCannotGetTwoWayPasswordChars = "ELY05063: Cannot get clear password from two way password";

代码示例来源:origin: org.hibernate.validator/hibernate-validator

@Override
public final NumberFormatException getCharacterIsNotADigitException(final char c) {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), getCharacterIsNotADigitException$str(), c));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String getConstraintParametersCannotStartWithValidException = "HV000073: Parameters starting with 'valid' are not allowed in a constraint.";

代码示例来源:origin: org.wildfly.security/wildfly-elytron

@Override
public final NumberFormatException tooBigNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), tooBigNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String mechCannotGetTwoWayPasswordChars = "ELY05063: Cannot get clear password from two way password";

代码示例来源:origin: org.wildfly.security/wildfly-elytron

@Override
public final NumberFormatException emptyNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), emptyNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String invalidNumericCharacter = "ELY05061: Invalid numeric character";

代码示例来源:origin: org.wildfly.security/wildfly-elytron-mechanism

@Override
public final NumberFormatException invalidNumericCharacter() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), invalidNumericCharacter$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String tooBigNumber = "ELY05062: Too big number";

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public final NumberFormatException invalidNumericCharacter() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), invalidNumericCharacter$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String tooBigNumber = "ELY05062: Too big number";

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public final NumberFormatException tooBigNumber() {
  final NumberFormatException result = new NumberFormatException(String.format(getLoggingLocale(), tooBigNumber$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String mechCannotGetTwoWayPasswordChars = "ELY05063: Cannot get clear password from two way password";

代码示例来源:origin: com.caucho/resin

public int getArgInt(String arg, int defaultValue)
{
 String value = getArg(arg);
 if (value == null)
  return defaultValue;
 try {
  return Integer.parseInt(value);
 } catch (NumberFormatException e) {
  NumberFormatException e1
   = new NumberFormatException(L().l("{0} argument is not a number '{1}'",
                   arg, value));
  e1.setStackTrace(e.getStackTrace());
  throw e;
 }
}

相关文章