Created
August 2, 2010 04:43
-
-
Save hakanai/504115 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // | |
| // Find the bug. :-) | |
| // | |
| interface HeavyLifting { | |
| void doSomeBlockingStuff() throws InterruptedException; | |
| } | |
| // meanwhile, somewhere else in the universe: | |
| class MyUsefulUtility { | |
| private final HeavyLifting lifter; | |
| public MyUsefulUtility(HeavyLifting lifter) { | |
| this.lifter = lifter; | |
| } | |
| public void liftStuff() { | |
| try { | |
| lifter.doSomeBlockingStuff(); | |
| } catch (Exception e) { | |
| Logger.getLogger(getClass()).error("It didn't work, bro."); | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment