code: private static String getTypeString(IType t) {
          if(t==null)
              return "null";
  
          IPtrType pt = t.queryInterface(IPtrType.class);
          if(pt!=null)
              return getTypeString(pt.getPointedAtType())+"*";
  
          IPrimitiveType prim = t.queryInterface(IPrimitiveType.class);
          if(prim!=null)
              return prim.getName();
  
          ITypeDecl decl = t.queryInterface(ITypeDecl.class);
          if(decl!=null)
              return decl.getName();
  
          ISafeArrayType sa = t.queryInterface(ISafeArrayType.class);
          if (sa != null) {
            return "SAFEARRAY(" + getTypeString(sa.getComponentType()) + ")";
          }
  
          return "N/A";
      }
docs: Returns a human-readable identifier of the type,
  but it's not necessarily a correct Java id.
  
  This is mainly for debugging.