Пример #1
0
  //
  // called by the .end method directive to end the definition for a method
  //
  void endMethod() throws jasError {
    if (cur_method == null) throw new jasError(".end method without .method");

    if (cur_annotation != null) opened_annotation("method");

    if (code != null) {

      plantLabel(END_METHOD);
      flushInsnBuffer();

      if (catch_table != null) {
        code.setCatchtable(catch_table);
      }

      if (var_table != null) {
        code.setLocalVarTable(var_table);
      }
      if (vtype_table != null) {
        code.setLocalVarTypeTable(vtype_table);
      }
      if (line_table != null) {
        code.setLineTable(line_table);
      }
      if (stackmap != null) {
        code.setStackMap(stackmap);
      }
    }
    cur_method.setCode(code, except_attr);
    class_env.addMethod(cur_method);

    // clear method state variables
    cur_method = null;
    code = null;
    labels = null;
    catch_table = null;
    line_table = null;
    var_table = null;
    vtype_table = null;
    stackmap = null;
    verifyframe = null;
  }