Created
October 4, 2012 21:05
-
-
Save pwightman/3836457 to your computer and use it in GitHub Desktop.
Some straight-up funny Java code.
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
// 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