public static String[] signatureParameterTypes(String sig){
  int pos1=sig.indexOf("(");
  int pos2=sig.indexOf(",",pos1 + 1);
  int pos3=sig.lastIndexOf(")");
  String paramType;
  List<String> paramTypes=new ArrayList<String>();
  while (pos2 > 0) {
    paramType=sig.substring(pos1 + 1,pos2);
    paramTypes.add(paramType);
    pos1=pos2;
    pos2=sig.indexOf(",",pos1 + 1);
  }
  paramType=sig.substring(pos1 + 1,pos3);
  if (!paramType.isEmpty())   paramTypes.add(paramType);
  return paramTypes.toArray(new String[0]);
}

public static String [ ] signatureParameterTypes ( String sig ) { int pos1 = sig . indexOf ( "(" ) ; int pos2 = sig . indexOf ( "," , pos1 + 1 ) ; int pos3 = sig . lastIndexOf ( ")" ) ; String paramType ; List < String > paramTypes = new ArrayList < String > ( ) ; while ( pos2 > 0 ) { paramType = sig . substring ( pos1 + 1 , pos2 ) ; paramTypes . add ( paramType ) ; pos1 = pos2 ; pos2 = sig . indexOf ( "," , pos1 + 1 ) ; } paramType = sig . substring ( pos1 + 1 , pos3 ) ; if ( ! paramType . isEmpty ( ) ) paramTypes . add ( paramType ) ; return paramTypes . toArray ( new String [ 0 ] ) ; }
given a method signature , returns a substring denoting the parameter types .
