code: protected JCTree methodDeclaratorRest(int pos,
                                JCModifiers mods,
                                JCExpression type,
                                Name name,
                                List<JCTypeParameter> typarams,
                                boolean isInterface, boolean isVoid,
                                Comment dc) {
          if (isInterface) {
              if ((mods.flags & Flags.STATIC) != 0) {
                  checkStaticInterfaceMethods();
              }
              if ((mods.flags & Flags.PRIVATE) != 0) {
                  checkPrivateInterfaceMethods();
              }
          }
          JCVariableDecl prevReceiverParam = this.receiverParam;
          try {
              this.receiverParam = null;
              // Parsing formalParameters sets the receiverParam, if present
              List<JCVariableDecl> params = formalParameters();
              if (!isVoid) type = bracketsOpt(type);
              List<JCExpression> thrown = List.nil();
              if (token.kind == THROWS) {
                  nextToken();
                  thrown = qualidentList(true);
              }
              JCBlock body = null;
              JCExpression defaultValue;
              if (token.kind == LBRACE) {
                  body = block();
                  defaultValue = null;
              } else {
                  if (token.kind == DEFAULT) {
                      accept(DEFAULT);
                      defaultValue = annotationValue();
                  } else {
                      defaultValue = null;
                  }
                  accept(SEMI);
                  if (token.pos <= endPosTable.errorEndPos) {
                      // error recovery
                      skip(false, true, false, false);
                      if (token.kind == LBRACE) {
                          body = block();
                      }
                  }
              }
  
              JCMethodDecl result =
                      toP(F.at(pos).MethodDef(mods, name, type, typarams,
                                              receiverParam, params, thrown,
                                              body, defaultValue));
              attach(result, dc);
              return result;
          } finally {
              this.receiverParam = prevReceiverParam;
          }
      }
docs: MethodDeclaratorRest =
  FormalParameters BracketsOpt [THROWS TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";")
  VoidMethodDeclaratorRest =
  FormalParameters [THROWS TypeList] ( MethodBody | ";")
  ConstructorDeclaratorRest =
  "(" FormalParameterListOpt ")" [THROWS TypeList] MethodBody