private MethodDef parse_method(StrTok st){
  String method_name=st.need_word();
  st.need("(");
  ArrayList<String> args=new ArrayList<>();
  String tok=st.nextToken();
  if (tok != ")") {
    st.pushBack();
    do {
      tok=st.need_word();
      args.add(tok);
    }
 while (st.nextToken() == ",");
    st.pushBack();
    st.need(")");
  }
  Type[] targs=new Type[args.size()];
  for (int ii=0; ii < args.size(); ii++) {
    targs[ii]=BCELUtil.classname_to_type(args.get(ii));
  }
  return new MethodDef(method_name,targs);
}

private MethodDef parse_method ( StrTok st ) { String method_name = st . need_word ( ) ; st . need ( "(" ) ; ArrayList < String > args = new ArrayList < > ( ) ; String tok = st . nextToken ( ) ; if ( tok != ")" ) { st . pushBack ( ) ; do { tok = st . need_word ( ) ; args . add ( tok ) ; } while ( st . nextToken ( ) == "," ) ; st . pushBack ( ) ; st . need ( ")" ) ; } Type [ ] targs = new Type [ args . size ( ) ] ; for ( int ii = 0 ; ii < args . size ( ) ; ii ++ ) { targs [ ii ] = BCELUtil . classname_to_type ( args . get ( ii ) ) ; } return new MethodDef ( method_name , targs ) ; }
parse a method declaration . the declaration should be in the following format : fully - qualified - method - name ( args ) where the arguments are comma separated and all arguments other than primitives should have fully - qualified names . arrays are indicating by trailing brackets . for example : int int [ ] int [ ] [ ] java . lang . string java . util . date [ ] the arguments are translated into bcel types and a methoddef is returned .
