Package kilim.analysis
Class TypeDesc
- java.lang.Object
-
- kilim.analysis.TypeDesc
-
public class TypeDesc extends java.lang.ObjectA utility class that provides static methods for interning type strings and merging type descriptors.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringJAVA_LANG_OBJECT(package private) static java.util.HashMap<java.lang.String,java.lang.String>knownTypes
-
Constructor Summary
Constructors Constructor Description TypeDesc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcommonSuperType(Detector det, java.lang.String oa, java.lang.String ob)static java.lang.String[]getArgumentTypes(java.lang.String methodDescriptor)static java.lang.StringgetComponentType(java.lang.String t)static java.lang.StringgetInternalName(java.lang.String desc)static java.lang.StringgetInterned(java.lang.String desc)static intgetNumArgumentTypes(char[] buf)static intgetNumArgumentTypes(java.lang.String desc)static java.lang.StringgetReturnTypeDesc(java.lang.String desc)static java.lang.StringgetTypeDesc(java.lang.Object object)(package private) static booleanisDoubleWord(java.lang.String desc)static booleanisIntType(java.lang.String typeDesc)static booleanisRefType(java.lang.String typeDesc)(package private) static booleanisSingleWord(java.lang.String desc)static java.lang.StringmergeType(Detector det, java.lang.String a, java.lang.String b)Given two type descriptors, it returns an appropriate merge: 1) If they are Array types, the result is a an array of the merged component types 2) If they are ref types, it returns the least common super type.private static inttypelen(char[] buf, int off)
-
-
-
Method Detail
-
isDoubleWord
static boolean isDoubleWord(java.lang.String desc)
-
getInterned
public static java.lang.String getInterned(java.lang.String desc)
-
getReturnTypeDesc
public static java.lang.String getReturnTypeDesc(java.lang.String desc)
-
isSingleWord
static boolean isSingleWord(java.lang.String desc)
-
getComponentType
public static java.lang.String getComponentType(java.lang.String t)
-
getTypeDesc
public static java.lang.String getTypeDesc(java.lang.Object object)
-
typelen
private static int typelen(char[] buf, int off)
-
getArgumentTypes
public static java.lang.String[] getArgumentTypes(java.lang.String methodDescriptor)
-
getNumArgumentTypes
public static int getNumArgumentTypes(java.lang.String desc)
-
getNumArgumentTypes
public static int getNumArgumentTypes(char[] buf)
-
mergeType
public static java.lang.String mergeType(Detector det, java.lang.String a, java.lang.String b) throws IncompatibleTypesException
Given two type descriptors, it returns an appropriate merge: 1) If they are Array types, the result is a an array of the merged component types 2) If they are ref types, it returns the least common super type. If one of them is an interface, the result is D_OBJECT 3) All other types must match exactly in order to not raise an error.- Throws:
IncompatibleTypesException
-
commonSuperType
public static java.lang.String commonSuperType(Detector det, java.lang.String oa, java.lang.String ob)
-
isIntType
public static boolean isIntType(java.lang.String typeDesc)
-
isRefType
public static boolean isRefType(java.lang.String typeDesc)
-
getInternalName
public static java.lang.String getInternalName(java.lang.String desc)
-
-