Class SecurityActions.TheUnsafe

  • Enclosing class:
    SecurityActions

    class SecurityActions.TheUnsafe
    extends java.lang.Object
    _The_ Notorious sun.misc.Unsafe in all its glory, but anonymous so as not to attract unwanted attention. Kept in two separate parts it manages to avoid detection from linker/compiler/general complainers and those. This functionality will vanish from the JDK soon but in the meantime it shouldn't be an obstacle. All exposed methods are cached in a dictionary with overloaded methods collected under their corresponding keys. Currently the implementation assumes there is only one, if you need find a need there will have to be a compare.
    Since:
    3.23
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.Map<java.lang.String,​java.util.List<java.lang.reflect.Method>> methods  
      (package private) java.lang.Object theUnsafe  
      (package private) java.lang.Class<?> unsafe  
    • Constructor Summary

      Constructors 
      Constructor Description
      TheUnsafe​(java.lang.Class<?> c, java.lang.Object o)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object call​(java.lang.String name, java.lang.Object... args)  
      private java.lang.reflect.Method getM​(java.lang.String name, java.lang.Object[] o)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • unsafe

        final java.lang.Class<?> unsafe
      • theUnsafe

        final java.lang.Object theUnsafe
      • methods

        final java.util.Map<java.lang.String,​java.util.List<java.lang.reflect.Method>> methods
    • Constructor Detail

      • TheUnsafe

        TheUnsafe​(java.lang.Class<?> c,
                  java.lang.Object o)
    • Method Detail

      • getM

        private java.lang.reflect.Method getM​(java.lang.String name,
                                              java.lang.Object[] o)
      • call

        public java.lang.Object call​(java.lang.String name,
                                     java.lang.Object... args)