Package javassist.util.proxy
Class SecurityActions
java.lang.Object
java.lang.SecurityManager
javassist.util.proxy.SecurityActions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
_The_ Notorious sun.misc.Unsafe in all its glory, but anonymous so as not to attract unwanted attention. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
Java 9 now complains about every privileged action regardless.Class
<?> Since Java 9 abruptly removedReflection.getCallerClass()
in favour ofStackWalker
we are left having to find a solution for the older versions without upsetting the new compiler.(package private) static Constructor
<?> getDeclaredConstructor
(Class<?> clazz, Class<?>[] types) (package private) static Constructor<?>[]
getDeclaredConstructors
(Class<?> clazz) (package private) static Method
getDeclaredMethod
(Class<?> clazz, String name, Class<?>[] types) (package private) static Method[]
getDeclaredMethods
(Class<?> clazz) (package private) static MethodHandle
getMethodHandle
(Class<?> clazz, String name, Class<?>[] params) (package private) static SecurityActions.TheUnsafe
(package private) static void
(package private) static void
setAccessible
(AccessibleObject ao, boolean accessible) Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkExit, checkLink, checkListen, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkWrite, checkWrite, getClassContext, getSecurityContext, getThreadGroup
-
Field Details
-
stack
-
-
Constructor Details
-
SecurityActions
SecurityActions()
-
-
Method Details
-
getCallerClass
Since Java 9 abruptly removedReflection.getCallerClass()
in favour ofStackWalker
we are left having to find a solution for the older versions without upsetting the new compiler. The member scoped functiongetClassContext()
available as aSecurityManager
sibling remains functional across all versions, for now.- Returns:
- represents the declaring class of the method that invoked the method that called this or index 2 on the stack trace.
- Since:
- 3.23
-
getDeclaredMethods
-
getDeclaredConstructors
-
getMethodHandle
static MethodHandle getMethodHandle(Class<?> clazz, String name, Class<?>[] params) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
getDeclaredMethod
static Method getDeclaredMethod(Class<?> clazz, String name, Class<?>[] types) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
getDeclaredConstructor
static Constructor<?> getDeclaredConstructor(Class<?> clazz, Class<?>[] types) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
setAccessible
-
set
- Throws:
IllegalAccessException
-
getSunMiscUnsafeAnonymously
- Throws:
ClassNotFoundException
-
disableWarning
Java 9 now complains about every privileged action regardless. Displaying warnings of "illegal usage" and then instructing users to go hassle the maintainers in order to have it fixed. Making it hush for now, see all fixed.- Parameters:
tu
- theUnsafe that'll fix it
-