Skip to content

Instantly share code, notes, and snippets.

@Nullcaller
Created January 19, 2019 23:09
Show Gist options
  • Save Nullcaller/e33cc71eeeb17d5cf21f676e17111cf0 to your computer and use it in GitHub Desktop.
Save Nullcaller/e33cc71eeeb17d5cf21f676e17111cf0 to your computer and use it in GitHub Desktop.
A class for quick code execution without exception handling. (use lambda expressions)
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