Class TypeEvaluator


  • public class TypeEvaluator
    extends java.lang.Object
    • Field Detail

      • ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION

        private static final java.lang.String ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION
        For ORB compatibility with JDK11+ JDKs see https://github.com/eclipse-ee4j/orb-gmbal/issues/22

        In short, the ORB references com.sun.corba.ee.spi.orb.ORB, which references com.sun.corba.ee.impl.corba.TypeCodeFactory which eventually references com.sun.corba.ee.spi.legacy.connection.Connection.getSocket and java.net.Socket.checkPermission(java.net.SocketImpl).

        Now SocketImpl contains a method "<S extends SocketImpl & PlatformSocketImpl> S createPlatformSocketImpl", which causes the ORB to crash completely. Setting a system property with this string ignores the fact GMBAL doesn't support multiple upper bounds.

        See Also:
        Constant Field Values
      • immutableTypes

        private static java.util.Map<java.lang.Class<?>,​EvaluatedType> immutableTypes
      • emptyETList

        private static java.util.List<EvaluatedType> emptyETList
      • classMap

        private static java.util.Map<java.lang.Class,​EvaluatedType> classMap
    • Constructor Detail

      • TypeEvaluator

        private TypeEvaluator()
    • Method Detail

      • getImmutableEvaluatedType

        private static EvaluatedType getImmutableEvaluatedType​(java.lang.Class<?> cls)
        Return the EvaluatedType corresponding to cls if cls represents an immutable type, otherwise return null.
        Parameters:
        cls -
        Returns:
        an EvaluatedType, if cls is on the immutable list; otherwise null.
      • setDebugLevel

        public static void setDebugLevel​(int level)
      • getDeclaredMethods

        private static java.util.List<java.lang.reflect.Method> getDeclaredMethods​(java.lang.Class<?> cls)
      • getDeclaredFields

        private static java.util.List<java.lang.reflect.Field> getDeclaredFields​(java.lang.Class<?> cls)
      • getDeclaredMethod

        private static java.lang.reflect.Method getDeclaredMethod​(java.lang.Class<?> cls,
                                                                  java.lang.String name,
                                                                  java.lang.Class<?>... sig)
                                                           throws java.lang.NoSuchMethodException,
                                                                  java.security.PrivilegedActionException
        Throws:
        java.lang.NoSuchMethodException
        java.security.PrivilegedActionException
      • evalClassMapSize

        public static int evalClassMapSize()
      • dumpEvalClassMap

        public static void dumpEvalClassMap()
      • getEvaluatedType

        public static EvaluatedType getEvaluatedType​(java.lang.Class cls)
        Given any generic java type, evaluate all of its type bounds and return an evaluated type.
        Parameters:
        cls - The java type to evaluate
        Returns:
        The evaluated type