java.lang.NullPointerException.getStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(231)

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

NullPointerException.getStackTrace介绍

暂无

代码示例

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

@Override
public final NullPointerException nullParamNPE(final String name) {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullParamNPE$str(), name));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String invalidPermissionAction = "COM00007: Invalid permission action '%s'";

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

@Override
public final NullPointerException sendChallengeReturnedNull(final AuthenticationMechanism mechanism) {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), sendChallengeReturnedNull$str(), mechanism));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String bodyIsSetAndNotReadyForFlush = "UT000155: Framed channel body was set when it was not ready for flush";

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

@Override
public final NullPointerException nullTransaction() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullTransaction$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
@Override

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

StackTraceElement[] elements = npe.getStackTrace();
if(elements.length == 0 || !elements[0].getMethodName().equals("skipChar")) {  //NOI18N

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

private String getMethodName()
{
  final NullPointerException npe = new NullPointerException();
  final StackTraceElement[] trace = npe.getStackTrace();
  final StackTraceElement methodElement = trace[1];
  return methodElement.getMethodName() + " (archiver line: " + methodElement.getLineNumber() + ")";
}

代码示例来源:origin: org.terracotta/terracotta-ee

/**
 * Determine whether the NPE should be ignored due to bug 6427854. See
 * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6427854
 * 
 * @param npe Exception to examine
 * @return True if exception should be ignored
 */
public static boolean selectorOpenRace(NullPointerException npe) {
 StackTraceElement source = npe.getStackTrace()[0];
 if (source.getClassName().equals("sun.nio.ch.Util") && source.getMethodName().equals("atBugLevel")) { return true; }
 return false;
}

代码示例来源:origin: org.terracotta/terracotta-l1

/**
 * Determine whether the NPE should be ignored due to bug 6427854. See
 * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6427854
 * 
 * @param npe Exception to examine
 * @return True if exception should be ignored
 */
public static boolean selectorOpenRace(NullPointerException npe) {
 StackTraceElement source = npe.getStackTrace()[0];
 if (source.getClassName().equals("sun.nio.ch.Util") && source.getMethodName().equals("atBugLevel")) { return true; }
 return false;
}

代码示例来源:origin: io.undertow/undertow-servlet

@Override
public final NullPointerException headerNameWasNull() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), headerNameWasNull$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String noConfidentialPortAvailable = "UT010053: No confidential port is available to redirect the current request.";

代码示例来源:origin: io.undertow/undertow-core

@Override
public final NullPointerException sendChallengeReturnedNull(final AuthenticationMechanism mechanism) {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), sendChallengeReturnedNull$str(), mechanism));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String bodyIsSetAndNotReadyForFlush = "UT000155: Framed channel body was set when it was not ready for flush";

代码示例来源:origin: org.wildfly.transaction/wildfly-transaction-client

@Override
public final NullPointerException nullTransaction() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullTransaction$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
@Override

代码示例来源:origin: io.undertow.jastow/jastow

@Override
public final NullPointerException elResolverNullContext() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), elResolverNullContext$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String errorResolvingVariable = "JBWEB004224: Error resolving variable %s due to %s";

代码示例来源:origin: io.undertow/undertow-servlet

@Override
public final NullPointerException listenerCannotBeNull() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), listenerCannotBeNull$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String sslCannotBeCombinedWithAnyOtherMethod = "UT010045: SSL cannot be combined with any other method";

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

@Override
public final NullPointerException nullTransaction() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullTransaction$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
@Override

代码示例来源:origin: org.jboss.eap/wildfly-webservices-server-integration

@Override
public final NullPointerException nullEndpointClass() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullEndpointClass$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String classLoaderResolutionFailed = "WFLYWS0025: Cannot resolve module or classloader for deployment %s";

代码示例来源:origin: io.undertow/undertow-servlet

@Override
public final NullPointerException paramCannotBeNullNPE(final String name) {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), paramCannotBeNullNPE$str(), name));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String trailersNotSupported = "UT010060: Trailers not supported for this request due to %s";

代码示例来源:origin: io.undertow/undertow-servlet

@Override
public final NullPointerException nullName() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullName$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String invalidRequestResponseType = "UT010048: Can only handle HTTP type of request / response: %s / %s";

代码示例来源:origin: org.wildfly/wildfly-webservices-server-integration

@Override
public final NullPointerException nullEndpointName() {
  final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullEndpointName$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String nullEndpointClass = "WFLYWS0024: Null endpoint class";

代码示例来源:origin: EvoSuite/evosuite

public MockNullPointerException() {
  super();
  delegate = new MockThrowable();
  delegate.setOriginForDelegate(super.getStackTrace()[0]);
}

代码示例来源:origin: EvoSuite/evosuite

public MockNullPointerException(String message) {
  super(message);
  delegate = new MockThrowable(message);
  delegate.setOriginForDelegate(super.getStackTrace()[0]);
}

代码示例来源:origin: EvoSuite/evosuite

@Override
public StackTraceElement[] getStackTrace() {		
  if(!MockFramework.isEnabled()){
    return super.getStackTrace();
  }
  return getDelegate().getStackTrace();
}

相关文章