Created
January 19, 2019 23:09
-
-
Save Nullcaller/e33cc71eeeb17d5cf21f676e17111cf0 to your computer and use it in GitHub Desktop.
A class for quick code execution without exception handling. (use lambda expressions)
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
public interface Unsafe { | |
public void code() throws Throwable; | |
public static void execute(Unsafe unsafe) { | |
try { | |
unsafe.code(); | |
} catch(Throwable t) { | |
throw new RuntimeException(t); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment