Class SunJdk8Internals


  • public final class SunJdk8Internals
    extends Object
    • Constructor Detail

      • SunJdk8Internals

        public SunJdk8Internals()
    • Method Detail

      • accessArray

        public static Object[] accessArray​(ArrayList<?> arrayList)
      • setSize

        public static void setSize​(ArrayList<?> arrayList,
                                   int size)
      • getLoadFactor

        public static float getLoadFactor​(HashSet<?> hashSet)
        My god. How incompetent can one be: they provide a constructor for configuring the load factor, but they provide no means to querying it. So if a hashset instance shall be transformed to another context and back (e.g. persistence), what is one supposed to do? Ignore the load factor and change the program behavior? What harm would it do to add an implementation-specific getter?

        Not to mention the set wraps a map internally which is THE most moronic thing to do both memory- and performance-wise.

        So another hack method has to provide basic functionality that is missing in the JDK. And should they ever get the idea to implement the set properly, this method will break.

        Parameters:
        hashSet -
      • getLoadFactor

        public static float getLoadFactor​(HashMap<?,​?> hashMap)
      • getLoadFactor

        public static float getLoadFactor​(Hashtable<?,​?> hashtable)
      • getLoadFactor

        public static float getLoadFactor​(LinkedHashMap<?,​?> linkedHashMap)
      • getAccessOrder

        public static boolean getAccessOrder​(LinkedHashMap<?,​?> linkedHashMap)
      • accessArray

        public static Object[] accessArray​(Vector<?> vector)
      • getElementCount

        public static int getElementCount​(Vector<?> vector)
      • setElementCount

        public static void setElementCount​(Vector<?> vector,
                                           int size)
      • getCapacityIncrement

        public static int getCapacityIncrement​(Vector<?> vector)
      • setCapacityIncrement

        public static void setCapacityIncrement​(Vector<?> vector,
                                                int size)
      • setSize

        public static void setSize​(PriorityQueue<?> priorityQueue,
                                   int size)