Skip to content

Instantly share code, notes, and snippets.

@pwightman
Created October 4, 2012 21:05
Show Gist options
  • Save pwightman/3836457 to your computer and use it in GitHub Desktop.
Save pwightman/3836457 to your computer and use it in GitHub Desktop.
Some straight-up funny Java code.
// This was someone's real java code in production (names changed),
// I'm not making this crap up.
class SomeClass {
public void someMethod() {
if (some_condition) {
try {
throw new Exception();
} catch(Exception e) {
System.out.println(e.message());
System.exit(1);
}
}
}
}
// How about you just let the exception do a better job of what you're
// trying to do manually?!
// Thanks to Stephen J. Ward for bringing this award-winning code to my attention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment