HelperClass.java
(520 bytes)
import sun.misc.Unsafe; class MyDangerousHelperClass{ private static Unsafe UNSAFE = null; //caching it - just for sake of "performance"... public static void THROW(Throwable t) { if (UNSAFE == null) { Field field; try { field = Unsafe.class.getDeclaredField("theUnsafe"); field.setAccessible(true); UNSAFE = (Unsafe) field.get(null); } catch (Throwable unsafeCannotBeRetrieved) { throw new RuntimeException(unsafeCannotBeRetrieved); } } UNSAFE.throwException(t); } }