Created
August 2, 2010 05:31
-
-
Save hakanai/504155 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 - Hard Mode | |
| // | |
| class SomeSunLibrary { | |
| /** | |
| * @throws InterruptedIOException sometimes, depending on the OS and the moon. | |
| * @throws IOException | |
| */ | |
| void doSomeIO() throws IOException { | |
| try { | |
| doSomeBlockingShit(); | |
| } catch (InterruptedException e) { | |
| throw new InterruptedIOException(e); | |
| } | |
| } | |
| } | |
| // meanwhile, somewhere else in the universe: | |
| class MyUsefulUtility { | |
| private final SomeSunLibrary library; | |
| public MyUsefulUtility(SomeSunLibrary library) { | |
| this.library = library; | |
| } | |
| public void liftStuff() { | |
| try { | |
| library.doSomeIO(); | |
| } catch (IOException 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