TODO Add method documentation
427802
public final void decreaseReadBufferSize() {
        if (deferDecreaseReadBuffer) {
            deferDecreaseReadBuffer = false;
            return;
        }

        if (AbstractIoSessionConfig.ENABLE_BUFFER_SIZE) {
            System.out.println("AbstractIoSession.decreaseReadBufferSize()");
            if (getConfig().getReadBufferSize() > getConfig().getMinReadBufferSize()) {
                getConfig().setReadBufferSize(getConfig().getReadBufferSize() >>> 1);
            }
        }

        deferDecreaseReadBuffer = true;
    }
1269455
private FunctionDeclaration makeFunction(MethodDeclaration method) {
    ExecutableElement elem = method.getExecutableElement();
    TypeElement declaringClass = ElementUtil.getDeclaringClass(elem);
    boolean isInstanceMethod = !ElementUtil.isStatic(elem) && !ElementUtil.isConstructor(elem);

    FunctionDeclaration function =
        new FunctionDeclaration(nameTable.getFullFunctionName(elem), elem.getReturnType());
    function.setJniSignature(signatureGenerator.createJniFunctionSignature(elem));
    function.setLineNumber(method.getLineNumber());

    if (!ElementUtil.isStatic(elem)) {
      VariableElement var = GeneratedVariableElement.newParameter(
          NameTable.SELF_NAME, declaringClass.asType(), null);
      function.addParameter(new SingleVariableDeclaration(var));
    }
    TreeUtil.copyList(method.getParameters(), function.getParameters());

    function.setModifiers(method.getModifiers() & Modifier.STATIC);
    if (ElementUtil.isPrivate(elem) || (isInstanceMethod && !ElementUtil.isDefault(elem))) {
      function.addModifiers(Modifier.PRIVATE);
    } else {
      function.addModifiers(Modifier.PUBLIC);
    }

    if (Modifier.isNative(method.getModifiers())) {
      function.addModifiers(Modifier.NATIVE);
      return function;
    }

    function.setBody(TreeUtil.remove(method.getBody()));

    if (ElementUtil.isStatic(elem) || ElementUtil.isDefault(elem)) {
      // Add class initialization invocation, since this may be the first use of this class.
      String initName = UnicodeUtils.format("%s_initialize", nameTable.getFullName(declaringClass));
      TypeMirror voidType = typeUtil.getVoid();
      FunctionElement initElement = new FunctionElement(initName, voidType, declaringClass);
      FunctionInvocation initCall = new FunctionInvocation(initElement, voidType);
      function.getBody().addStatement(0, new ExpressionStatement(initCall));
    } else {
      FunctionConverter.convert(function);
    }

    return function;
  }
803033
static String signatureOfMethod(final CtBehavior method) throws NotFoundException {
        final StringBuilder stringBuilder = new StringBuilder();

        stringBuilder.append(Modifier.toString(method.getModifiers()));
        if (method instanceof CtMethod) {
            final String returnType = ((CtMethod) method).getReturnType().getSimpleName();
            stringBuilder.append(" ").append(returnType);
        }
        stringBuilder.append(" ").append(method.getName()).append("(");

        final CtClass[] parameterTypes = method.getParameterTypes();
        for (int i = 0; i < parameterTypes.length; i++) {
            CtClass parameterType = parameterTypes[i];
            if (i != 0) stringBuilder.append(", ");
            stringBuilder.append(parameterType.getSimpleName());
        }

        stringBuilder.append(")");
        return stringBuilder.toString();
    }
897440
function(context) {
		this._keymap = Object.create(null);
		["keydown", "keypress", "keyup"].forEach(function(type) {
			context.document.addEventListener(type, this, false);
		}, this);
	}
1068577
function () {
			/** A stateful object to hold items till they are added to the compiler */
			var pkg = {
				exec          : [],
				aliases       : {},
				dependAliases : [],
				ignore        : [],
				publish       : [],
				externals     : [],
				modules       : [],
				noParse       : []
			};

			// process modules to ignore
			var ignore = task.data.ignore;
			if ( !sys.isEmpty( ignore ) && !sys.isEmpty( ignore.src ) ) {
				grunt.verbose.writeln( "Adding ignores" );

				pkg.ignore = sys.map( grunt.file.expand( ignore, ignore.src ), function ( item ) {
					return resolvePath( item );
				} );
			}

			// process modules that won't be parsed
			var noParse = task.data.noParse;
			if ( !sys.isEmpty( noParse ) && !sys.isEmpty( noParse.src ) ) {
				grunt.verbose.writeln( "Adding ignores" );

				pkg.noParse = sys.map( grunt.file.expand( noParse, noParse.src ), function ( item ) {
					return resolvePath( item );
				} );
			}

			// process executable modules
			var exec = task.data.exec;
			if ( !sys.isEmpty( exec ) && !sys.isEmpty( exec.src ) ) {
				grunt.verbose.writeln( "Adding executable modules" );

				pkg.exec = sys.map( grunt.file.expand( exec, exec.src ), function ( item ) {
					return resolvePath( item );
				} );
			}

			// process module entries
			var modules = task.data.modules;
			if ( !sys.isEmpty( modules ) && !sys.isEmpty( modules.src ) ) {
				grunt.verbose.writeln( "Adding modules" );

				pkg.modules = sys.map( grunt.file.expand( modules, modules.src ), function ( item ) {
					return resolvePath( item );
				} );
			}

			// process modules to be published
			var publish = task.data.publish;
			if ( !sys.isEmpty( publish ) && !sys.isEmpty( publish.src ) ) {
				grunt.verbose.writeln( "Adding published modules" );

				pkg.publish = sys.map( grunt.file.expand( publish, publish.src ), function ( item ) {
					return resolvePath( item );
				} );
			}

			// process externals entries
			var externals = task.data.externals;
			if ( !sys.isEmpty( externals ) && !sys.isEmpty( externals.src ) ) {
				grunt.log.writeln( "Adding external modules" );

				pkg.externals = sys.map( grunt.file.expand( externals, externals.src ), function ( item ) {
					return resolvePath( item );
				} );
			}

			// get all task aliases
			sys.extend( pkg.aliases, getTaskAliases( task.target, options ) );
			if ( !sys.isEmpty( task.data.depends ) ) {
				sys.each( task.data.depends, function ( depends ) {
					var dependents = getTaskAliases( depends, options );

					sys.each( dependents, function ( val, key ) {
						pkg.dependAliases.push( key );
					} );
				} );
			}

			// get dependencies definitions and add them to this as external
			if ( options.autoExternals && !sys.isEmpty( task.data.depends ) ) {
				sys.each( task.data.depends, function ( depends ) {
					pkg.externals = pkg.externals.concat( getTaskSources( depends ) );
				} );
			}

			return pkg;
		}
1181459
function ToDate(amount, unit, method) {
  this.amount = amount;
  this.method = method;
  this.unit = unit;
}
1354598
@Override
  StringBuilder appendTo(StringBuilder sb, boolean forAnnotations) {
    if (!isPrettyPrint() || this == registry.getNativeType(JSTypeNative.FUNCTION_INSTANCE_TYPE)) {
      return sb.append(forAnnotations ? "!Function" : "Function");
    }

    if (hasInstanceType() && getSource() != null) {
      // Render function types known to be type definitions as "(typeof Foo)". This includes types
      // defined like "/** @constructor */ function Foo() { }" but not to those defined like "@param
      // {function(new:Foo)}". Only the former will have a source node.
      sb.append("(typeof ");
      getInstanceType().appendTo(sb, forAnnotations);
      sb.append(")");
      return sb;
    }

    setPrettyPrint(false);

    sb.append("function(");
    int paramNum = call.parameters.getChildCount();
    boolean hasKnownTypeOfThis = !(typeOfThis instanceof UnknownType);
    if (hasKnownTypeOfThis) {
      if (isConstructor()) {
        sb.append("new:");
      } else {
        sb.append("this:");
      }
      typeOfThis.appendTo(sb, forAnnotations);
    }
    if (paramNum > 0) {
      if (hasKnownTypeOfThis) {
        sb.append(", ");
      }
      Node p = call.parameters.getFirstChild();
      appendArgString(sb, p, forAnnotations);

      p = p.getNext();
      while (p != null) {
        sb.append(", ");
        appendArgString(sb, p, forAnnotations);
        p = p.getNext();
      }
    }
    sb.append("): ");
    call.returnType.appendAsNonNull(sb, forAnnotations);

    setPrettyPrint(true);
    return sb;
  }
964102
function addTransient( internalObj, tempObj ) {
			var temp = {}, k, tr = tempObj["transient"] || [];
			tr.push("shortHand");
			for (k = 0; k < tr.length; k++) {
				(temp[tr[k]] = true);
			}
			eachPropertyOf(internalObj.Static, function( v, key ) {
				temp[key] = true;
			});
			eachPropertyOf(internalObj.staticConst, function( v, key ) {
				temp[key] = true;
			});
			internalObj["transient"] = temp;
			internalObj = tempObj = k = temp = undefined;
		}
379591
function () {
    // Create hash table for easy reference
    var collectionValues = hashTable(this.collection.toJSON(), 'label', 'value')
    var filteredCollectionValues = hashTable(this.filteredCollection.toJSON(), 'label', 'value')

    // Add value from hash tables to geojson properties
    var idAttribute = this.boundaries.idAttribute
    var filtered = this.filteredCollection.getFilters().length
    this.boundaries.forEach(function (item) {
      var properties = item.get('properties')
      properties.value = collectionValues[properties[idAttribute]]
      if (filtered) {
        properties.filteredValue = filteredCollectionValues[properties[idAttribute]] || 0
      }
      item.set('properties', properties)
    }, this)
  }
1327410
protected void addMethod(String k, ExecutableElement e, MethodModel exec) {
    ArrayList<ContractableMethod> list = methodMap.get(k);
    if (list == null) {
      list = new ArrayList<ContractableMethod>();
      methodMap.put(k, list);
    }
    list.add(new ContractableMethod(e, exec));
  }
532778
@Override
    public <T> void postProcess(T anyContext) {
        Tuple2<List<String>, List<String>> dimsAndMetrics = (Tuple2<List<String>, List<String>>)anyContext;
        List<String> dims = dimsAndMetrics._1();
        List<String> metrics = dimsAndMetrics._2();
        Iterator<Map.Entry<String, String>> colIter = fetchDimensions.entrySet().iterator();
        while (colIter.hasNext()) {
            Map.Entry<String, String> entry = colIter.next();
            if (dims.contains(entry.getKey())) {
                //No action.
            } else if (metrics.contains(entry.getKey())) {
                fetchMetrics.add(entry.getKey());
                colIter.remove();
            } else {//TODO: Handle error
                
            }
        }
    }
883824
function (v, paramd) {
    var nd = {};

    var _add = function(v) {
        if (!_.is.String(v)) {
            return false;
        }

        var vmatch = v.match(/^([-a-z0-9]*):.+/);
        if (!vmatch) {
            return false;
        }
        
        var nshort = vmatch[1];
        var nurl = _namespace[nshort];
        if (!nurl) {
            return false;
        }

        nd[nshort] = nurl;

        return true;
    };
    var _walk = function(o) {
        if (_.is.Object(o)) {
            for (var key in o) {
                if (!_add(key)) {
                    continue;
                } else if (!key.match(/^iot/)) {
                    continue;
                } else if (key === "iot:help") {
                    continue;
                }

                var sv = o[key];
                if (_walk(sv)) {
                    nd[key] = {
                        "@id": _ld_expand(key),
                        "@type": "@id"
                    };
                }
            }
        } else if (_.is.Array(o)) {
            var any = false;
            o.map(function(sv) {
                _add(sv);
                any |= _walk(sv);
            });
            return any;
        } else if (_.is.String(o)) {
            if (_add(o)) {
                return true;
            }
        }
    };

    _walk(v);

    if (!v["@context"]) {
        v["@context"] = {};
    }

    _.extend(v["@context"], nd);

    return v;
}
846046
String join(Dialect d, boolean isTopLevel, DialectSqlItem function, DialectSqlItem[] items) {//NOSONAR
		int pos = 0;
		for (DialectSqlItem item : items) {
			if (item.subItems != null) {
				String value;
				if (pos > 0 && items[pos - 1] != null && items[pos - 1].type == 'F')
					// join as parameters
					value = join(d, false, items[pos - 1], item.subItems);
				else
					value = join(d, false, null, item.subItems); // join as
																	// string
				item.type = 'S';
				item.value = value;
				item.subItems = null;
			}
			pos++;
		} // now there is no subItems

		if (function != null) {
			List<String> l = new ArrayList<String>();
			for (DialectSqlItem item : items) {
				if (item.type != '0')
					l.add((String) item.value);
			}
			return renderFunction(d, function, l.toArray(new String[l.size()]));
		}

		StringBuilder sb = new StringBuilder();
		if (!isTopLevel)
			sb.append("(");
		for (DialectSqlItem item : items)
			if (item.type != '0') {
				sb.append(item.value);
			}
		if (!isTopLevel)
			sb.append(")");
		return sb.toString();
	}
147880
function (beyond) {
        "use strict";
    
        var items = {};
        var keys = [];
        Object.defineProperty(this, 'items', {
            'get': function () {
                return items;
            }
        });
        Object.defineProperty(this, 'keys', {
            'get': function () {
                return keys;
            }
        });
        Object.defineProperty(this, 'length', {
            'get': function () {
                return keys.length;
            }
        });
    
        this.get = function (name) {
    
            if (items[name]) return items[name];
    
            var library = new Library(beyond, name);
            items[name] = library;
            keys.push(name);
    
            return library;
    
        };
    
    }
492113
function showInterfaceJavaScriptMethod(intf, method, html) {
    var line = ""

    line += "\n//"
    line += "\n<span class='methodName'>method " + method.name + "</span>(" + getJavaScriptParameterListSimple(method.parameters, method.returns) + ")"
    line += "\n    // callback: function(" + getJavaScriptCallbackParameterListSimple(method.callbackParameters) + ")"
    line += "\n    Weinre.notImplemented(arguments.callee.signature)"
    line += "\n"
    html.push(line)
}
1036644
def AddMethod(self, function, name=None):
        
        method = MethodWrapper(self, function, name)
        self.added_methods.append(method)
500108
function decorateMethodDoc(methodDoc) {
    normalizeMethodParameters(methodDoc);

    // Mark methods with a `void` return type so we can omit show the return type in the docs.
    methodDoc.showReturns = methodDoc.returnType && methodDoc.returnType != 'void';
  }