Package org.glassfish.gmbal.typelib
Class TypeEvaluator
- java.lang.Object
-
- org.glassfish.gmbal.typelib.TypeEvaluator
-
public class TypeEvaluator extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTypeEvaluator.EvalMapKeyprivate static classTypeEvaluator.PartialDefinitionsprivate static classTypeEvaluator.TypeEvaluationVisitor
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.Class,EvaluatedType>classMapprivate static java.util.List<EvaluatedType>emptyETListprivate static java.util.Map<TypeEvaluator.EvalMapKey,EvaluatedClassDeclaration>evalClassMapprivate static java.util.Map<java.lang.Class<?>,EvaluatedType>immutableTypesprivate static java.lang.StringORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTIONFor ORB compatibility with JDK11+ JDKs see https://github.com/eclipse-ee4j/orb-gmbal/issues/22
-
Constructor Summary
Constructors Modifier Constructor Description privateTypeEvaluator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddumpEvalClassMap()static intevalClassMapSize()private static java.util.List<java.lang.reflect.Field>getDeclaredFields(java.lang.Class<?> cls)private static java.lang.reflect.MethodgetDeclaredMethod(java.lang.Class<?> cls, java.lang.String name, java.lang.Class<?>... sig)private static java.util.List<java.lang.reflect.Method>getDeclaredMethods(java.lang.Class<?> cls)private static EvaluatedClassDeclarationgetECD(java.lang.Class cls)static EvaluatedTypegetEvaluatedType(java.lang.Class cls)Given any generic java type, evaluate all of its type bounds and return an evaluated type.private static EvaluatedTypegetImmutableEvaluatedType(java.lang.Class<?> cls)Return the EvaluatedType corresponding to cls if cls represents an immutable type, otherwise return null.private static voidmapPut(EvaluatedClassDeclaration ecd, java.lang.Class cls)static voidsetDebugLevel(int level)
-
-
-
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/22In 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
-
evalClassMap
private static java.util.Map<TypeEvaluator.EvalMapKey,EvaluatedClassDeclaration> evalClassMap
-
emptyETList
private static java.util.List<EvaluatedType> emptyETList
-
classMap
private static java.util.Map<java.lang.Class,EvaluatedType> classMap
-
-
Method Detail
-
mapPut
private static void mapPut(EvaluatedClassDeclaration ecd, java.lang.Class cls)
-
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)
-
getECD
private static EvaluatedClassDeclaration getECD(java.lang.Class cls)
-
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.NoSuchMethodExceptionjava.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
-
-