mark methods to deprecate. while developer call it, print a warning text to console

@param {any} methodDescriptor

@return {any}
338180
function Deprecate(methodDescriptor) {
    let {descriptor, key} = methodDescriptor;

    let fn = descriptor.value;

    descriptor.value = function(...args) {
        console.warn(`DEPRECATE: [${key}] This function will be removed in future versions.`);
        return fn.apply(this, args);
    };

    return {
        ...methodDescriptor,
        descriptor,
    };
}
458901
def deprecate(
    message: str, category: Any = DeprecationWarning, stacklevel: int = 0
) -> Callable[[F], F]:
    """"""

    def decorator(func: F) -> F:
        if not __debug__:
            return func

        @functools.wraps(func)
        def wrapper(*args, **kargs):  # type: ignore
            warnings.warn(message, category, stacklevel=stacklevel + 2)
            return func(*args, **kargs)

        return cast(F, wrapper)

    return decorator
1327806
def deprecated(msg=''):
    """"""
    @decorator.decorator
    def wrap(function, *args, **kwargs):
        if not kwargs.pop('disable_warning', False):
            warn(msg, DeprecationWarning)
        return function(*args, **kwargs)
    return wrap
709237
function boundMethod(target, key, descriptor) {
    // console.log('target, key, descriptor', target, key, descriptor)
    let fn = descriptor.value

    if (typeof fn !== 'function') {
        throw new Error(`@autobind decorator can only be applied to methods not: ${typeof fn}`)
    }

    // In IE11 calling Object.defineProperty has a side-effect of evaluating the
    // getter for the property which is being replaced. This causes infinite
    // recursion and an "Out of stack space" error.
    let definingProperty = false

    return {
        configurable: true,
        get() {
            if (definingProperty || this === target.prototype || this.hasOwnProperty(key)
                || typeof fn !== 'function') {
                return fn
            }

            let boundFn = bind(fn, this)//fn.bind(this)
            definingProperty = true
            Object.defineProperty(this, key, {
                configurable: true,
                get() {
                    return boundFn
                },
                set(value) {
                    fn = value
                    delete this[key]
                }
            })
            definingProperty = false
            return boundFn
        },
        set(value) {
            fn = value
        }
    }
}
155437
def method_descriptor(descriptor: str) -> MethodDescriptor:
    
    end_para = descriptor.find(')')
    returns = descriptor[end_para + 1:]
    args = descriptor[1:end_para]

    return MethodDescriptor(
        parse_descriptor(returns)[0],
        parse_descriptor(args),
        returns,
        args,
        descriptor
    )
753124
private String methodReferenceDescriptor(Types types, MethodSymbol sym) {
    StringBuilder sb = new StringBuilder();
    sb.append(sym.getSimpleName()).append('(');
    if (!sym.isStatic()) {
      sb.append(Signatures.descriptor(sym.owner.type, types));
    }
    sym.params().stream().map(p -> Signatures.descriptor(p.type, types)).forEachOrdered(sb::append);
    sb.append(")");
    return sb.toString();
  }
852853
int getMethodIndex(ExecutableElement method)
    {
        TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
        String fullyQualifiedname = declaringClass.getQualifiedName().toString();
        return getRefIndex(Methodref.class, fullyQualifiedname, method.getSimpleName().toString(), Descriptor.getDesriptor(method));
    }
951609
def method_missing(method, *args, &blck)
      if data.key?(method.to_s)
        Bunto::Deprecator.deprecation_message "Document##{method} is now a key "\
                           "in the #data hash."
        Bunto::Deprecator.deprecation_message "Called by #{caller.first}."
        data[method.to_s]
      else
        super
      end
    end
723006
function NextTick(method) {
      return function (target, key, descriptor) {
          var original = descriptor.value;
          descriptor.value = function emitter() {
              var args = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                  args[_i] = arguments[_i];
              }
              if (original.apply(this, args) !== false)
                  if (typeof this[method] === 'function') {
                      this.$nextTick(this[method]);
                  }
                  else {
                      throw new TypeError('must be a method name');
                  }
          };
      };
  }
20264
private static MethodDescriptor[] getMdescriptor() {
    final MethodDescriptor[] methods = new MethodDescriptor[36];

    try {
      methods[METHOD_addAttribute0] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("addAttribute", new Class[] {
              java.lang.String.class, java.lang.Object.class})); // NOI18N
      methods[METHOD_addAttribute0].setDisplayName("");
      methods[METHOD_addAttribute1] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("addAttribute", new Class[] {
              java.lang.String.class, int.class, java.lang.Object.class})); // NOI18N
      methods[METHOD_addAttribute1].setDisplayName("");
      methods[METHOD_addChild2] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("addChild", new Class[] {
              java.lang.String.class, com.google.protobuf.Message.class})); // NOI18N
      methods[METHOD_addChild2].setDisplayName("");
      methods[METHOD_addChild3] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("addChild",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_addChild3].setDisplayName("");
      methods[METHOD_addChild4] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("addChild", new Class[] {
              java.lang.String.class, int.class, com.google.protobuf.Message.class})); // NOI18N
      methods[METHOD_addChild4].setDisplayName("");
      methods[METHOD_addChild5] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("addChild", new Class[] {
              java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_addChild5].setDisplayName("");
      methods[METHOD_build6] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("build", new Class[] {})); // NOI18N
      methods[METHOD_build6].setDisplayName("");
      methods[METHOD_buildPartial7] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("buildPartial",
              new Class[] {})); // NOI18N
      methods[METHOD_buildPartial7].setDisplayName("");
      methods[METHOD_clear8] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("clear", new Class[] {})); // NOI18N
      methods[METHOD_clear8].setDisplayName("");
      methods[METHOD_clone9] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("clone", new Class[] {})); // NOI18N
      methods[METHOD_clone9].setDisplayName("");
      methods[METHOD_getAttribute10] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("getAttribute",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_getAttribute10].setDisplayName("");
      methods[METHOD_getAttribute11] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("getAttribute", new Class[] {
              java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_getAttribute11].setDisplayName("");
      methods[METHOD_getChild12] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("getChild",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_getChild12].setDisplayName("");
      methods[METHOD_getChild13] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("getChild", new Class[] {
              java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_getChild13].setDisplayName("");
      methods[METHOD_isAttribute14] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("isAttribute",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_isAttribute14].setDisplayName("");
      methods[METHOD_isFieldIndexed15] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("isFieldIndexed",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_isFieldIndexed15].setDisplayName("");
      methods[METHOD_mergeFrom16] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("mergeFrom",
              new Class[] {com.google.protobuf.Message.class})); // NOI18N
      methods[METHOD_mergeFrom16].setDisplayName("");
      methods[METHOD_newSavePoint17] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("newSavePoint",
              new Class[] {})); // NOI18N
      methods[METHOD_newSavePoint17].setDisplayName("");
      methods[METHOD_removeAttribute18] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("removeAttribute",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_removeAttribute18].setDisplayName("");
      methods[METHOD_removeAttribute19] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("removeAttribute",
              new Class[] {java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_removeAttribute19].setDisplayName("");
      methods[METHOD_removeChild20] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("removeChild",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_removeChild20].setDisplayName("");
      methods[METHOD_removeChild21] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("removeChild", new Class[] {
              java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_removeChild21].setDisplayName("");
      methods[METHOD_setAttribute24] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("setAttribute", new Class[] {
              java.lang.String.class, java.lang.Object.class})); // NOI18N
      methods[METHOD_setAttribute24].setDisplayName("");
      methods[METHOD_setAttribute25] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("setAttribute", new Class[] {
              java.lang.String.class, int.class, java.lang.Object.class})); // NOI18N
      methods[METHOD_setAttribute25].setDisplayName("");
      methods[METHOD_setChild26] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("setChild", new Class[] {
              java.lang.String.class, com.google.protobuf.Message.class})); // NOI18N
      methods[METHOD_setChild26].setDisplayName("");
      methods[METHOD_setChild27] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("setChild",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_setChild27].setDisplayName("");
      methods[METHOD_setChild28] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("setChild", new Class[] {
              java.lang.String.class, int.class, com.google.protobuf.Message.class})); // NOI18N
      methods[METHOD_setChild28].setDisplayName("");
      methods[METHOD_setChild29] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("setChild", new Class[] {
              java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_setChild29].setDisplayName("");
      methods[METHOD_size30] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("size", new Class[] {})); // NOI18N
      methods[METHOD_size30].setDisplayName("");
      methods[METHOD_toChild31] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("toChild",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_toChild31].setDisplayName("");
      methods[METHOD_toChild32] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("toChild", new Class[] {
              java.lang.String.class, int.class})); // NOI18N
      methods[METHOD_toChild32].setDisplayName("");
      methods[METHOD_toLastChild33] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("toLastChild",
              new Class[] {java.lang.String.class})); // NOI18N
      methods[METHOD_toLastChild33].setDisplayName("");
      methods[METHOD_toParent34] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("toParent", new Class[] {})); // NOI18N
      methods[METHOD_toParent34].setDisplayName("");
      methods[METHOD_toRoot35] =
          new MethodDescriptor(DynamicMessage.Builder.class.getMethod("toRoot", new Class[] {})); // NOI18N
      methods[METHOD_toRoot35].setDisplayName("");
    } catch (final Exception e) {
    }// GEN-HEADEREND:Methods
     // Here you can add code for customizing the methods array.

    return methods;
  }
62223
public static void deprecated(Class<?> clazz, String methodOrPropName, String version) {
        if (LOG_DEPRECATED) {
            deprecated("Property or method [" + methodOrPropName + "] of class [" + clazz.getName() +
                    "] is deprecated in [" + version +
                    "] and will be removed in future releases");
        }
    }
785801
function() {
            var supportsPropertyDescriptors = this.supportsPropertyDescriptors();

            ariaUtilsArray.forEach(this._deprecatedProperties, function(property) {
                // ----------------------------------------------- destructuring

                var name = property.name;
                var type = property.type;
                var underlying = property.underlying;
                var loggingMessage = property.loggingMessage;
                var loggingMessageArguments = property.loggingMessageArguments;

                // -------------------------------------------------- processing

                var self = this;

                if (type == "attribute" && supportsPropertyDescriptors) {
                    var prefixedName = "_" + name;
                    this[prefixedName] = this[name];

                    Object.defineProperty(this, name, {
                        get : function () {
                            self.$logWarn(loggingMessage, loggingMessageArguments);
                            return self[prefixedName];
                        },
                        set : function (value) {
                            self.$logWarn(loggingMessage, loggingMessageArguments);
                            self[prefixedName] = value;
                        }
                    });
                } else if (type == "method") {
                    this[name] = function() {
                        self.$logWarn(loggingMessage, loggingMessageArguments);
                        return underlying.apply(self, arguments);
                    };
                }
            }, this);
        }
788752
function deprecateRenamedMethod(book, key, instance, oldName, newName, msg) {
    msg = msg || ('"' + oldName + '" is deprecated, use "' + newName + '()" instead');
    var fn = objectPath.get(instance, newName);

    instance[oldName] = deprecateMethod(book, key, fn, msg);
}
755298
private void removeDeadMethods(String clazz, List<BodyDeclaration> declarations) {
    Iterator<BodyDeclaration> declarationsIter = declarations.iterator();
    while (declarationsIter.hasNext()) {
      BodyDeclaration declaration = declarationsIter.next();
      if (declaration instanceof MethodDeclaration) {
        MethodDeclaration method = (MethodDeclaration) declaration;
        ExecutableElement elem = method.getExecutableElement();
        String name = typeUtil.getReferenceName(elem);
        String signature = typeUtil.getReferenceSignature(elem);
        if (deadCodeMap.containsMethod(clazz, name, signature)) {
          if (method.isConstructor()) {
            deadCodeMap.addConstructorRemovedClass(clazz);
          }
          if (Modifier.isNative(method.getModifiers())) {
            removeMethodOCNI(method);
          }
          declarationsIter.remove();
        }
      }
    }
  }
1163483
function isValidMethodSpec(methodSpec, methodName) {
  var valid = true;
  var printIgnoredMethodOnce = _.once(function() { console.log(methodName + ' from ' + path.basename(xml2js.opts.custom) + ' is omitted from JS documentation.'); });
  function checkRule(rule, errMsg) {
    if (!rule) {
      printIgnoredMethodOnce();
      console.log('  ' + errMsg);
      valid = false;
    }
  }
  checkRule(_.has(methodSpec, 'description'), 'no description given');
  checkRule(_.has(methodSpec, 'params'), 'no params given (specify "params": {} for no params)');
  _.each(methodSpec.params, function(paramSpec, paramName) {
    checkRule(_.has(paramSpec, 'type'), 'no type given for param ' + paramName);
    checkRule(_.has(paramSpec, 'description'), 'no description given for param ' + paramName);
  });
  checkRule(_.has(methodSpec, 'return'), 'no return given (specify "return": {} for no return value)');
  checkRule(_.has(methodSpec.return, 'type'), 'no type given for return value');
  checkRule(_.has(methodSpec.return, 'description'), 'no description given for return value');
  return valid;
}
138688
public static MethodHandle of(MethodDescription.InDefinedShape methodDescription) {
            return new MethodHandle(HandleType.of(methodDescription),
                    methodDescription.getDeclaringType().asErasure(),
                    methodDescription.getInternalName(),
                    methodDescription.getReturnType().asErasure(),
                    methodDescription.getParameters().asTypeList().asErasures());
        }
928947
function deprecate(method, name, message) {
    var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
    return function() {
        var e = new Error('get-stack-trace');
        var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
            .replace(/^\s+at\s+/gm, '')
            .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';

        var log = window.console && (window.console.warn || window.console.log);
        if (log) {
            log.call(window.console, deprecationMessage, stack);
        }
        return method.apply(this, arguments);
    };
}