Created
April 1, 2013 09:25
-
-
Save jangalinski/5283991 to your computer and use it in GitHub Desktop.
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 FactoryThatThrowsException { | |
// a String creation Factory/Builder ... | |
public static String getString() throws Exception { | |
throw new Exception(); | |
} | |
// normally would not compile | |
private final String aString = getString(); | |
// but does as long the constructor throws the exception | |
public FactoryThatThrowsException() throws Exception { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment