From 7abc5f9f843420fdc68e86f72c193f1f1ace76d8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 23 Feb 2019 11:26:21 -0500 Subject: [PATCH] Paper Utils diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java new file mode 100644 index 000000000..9db0056ab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java @@ -0,0 +1,16 @@ +package com.destroystokyo.paper.util; + +import org.jetbrains.annotations.NotNull; + +public class SneakyThrow { + + public static void sneaky(@NotNull Throwable exception) { + SneakyThrow.throwSneaky(exception); + } + + @SuppressWarnings("unchecked") + private static void throwSneaky(@NotNull Throwable exception) throws T { + throw (T) exception; + } + +} -- 2.21.0