TODO Jochen: replace with new MetaMethod
495378
public MetaMethod getMethod(String name, Class[] parameters) {
        return impl.pickMethod(name, parameters);
    }
1095823
function warnOnDeprecation( oldMethod, newMethod ) {
	return function() {
		if ( console.warn || console.log ) {
			var msg = "Warning, the " + oldMethod + " method has been deprecated. Please use " + newMethod + " instead.";
			if ( console.warn ) {
				console.warn( msg );
			} else {
				console.log( msg );
			}
		}
		return SubscriptionDefinition.prototype[ newMethod ].apply( this, arguments );
	};
}
16839
function patchMeta(uri, data) {
  const id = replaceVersion(uri.replace('/meta', ''));

  return db.patchMeta(id, data)
    .then(() => getMeta(uri))
    .then(pubToBus(id));
}
895522
def method_missing(meth, *args, &block)
      if args.size == 1 and meth =~ /^(.+)=$/
        self[$1.to_sym] = args[0]
      else
        super meth, *args, &block
      end
    end
1162965
function Property(path, node, scope, getObjectRef, file) {
  if (!node.method && node.kind === "init") return;
  if (!t.isFunction(node.value)) return;

  var replaceSupers = new _helpersReplaceSupers2["default"]({
    getObjectRef: getObjectRef,
    methodNode: node,
    methodPath: path,
    isStatic: true,
    scope: scope,
    file: file
  });

  replaceSupers.replace();
}
634117
function(template) {
        // no pragmas
        if(!this.includes("%", template)) {
          return template;
        }

        var that = this;
        var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
              this.ctag);
        return template.replace(regex, function(match, pragma, options) {
          if(!that.pragmas_implemented[pragma]) {
            throw({message:
              "This implementation of mustache doesn't understand the '" +
              pragma + "' pragma"});
          }
          that.pragmas[pragma] = {};
          if(options) {
            var opts = options.split("=");
            that.pragmas[pragma][opts[0]] = opts[1];
          }
          return "";
          // ignore unknown pragmas silently
        });
      }
370672
private void updateArrayOfGetters(ClassOutline co, JCodeModel model) {
    JDefinedClass implClass = co.implClass;

    List<JMethod> removedMethods = new ArrayList<>();
    Iterator<JMethod> iter = implClass.methods().iterator();
    while (iter.hasNext()) {
      JMethod method = iter.next();
      if (method.type().name().startsWith("ArrayOf")) {
        removedMethods.add(method);
        iter.remove();
      }
    }

    for (JMethod removed : removedMethods) {
      // Parse the old code to get the variable name
      StringWriter oldWriter = new StringWriter();
      removed.body().state(new JFormatter(oldWriter));
      String oldBody = oldWriter.toString();
      String varName = oldBody.substring(oldBody.indexOf("return ") + "return ".length(), oldBody.indexOf(";"));

      // Build the new method
      JClass newReturnType = (JClass) ((JDefinedClass) removed.type()).fields().values().iterator().next().type();
      JMethod newMethod = implClass.method(removed.mods().getValue(), newReturnType, removed.name());
      JFieldVar field = implClass.fields().get(varName);          
      JClass typeParameter = newReturnType.getTypeParameters().get(0);
      String fieldName = model._getClass(field.type().fullName()).fields().keySet().iterator().next();

      newMethod.body()._return(
          JOp.cond(field.eq(JExpr._null()),
              JExpr._new(model.ref("java.util.ArrayList").narrow(typeParameter)),
              field.invoke("get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1))));
    }    
  }
378432
function (collection, settings, html, oldIndex, newIndex, oldKey, newKey) {
            var toReplace = new RegExp(pregQuote(settings.name_prefix + '[' + oldKey + ']'), 'g');
            var replaceWith = settings.name_prefix + '[' + newKey + ']';
            html = html.replace(toReplace, replaceWith);

            toReplace = new RegExp(pregQuote(collection.attr('id') + '_' + oldIndex), 'g');
            replaceWith = collection.attr('id') + '_' + newIndex;
            html = html.replace(toReplace, replaceWith);

            return html;
        }
239279
function() {
        var FN_ARGS        = /^function\s*[^\(]*\(\s*([^\)]*)\)/m,
            FN_ARG_SPLIT   = /,/,
            FN_ARG         = /^\s*(_?)(\S+?)\1\s*$/,
            STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,
            getParams      = function(fn) {
                var fnText, argDecl;
                var args = [];
                fnText = fn.toString().replace(STRIP_COMMENTS, '');
                argDecl = fnText.match(FN_ARGS);

                var r = argDecl[1].split(FN_ARG_SPLIT), repl = function(all, underscore, name) {
                    args.push(name);
                };
                for (var a in r) {
                    var arg = r[a];
                    arg.replace(FN_ARG, repl);
                }

                return args;
            };

        var prototype = this.reflector.getProto();
        var overloads = prototype.__joii__.metadata[this.name].overloads;

        if (!overloads || overloads.length === 0) {
            // old method for BC (wasn't recognized as a function when prototyping)
            return getParams(this.reflector.getProto()[this.name]);
        } else if (overloads.length === 1 && overloads[0].parameters.length === 0) {
            // old method for BC (was recognized when prototyping, but old style)
            return getParams(overloads[0].fn);
        }
        else {
            var ret = [];

            for (var idx = 0; idx < overloads.length; idx++) {
                var fn_meta = [];
                var function_parameters_meta = overloads[idx];
                var parsed_params = getParams(function_parameters_meta.fn);
                for (var j = 0; j < function_parameters_meta.parameters.length; j++) {
                    var param = {
                        name: parsed_params.length > j ? parsed_params[j] : null,
                        type: function_parameters_meta.parameters[j]
                    };
                    fn_meta.push(param);
                }
                ret.push(fn_meta);
            }
            return ret;
        }
    }
486651
function substitute(originalString, params) {
	"use strict";

	var result = originalString;
	if (params) {
		Object.keys(params).forEach(function(key) {
			result = result.replace(new RegExp('{' + key + '}', 'g'), params[key]);
		});
	}
	return result;
}
424273
function matchesMethod(method, opts) {
  var methods = !opts.method || Array.isArray(opts.method) ?
    opts.method : [opts.method];

  if (methods) {
    return !!~methods.indexOf(method);
  }
}
806537
function replacer(match, file, line, col) {
		line = parseInt(line, 10);
		col = parseInt(col, 10);

		for (var i = 0; i < responses.length; i++) {
			var meta = responses[i].meta;
			var sourcemap = meta && meta.sourcemaps && meta.sourcemaps[file];

			if (!sourcemap) {
				continue;
			}

			var smc = new SourceMapConsumer(sourcemap);
			var pos = smc.originalPositionFor({ line: line, column: col });

			if (pos) {
				return pos.name + ' (' + file + ':' + pos.line + ':' + pos.column + ')';
			}
		}

		return match;
	}
291841
@Override
    public Object apply(Object value, Object... params) {

        String original = super.asString(value);

        Object needle = super.get(0, params);
        String replacement = "";

        if (needle == null) {
            throw new RuntimeException("invalid pattern: " + needle);
        }

        if (params.length >= 2) {

            Object obj = super.get(1, params);

            if (obj == null) {
                throw new RuntimeException("invalid replacement: " + needle);
            }

            replacement = super.asString(super.get(1, params));
        }

        return original.replaceFirst(Pattern.quote(String.valueOf(needle)),
                Matcher.quoteReplacement(replacement));
    }
1095598
def method_missing(m, *args, &block)
      if block = ChefSpec.matchers[resource_name(m.to_sym)]
        instance_exec(args.first, &block)
      else
        super
      end
    end
672256
def replace_fields(meta, patterns):
    
    for pattern in patterns:
        try:
            field, regex, subst, _ = pattern.split(pattern[-1])

            # TODO: Allow numerical indices, and "+" for append
            namespace = meta
            keypath = [i.replace('\0', '.') for i in field.replace('..', '\0').split('.')]
            for key in keypath[:-1]:
                namespace = namespace[key]

            namespace[keypath[-1]] = re.sub(regex, subst, namespace[keypath[-1]])
        except (KeyError, IndexError, TypeError, ValueError) as exc:
            raise error.UserError("Bad substitution '%s' (%s)!" % (pattern, exc))

    return meta
1091027
def replace_meta(self, name, content=None, meta_key=None):
        '''
        '''
        children = self.meta._children
        if not content:     # small optimazation
            children = tuple(children)
        meta_key = meta_key or 'name'
        for child in children:
            if child.attr(meta_key) == name:
                if content:
                    child.attr('content', content)
                else:
                    self.meta._children.remove(child)
                return
        if content:
            self.add_meta(**{meta_key: name, 'content': content})
320072
function replaceRenderer(md, renderer) {
  var openMethodName = renderer.fullName + "_open";
  replacedMethods[openMethodName] = md.renderer.rules[openMethodName];

  md.renderer.rules[openMethodName] = function (tokens, idx) {
    var classy, result;

    // first get the result as per the original method we replaced
    result = replacedMethods[openMethodName].apply(null, arguments).trim();

    if (renderer.inline) {
      classy = getClassyFromInlineElement(tokens, idx, renderer.fullName);
    } else {
      classy = getClassyFromBlockElement(tokens, idx, renderer.fullName);
    }

    if (classy) {
      result = result.replace(new RegExp("<" + renderer.pattern), "$& class=\"" + classy.content + "\"");
    }

    return result;
  };
}