Skip to content

Instantly share code, notes, and snippets.

@yurylyt
Created October 25, 2012 08:17
Show Gist options
  • Save yurylyt/3951375 to your computer and use it in GitHub Desktop.
Save yurylyt/3951375 to your computer and use it in GitHub Desktop.
where-do-stack-traces-come-5
public class SponsoredException extends RuntimeException {
@Override
public synchronized Throwable fillInStackTrace() {
setStackTrace(new StackTraceElement[]{
new StackTraceElement("ADVERTISEMENT", " If you don't ", null, 0),
new StackTraceElement("ADVERTISEMENT", " want to see this ", null, 0),
new StackTraceElement("ADVERTISEMENT", " exception ", null, 0),
new StackTraceElement("ADVERTISEMENT", " please buy ", null, 0),
new StackTraceElement("ADVERTISEMENT", " full version ", null, 0),
new StackTraceElement("ADVERTISEMENT", " of the program ", null, 0)
});
return this;
}
}
public class ExceptionFromHell extends RuntimeException {
public ExceptionFromHell() {
super("Catch me if you can");
}
@Override
public synchronized Throwable fillInStackTrace() {
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment