public static MethodTracepoint create(Class<?> cls,String methodName,String... namesForMethodParameters){
  Where where=Where.ENTRY;
  String tracepointName=String.format("%s.%s",cls.getSimpleName(),methodName);
  Method m=getMethod(cls,methodName,namesForMethodParameters.length);
  MethodTracepoint tracepoint=new MethodTracepoint(tracepointName,where,m);
  int paramCount=0;
  for (  Type paramType : m.getGenericParameterTypes()) {
    String exportAs=namesForMethodParameters[paramCount];
    String literal=String.format("$%d",++paramCount);
    if (TypeUtils.isArrayType(paramType)) {
      Type arrayOfType=TypeUtils.getArrayComponentType(paramType);
      String arrayOf=TypeUtils.toString(arrayOfType);
      tracepoint.addMultiExport(exportAs,literal,arrayOf);
    }
 else     if (TypeUtils.isAssignable(paramType,Collection.class)) {
      ParameterizedType pt=(ParameterizedType)paramType;
      Type collectionOfType=pt.getActualTypeArguments()[0];
      String collectionOf=TypeUtils.toString(collectionOfType);
      tracepoint.addMultiExport(exportAs,literal,collectionOf);
    }
 else {
      tracepoint.addExport(exportAs,literal);
    }
  }
  return tracepoint;
}

public static MethodTracepoint create ( Class < ? > cls , String methodName , String ... namesForMethodParameters ) { Where where = Where . ENTRY ; String tracepointName = String . format ( "%s.%s" , cls . getSimpleName ( ) , methodName ) ; Method m = getMethod ( cls , methodName , namesForMethodParameters . length ) ; MethodTracepoint tracepoint = new MethodTracepoint ( tracepointName , where , m ) ; int paramCount = 0 ; for ( Type paramType : m . getGenericParameterTypes ( ) ) { String exportAs = namesForMethodParameters [ paramCount ] ; String literal = String . format ( "$%d" , ++ paramCount ) ; if ( TypeUtils . isArrayType ( paramType ) ) { Type arrayOfType = TypeUtils . getArrayComponentType ( paramType ) ; String arrayOf = TypeUtils . toString ( arrayOfType ) ; tracepoint . addMultiExport ( exportAs , literal , arrayOf ) ; } else if ( TypeUtils . isAssignable ( paramType , Collection . class ) ) { ParameterizedType pt = ( ParameterizedType ) paramType ; Type collectionOfType = pt . getActualTypeArguments ( ) [ 0 ] ; String collectionOf = TypeUtils . toString ( collectionOfType ) ; tracepoint . addMultiExport ( exportAs , literal , collectionOf ) ; } else { tracepoint . addExport ( exportAs , literal ) ; } } return tracepoint ; }
create a tracepoint for the entry of the named method of the class . the name of the tracepoint will be the short class name and the method name , eg java . lang . string . format will have short name string . format parameter types will be looked up , and if the method is overloaded , returns one of the methods . if any of the method arguments are arrays or collections , they will be exported as multi - variables
