/test/src/solidstack/cache/StackTrace.java

http://solidstack.googlecode.com/ · Java · 36 lines · 22 code · 6 blank · 8 comment · 0 complexity · c1b7f6b492da91a6a37f07197324ebd6 MD5 · raw file

  1. package solidstack.cache;
  2. /**
  3. * Wrapper to enable the current stack trace of a thread to be logged.
  4. *
  5. * @author René de Bloois
  6. */
  7. public class StackTrace extends Throwable
  8. {
  9. private static final long serialVersionUID = 1L;
  10. private Thread thread;
  11. /**
  12. * @param thread The thread of which the stack trace needs to be logged.
  13. */
  14. public StackTrace( Thread thread )
  15. {
  16. super( "" );
  17. this.thread = thread;
  18. }
  19. @Override
  20. @SuppressWarnings( "all" )
  21. public Throwable fillInStackTrace()
  22. {
  23. return this;
  24. }
  25. @Override
  26. public StackTraceElement[] getStackTrace()
  27. {
  28. return this.thread.getStackTrace();
  29. }
  30. }