Skip to content

Instantly share code, notes, and snippets.

@bandrzejczak
Created February 9, 2018 22:07
Show Gist options
  • Save bandrzejczak/6c3a0308646c386cd1cc2e771f1f9285 to your computer and use it in GitHub Desktop.
Save bandrzejczak/6c3a0308646c386cd1cc2e771f1f9285 to your computer and use it in GitHub Desktop.
@CallerSensitive
public static Unsafe getUnsafe() {
Class var0 = Reflection.getCallerClass();
if(!VM.isSystemDomainLoader(var0.getClassLoader())) {
throw new SecurityException("Unsafe");
} else {
return theUnsafe;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment