Class SunLimitedUnsafeReflectionProvider

  • All Implemented Interfaces:
    ReflectionProvider
    Direct Known Subclasses:
    SunUnsafeReflectionProvider

    public class SunLimitedUnsafeReflectionProvider
    extends PureJavaReflectionProvider
    Instantiates a new object bypassing the constructor using undocumented internal JDK features.

    The code in the constructor will never be executed and parameters do not have to be known. This is the same method used by the internals of standard Java serialization, but relies on internal code (sun.misc.Unsafe) that may not be present on all JVMs.

    The implementation will use standard Java functionality to write any fields. This requires Java 5 as minimum runtime and is used as fallback on platforms that do not provide the complete implementation level for the internals (like Dalvik).

    Since:
    1.4.7
    Author:
    Jörg Schaible, Joe Walnes, Brian Slesinsky
    • Field Detail

      • unsafe

        protected static final sun.misc.Unsafe unsafe
      • exception

        protected static final java.lang.Exception exception
    • Constructor Detail

      • SunLimitedUnsafeReflectionProvider

        public SunLimitedUnsafeReflectionProvider()
        Since:
        1.4.7
      • SunLimitedUnsafeReflectionProvider

        public SunLimitedUnsafeReflectionProvider​(FieldDictionary fieldDictionary)
        Since:
        1.4.7