Package jadx.core.dex.nodes.utils
Class TypeUtils
java.lang.Object
jadx.core.dex.nodes.utils.TypeUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprivate ClassTypeVarsAttr@Nullable ArgTypecheckForUnknownTypeVars(MethodNode mth, ArgType checkType) Search for unknown type vars at current method.booleancontainsUnknownTypeVar(MethodNode mth, ArgType type) private voidexpandTypeVar(NotificationAttrNode node, ArgType type, Collection<ArgType> typeVars) expandTypeVariables(ClassNode cls, ArgType type) expandTypeVariables(MethodNode mth, ArgType type) getClassGenerics(ArgType type) @Nullable ClassTypeVarsAttrgetClassTypeVars(ArgType type) private static Collection<ArgType> getTypeVariablesMapping(ArgType clsType) getTypeVarMappingForInvoke(BaseInvokeNode invokeInsn) @Nullable ArgTypereplaceClassGenerics(ArgType instanceType, ArgType typeWithGeneric) Replace generic types intypeWithGenericusing instance types
Example:instanceType: Set<String>typeWithGeneric: Iterator<E>return: Iterator<String>@Nullable ArgTypereplaceClassGenerics(ArgType instanceType, ArgType genericSourceType, ArgType typeWithGeneric) @Nullable ArgTypereplaceMethodGenerics(BaseInvokeNode invokeInsn, IMethodDetails details, ArgType typeWithGeneric) @Nullable ArgTypereplaceTypeVariablesUsingMap(ArgType replaceType, Map<ArgType, ArgType> replaceMap) voidvisitSuperTypes(ArgType type, BiConsumer<ArgType, ArgType> consumer)
-
Field Details
-
root
-
-
Constructor Details
-
TypeUtils
-
-
Method Details
-
getClassGenerics
-
getClassTypeVars
-
expandTypeVariables
-
expandTypeVariables
-
expandTypeVar
-
getKnownTypeVarsAtMethod
-
getKnownTypeVarsAtClass
-
collectKnownTypeVarsAtMethod
-
checkForUnknownTypeVars
Search for unknown type vars at current method. Return only first.- Returns:
- unknown type var, null if not found
-
containsUnknownTypeVar
-
replaceClassGenerics
@Nullable public @Nullable ArgType replaceClassGenerics(ArgType instanceType, ArgType typeWithGeneric) Replace generic types intypeWithGenericusing instance types
Example:instanceType: Set<String>typeWithGeneric: Iterator<E>return: Iterator<String>
-
replaceClassGenerics
-
mergeTypeMaps
-
getTypeVariablesMapping
-
getTypeVarMappingForInvoke
-
addTypeVarMapping
-
replaceMethodGenerics
@Nullable public @Nullable ArgType replaceMethodGenerics(BaseInvokeNode invokeInsn, IMethodDetails details, ArgType typeWithGeneric) -
replaceTypeVariablesUsingMap
-
buildClassTypeVarsAttr
-
visitSuperTypes
-