Class TypeDesc

java.lang.Object
kilim.analysis.TypeDesc

public class TypeDesc extends Object
A utility class that provides static methods for interning type strings and merging type descriptors.
  • Field Details

  • Constructor Details

    • TypeDesc

      public TypeDesc()
  • Method Details

    • isDoubleWord

      static boolean isDoubleWord(String desc)
    • getInterned

      public static String getInterned(String desc)
    • getReturnTypeDesc

      public static String getReturnTypeDesc(String desc)
    • isSingleWord

      static boolean isSingleWord(String desc)
    • getComponentType

      public static String getComponentType(String t)
    • getTypeDesc

      public static String getTypeDesc(Object object)
    • typelen

      private static int typelen(char[] buf, int off)
    • getArgumentTypes

      public static String[] getArgumentTypes(String methodDescriptor)
    • getNumArgumentTypes

      public static int getNumArgumentTypes(String desc)
    • getNumArgumentTypes

      public static int getNumArgumentTypes(char[] buf)
    • mergeType

      public static String mergeType(Detector det, String a, 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 String commonSuperType(Detector det, String oa, String ob)
    • isIntType

      public static boolean isIntType(String typeDesc)
    • isRefType

      public static boolean isRefType(String typeDesc)
    • getInternalName

      public static String getInternalName(String desc)