Created
October 25, 2012 08:17
-
-
Save yurylyt/3951375 to your computer and use it in GitHub Desktop.
where-do-stack-traces-come-5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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