Tabnine Logo
Throwable.fillInStackTrace
Code IndexAdd Tabnine to your IDE (free)

How to use
fillInStackTrace
method
in
java.lang.Throwable

Best Java code snippets using java.lang.Throwable.fillInStackTrace (Showing top 20 results out of 2,070)

origin: facebook/litho

/**
 * Reset the stacktrace of this Runnable to this point. To be called right before the runnable is
 * scheduled to another thread, in case it was instantiated ahead of time with a different code
 * flow.
 */
public void resetTrace() {
 mTracingThrowable.fillInStackTrace();
}
origin: robovm/robovm

/**
 * Constructs a new {@code Throwable} with the current stack trace and the
 * given detail message.
 */
public Throwable(String detailMessage) {
  this.detailMessage = detailMessage;
  this.stackTrace = EmptyArray.STACK_TRACE_ELEMENT;
  fillInStackTrace();
}
origin: robovm/robovm

/**
 * Constructs a new {@code Throwable} with the current stack trace, the
 * given detail message and cause.
 */
public Throwable(String detailMessage, Throwable cause) {
  this.detailMessage = detailMessage;
  this.cause = cause;
  this.stackTrace = EmptyArray.STACK_TRACE_ELEMENT;
  fillInStackTrace();
}
origin: robovm/robovm

/**
 * Constructs a new {@code Throwable} that includes the current stack trace.
 */
public Throwable() {
  this.stackTrace = EmptyArray.STACK_TRACE_ELEMENT;
  fillInStackTrace();
}
origin: plantuml/plantuml

private CString(List<Character> data2, int currentStart) {
  this.data2 = data2;
  this.currentStart = currentStart;
  this.uid = UID;
  UID += 2;
  creation.fillInStackTrace();
}
origin: robovm/robovm

/**
 * Constructs a new {@code Throwable} with the current stack trace and the
 * given cause.
 */
public Throwable(Throwable cause) {
  this.detailMessage = cause == null ? null : cause.toString();
  this.cause = cause;
  this.stackTrace = EmptyArray.STACK_TRACE_ELEMENT;
  fillInStackTrace();
}
origin: plantuml/plantuml

RealMoveable(RealLine line, String name) {
  super(line);
  this.name = name;
  this.creationPoint = new Throwable();
  this.creationPoint.fillInStackTrace();
}
origin: plantuml/plantuml

public PositiveForce(Real fixedPoint, RealMoveable movingPoint, double minimunDistance) {
  if (fixedPoint == movingPoint) {
    throw new IllegalArgumentException();
  }
  this.fixedPoint = fixedPoint;
  this.movingPoint = movingPoint;
  this.minimunDistance = minimunDistance;
  this.creationPoint = new Throwable();
  this.creationPoint.fillInStackTrace();
}
origin: plantuml/plantuml

RealMax(Collection<Real> reals) {
  super(line(reals));
  this.all.addAll(reals);
  this.creationPoint = new Throwable();
  this.creationPoint.fillInStackTrace();
}
origin: plantuml/plantuml

public static PSystemVersion createDumpStackTrace() throws IOException {
  final List<String> strings = new ArrayList<String>();
  final Throwable creationPoint = new Throwable();
  creationPoint.fillInStackTrace();
  for (StackTraceElement ste : creationPoint.getStackTrace()) {
    strings.add(ste.toString());
  }
  return new PSystemVersion(false, strings);
}
origin: org.mockito/mockito-core

public Object answer(InvocationOnMock invocation) throws Throwable {
  if (throwable == null) {
    throw new IllegalStateException("throwable is null: " +
      "you shall not call #answer if #validateFor fails!");
  }
  if (MockUtil.isMock(throwable)) {
    throw throwable;
  }
  Throwable t = throwable.fillInStackTrace();
  if (t == null) {
    //Custom exceptions sometimes return null, see #866
    throw throwable;
  }
  filter.filter(t);
  throw t;
}
origin: commons-logging/commons-logging

try {
  Throwable throwable = new Throwable();
  throwable.fillInStackTrace();
  StringWriter stringWriter = new StringWriter();
  PrintWriter printWriter = new PrintWriter( stringWriter );
origin: chentao0707/SimplifyReader

/**
 * Formats the caller's provided message and prepends useful info like
 * calling thread ID and method name.
 */
private static String buildMessage(String format, Object... args) {
  String msg = (args == null) ? format : String.format(Locale.US, format, args);
  StackTraceElement[] trace = new Throwable().fillInStackTrace().getStackTrace();
  String caller = "<unknown>";
  // Walk up the stack looking for the first caller outside of VolleyLog.
  // It will be at least two frames up, so start there.
  for (int i = 2; i < trace.length; i++) {
    Class<?> clazz = trace[i].getClass();
    if (!clazz.equals(VolleyLog.class)) {
      String callingClass = trace[i].getClassName();
      callingClass = callingClass.substring(callingClass.lastIndexOf('.') + 1);
      callingClass = callingClass.substring(callingClass.lastIndexOf('$') + 1);
      caller = callingClass + "." + trace[i].getMethodName();
      break;
    }
  }
  return String.format(Locale.US, "[%d] %s: %s",
      Thread.currentThread().getId(), caller, msg);
}
origin: mcxiaoke/android-volley

/**
 * Formats the caller's provided message and prepends useful info like
 * calling thread ID and method name.
 */
private static String buildMessage(String format, Object... args) {
  String msg = (args == null) ? format : String.format(Locale.US, format, args);
  StackTraceElement[] trace = new Throwable().fillInStackTrace().getStackTrace();
  String caller = "<unknown>";
  // Walk up the stack looking for the first caller outside of VolleyLog.
  // It will be at least two frames up, so start there.
  for (int i = 2; i < trace.length; i++) {
    Class<?> clazz = trace[i].getClass();
    if (!clazz.equals(VolleyLog.class)) {
      String callingClass = trace[i].getClassName();
      callingClass = callingClass.substring(callingClass.lastIndexOf('.') + 1);
      callingClass = callingClass.substring(callingClass.lastIndexOf('$') + 1);
      caller = callingClass + "." + trace[i].getMethodName();
      break;
    }
  }
  return String.format(Locale.US, "[%d] %s: %s",
      Thread.currentThread().getId(), caller, msg);
}
origin: killbill/killbill

  private static String getDebugInfo() {
    final Throwable t = new Throwable();
    t.fillInStackTrace();

    final StackTraceElement[] stackTrace = t.getStackTrace();
    if (stackTrace == null) {
      return null;
    }

    final StringBuilder dump = new StringBuilder();
    int firstEntitySqlDaoCall = 0;

    String className;
    for (int i = 0; i < stackTrace.length; i++) {
      className = stackTrace[i].getClassName();
      if (className.startsWith("org.killbill.billing.util.entity.dao.EntitySqlDaoTransactionalJdbiWrapper")) {
        firstEntitySqlDaoCall = i;
      }
    }
    final int j = 1 + firstEntitySqlDaoCall;

    dump.append(stackTrace[j].getClassName()).append(".").append(stackTrace[j].getMethodName()).append("(").
        append(stackTrace[j].getFileName()).append(":").append(stackTrace[j].getLineNumber()).append(")");

    return dump.toString();
  }
}
origin: google/j2objc

public Object answer(InvocationOnMock invocation) throws Throwable {
  Throwable throwable = (Throwable) ObjenesisHelper.newInstance(throwableClass);
  throwable.fillInStackTrace();
  filter.filter(throwable);
  throw throwable;
}
origin: plantuml/plantuml

@Override
double getCurrentValueInternal() {
  double result = all.get(0).getCurrentValue();
  for (int i = 1; i < all.size(); i++) {
    Throwable t = new Throwable();
    t.fillInStackTrace();
    final int stackLength = t.getStackTrace().length;
    if (stackLength > 1000) {
      System.err.println("The faulty RealMax " + getName());
      System.err.println("has been created here:");
      printCreationStackTrace();
      throw new IllegalStateException("Infinite recursion?");
    }
    final double v = all.get(i).getCurrentValue();
    if (v > result) {
      result = v;
    }
  }
  return result;
}
origin: google/j2objc

public Object answer(InvocationOnMock invocation) throws Throwable {
  if (new MockUtil().isMock(throwable)) {
    throw throwable;
  }
  Throwable t = throwable.fillInStackTrace();
  filter.filter(t);
  throw t;
}
origin: reactor/reactor-core

@Override
public synchronized Throwable fillInStackTrace() {
  return getCause() != null ? getCause().fillInStackTrace() :
      super.fillInStackTrace();
}
origin: org.easymock/easymock

public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  try {
    if (control.getState() instanceof RecordState) {
      LastControl.reportLastControl(control);
    }
    return control.getState().invoke(new Invocation(proxy, method, args));
  } catch (RuntimeExceptionWrapper e) {
    throw e.getRuntimeException().fillInStackTrace();
  } catch (AssertionErrorWrapper e) {
    throw e.getAssertionError().fillInStackTrace();
  } catch (ThrowableWrapper t) {
    throw t.getThrowable().fillInStackTrace();
  }
  // then let all unwrapped exceptions pass unmodified
}
java.langThrowablefillInStackTrace

Javadoc

Records the stack trace from the point where this method has been called to this Throwable. This method is invoked by the Throwable constructors.

This method is public so that code (such as an RPC system) which catches a Throwable and then re-throws it can replace the construction-time stack trace with a stack trace from the location where the exception was re-thrown, by calling fillInStackTrace.

This method is non-final so that non-Java language implementations can disable VM stack traces for their language. Filling in the stack trace is relatively expensive. Overriding this method in the root of a language's exception hierarchy allows the language to avoid paying for something it doesn't need.

Popular methods of Throwable

  • getMessage
    Returns the detail message string of this throwable.
  • printStackTrace
  • getCause
    Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is th
  • toString
    Returns a short description of this throwable. The result is the concatenation of: * the Class#getN
  • getStackTrace
    Provides programmatic access to the stack trace information printed by #printStackTrace(). Returns a
  • <init>
    Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : ca
  • getLocalizedMessage
    Creates a localized description of this throwable. Subclasses may override this method in order to p
  • setStackTrace
    Sets the stack trace elements that will be returned by #getStackTrace() and printed by #printStackTr
  • addSuppressed
    Appends the specified exception to the exceptions that were suppressed in order to deliver this exce
  • initCause
    Initializes the cause of this throwable to the specified value. (The cause is the throwable that cau
  • getSuppressed
    Returns the throwables suppressed by this.
  • countDuplicates
    Counts the number of duplicate stack frames, starting from the end of the stack.
  • getSuppressed,
  • countDuplicates,
  • getInternalStackTrace,
  • nativeFillInStackTrace,
  • nativeGetStackTrace,
  • fillInStackTrace0,
  • genStackTrace,
  • genStackTraceFromError,
  • getOurStackTrace

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now