本文整理了Java中java.lang.Error.setStackTrace()
方法的一些代码示例,展示了Error.setStackTrace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Error.setStackTrace()
方法的具体详情如下:
包路径:java.lang.Error
类名称:Error
方法名:setStackTrace
暂无
代码示例来源:origin: org.appdapter/org.appdapter.lib.gui
@Override public void setStackTrace(StackTraceElement[] stackTrace) {
rethrowThisNever();
super.setStackTrace(stackTrace);
}
代码示例来源:origin: wildfly/wildfly-core
@Override
public final Error invalidObjectName(final String name, final String message) {
final Error result = new Error(String.format(getLoggingLocale(), invalidObjectName2$str(), name, message));
final StackTraceElement[] st = result.getStackTrace();
result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
return result;
}
private static final String invalidObjectName3 = "WFLYJMX0015: Invalid ObjectName: %s,%s; %s";
代码示例来源:origin: org.jboss.ws/jbossws-common
@Override
public final Error invalidObjectName(final Throwable cause, final String message) {
final Error result = new Error(String.format(getLoggingLocale(), invalidObjectName$str(), message), cause);
final StackTraceElement[] st = result.getStackTrace();
result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
return result;
}
private static final String invalidBinaryComponentForArray = "JBWS022005: Could not get component type from array; invalid binary component for array: %s";
代码示例来源:origin: wildfly/wildfly-core
@Override
public final Error invalidObjectName(final String domain, final java.util.Hashtable<String, String> table, final String message) {
final Error result = new Error(String.format(getLoggingLocale(), invalidObjectName3$str(), domain, table, message));
final StackTraceElement[] st = result.getStackTrace();
result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
return result;
}
private static final String invalidObjectName4 = "WFLYJMX0015: Invalid ObjectName: %s,%s,%s; %s";
代码示例来源:origin: wildfly/wildfly-core
@Override
public final Error invalidObjectName(final String domain, final String key, final String value, final String message) {
final Error result = new Error(String.format(getLoggingLocale(), invalidObjectName4$str(), domain, key, value, message));
final StackTraceElement[] st = result.getStackTrace();
result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
return result;
}
private static final String mbeanNotFound = "WFLYJMX0017: No MBean found with name %s";
代码示例来源:origin: Camelcade/Perl5-IDEA
protected void locateToken() {
if (myTokenType != null) {
return;
}
try {
compileState();
myTokenType = myFlex.advance();
}
catch (IOException e) { /*Can't happen*/ }
catch (Error e) {
// add lexer class name to the error
final Error error = new Error(myFlex.getClass().getName() + ": " + e.getMessage());
error.setStackTrace(e.getStackTrace());
throw error;
}
}
}
代码示例来源:origin: JetBrains/mapper
private Error createGwtError() {
Error e = new NoClassDefFoundError();
e.setStackTrace(getStackTrace());
return e;
}
代码示例来源:origin: EvoSuite/evosuite
@Override
public void setStackTrace(StackTraceElement[] stackTrace) {
if(!MockFramework.isEnabled()){
super.setStackTrace(stackTrace);
return;
}
getDelegate().setStackTrace(stackTrace);
}
}
代码示例来源:origin: jmock-developers/jmock-library
private Object dispatch(Invocation invocation) throws Throwable {
if (firstError != null) {
throw firstError;
}
try {
Object result = dispatcher.dispatch(invocation);
actualInvocations.add(invocation);
return result;
}
catch (ExpectationError e) {
firstError = expectationErrorTranslator.translate(mismatchDescribing(e));
firstError.setStackTrace(e.getStackTrace());
throw firstError;
}
catch (Throwable t) {
actualInvocations.add(invocation);
throw t;
}
}
代码示例来源:origin: MobiVM/robovm
e.setStackTrace(stackTrace);
if (cause != null) {
e.initCause(cause);
代码示例来源:origin: org.jboss.modules/jboss-modules
final String newMsg = "Failed to link " + name.replace('.', '/') + " (" + module + ")";
ne = e.getClass().getConstructor(String.class).newInstance(oldMsg == null || oldMsg.isEmpty() ? newMsg : newMsg + ": " + oldMsg);
ne.setStackTrace(e.getStackTrace());
} catch (InstantiationException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) {
内容来源于网络,如有侵权,请联系作者删除!