id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
25,000
google/closure-compiler
src/com/google/javascript/jscomp/PolymerPassStaticUtils.java
PolymerPassStaticUtils.quoteListenerAndHostAttributeKeys
static void quoteListenerAndHostAttributeKeys(Node objLit, AbstractCompiler compiler) { checkState(objLit.isObjectLit()); for (Node keyNode : objLit.children()) { if (keyNode.isComputedProp()) { continue; } if (!keyNode.getString().equals("listeners") && !keyNode.getString()....
java
static void quoteListenerAndHostAttributeKeys(Node objLit, AbstractCompiler compiler) { checkState(objLit.isObjectLit()); for (Node keyNode : objLit.children()) { if (keyNode.isComputedProp()) { continue; } if (!keyNode.getString().equals("listeners") && !keyNode.getString()....
[ "static", "void", "quoteListenerAndHostAttributeKeys", "(", "Node", "objLit", ",", "AbstractCompiler", "compiler", ")", "{", "checkState", "(", "objLit", ".", "isObjectLit", "(", ")", ")", ";", "for", "(", "Node", "keyNode", ":", "objLit", ".", "children", "("...
Makes sure that the keys for listeners and hostAttributes blocks are quoted to avoid renaming.
[ "Makes", "sure", "that", "the", "keys", "for", "listeners", "and", "hostAttributes", "blocks", "are", "quoted", "to", "avoid", "renaming", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PolymerPassStaticUtils.java#L109-L126
25,001
google/closure-compiler
src/com/google/javascript/jscomp/PolymerPassStaticUtils.java
PolymerPassStaticUtils.collectConstructorPropertyJsDoc
private static void collectConstructorPropertyJsDoc(Node node, Map<String, JSDocInfo> map) { checkNotNull(node); for (Node child : node.children()) { if (child.isGetProp() && child.getFirstChild().isThis() && child.getSecondChild().isString()) { // We found a "this.foo" express...
java
private static void collectConstructorPropertyJsDoc(Node node, Map<String, JSDocInfo> map) { checkNotNull(node); for (Node child : node.children()) { if (child.isGetProp() && child.getFirstChild().isThis() && child.getSecondChild().isString()) { // We found a "this.foo" express...
[ "private", "static", "void", "collectConstructorPropertyJsDoc", "(", "Node", "node", ",", "Map", "<", "String", ",", "JSDocInfo", ">", "map", ")", "{", "checkNotNull", "(", "node", ")", ";", "for", "(", "Node", "child", ":", "node", ".", "children", "(", ...
Find the properties that are initialized in the given constructor, and return a map from each property name to its JSDoc. @param node The constructor function node to traverse. @param map The map from property name to JSDoc.
[ "Find", "the", "properties", "that", "are", "initialized", "in", "the", "given", "constructor", "and", "return", "a", "map", "from", "each", "property", "name", "to", "its", "JSDoc", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PolymerPassStaticUtils.java#L184-L201
25,002
google/closure-compiler
src/com/google/javascript/jscomp/PolymerPassStaticUtils.java
PolymerPassStaticUtils.getTypeFromProperty
static JSTypeExpression getTypeFromProperty( MemberDefinition property, AbstractCompiler compiler) { if (property.info != null && property.info.hasType()) { return property.info.getType(); } String typeString; if (property.value.isObjectLit()) { Node typeValue = NodeUtil.getFirstPropM...
java
static JSTypeExpression getTypeFromProperty( MemberDefinition property, AbstractCompiler compiler) { if (property.info != null && property.info.hasType()) { return property.info.getType(); } String typeString; if (property.value.isObjectLit()) { Node typeValue = NodeUtil.getFirstPropM...
[ "static", "JSTypeExpression", "getTypeFromProperty", "(", "MemberDefinition", "property", ",", "AbstractCompiler", "compiler", ")", "{", "if", "(", "property", ".", "info", "!=", "null", "&&", "property", ".", "info", ".", "hasType", "(", ")", ")", "{", "retur...
Gets the JSTypeExpression for a given property using its "type" key. @see https://github.com/Polymer/polymer/blob/0.8-preview/PRIMER.md#configuring-properties
[ "Gets", "the", "JSTypeExpression", "for", "a", "given", "property", "using", "its", "type", "key", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PolymerPassStaticUtils.java#L207-L246
25,003
google/closure-compiler
src/com/google/javascript/jscomp/Scope.java
Scope.declare
Var declare(String name, Node nameNode, CompilerInput input) { checkArgument(!name.isEmpty()); // Make sure that it's declared only once checkState(getOwnSlot(name) == null); Var var = new Var(name, nameNode, this, getVarCount(), input); declareInternal(name, var); return var; }
java
Var declare(String name, Node nameNode, CompilerInput input) { checkArgument(!name.isEmpty()); // Make sure that it's declared only once checkState(getOwnSlot(name) == null); Var var = new Var(name, nameNode, this, getVarCount(), input); declareInternal(name, var); return var; }
[ "Var", "declare", "(", "String", "name", ",", "Node", "nameNode", ",", "CompilerInput", "input", ")", "{", "checkArgument", "(", "!", "name", ".", "isEmpty", "(", ")", ")", ";", "// Make sure that it's declared only once", "checkState", "(", "getOwnSlot", "(", ...
Non-final for PersisteneScope.
[ "Non", "-", "final", "for", "PersisteneScope", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Scope.java#L59-L66
25,004
google/closure-compiler
src/com/google/javascript/refactoring/ErrorToFixMapper.java
ErrorToFixMapper.getFixForJsError
public static SuggestedFix getFixForJsError(JSError error, AbstractCompiler compiler) { switch (error.getType().key) { case "JSC_REDECLARED_VARIABLE": return getFixForRedeclaration(error, compiler); case "JSC_REFERENCE_BEFORE_DECLARE": return getFixForEarlyReference(error, compiler); ...
java
public static SuggestedFix getFixForJsError(JSError error, AbstractCompiler compiler) { switch (error.getType().key) { case "JSC_REDECLARED_VARIABLE": return getFixForRedeclaration(error, compiler); case "JSC_REFERENCE_BEFORE_DECLARE": return getFixForEarlyReference(error, compiler); ...
[ "public", "static", "SuggestedFix", "getFixForJsError", "(", "JSError", "error", ",", "AbstractCompiler", "compiler", ")", "{", "switch", "(", "error", ".", "getType", "(", ")", ".", "key", ")", "{", "case", "\"JSC_REDECLARED_VARIABLE\"", ":", "return", "getFixF...
Creates a SuggestedFix for the given error. Note that some errors have multiple fixes so getFixesForJsError should often be used instead of this.
[ "Creates", "a", "SuggestedFix", "for", "the", "given", "error", ".", "Note", "that", "some", "errors", "have", "multiple", "fixes", "so", "getFixesForJsError", "should", "often", "be", "used", "instead", "of", "this", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/ErrorToFixMapper.java#L74-L111
25,005
google/closure-compiler
src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java
ChainableReverseAbstractInterpreter.firstPreciserScopeKnowingConditionOutcome
protected FlowScope firstPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome) { return firstLink.getPreciserScopeKnowingConditionOutcome( condition, blindScope, outcome); }
java
protected FlowScope firstPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome) { return firstLink.getPreciserScopeKnowingConditionOutcome( condition, blindScope, outcome); }
[ "protected", "FlowScope", "firstPreciserScopeKnowingConditionOutcome", "(", "Node", "condition", ",", "FlowScope", "blindScope", ",", "boolean", "outcome", ")", "{", "return", "firstLink", ".", "getPreciserScopeKnowingConditionOutcome", "(", "condition", ",", "blindScope", ...
Calculates the preciser scope starting with the first link.
[ "Calculates", "the", "preciser", "scope", "starting", "with", "the", "first", "link", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L98-L102
25,006
google/closure-compiler
src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java
ChainableReverseAbstractInterpreter.nextPreciserScopeKnowingConditionOutcome
protected FlowScope nextPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome) { return nextLink != null ? nextLink.getPreciserScopeKnowingConditionOutcome( condition, blindScope, outcome) : blindScope; }
java
protected FlowScope nextPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome) { return nextLink != null ? nextLink.getPreciserScopeKnowingConditionOutcome( condition, blindScope, outcome) : blindScope; }
[ "protected", "FlowScope", "nextPreciserScopeKnowingConditionOutcome", "(", "Node", "condition", ",", "FlowScope", "blindScope", ",", "boolean", "outcome", ")", "{", "return", "nextLink", "!=", "null", "?", "nextLink", ".", "getPreciserScopeKnowingConditionOutcome", "(", ...
Delegates the calculation of the preciser scope to the next link. If there is no next link, returns the blind scope.
[ "Delegates", "the", "calculation", "of", "the", "preciser", "scope", "to", "the", "next", "link", ".", "If", "there", "is", "no", "next", "link", "returns", "the", "blind", "scope", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L108-L112
25,007
google/closure-compiler
src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java
ChainableReverseAbstractInterpreter.getTypeIfRefinable
protected JSType getTypeIfRefinable(Node node, FlowScope scope) { switch (node.getToken()) { case NAME: StaticTypedSlot nameVar = scope.getSlot(node.getString()); if (nameVar != null) { JSType nameVarType = nameVar.getType(); if (nameVarType == null) { nameVarTy...
java
protected JSType getTypeIfRefinable(Node node, FlowScope scope) { switch (node.getToken()) { case NAME: StaticTypedSlot nameVar = scope.getSlot(node.getString()); if (nameVar != null) { JSType nameVarType = nameVar.getType(); if (nameVarType == null) { nameVarTy...
[ "protected", "JSType", "getTypeIfRefinable", "(", "Node", "node", ",", "FlowScope", "scope", ")", "{", "switch", "(", "node", ".", "getToken", "(", ")", ")", "{", "case", "NAME", ":", "StaticTypedSlot", "nameVar", "=", "scope", ".", "getSlot", "(", "node",...
Returns the type of a node in the given scope if the node corresponds to a name whose type is capable of being refined. @return The current type of the node if it can be refined, null otherwise.
[ "Returns", "the", "type", "of", "a", "node", "in", "the", "given", "scope", "if", "the", "node", "corresponds", "to", "a", "name", "whose", "type", "is", "capable", "of", "being", "refined", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L119-L153
25,008
google/closure-compiler
src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java
ChainableReverseAbstractInterpreter.getRestrictedWithoutUndefined
protected final JSType getRestrictedWithoutUndefined(JSType type) { return type == null ? null : type.visit(restrictUndefinedVisitor); }
java
protected final JSType getRestrictedWithoutUndefined(JSType type) { return type == null ? null : type.visit(restrictUndefinedVisitor); }
[ "protected", "final", "JSType", "getRestrictedWithoutUndefined", "(", "JSType", "type", ")", "{", "return", "type", "==", "null", "?", "null", ":", "type", ".", "visit", "(", "restrictUndefinedVisitor", ")", ";", "}" ]
Returns a version of type where undefined is not present.
[ "Returns", "a", "version", "of", "type", "where", "undefined", "is", "not", "present", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L691-L693
25,009
google/closure-compiler
src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java
ChainableReverseAbstractInterpreter.getRestrictedWithoutNull
protected final JSType getRestrictedWithoutNull(JSType type) { return type == null ? null : type.visit(restrictNullVisitor); }
java
protected final JSType getRestrictedWithoutNull(JSType type) { return type == null ? null : type.visit(restrictNullVisitor); }
[ "protected", "final", "JSType", "getRestrictedWithoutNull", "(", "JSType", "type", ")", "{", "return", "type", "==", "null", "?", "null", ":", "type", ".", "visit", "(", "restrictNullVisitor", ")", ";", "}" ]
Returns a version of type where null is not present.
[ "Returns", "a", "version", "of", "type", "where", "null", "is", "not", "present", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L698-L700
25,010
google/closure-compiler
src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java
ChainableReverseAbstractInterpreter.getNativeTypeForTypeOf
private JSType getNativeTypeForTypeOf(String value) { switch (value) { case "number": return getNativeType(NUMBER_TYPE); case "boolean": return getNativeType(BOOLEAN_TYPE); case "string": return getNativeType(STRING_TYPE); case "symbol": return getNativeType(S...
java
private JSType getNativeTypeForTypeOf(String value) { switch (value) { case "number": return getNativeType(NUMBER_TYPE); case "boolean": return getNativeType(BOOLEAN_TYPE); case "string": return getNativeType(STRING_TYPE); case "symbol": return getNativeType(S...
[ "private", "JSType", "getNativeTypeForTypeOf", "(", "String", "value", ")", "{", "switch", "(", "value", ")", "{", "case", "\"number\"", ":", "return", "getNativeType", "(", "NUMBER_TYPE", ")", ";", "case", "\"boolean\"", ":", "return", "getNativeType", "(", "...
If we definitely know what a type is based on the typeof result, return it. Otherwise, return null. The typeof operation in JS is poorly defined, and this function works for both the native typeof and goog.typeOf. It should not be made public, because its semantics are informally defined, and would be wrong in the ge...
[ "If", "we", "definitely", "know", "what", "a", "type", "is", "based", "on", "the", "typeof", "result", "return", "it", ".", "Otherwise", "return", "null", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L756-L773
25,011
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.reconcileOptionsWithGuards
protected void reconcileOptionsWithGuards() { // DiagnosticGroups override the plain checkTypes option. if (options.enables(DiagnosticGroups.CHECK_TYPES)) { options.checkTypes = true; } else if (options.disables(DiagnosticGroups.CHECK_TYPES)) { options.checkTypes = false; } else if (!options...
java
protected void reconcileOptionsWithGuards() { // DiagnosticGroups override the plain checkTypes option. if (options.enables(DiagnosticGroups.CHECK_TYPES)) { options.checkTypes = true; } else if (options.disables(DiagnosticGroups.CHECK_TYPES)) { options.checkTypes = false; } else if (!options...
[ "protected", "void", "reconcileOptionsWithGuards", "(", ")", "{", "// DiagnosticGroups override the plain checkTypes option.", "if", "(", "options", ".", "enables", "(", "DiagnosticGroups", ".", "CHECK_TYPES", ")", ")", "{", "options", ".", "checkTypes", "=", "true", ...
When the CompilerOptions and its WarningsGuard overlap, reconcile any discrepancies.
[ "When", "the", "CompilerOptions", "and", "its", "WarningsGuard", "overlap", "reconcile", "any", "discrepancies", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L415-L468
25,012
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.init
public final <T1 extends SourceFile, T2 extends SourceFile> void init( List<T1> externs, List<T2> sources, CompilerOptions options) { JSModule module = new JSModule(JSModule.STRONG_MODULE_NAME); for (SourceFile source : sources) { module.add(new CompilerInput(source)); } List<JSModule> modu...
java
public final <T1 extends SourceFile, T2 extends SourceFile> void init( List<T1> externs, List<T2> sources, CompilerOptions options) { JSModule module = new JSModule(JSModule.STRONG_MODULE_NAME); for (SourceFile source : sources) { module.add(new CompilerInput(source)); } List<JSModule> modu...
[ "public", "final", "<", "T1", "extends", "SourceFile", ",", "T2", "extends", "SourceFile", ">", "void", "init", "(", "List", "<", "T1", ">", "externs", ",", "List", "<", "T2", ">", "sources", ",", "CompilerOptions", "options", ")", "{", "JSModule", "modu...
Initializes the instance state needed for a compile job.
[ "Initializes", "the", "instance", "state", "needed", "for", "a", "compile", "job", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L471-L482
25,013
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.initModules
public <T extends SourceFile> void initModules( List<T> externs, List<JSModule> modules, CompilerOptions options) { initOptions(options); checkFirstModule(modules); this.externs = makeExternInputs(externs); // Generate the module graph, and report any errors in the module specification as error...
java
public <T extends SourceFile> void initModules( List<T> externs, List<JSModule> modules, CompilerOptions options) { initOptions(options); checkFirstModule(modules); this.externs = makeExternInputs(externs); // Generate the module graph, and report any errors in the module specification as error...
[ "public", "<", "T", "extends", "SourceFile", ">", "void", "initModules", "(", "List", "<", "T", ">", "externs", ",", "List", "<", "JSModule", ">", "modules", ",", "CompilerOptions", "options", ")", "{", "initOptions", "(", "options", ")", ";", "checkFirstM...
Initializes the instance state needed for a compile job if the sources are in modules.
[ "Initializes", "the", "instance", "state", "needed", "for", "a", "compile", "job", "if", "the", "sources", "are", "in", "modules", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L488-L516
25,014
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.initBasedOnOptions
public void initBasedOnOptions() { inputSourceMaps.putAll(options.inputSourceMaps); // Create the source map if necessary. if (options.sourceMapOutputPath != null) { sourceMap = options.sourceMapFormat.getInstance(); sourceMap.setPrefixMappings(options.sourceMapLocationMappings); if (optio...
java
public void initBasedOnOptions() { inputSourceMaps.putAll(options.inputSourceMaps); // Create the source map if necessary. if (options.sourceMapOutputPath != null) { sourceMap = options.sourceMapFormat.getInstance(); sourceMap.setPrefixMappings(options.sourceMapLocationMappings); if (optio...
[ "public", "void", "initBasedOnOptions", "(", ")", "{", "inputSourceMaps", ".", "putAll", "(", "options", ".", "inputSourceMaps", ")", ";", "// Create the source map if necessary.", "if", "(", "options", ".", "sourceMapOutputPath", "!=", "null", ")", "{", "sourceMap"...
Do any initialization that is dependent on the compiler options.
[ "Do", "any", "initialization", "that", "is", "dependent", "on", "the", "compiler", "options", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L521-L536
25,015
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.checkFirstModule
private void checkFirstModule(List<JSModule> modules) { if (modules.isEmpty()) { report(JSError.make(EMPTY_MODULE_LIST_ERROR)); } else if (modules.get(0).getInputs().isEmpty() && modules.size() > 1) { // The root module may only be empty if there is exactly 1 module. report(JSError.make(EMPTY_...
java
private void checkFirstModule(List<JSModule> modules) { if (modules.isEmpty()) { report(JSError.make(EMPTY_MODULE_LIST_ERROR)); } else if (modules.get(0).getInputs().isEmpty() && modules.size() > 1) { // The root module may only be empty if there is exactly 1 module. report(JSError.make(EMPTY_...
[ "private", "void", "checkFirstModule", "(", "List", "<", "JSModule", ">", "modules", ")", "{", "if", "(", "modules", ".", "isEmpty", "(", ")", ")", "{", "report", "(", "JSError", ".", "make", "(", "EMPTY_MODULE_LIST_ERROR", ")", ")", ";", "}", "else", ...
Verifies that at least one module has been provided and that the first one has at least one source code input.
[ "Verifies", "that", "at", "least", "one", "module", "has", "been", "provided", "and", "that", "the", "first", "one", "has", "at", "least", "one", "source", "code", "input", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L558-L566
25,016
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.fillEmptyModules
private void fillEmptyModules(Iterable<JSModule> modules) { for (JSModule module : modules) { if (!module.getName().equals(JSModule.WEAK_MODULE_NAME) && module.getInputs().isEmpty()) { CompilerInput input = new CompilerInput(SourceFile.fromCode(createFillFileName(module.getName()), "")); ...
java
private void fillEmptyModules(Iterable<JSModule> modules) { for (JSModule module : modules) { if (!module.getName().equals(JSModule.WEAK_MODULE_NAME) && module.getInputs().isEmpty()) { CompilerInput input = new CompilerInput(SourceFile.fromCode(createFillFileName(module.getName()), "")); ...
[ "private", "void", "fillEmptyModules", "(", "Iterable", "<", "JSModule", ">", "modules", ")", "{", "for", "(", "JSModule", "module", ":", "modules", ")", "{", "if", "(", "!", "module", ".", "getName", "(", ")", ".", "equals", "(", "JSModule", ".", "WEA...
Fill any empty modules with a place holder file. It makes any cross module motion easier.
[ "Fill", "any", "empty", "modules", "with", "a", "place", "holder", "file", ".", "It", "makes", "any", "cross", "module", "motion", "easier", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L576-L585
25,017
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.initInputsByIdMap
void initInputsByIdMap() { inputsById.clear(); for (CompilerInput input : externs) { InputId id = input.getInputId(); CompilerInput previous = putCompilerInput(id, input); if (previous != null) { report(JSError.make(DUPLICATE_EXTERN_INPUT, input.getName())); } } for (Comp...
java
void initInputsByIdMap() { inputsById.clear(); for (CompilerInput input : externs) { InputId id = input.getInputId(); CompilerInput previous = putCompilerInput(id, input); if (previous != null) { report(JSError.make(DUPLICATE_EXTERN_INPUT, input.getName())); } } for (Comp...
[ "void", "initInputsByIdMap", "(", ")", "{", "inputsById", ".", "clear", "(", ")", ";", "for", "(", "CompilerInput", "input", ":", "externs", ")", "{", "InputId", "id", "=", "input", ".", "getInputId", "(", ")", ";", "CompilerInput", "previous", "=", "put...
Creates a map to make looking up an input by name fast. Also checks for duplicate inputs.
[ "Creates", "a", "map", "to", "make", "looking", "up", "an", "input", "by", "name", "fast", ".", "Also", "checks", "for", "duplicate", "inputs", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L605-L621
25,018
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.compile
public Result compile(SourceFile extern, SourceFile input, CompilerOptions options) { return compile(ImmutableList.of(extern), ImmutableList.of(input), options); }
java
public Result compile(SourceFile extern, SourceFile input, CompilerOptions options) { return compile(ImmutableList.of(extern), ImmutableList.of(input), options); }
[ "public", "Result", "compile", "(", "SourceFile", "extern", ",", "SourceFile", "input", ",", "CompilerOptions", "options", ")", "{", "return", "compile", "(", "ImmutableList", ".", "of", "(", "extern", ")", ",", "ImmutableList", ".", "of", "(", "input", ")",...
Compiles a single source file and a single externs file.
[ "Compiles", "a", "single", "source", "file", "and", "a", "single", "externs", "file", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L633-L635
25,019
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.compile
public <T1 extends SourceFile, T2 extends SourceFile> Result compile( List<T1> externs, List<T2> inputs, CompilerOptions options) { // The compile method should only be called once. checkState(jsRoot == null); try { init(externs, inputs, options); if (options.printConfig) { printC...
java
public <T1 extends SourceFile, T2 extends SourceFile> Result compile( List<T1> externs, List<T2> inputs, CompilerOptions options) { // The compile method should only be called once. checkState(jsRoot == null); try { init(externs, inputs, options); if (options.printConfig) { printC...
[ "public", "<", "T1", "extends", "SourceFile", ",", "T2", "extends", "SourceFile", ">", "Result", "compile", "(", "List", "<", "T1", ">", "externs", ",", "List", "<", "T2", ">", "inputs", ",", "CompilerOptions", "options", ")", "{", "// The compile method sho...
Compiles a list of inputs. <p>This is a convenience method to wrap up all the work of compilation, including generating the error and warning report. <p>NOTE: All methods called here must be public, because client code must be able to replicate and customize this.
[ "Compiles", "a", "list", "of", "inputs", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L646-L676
25,020
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.compileModules
public <T extends SourceFile> Result compileModules( List<T> externs, List<JSModule> modules, CompilerOptions options) { // The compile method should only be called once. checkState(jsRoot == null); try { initModules(externs, modules, options); if (options.printConfig) { printConf...
java
public <T extends SourceFile> Result compileModules( List<T> externs, List<JSModule> modules, CompilerOptions options) { // The compile method should only be called once. checkState(jsRoot == null); try { initModules(externs, modules, options); if (options.printConfig) { printConf...
[ "public", "<", "T", "extends", "SourceFile", ">", "Result", "compileModules", "(", "List", "<", "T", ">", "externs", ",", "List", "<", "JSModule", ">", "modules", ",", "CompilerOptions", "options", ")", "{", "// The compile method should only be called once.", "ch...
Compiles a list of modules. <p>This is a convenience method to wrap up all the work of compilation, including generating the error and warning report. <p>NOTE: All methods called here must be public, because client code must be able to replicate and customize this.
[ "Compiles", "a", "list", "of", "modules", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L701-L731
25,021
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.stage1Passes
public void stage1Passes() { checkState(moduleGraph != null, "No inputs. Did you call init() or initModules()?"); checkState(!hasErrors()); checkState(!options.getInstrumentForCoverageOnly()); runInCompilerThread( () -> { performChecksAndTranspilation(); return null; ...
java
public void stage1Passes() { checkState(moduleGraph != null, "No inputs. Did you call init() or initModules()?"); checkState(!hasErrors()); checkState(!options.getInstrumentForCoverageOnly()); runInCompilerThread( () -> { performChecksAndTranspilation(); return null; ...
[ "public", "void", "stage1Passes", "(", ")", "{", "checkState", "(", "moduleGraph", "!=", "null", ",", "\"No inputs. Did you call init() or initModules()?\"", ")", ";", "checkState", "(", "!", "hasErrors", "(", ")", ")", ";", "checkState", "(", "!", "options", "....
Perform compiler passes for stage 1 of compilation. <p>Stage 1 consists primarily of error and type checking passes. <p>{@code parseForCompilation()} must be called before this method is called. <p>The caller is responsible for also calling {@code generateReport()} to generate a report of warnings and errors to stde...
[ "Perform", "compiler", "passes", "for", "stage", "1", "of", "compilation", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L743-L752
25,022
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.stage2Passes
public void stage2Passes() { checkState(moduleGraph != null, "No inputs. Did you call init() or initModules()?"); checkState(!hasErrors()); checkState(!options.getInstrumentForCoverageOnly()); JSModule weakModule = moduleGraph.getModuleByName(JSModule.WEAK_MODULE_NAME); if (weakModule != null) { ...
java
public void stage2Passes() { checkState(moduleGraph != null, "No inputs. Did you call init() or initModules()?"); checkState(!hasErrors()); checkState(!options.getInstrumentForCoverageOnly()); JSModule weakModule = moduleGraph.getModuleByName(JSModule.WEAK_MODULE_NAME); if (weakModule != null) { ...
[ "public", "void", "stage2Passes", "(", ")", "{", "checkState", "(", "moduleGraph", "!=", "null", ",", "\"No inputs. Did you call init() or initModules()?\"", ")", ";", "checkState", "(", "!", "hasErrors", "(", ")", ")", ";", "checkState", "(", "!", "options", "....
Perform compiler passes for stage 2 of compilation. <p>Stage 2 consists primarily of optimization passes. <p>{@code stage1Passes()} must be called before this method is called. <p>The caller is responsible for also calling {@code generateReport()} to generate a report of warnings and errors to stderr. See the invoca...
[ "Perform", "compiler", "passes", "for", "stage", "2", "of", "compilation", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L764-L784
25,023
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.runInCompilerThread
<T> T runInCompilerThread(Callable<T> callable) { return compilerExecutor.runInCompilerThread( callable, options != null && options.getTracerMode().isOn()); }
java
<T> T runInCompilerThread(Callable<T> callable) { return compilerExecutor.runInCompilerThread( callable, options != null && options.getTracerMode().isOn()); }
[ "<", "T", ">", "T", "runInCompilerThread", "(", "Callable", "<", "T", ">", "callable", ")", "{", "return", "compilerExecutor", ".", "runInCompilerThread", "(", "callable", ",", "options", "!=", "null", "&&", "options", ".", "getTracerMode", "(", ")", ".", ...
The primary purpose of this method is to run the provided code with a larger than standard stack.
[ "The", "primary", "purpose", "of", "this", "method", "is", "to", "run", "the", "provided", "code", "with", "a", "larger", "than", "standard", "stack", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L806-L809
25,024
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.performPostCompilationTasksInternal
private void performPostCompilationTasksInternal() { if (options.devMode == DevMode.START_AND_END) { runValidityCheck(); } setProgress(1.0, "recordFunctionInformation"); if (tracker != null) { tracker.outputTracerReport(); } }
java
private void performPostCompilationTasksInternal() { if (options.devMode == DevMode.START_AND_END) { runValidityCheck(); } setProgress(1.0, "recordFunctionInformation"); if (tracker != null) { tracker.outputTracerReport(); } }
[ "private", "void", "performPostCompilationTasksInternal", "(", ")", "{", "if", "(", "options", ".", "devMode", "==", "DevMode", ".", "START_AND_END", ")", "{", "runValidityCheck", "(", ")", ";", "}", "setProgress", "(", "1.0", ",", "\"recordFunctionInformation\"",...
Performs all the bookkeeping required at the end of a compilation.
[ "Performs", "all", "the", "bookkeeping", "required", "at", "the", "end", "of", "a", "compilation", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L841-L850
25,025
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.instrumentForCoverage
public void instrumentForCoverage() { checkState(moduleGraph != null, "No inputs. Did you call init() or initModules()?"); checkState(!hasErrors()); runInCompilerThread( () -> { checkState(options.getInstrumentForCoverageOnly()); checkState(!hasErrors()); instrumentForC...
java
public void instrumentForCoverage() { checkState(moduleGraph != null, "No inputs. Did you call init() or initModules()?"); checkState(!hasErrors()); runInCompilerThread( () -> { checkState(options.getInstrumentForCoverageOnly()); checkState(!hasErrors()); instrumentForC...
[ "public", "void", "instrumentForCoverage", "(", ")", "{", "checkState", "(", "moduleGraph", "!=", "null", ",", "\"No inputs. Did you call init() or initModules()?\"", ")", ";", "checkState", "(", "!", "hasErrors", "(", ")", ")", ";", "runInCompilerThread", "(", "(",...
Instrument code for coverage. <p>{@code parseForCompilation()} must be called before this method is called. <p>The caller is responsible for also calling {@code generateReport()} to generate a report of warnings and errors to stderr. See the invocation in {@link #compile} for a good example. <p>This method is mutual...
[ "Instrument", "code", "for", "coverage", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L863-L873
25,026
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.startPass
void startPass(String passName) { checkState(currentTracer == null); currentPassName = passName; currentTracer = newTracer(passName); beforePass(passName); }
java
void startPass(String passName) { checkState(currentTracer == null); currentPassName = passName; currentTracer = newTracer(passName); beforePass(passName); }
[ "void", "startPass", "(", "String", "passName", ")", "{", "checkState", "(", "currentTracer", "==", "null", ")", ";", "currentPassName", "=", "passName", ";", "currentTracer", "=", "newTracer", "(", "passName", ")", ";", "beforePass", "(", "passName", ")", "...
Marks the beginning of a pass.
[ "Marks", "the", "beginning", "of", "a", "pass", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1074-L1079
25,027
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.endPass
void endPass(String passName) { checkState(currentTracer != null, "Tracer should not be null at the end of a pass."); stopTracer(currentTracer, currentPassName); afterPass(passName); currentPassName = null; currentTracer = null; maybeRunValidityCheck(); }
java
void endPass(String passName) { checkState(currentTracer != null, "Tracer should not be null at the end of a pass."); stopTracer(currentTracer, currentPassName); afterPass(passName); currentPassName = null; currentTracer = null; maybeRunValidityCheck(); }
[ "void", "endPass", "(", "String", "passName", ")", "{", "checkState", "(", "currentTracer", "!=", "null", ",", "\"Tracer should not be null at the end of a pass.\"", ")", ";", "stopTracer", "(", "currentTracer", ",", "currentPassName", ")", ";", "afterPass", "(", "p...
Marks the end of a pass.
[ "Marks", "the", "end", "of", "a", "pass", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1084-L1092
25,028
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.newTracer
Tracer newTracer(String passName) { String comment = passName + (recentChange.hasCodeChanged() ? " on recently changed AST" : ""); if (options.getTracerMode().isOn() && tracker != null) { tracker.recordPassStart(passName, true); } return new Tracer("Compiler", comment); }
java
Tracer newTracer(String passName) { String comment = passName + (recentChange.hasCodeChanged() ? " on recently changed AST" : ""); if (options.getTracerMode().isOn() && tracker != null) { tracker.recordPassStart(passName, true); } return new Tracer("Compiler", comment); }
[ "Tracer", "newTracer", "(", "String", "passName", ")", "{", "String", "comment", "=", "passName", "+", "(", "recentChange", ".", "hasCodeChanged", "(", ")", "?", "\" on recently changed AST\"", ":", "\"\"", ")", ";", "if", "(", "options", ".", "getTracerMode",...
Returns a new tracer for the given pass name.
[ "Returns", "a", "new", "tracer", "for", "the", "given", "pass", "name", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1177-L1184
25,029
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.getResult
public Result getResult() { Set<SourceFile> transpiledFiles = new HashSet<>(); if (jsRoot != null) { for (Node scriptNode : jsRoot.children()) { if (scriptNode.getBooleanProp(Node.TRANSPILED)) { transpiledFiles.add(getSourceFileByName(scriptNode.getSourceFileName())); } } ...
java
public Result getResult() { Set<SourceFile> transpiledFiles = new HashSet<>(); if (jsRoot != null) { for (Node scriptNode : jsRoot.children()) { if (scriptNode.getBooleanProp(Node.TRANSPILED)) { transpiledFiles.add(getSourceFileByName(scriptNode.getSourceFileName())); } } ...
[ "public", "Result", "getResult", "(", ")", "{", "Set", "<", "SourceFile", ">", "transpiledFiles", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "jsRoot", "!=", "null", ")", "{", "for", "(", "Node", "scriptNode", ":", "jsRoot", ".", "children",...
Returns the result of the compilation.
[ "Returns", "the", "result", "of", "the", "compilation", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1196-L1217
25,030
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.getInput
@Override public CompilerInput getInput(InputId id) { // TODO(bradfordcsmith): Allowing null id is less ideal. Add checkNotNull(id) here and fix // call sites that break. if (id == null) { return null; } return inputsById.get(id); }
java
@Override public CompilerInput getInput(InputId id) { // TODO(bradfordcsmith): Allowing null id is less ideal. Add checkNotNull(id) here and fix // call sites that break. if (id == null) { return null; } return inputsById.get(id); }
[ "@", "Override", "public", "CompilerInput", "getInput", "(", "InputId", "id", ")", "{", "// TODO(bradfordcsmith): Allowing null id is less ideal. Add checkNotNull(id) here and fix", "// call sites that break.", "if", "(", "id", "==", "null", ")", "{", "return", "null", ";",...
interface, and which ones should always be injected.
[ "interface", "and", "which", "ones", "should", "always", "be", "injected", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1282-L1290
25,031
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.removeExternInput
protected void removeExternInput(InputId id) { CompilerInput input = getInput(id); if (input == null) { return; } checkState(input.isExtern(), "Not an extern input: %s", input.getName()); inputsById.remove(id); externs.remove(input); Node root = checkNotNull(input.getAstRoot(this)); ...
java
protected void removeExternInput(InputId id) { CompilerInput input = getInput(id); if (input == null) { return; } checkState(input.isExtern(), "Not an extern input: %s", input.getName()); inputsById.remove(id); externs.remove(input); Node root = checkNotNull(input.getAstRoot(this)); ...
[ "protected", "void", "removeExternInput", "(", "InputId", "id", ")", "{", "CompilerInput", "input", "=", "getInput", "(", "id", ")", ";", "if", "(", "input", "==", "null", ")", "{", "return", ";", "}", "checkState", "(", "input", ".", "isExtern", "(", ...
Removes an input file from AST. @param id The id of the input to be removed.
[ "Removes", "an", "input", "file", "from", "AST", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1296-L1308
25,032
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.replaceIncrementalSourceAst
boolean replaceIncrementalSourceAst(JsAst ast) { CompilerInput oldInput = getInput(ast.getInputId()); checkNotNull(oldInput, "No input to replace: %s", ast.getInputId().getIdName()); Node newRoot = checkNotNull(ast.getAstRoot(this)); Node oldRoot = oldInput.getAstRoot(this); oldRoot.replaceWith(newR...
java
boolean replaceIncrementalSourceAst(JsAst ast) { CompilerInput oldInput = getInput(ast.getInputId()); checkNotNull(oldInput, "No input to replace: %s", ast.getInputId().getIdName()); Node newRoot = checkNotNull(ast.getAstRoot(this)); Node oldRoot = oldInput.getAstRoot(this); oldRoot.replaceWith(newR...
[ "boolean", "replaceIncrementalSourceAst", "(", "JsAst", "ast", ")", "{", "CompilerInput", "oldInput", "=", "getInput", "(", "ast", ".", "getInputId", "(", ")", ")", ";", "checkNotNull", "(", "oldInput", ",", "\"No input to replace: %s\"", ",", "ast", ".", "getIn...
Replace a source input dynamically. Intended for incremental re-compilation. If the new source input doesn't parse, then keep the old input in the AST and return false. @return Whether the new AST was attached successfully.
[ "Replace", "a", "source", "input", "dynamically", ".", "Intended", "for", "incremental", "re", "-", "compilation", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1347-L1369
25,033
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.findModulesFromEntryPoints
private void findModulesFromEntryPoints( boolean supportEs6Modules, boolean supportCommonJSModules) { maybeDoThreadedParsing(); List<CompilerInput> entryPoints = new ArrayList<>(); Map<String, CompilerInput> inputsByProvide = new HashMap<>(); Map<String, CompilerInput> inputsByIdentifier = new Has...
java
private void findModulesFromEntryPoints( boolean supportEs6Modules, boolean supportCommonJSModules) { maybeDoThreadedParsing(); List<CompilerInput> entryPoints = new ArrayList<>(); Map<String, CompilerInput> inputsByProvide = new HashMap<>(); Map<String, CompilerInput> inputsByIdentifier = new Has...
[ "private", "void", "findModulesFromEntryPoints", "(", "boolean", "supportEs6Modules", ",", "boolean", "supportCommonJSModules", ")", "{", "maybeDoThreadedParsing", "(", ")", ";", "List", "<", "CompilerInput", ">", "entryPoints", "=", "new", "ArrayList", "<>", "(", "...
Find modules by recursively traversing dependencies starting with the entry points. <p>Causes a regex parse of every file, and a full parse of every file reachable from the entry points (which would be required by later compilation passes regardless). <p>If the dependency mode is set to LOOSE, inputs which the regex ...
[ "Find", "modules", "by", "recursively", "traversing", "dependencies", "starting", "with", "the", "entry", "points", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1812-L1851
25,034
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.findModulesFromInput
private void findModulesFromInput( CompilerInput input, boolean wasImportedByModule, Set<CompilerInput> inputs, Map<String, CompilerInput> inputsByIdentifier, Map<String, CompilerInput> inputsByProvide, boolean supportEs6Modules, boolean supportCommonJSModules) { if (!input...
java
private void findModulesFromInput( CompilerInput input, boolean wasImportedByModule, Set<CompilerInput> inputs, Map<String, CompilerInput> inputsByIdentifier, Map<String, CompilerInput> inputsByProvide, boolean supportEs6Modules, boolean supportCommonJSModules) { if (!input...
[ "private", "void", "findModulesFromInput", "(", "CompilerInput", "input", ",", "boolean", "wasImportedByModule", ",", "Set", "<", "CompilerInput", ">", "inputs", ",", "Map", "<", "String", ",", "CompilerInput", ">", "inputsByIdentifier", ",", "Map", "<", "String",...
Traverse an input's dependencies to find additional modules.
[ "Traverse", "an", "input", "s", "dependencies", "to", "find", "additional", "modules", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1854-L1908
25,035
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.hoistIfExtern
private boolean hoistIfExtern(CompilerInput input) { if (input.getHasExternsAnnotation()) { // If the input file is explicitly marked as an externs file, then move it out of the main // JS root and put it with the other externs. externsRoot.addChildToBack(input.getAstRoot(this)); JSModule m...
java
private boolean hoistIfExtern(CompilerInput input) { if (input.getHasExternsAnnotation()) { // If the input file is explicitly marked as an externs file, then move it out of the main // JS root and put it with the other externs. externsRoot.addChildToBack(input.getAstRoot(this)); JSModule m...
[ "private", "boolean", "hoistIfExtern", "(", "CompilerInput", "input", ")", "{", "if", "(", "input", ".", "getHasExternsAnnotation", "(", ")", ")", "{", "// If the input file is explicitly marked as an externs file, then move it out of the main", "// JS root and put it with the ot...
Hoists a compiler input to externs if it contains the @externs annotation. Return whether or not the given input was hoisted.
[ "Hoists", "a", "compiler", "input", "to", "externs", "if", "it", "contains", "the" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1928-L1943
25,036
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.markExterns
private void markExterns(ImmutableList<CompilerInput> originalInputs) { for (CompilerInput input : originalInputs) { if (input.getHasExternsAnnotation()) { input.setIsExtern(); } } }
java
private void markExterns(ImmutableList<CompilerInput> originalInputs) { for (CompilerInput input : originalInputs) { if (input.getHasExternsAnnotation()) { input.setIsExtern(); } } }
[ "private", "void", "markExterns", "(", "ImmutableList", "<", "CompilerInput", ">", "originalInputs", ")", "{", "for", "(", "CompilerInput", "input", ":", "originalInputs", ")", "{", "if", "(", "input", ".", "getHasExternsAnnotation", "(", ")", ")", "{", "input...
Marks inputs with the @externs annotation as an Extern source file type. This is so that externs marking can be done before dependency management, and externs hoisting done after dependency management.
[ "Marks", "inputs", "with", "the" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1950-L1956
25,037
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.processJsonInputs
Map<String, String> processJsonInputs(Iterable<CompilerInput> inputsToProcess) { RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this); for (CompilerInput input : inputsToProcess) { if (!input.getSourceFile().getOriginalPath().endsWith(".json")) { continue; } input.setCompil...
java
Map<String, String> processJsonInputs(Iterable<CompilerInput> inputsToProcess) { RewriteJsonToModule rewriteJson = new RewriteJsonToModule(this); for (CompilerInput input : inputsToProcess) { if (!input.getSourceFile().getOriginalPath().endsWith(".json")) { continue; } input.setCompil...
[ "Map", "<", "String", ",", "String", ">", "processJsonInputs", "(", "Iterable", "<", "CompilerInput", ">", "inputsToProcess", ")", "{", "RewriteJsonToModule", "rewriteJson", "=", "new", "RewriteJsonToModule", "(", "this", ")", ";", "for", "(", "CompilerInput", "...
Transforms JSON files to a module export that closure compiler can process and keeps track of any "main" entries in package.json files.
[ "Transforms", "JSON", "files", "to", "a", "module", "export", "that", "closure", "compiler", "can", "process", "and", "keeps", "track", "of", "any", "main", "entries", "in", "package", ".", "json", "files", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L1992-L2012
25,038
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.processAMDModules
void processAMDModules(Iterable<CompilerInput> inputs) { for (CompilerInput input : inputs) { input.setCompiler(this); Node root = checkNotNull(input.getAstRoot(this)); new TransformAMDToCJSModule(this).process(null, root); } }
java
void processAMDModules(Iterable<CompilerInput> inputs) { for (CompilerInput input : inputs) { input.setCompiler(this); Node root = checkNotNull(input.getAstRoot(this)); new TransformAMDToCJSModule(this).process(null, root); } }
[ "void", "processAMDModules", "(", "Iterable", "<", "CompilerInput", ">", "inputs", ")", "{", "for", "(", "CompilerInput", "input", ":", "inputs", ")", "{", "input", ".", "setCompiler", "(", "this", ")", ";", "Node", "root", "=", "checkNotNull", "(", "input...
Transforms AMD to CJS modules
[ "Transforms", "AMD", "to", "CJS", "modules" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2037-L2043
25,039
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSource
@Override public String toSource() { return runInCompilerThread( () -> { Tracer tracer = newTracer("toSource"); try { CodeBuilder cb = new CodeBuilder(); if (jsRoot != null) { int i = 0; if (options.shouldPrintExterns()) { ...
java
@Override public String toSource() { return runInCompilerThread( () -> { Tracer tracer = newTracer("toSource"); try { CodeBuilder cb = new CodeBuilder(); if (jsRoot != null) { int i = 0; if (options.shouldPrintExterns()) { ...
[ "@", "Override", "public", "String", "toSource", "(", ")", "{", "return", "runInCompilerThread", "(", "(", ")", "->", "{", "Tracer", "tracer", "=", "newTracer", "(", "\"toSource\"", ")", ";", "try", "{", "CodeBuilder", "cb", "=", "new", "CodeBuilder", "(",...
Converts the main parse tree back to JS code.
[ "Converts", "the", "main", "parse", "tree", "back", "to", "JS", "code", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2101-L2128
25,040
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSource
public String toSource(final JSModule module) { return runInCompilerThread( () -> { List<CompilerInput> inputs = module.getInputs(); int numInputs = inputs.size(); if (numInputs == 0) { return ""; } CodeBuilder cb = new CodeBuilder(); f...
java
public String toSource(final JSModule module) { return runInCompilerThread( () -> { List<CompilerInput> inputs = module.getInputs(); int numInputs = inputs.size(); if (numInputs == 0) { return ""; } CodeBuilder cb = new CodeBuilder(); f...
[ "public", "String", "toSource", "(", "final", "JSModule", "module", ")", "{", "return", "runInCompilerThread", "(", "(", ")", "->", "{", "List", "<", "CompilerInput", ">", "inputs", "=", "module", ".", "getInputs", "(", ")", ";", "int", "numInputs", "=", ...
Converts the parse tree for a module back to JS code.
[ "Converts", "the", "parse", "tree", "for", "a", "module", "back", "to", "JS", "code", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2133-L2151
25,041
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSource
public void toSource(final CodeBuilder cb, final int inputSeqNum, final Node root) { runInCompilerThread( () -> { if (options.printInputDelimiter) { if ((cb.getLength() > 0) && !cb.endsWith("\n")) { cb.append("\n"); // Make su...
java
public void toSource(final CodeBuilder cb, final int inputSeqNum, final Node root) { runInCompilerThread( () -> { if (options.printInputDelimiter) { if ((cb.getLength() > 0) && !cb.endsWith("\n")) { cb.append("\n"); // Make su...
[ "public", "void", "toSource", "(", "final", "CodeBuilder", "cb", ",", "final", "int", "inputSeqNum", ",", "final", "Node", "root", ")", "{", "runInCompilerThread", "(", "(", ")", "->", "{", "if", "(", "options", ".", "printInputDelimiter", ")", "{", "if", ...
Writes out JS code from a root node. If printing input delimiters, this method will attach a comment to the start of the text indicating which input the output derived from. If there were any preserve annotations within the root's source, they will also be printed in a block comment at the beginning of the output.
[ "Writes", "out", "JS", "code", "from", "a", "root", "node", ".", "If", "printing", "input", "delimiters", "this", "method", "will", "attach", "a", "comment", "to", "the", "start", "of", "the", "text", "indicating", "which", "input", "the", "output", "deriv...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2160-L2218
25,042
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSource
@Override public String toSource(Node n) { initCompilerOptionsIfTesting(); return toSource(n, null, true); }
java
@Override public String toSource(Node n) { initCompilerOptionsIfTesting(); return toSource(n, null, true); }
[ "@", "Override", "public", "String", "toSource", "(", "Node", "n", ")", "{", "initCompilerOptionsIfTesting", "(", ")", ";", "return", "toSource", "(", "n", ",", "null", ",", "true", ")", ";", "}" ]
Generates JavaScript source code for an AST, doesn't generate source map info.
[ "Generates", "JavaScript", "source", "code", "for", "an", "AST", "doesn", "t", "generate", "source", "map", "info", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2224-L2228
25,043
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSource
private String toSource(Node n, SourceMap sourceMap, boolean firstOutput) { CodePrinter.Builder builder = new CodePrinter.Builder(n); builder.setTypeRegistry(getTypeRegistry()); builder.setCompilerOptions(options); builder.setSourceMap(sourceMap); builder.setTagAsTypeSummary(!n.isFromExterns() && op...
java
private String toSource(Node n, SourceMap sourceMap, boolean firstOutput) { CodePrinter.Builder builder = new CodePrinter.Builder(n); builder.setTypeRegistry(getTypeRegistry()); builder.setCompilerOptions(options); builder.setSourceMap(sourceMap); builder.setTagAsTypeSummary(!n.isFromExterns() && op...
[ "private", "String", "toSource", "(", "Node", "n", ",", "SourceMap", "sourceMap", ",", "boolean", "firstOutput", ")", "{", "CodePrinter", ".", "Builder", "builder", "=", "new", "CodePrinter", ".", "Builder", "(", "n", ")", ";", "builder", ".", "setTypeRegist...
Generates JavaScript source code for an AST.
[ "Generates", "JavaScript", "source", "code", "for", "an", "AST", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2233-L2241
25,044
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSourceArray
public String[] toSourceArray() { return runInCompilerThread( () -> { Tracer tracer = newTracer("toSourceArray"); try { int numInputs = moduleGraph.getInputCount(); String[] sources = new String[numInputs]; CodeBuilder cb = new CodeBuilder(); ...
java
public String[] toSourceArray() { return runInCompilerThread( () -> { Tracer tracer = newTracer("toSourceArray"); try { int numInputs = moduleGraph.getInputCount(); String[] sources = new String[numInputs]; CodeBuilder cb = new CodeBuilder(); ...
[ "public", "String", "[", "]", "toSourceArray", "(", ")", "{", "return", "runInCompilerThread", "(", "(", ")", "->", "{", "Tracer", "tracer", "=", "newTracer", "(", "\"toSourceArray\"", ")", ";", "try", "{", "int", "numInputs", "=", "moduleGraph", ".", "get...
Converts the parse tree for each input back to JS code.
[ "Converts", "the", "parse", "tree", "for", "each", "input", "back", "to", "JS", "code", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2246-L2267
25,045
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.toSourceArray
public String[] toSourceArray(final JSModule module) { return runInCompilerThread( () -> { List<CompilerInput> inputs = module.getInputs(); int numInputs = inputs.size(); if (numInputs == 0) { return new String[0]; } String[] sources = new Strin...
java
public String[] toSourceArray(final JSModule module) { return runInCompilerThread( () -> { List<CompilerInput> inputs = module.getInputs(); int numInputs = inputs.size(); if (numInputs == 0) { return new String[0]; } String[] sources = new Strin...
[ "public", "String", "[", "]", "toSourceArray", "(", "final", "JSModule", "module", ")", "{", "return", "runInCompilerThread", "(", "(", ")", "->", "{", "List", "<", "CompilerInput", ">", "inputs", "=", "module", ".", "getInputs", "(", ")", ";", "int", "n...
Converts the parse tree for each input in a module back to JS code.
[ "Converts", "the", "parse", "tree", "for", "each", "input", "in", "a", "module", "back", "to", "JS", "code", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2272-L2295
25,046
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.computeCFG
ControlFlowGraph<Node> computeCFG() { logger.fine("Computing Control Flow Graph"); Tracer tracer = newTracer("computeCFG"); ControlFlowAnalysis cfa = new ControlFlowAnalysis(this, true, false); process(cfa); stopTracer(tracer, "computeCFG"); return cfa.getCfg(); }
java
ControlFlowGraph<Node> computeCFG() { logger.fine("Computing Control Flow Graph"); Tracer tracer = newTracer("computeCFG"); ControlFlowAnalysis cfa = new ControlFlowAnalysis(this, true, false); process(cfa); stopTracer(tracer, "computeCFG"); return cfa.getCfg(); }
[ "ControlFlowGraph", "<", "Node", ">", "computeCFG", "(", ")", "{", "logger", ".", "fine", "(", "\"Computing Control Flow Graph\"", ")", ";", "Tracer", "tracer", "=", "newTracer", "(", "\"computeCFG\"", ")", ";", "ControlFlowAnalysis", "cfa", "=", "new", "Control...
Control Flow Analysis.
[ "Control", "Flow", "Analysis", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2395-L2402
25,047
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.addSourceMapSourceFiles
private synchronized void addSourceMapSourceFiles(SourceMapInput inputSourceMap) { // synchronized annotation guards concurrent access to sourceMap during parsing. SourceMapConsumerV3 consumer = inputSourceMap.getSourceMap(errorManager); if (consumer == null) { return; } Collection<String> sou...
java
private synchronized void addSourceMapSourceFiles(SourceMapInput inputSourceMap) { // synchronized annotation guards concurrent access to sourceMap during parsing. SourceMapConsumerV3 consumer = inputSourceMap.getSourceMap(errorManager); if (consumer == null) { return; } Collection<String> sou...
[ "private", "synchronized", "void", "addSourceMapSourceFiles", "(", "SourceMapInput", "inputSourceMap", ")", "{", "// synchronized annotation guards concurrent access to sourceMap during parsing.", "SourceMapConsumerV3", "consumer", "=", "inputSourceMap", ".", "getSourceMap", "(", "...
Adds file name to content mappings for all sources found in a source map. This is used to populate sourcesContent array in the output source map even for sources embedded in the input source map.
[ "Adds", "file", "name", "to", "content", "mappings", "for", "all", "sources", "found", "in", "a", "source", "map", ".", "This", "is", "used", "to", "populate", "sourcesContent", "array", "in", "the", "output", "source", "map", "even", "for", "sources", "em...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2781-L2805
25,048
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.getAstDotGraph
public String getAstDotGraph() throws IOException { if (jsRoot != null) { ControlFlowAnalysis cfa = new ControlFlowAnalysis(this, true, false); cfa.process(null, jsRoot); return DotFormatter.toDot(jsRoot, cfa.getCfg()); } else { return ""; } }
java
public String getAstDotGraph() throws IOException { if (jsRoot != null) { ControlFlowAnalysis cfa = new ControlFlowAnalysis(this, true, false); cfa.process(null, jsRoot); return DotFormatter.toDot(jsRoot, cfa.getCfg()); } else { return ""; } }
[ "public", "String", "getAstDotGraph", "(", ")", "throws", "IOException", "{", "if", "(", "jsRoot", "!=", "null", ")", "{", "ControlFlowAnalysis", "cfa", "=", "new", "ControlFlowAnalysis", "(", "this", ",", "true", ",", "false", ")", ";", "cfa", ".", "proce...
Gets the DOT graph of the AST generated at the end of compilation.
[ "Gets", "the", "DOT", "graph", "of", "the", "AST", "generated", "at", "the", "end", "of", "compilation", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3005-L3013
25,049
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.replaceScript
public void replaceScript(JsAst ast) { CompilerInput input = this.getInput(ast.getInputId()); if (!replaceIncrementalSourceAst(ast)) { return; } Node originalRoot = checkNotNull(input.getAstRoot(this)); processNewScript(ast, originalRoot); }
java
public void replaceScript(JsAst ast) { CompilerInput input = this.getInput(ast.getInputId()); if (!replaceIncrementalSourceAst(ast)) { return; } Node originalRoot = checkNotNull(input.getAstRoot(this)); processNewScript(ast, originalRoot); }
[ "public", "void", "replaceScript", "(", "JsAst", "ast", ")", "{", "CompilerInput", "input", "=", "this", ".", "getInput", "(", "ast", ".", "getInputId", "(", ")", ")", ";", "if", "(", "!", "replaceIncrementalSourceAst", "(", "ast", ")", ")", "{", "return...
Replaces one file in a hot-swap mode. The given JsAst should be made from a new version of a file that already was present in the last compile call. If the file is new, this will silently ignored. @param ast the ast of the file that is being replaced
[ "Replaces", "one", "file", "in", "a", "hot", "-", "swap", "mode", ".", "The", "given", "JsAst", "should", "be", "made", "from", "a", "new", "version", "of", "a", "file", "that", "already", "was", "present", "in", "the", "last", "compile", "call", ".", ...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3163-L3171
25,050
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.runHotSwap
private void runHotSwap( Node originalRoot, Node js, PassConfig passConfig) { for (PassFactory passFactory : passConfig.getChecks()) { runHotSwapPass(originalRoot, js, passFactory); } }
java
private void runHotSwap( Node originalRoot, Node js, PassConfig passConfig) { for (PassFactory passFactory : passConfig.getChecks()) { runHotSwapPass(originalRoot, js, passFactory); } }
[ "private", "void", "runHotSwap", "(", "Node", "originalRoot", ",", "Node", "js", ",", "PassConfig", "passConfig", ")", "{", "for", "(", "PassFactory", "passFactory", ":", "passConfig", ".", "getChecks", "(", ")", ")", "{", "runHotSwapPass", "(", "originalRoot"...
Execute the passes from a PassConfig instance over a single replaced file.
[ "Execute", "the", "passes", "from", "a", "PassConfig", "instance", "over", "a", "single", "replaced", "file", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3214-L3219
25,051
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.getReleaseVersion
@GwtIncompatible("java.util.ResourceBundle") public static String getReleaseVersion() { ResourceBundle config = ResourceBundle.getBundle(CONFIG_RESOURCE); return config.getString("compiler.version"); }
java
@GwtIncompatible("java.util.ResourceBundle") public static String getReleaseVersion() { ResourceBundle config = ResourceBundle.getBundle(CONFIG_RESOURCE); return config.getString("compiler.version"); }
[ "@", "GwtIncompatible", "(", "\"java.util.ResourceBundle\"", ")", "public", "static", "String", "getReleaseVersion", "(", ")", "{", "ResourceBundle", "config", "=", "ResourceBundle", ".", "getBundle", "(", "CONFIG_RESOURCE", ")", ";", "return", "config", ".", "getSt...
Returns the compiler version baked into the jar.
[ "Returns", "the", "compiler", "version", "baked", "into", "the", "jar", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3308-L3312
25,052
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.getReleaseDate
@GwtIncompatible("java.util.ResourceBundle") public static String getReleaseDate() { ResourceBundle config = ResourceBundle.getBundle(CONFIG_RESOURCE); return config.getString("compiler.date"); }
java
@GwtIncompatible("java.util.ResourceBundle") public static String getReleaseDate() { ResourceBundle config = ResourceBundle.getBundle(CONFIG_RESOURCE); return config.getString("compiler.date"); }
[ "@", "GwtIncompatible", "(", "\"java.util.ResourceBundle\"", ")", "public", "static", "String", "getReleaseDate", "(", ")", "{", "ResourceBundle", "config", "=", "ResourceBundle", ".", "getBundle", "(", "CONFIG_RESOURCE", ")", ";", "return", "config", ".", "getStrin...
Returns the compiler date baked into the jar.
[ "Returns", "the", "compiler", "date", "baked", "into", "the", "jar", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3315-L3319
25,053
google/closure-compiler
src/com/google/javascript/jscomp/Compiler.java
Compiler.resolveSibling
private static String resolveSibling(String fromPath, String toPath) { // If the destination is an absolute path, nothing to do. if (toPath.startsWith("/")) { return toPath; } List<String> fromPathParts = new ArrayList<>(Arrays.asList(fromPath.split("/"))); List<String> toPathParts = new Arra...
java
private static String resolveSibling(String fromPath, String toPath) { // If the destination is an absolute path, nothing to do. if (toPath.startsWith("/")) { return toPath; } List<String> fromPathParts = new ArrayList<>(Arrays.asList(fromPath.split("/"))); List<String> toPathParts = new Arra...
[ "private", "static", "String", "resolveSibling", "(", "String", "fromPath", ",", "String", "toPath", ")", "{", "// If the destination is an absolute path, nothing to do.", "if", "(", "toPath", ".", "startsWith", "(", "\"/\"", ")", ")", "{", "return", "toPath", ";", ...
Simplistic implementation of the java.nio.file.Path resolveSibling method that works with GWT. @param fromPath - must be a file (not directory) @param toPath - must be a file (not directory)
[ "Simplistic", "implementation", "of", "the", "java", ".", "nio", ".", "file", ".", "Path", "resolveSibling", "method", "that", "works", "with", "GWT", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3618-L3643
25,054
google/closure-compiler
src/com/google/javascript/jscomp/CoverageInstrumentationPass.java
CoverageInstrumentationPass.addHeaderCode
private void addHeaderCode(Node script) { script.addChildToFront(createConditionalObjectDecl(JS_INSTRUMENTATION_OBJECT_NAME, script)); // Make subsequent usages of "window" and "window.top" work in a Web Worker context. script.addChildToFront( compiler.parseSyntheticCode( "if (!self.win...
java
private void addHeaderCode(Node script) { script.addChildToFront(createConditionalObjectDecl(JS_INSTRUMENTATION_OBJECT_NAME, script)); // Make subsequent usages of "window" and "window.top" work in a Web Worker context. script.addChildToFront( compiler.parseSyntheticCode( "if (!self.win...
[ "private", "void", "addHeaderCode", "(", "Node", "script", ")", "{", "script", ".", "addChildToFront", "(", "createConditionalObjectDecl", "(", "JS_INSTRUMENTATION_OBJECT_NAME", ",", "script", ")", ")", ";", "// Make subsequent usages of \"window\" and \"window.top\" work in ...
Creates the js code to be added to source. This code declares and initializes the variables required for collection of coverage data.
[ "Creates", "the", "js", "code", "to", "be", "added", "to", "source", ".", "This", "code", "declares", "and", "initializes", "the", "variables", "required", "for", "collection", "of", "coverage", "data", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CoverageInstrumentationPass.java#L73-L82
25,055
appium/java-client
src/main/java/io/appium/java_client/touch/WaitOptions.java
WaitOptions.withDuration
public WaitOptions withDuration(Duration duration) { checkNotNull(duration); checkArgument(duration.toMillis() >= 0, "Duration value should be greater or equal to zero"); this.duration = duration; return this; }
java
public WaitOptions withDuration(Duration duration) { checkNotNull(duration); checkArgument(duration.toMillis() >= 0, "Duration value should be greater or equal to zero"); this.duration = duration; return this; }
[ "public", "WaitOptions", "withDuration", "(", "Duration", "duration", ")", "{", "checkNotNull", "(", "duration", ")", ";", "checkArgument", "(", "duration", ".", "toMillis", "(", ")", ">=", "0", ",", "\"Duration value should be greater or equal to zero\"", ")", ";",...
Set the wait duration. @param duration the value to set. Time resolution unit is 1 ms. @return this instance for chaining.
[ "Set", "the", "wait", "duration", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/touch/WaitOptions.java#L46-L52
25,056
appium/java-client
src/main/java/io/appium/java_client/touch/LongPressOptions.java
LongPressOptions.withDuration
public LongPressOptions withDuration(Duration duration) { checkNotNull(duration); checkArgument(duration.toMillis() >= 0, "Duration value should be greater or equal to zero"); this.duration = duration; return this; }
java
public LongPressOptions withDuration(Duration duration) { checkNotNull(duration); checkArgument(duration.toMillis() >= 0, "Duration value should be greater or equal to zero"); this.duration = duration; return this; }
[ "public", "LongPressOptions", "withDuration", "(", "Duration", "duration", ")", "{", "checkNotNull", "(", "duration", ")", ";", "checkArgument", "(", "duration", ".", "toMillis", "(", ")", ">=", "0", ",", "\"Duration value should be greater or equal to zero\"", ")", ...
Set the long press duration. @param duration the value to set. Time resolution unit is 1 ms. @return this instance for chaining.
[ "Set", "the", "long", "press", "duration", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/touch/LongPressOptions.java#L47-L53
25,057
appium/java-client
src/main/java/io/appium/java_client/android/AndroidMobileCommandHelper.java
AndroidMobileCommandHelper.getPerformanceDataCommand
public static Map.Entry<String, Map<String, ?>> getPerformanceDataCommand( String packageName, String dataType, int dataReadTimeout) { String[] parameters = new String[] {"packageName", "dataType", "dataReadTimeout"}; Object[] values = new Object[] {packageName, dataType, dataReadTim...
java
public static Map.Entry<String, Map<String, ?>> getPerformanceDataCommand( String packageName, String dataType, int dataReadTimeout) { String[] parameters = new String[] {"packageName", "dataType", "dataReadTimeout"}; Object[] values = new Object[] {packageName, dataType, dataReadTim...
[ "public", "static", "Map", ".", "Entry", "<", "String", ",", "Map", "<", "String", ",", "?", ">", ">", "getPerformanceDataCommand", "(", "String", "packageName", ",", "String", "dataType", ",", "int", "dataReadTimeout", ")", "{", "String", "[", "]", "param...
returns the resource usage information of the application. the resource is one of the system state which means cpu, memory, network traffic, and battery. @param packageName the package name of the application @param dataType the type of system state which wants to read. It should be one of the supported performance da...
[ "returns", "the", "resource", "usage", "information", "of", "the", "application", ".", "the", "resource", "is", "one", "of", "the", "system", "state", "which", "means", "cpu", "memory", "network", "traffic", "and", "battery", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/android/AndroidMobileCommandHelper.java#L109-L115
25,058
appium/java-client
src/main/java/io/appium/java_client/ws/StringWebSocketClient.java
StringWebSocketClient.connect
public void connect(URI endpoint) { if (endpoint.equals(this.getEndpoint()) && isListening) { return; } OkHttpClient client = new OkHttpClient.Builder() .readTimeout(0, TimeUnit.MILLISECONDS) .build(); Request request = new Request.Builder() ...
java
public void connect(URI endpoint) { if (endpoint.equals(this.getEndpoint()) && isListening) { return; } OkHttpClient client = new OkHttpClient.Builder() .readTimeout(0, TimeUnit.MILLISECONDS) .build(); Request request = new Request.Builder() ...
[ "public", "void", "connect", "(", "URI", "endpoint", ")", "{", "if", "(", "endpoint", ".", "equals", "(", "this", ".", "getEndpoint", "(", ")", ")", "&&", "isListening", ")", "{", "return", ";", "}", "OkHttpClient", "client", "=", "new", "OkHttpClient", ...
Connects web socket client. @param endpoint The full address of an endpoint to connect to. Usually starts with 'ws://'.
[ "Connects", "web", "socket", "client", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ws/StringWebSocketClient.java#L63-L78
25,059
appium/java-client
src/main/java/io/appium/java_client/ScreenshotState.java
ScreenshotState.verifyChanged
public ScreenshotState verifyChanged(Duration timeout, double minScore) { return checkState((x) -> x < minScore, timeout); }
java
public ScreenshotState verifyChanged(Duration timeout, double minScore) { return checkState((x) -> x < minScore, timeout); }
[ "public", "ScreenshotState", "verifyChanged", "(", "Duration", "timeout", ",", "double", "minScore", ")", "{", "return", "checkState", "(", "(", "x", ")", "-", ">", "x", "<", "minScore", ",", "timeout", ")", ";", "}" ]
Verifies whether the state of the screenshot provided by stateProvider lambda function is changed within the given timeout. @param timeout timeout value @param minScore the value in range (0.0, 1.0) @return self instance for chaining @throws ScreenshotComparisonTimeout if the calculated score is still greater or equa...
[ "Verifies", "whether", "the", "state", "of", "the", "screenshot", "provided", "by", "stateProvider", "lambda", "function", "is", "changed", "within", "the", "given", "timeout", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ScreenshotState.java#L186-L188
25,060
appium/java-client
src/main/java/io/appium/java_client/ScreenshotState.java
ScreenshotState.verifyNotChanged
public ScreenshotState verifyNotChanged(Duration timeout, double minScore) { return checkState((x) -> x >= minScore, timeout); }
java
public ScreenshotState verifyNotChanged(Duration timeout, double minScore) { return checkState((x) -> x >= minScore, timeout); }
[ "public", "ScreenshotState", "verifyNotChanged", "(", "Duration", "timeout", ",", "double", "minScore", ")", "{", "return", "checkState", "(", "(", "x", ")", "-", ">", "x", ">=", "minScore", ",", "timeout", ")", ";", "}" ]
Verifies whether the state of the screenshot provided by stateProvider lambda function is not changed within the given timeout. @param timeout timeout value @param minScore the value in range (0.0, 1.0) @return self instance for chaining @throws ScreenshotComparisonTimeout if the calculated score is still less than...
[ "Verifies", "whether", "the", "state", "of", "the", "screenshot", "provided", "by", "stateProvider", "lambda", "function", "is", "not", "changed", "within", "the", "given", "timeout", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ScreenshotState.java#L201-L203
25,061
appium/java-client
src/main/java/io/appium/java_client/ios/IOSTouchAction.java
IOSTouchAction.doubleTap
public IOSTouchAction doubleTap(PointOption doubleTapOption) { ActionParameter action = new ActionParameter("doubleTap", doubleTapOption); parameterBuilder.add(action); return this; }
java
public IOSTouchAction doubleTap(PointOption doubleTapOption) { ActionParameter action = new ActionParameter("doubleTap", doubleTapOption); parameterBuilder.add(action); return this; }
[ "public", "IOSTouchAction", "doubleTap", "(", "PointOption", "doubleTapOption", ")", "{", "ActionParameter", "action", "=", "new", "ActionParameter", "(", "\"doubleTap\"", ",", "doubleTapOption", ")", ";", "parameterBuilder", ".", "add", "(", "action", ")", ";", "...
Double taps using coordinates. @param doubleTapOption see {@link PointOption} and {@link ElementOption}.. @return self-reference
[ "Double", "taps", "using", "coordinates", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ios/IOSTouchAction.java#L37-L42
25,062
appium/java-client
src/main/java/io/appium/java_client/pagefactory/utils/ProxyFactory.java
ProxyFactory.getEnhancedProxy
@SuppressWarnings("unchecked") public static <T> T getEnhancedProxy(Class<T> requiredClazz, Class<?>[] params, Object[] values, MethodInterceptor interceptor) { Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(requiredClazz); enhancer.setCallback(interceptor); retur...
java
@SuppressWarnings("unchecked") public static <T> T getEnhancedProxy(Class<T> requiredClazz, Class<?>[] params, Object[] values, MethodInterceptor interceptor) { Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(requiredClazz); enhancer.setCallback(interceptor); retur...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "getEnhancedProxy", "(", "Class", "<", "T", ">", "requiredClazz", ",", "Class", "<", "?", ">", "[", "]", "params", ",", "Object", "[", "]", "values", ",", "Meth...
It returns some proxies created by CGLIB. @param requiredClazz is a {@link java.lang.Class} whose instance should be created @param params is an array of @link java.lang.Class}. It should be convenient to parameter types of some declared constructor which belongs to desired class. @param values is an array of @link ja...
[ "It", "returns", "some", "proxies", "created", "by", "CGLIB", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/pagefactory/utils/ProxyFactory.java#L49-L56
25,063
appium/java-client
src/main/java/io/appium/java_client/AppiumDriver.java
AppiumDriver.substituteMobilePlatform
protected static Capabilities substituteMobilePlatform(Capabilities originalCapabilities, String newPlatform) { DesiredCapabilities dc = new DesiredCapabilities(originalCapabilities); dc.setCapability(PLATFORM_NAME, newPlatform); return dc; }
java
protected static Capabilities substituteMobilePlatform(Capabilities originalCapabilities, String newPlatform) { DesiredCapabilities dc = new DesiredCapabilities(originalCapabilities); dc.setCapability(PLATFORM_NAME, newPlatform); return dc; }
[ "protected", "static", "Capabilities", "substituteMobilePlatform", "(", "Capabilities", "originalCapabilities", ",", "String", "newPlatform", ")", "{", "DesiredCapabilities", "dc", "=", "new", "DesiredCapabilities", "(", "originalCapabilities", ")", ";", "dc", ".", "set...
Changes platform name and returns new capabilities. @param originalCapabilities the given {@link Capabilities}. @param newPlatform a {@link MobileCapabilityType#PLATFORM_NAME} value which has to be set up @return {@link Capabilities} with changed mobile platform value
[ "Changes", "platform", "name", "and", "returns", "new", "capabilities", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/AppiumDriver.java#L140-L145
25,064
appium/java-client
src/main/java/io/appium/java_client/pagefactory/AppiumElementLocator.java
AppiumElementLocator.findElements
public List<WebElement> findElements() { if (cachedElementList != null && shouldCache) { return cachedElementList; } List<WebElement> result; try { result = waitFor(() -> { List<WebElement> list = searchContext .findElement...
java
public List<WebElement> findElements() { if (cachedElementList != null && shouldCache) { return cachedElementList; } List<WebElement> result; try { result = waitFor(() -> { List<WebElement> list = searchContext .findElement...
[ "public", "List", "<", "WebElement", ">", "findElements", "(", ")", "{", "if", "(", "cachedElementList", "!=", "null", "&&", "shouldCache", ")", "{", "return", "cachedElementList", ";", "}", "List", "<", "WebElement", ">", "result", ";", "try", "{", "resul...
Find the element list.
[ "Find", "the", "element", "list", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocator.java#L133-L153
25,065
appium/java-client
src/main/java/io/appium/java_client/remote/NewAppiumSessionPayload.java
NewAppiumSessionPayload.writeTo
public void writeTo(Appendable appendable) throws IOException { try (JsonOutput json = new Json().newOutput(appendable)) { json.beginObject(); Map<String, Object> first = getOss(); if (first == null) { //noinspection unchecked first = (Map<Str...
java
public void writeTo(Appendable appendable) throws IOException { try (JsonOutput json = new Json().newOutput(appendable)) { json.beginObject(); Map<String, Object> first = getOss(); if (first == null) { //noinspection unchecked first = (Map<Str...
[ "public", "void", "writeTo", "(", "Appendable", "appendable", ")", "throws", "IOException", "{", "try", "(", "JsonOutput", "json", "=", "new", "Json", "(", ")", ".", "newOutput", "(", "appendable", ")", ")", "{", "json", ".", "beginObject", "(", ")", ";"...
Writes json capabilities to some appendable object. @param appendable to write a json
[ "Writes", "json", "capabilities", "to", "some", "appendable", "object", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/remote/NewAppiumSessionPayload.java#L239-L275
25,066
appium/java-client
src/main/java/io/appium/java_client/MultiTouchAction.java
MultiTouchAction.perform
public MultiTouchAction perform() { List<TouchAction> touchActions = actions.build(); checkArgument(touchActions.size() > 0, "MultiTouch action must have at least one TouchAction added before it can be performed"); if (touchActions.size() > 1) { performsTouchActions.p...
java
public MultiTouchAction perform() { List<TouchAction> touchActions = actions.build(); checkArgument(touchActions.size() > 0, "MultiTouch action must have at least one TouchAction added before it can be performed"); if (touchActions.size() > 1) { performsTouchActions.p...
[ "public", "MultiTouchAction", "perform", "(", ")", "{", "List", "<", "TouchAction", ">", "touchActions", "=", "actions", ".", "build", "(", ")", ";", "checkArgument", "(", "touchActions", ".", "size", "(", ")", ">", "0", ",", "\"MultiTouch action must have at ...
Perform the multi-touch action on the mobile performsTouchActions.
[ "Perform", "the", "multi", "-", "touch", "action", "on", "the", "mobile", "performsTouchActions", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/MultiTouchAction.java#L69-L79
25,067
appium/java-client
src/main/java/io/appium/java_client/ios/IOSDriver.java
IOSDriver.runAppInBackground
@Override public void runAppInBackground(Duration duration) { // timeout parameter is expected to be in milliseconds // float values are allowed execute(RUN_APP_IN_BACKGROUND, prepareArguments("seconds", prepareArguments("timeout", duration.toMillis()))); }
java
@Override public void runAppInBackground(Duration duration) { // timeout parameter is expected to be in milliseconds // float values are allowed execute(RUN_APP_IN_BACKGROUND, prepareArguments("seconds", prepareArguments("timeout", duration.toMillis()))); }
[ "@", "Override", "public", "void", "runAppInBackground", "(", "Duration", "duration", ")", "{", "// timeout parameter is expected to be in milliseconds", "// float values are allowed", "execute", "(", "RUN_APP_IN_BACKGROUND", ",", "prepareArguments", "(", "\"seconds\"", ",", ...
Runs the current app as a background app for the number of seconds or minimizes the app. @param duration The time to run App in background.
[ "Runs", "the", "current", "app", "as", "a", "background", "app", "for", "the", "number", "of", "seconds", "or", "minimizes", "the", "app", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ios/IOSDriver.java#L182-L187
25,068
appium/java-client
src/main/java/io/appium/java_client/ios/IOSDriver.java
IOSDriver.getCapabilities
@Nullable public Capabilities getCapabilities() { MutableCapabilities capabilities = (MutableCapabilities) super.getCapabilities(); if (capabilities != null) { capabilities.setCapability(PLATFORM_NAME, IOS_PLATFORM); } return capabilities; }
java
@Nullable public Capabilities getCapabilities() { MutableCapabilities capabilities = (MutableCapabilities) super.getCapabilities(); if (capabilities != null) { capabilities.setCapability(PLATFORM_NAME, IOS_PLATFORM); } return capabilities; }
[ "@", "Nullable", "public", "Capabilities", "getCapabilities", "(", ")", "{", "MutableCapabilities", "capabilities", "=", "(", "MutableCapabilities", ")", "super", ".", "getCapabilities", "(", ")", ";", "if", "(", "capabilities", "!=", "null", ")", "{", "capabili...
Returns capabilities that were provided on instantiation. @return given {@link Capabilities}
[ "Returns", "capabilities", "that", "were", "provided", "on", "instantiation", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ios/IOSDriver.java#L211-L218
25,069
appium/java-client
src/main/java/io/appium/java_client/MobileElement.java
MobileElement.getCenter
public Point getCenter() { Point upperLeft = this.getLocation(); Dimension dimensions = this.getSize(); return new Point(upperLeft.getX() + dimensions.getWidth() / 2, upperLeft.getY() + dimensions.getHeight() / 2); }
java
public Point getCenter() { Point upperLeft = this.getLocation(); Dimension dimensions = this.getSize(); return new Point(upperLeft.getX() + dimensions.getWidth() / 2, upperLeft.getY() + dimensions.getHeight() / 2); }
[ "public", "Point", "getCenter", "(", ")", "{", "Point", "upperLeft", "=", "this", ".", "getLocation", "(", ")", ";", "Dimension", "dimensions", "=", "this", ".", "getSize", "(", ")", ";", "return", "new", "Point", "(", "upperLeft", ".", "getX", "(", ")...
Method returns central coordinates of an element. @return The instance of the {@link org.openqa.selenium.Point}
[ "Method", "returns", "central", "coordinates", "of", "an", "element", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/MobileElement.java#L38-L43
25,070
appium/java-client
src/main/java/io/appium/java_client/MobileElement.java
MobileElement.setValue
public void setValue(String value) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.put("id", id).put("value", value); execute(MobileCommand.SET_VALUE, builder.build()); }
java
public void setValue(String value) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.put("id", id).put("value", value); execute(MobileCommand.SET_VALUE, builder.build()); }
[ "public", "void", "setValue", "(", "String", "value", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "Object", ">", "builder", "=", "ImmutableMap", ".", "builder", "(", ")", ";", "builder", ".", "put", "(", "\"id\"", ",", "id", ")", ".",...
This method sets the new value of the attribute "value". @param value is the new value which should be set
[ "This", "method", "sets", "the", "new", "value", "of", "the", "attribute", "value", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/MobileElement.java#L94-L98
25,071
appium/java-client
src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java
AppiumDriverLocalService.start
public void start() throws AppiumServerHasNotBeenStartedLocallyException { lock.lock(); try { if (isRunning()) { return; } try { process = new CommandLine(this.nodeJSExec.getCanonicalPath(), nodeJSArgs.toArray(new S...
java
public void start() throws AppiumServerHasNotBeenStartedLocallyException { lock.lock(); try { if (isRunning()) { return; } try { process = new CommandLine(this.nodeJSExec.getCanonicalPath(), nodeJSArgs.toArray(new S...
[ "public", "void", "start", "(", ")", "throws", "AppiumServerHasNotBeenStartedLocallyException", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "isRunning", "(", ")", ")", "{", "return", ";", "}", "try", "{", "process", "=", "new", "Comma...
Starts the defined appium server. @throws AppiumServerHasNotBeenStartedLocallyException If an error occurs while spawning the child process. @see #stop()
[ "Starts", "the", "defined", "appium", "server", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java#L135-L166
25,072
appium/java-client
src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java
AppiumDriverLocalService.stop
@Override public void stop() { lock.lock(); try { if (process != null) { destroyProcess(); } process = null; } finally { lock.unlock(); } }
java
@Override public void stop() { lock.lock(); try { if (process != null) { destroyProcess(); } process = null; } finally { lock.unlock(); } }
[ "@", "Override", "public", "void", "stop", "(", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "process", "!=", "null", ")", "{", "destroyProcess", "(", ")", ";", "}", "process", "=", "null", ";", "}", "finally", "{", "lock"...
Stops this service is it is currently running. This method will attempt to block until the server has been fully shutdown. @see #start()
[ "Stops", "this", "service", "is", "it", "is", "currently", "running", ".", "This", "method", "will", "attempt", "to", "block", "until", "the", "server", "has", "been", "fully", "shutdown", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java#L174-L184
25,073
appium/java-client
src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java
AppiumDriverLocalService.addOutPutStreams
public void addOutPutStreams(List<OutputStream> outputStreams) { checkNotNull(outputStreams, "outputStreams parameter is NULL!"); for (OutputStream stream : outputStreams) { addOutPutStream(stream); } }
java
public void addOutPutStreams(List<OutputStream> outputStreams) { checkNotNull(outputStreams, "outputStreams parameter is NULL!"); for (OutputStream stream : outputStreams) { addOutPutStream(stream); } }
[ "public", "void", "addOutPutStreams", "(", "List", "<", "OutputStream", ">", "outputStreams", ")", "{", "checkNotNull", "(", "outputStreams", ",", "\"outputStreams parameter is NULL!\"", ")", ";", "for", "(", "OutputStream", "stream", ":", "outputStreams", ")", "{",...
Adds other output streams which should accept server output data. @param outputStreams is a list of additional {@link OutputStream} that are ready to accept server output
[ "Adds", "other", "output", "streams", "which", "should", "accept", "server", "output", "data", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java#L222-L227
25,074
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/OccurrenceMatchingResult.java
OccurrenceMatchingResult.getRect
public Rectangle getRect() { verifyPropertyPresence(RECT); //noinspection unchecked return mapToRect((Map<String, Object>) getCommandResult().get(RECT)); }
java
public Rectangle getRect() { verifyPropertyPresence(RECT); //noinspection unchecked return mapToRect((Map<String, Object>) getCommandResult().get(RECT)); }
[ "public", "Rectangle", "getRect", "(", ")", "{", "verifyPropertyPresence", "(", "RECT", ")", ";", "//noinspection unchecked", "return", "mapToRect", "(", "(", "Map", "<", "String", ",", "Object", ">", ")", "getCommandResult", "(", ")", ".", "get", "(", "RECT...
Returns rectangle of partial image occurrence. @return The region of the partial image occurrence on the full image.
[ "Returns", "rectangle", "of", "partial", "image", "occurrence", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/OccurrenceMatchingResult.java#L35-L39
25,075
appium/java-client
src/main/java/io/appium/java_client/android/nativekey/KeyEvent.java
KeyEvent.withMetaModifier
public KeyEvent withMetaModifier(KeyEventMetaModifier keyEventMetaModifier) { if (this.metaState == null) { this.metaState = 0; } this.metaState |= keyEventMetaModifier.getValue(); return this; }
java
public KeyEvent withMetaModifier(KeyEventMetaModifier keyEventMetaModifier) { if (this.metaState == null) { this.metaState = 0; } this.metaState |= keyEventMetaModifier.getValue(); return this; }
[ "public", "KeyEvent", "withMetaModifier", "(", "KeyEventMetaModifier", "keyEventMetaModifier", ")", "{", "if", "(", "this", ".", "metaState", "==", "null", ")", "{", "this", ".", "metaState", "=", "0", ";", "}", "this", ".", "metaState", "|=", "keyEventMetaMod...
Adds the meta modifier. @param keyEventMetaModifier Native Android modifier value. Multiple modifiers can be combined into a single key event. @return self instance for chaining
[ "Adds", "the", "meta", "modifier", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/android/nativekey/KeyEvent.java#L55-L61
25,076
appium/java-client
src/main/java/io/appium/java_client/android/nativekey/KeyEvent.java
KeyEvent.withFlag
public KeyEvent withFlag(KeyEventFlag keyEventFlag) { if (this.flags == null) { this.flags = 0; } this.flags |= keyEventFlag.getValue(); return this; }
java
public KeyEvent withFlag(KeyEventFlag keyEventFlag) { if (this.flags == null) { this.flags = 0; } this.flags |= keyEventFlag.getValue(); return this; }
[ "public", "KeyEvent", "withFlag", "(", "KeyEventFlag", "keyEventFlag", ")", "{", "if", "(", "this", ".", "flags", "==", "null", ")", "{", "this", ".", "flags", "=", "0", ";", "}", "this", ".", "flags", "|=", "keyEventFlag", ".", "getValue", "(", ")", ...
Adds the flag. @param keyEventFlag Native Android flag value. Several flags can be combined into a single key event. @return self instance for chaining
[ "Adds", "the", "flag", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/android/nativekey/KeyEvent.java#L70-L76
25,077
appium/java-client
src/main/java/io/appium/java_client/android/nativekey/KeyEvent.java
KeyEvent.build
public Map<String, Object> build() { final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); final int keyCode = ofNullable(this.keyCode) .orElseThrow(() -> new IllegalStateException("The key code must be set")); builder.put("keycode", keyCode); ofNul...
java
public Map<String, Object> build() { final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); final int keyCode = ofNullable(this.keyCode) .orElseThrow(() -> new IllegalStateException("The key code must be set")); builder.put("keycode", keyCode); ofNul...
[ "public", "Map", "<", "String", ",", "Object", ">", "build", "(", ")", "{", "final", "ImmutableMap", ".", "Builder", "<", "String", ",", "Object", ">", "builder", "=", "ImmutableMap", ".", "builder", "(", ")", ";", "final", "int", "keyCode", "=", "ofNu...
Builds a map, which is ready to be used by the downstream API. @return API parameters mapping @throws IllegalStateException if key code is not set
[ "Builds", "a", "map", "which", "is", "ready", "to", "be", "used", "by", "the", "downstream", "API", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/android/nativekey/KeyEvent.java#L84-L92
25,078
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java
FeaturesMatchingResult.getPoints1
public List<Point> getPoints1() { verifyPropertyPresence(POINTS1); //noinspection unchecked return ((List<Map<String, Object>>) getCommandResult().get(POINTS1)).stream() .map(ComparisonResult::mapToPoint) .collect(Collectors.toList()); }
java
public List<Point> getPoints1() { verifyPropertyPresence(POINTS1); //noinspection unchecked return ((List<Map<String, Object>>) getCommandResult().get(POINTS1)).stream() .map(ComparisonResult::mapToPoint) .collect(Collectors.toList()); }
[ "public", "List", "<", "Point", ">", "getPoints1", "(", ")", "{", "verifyPropertyPresence", "(", "POINTS1", ")", ";", "//noinspection unchecked", "return", "(", "(", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", ")", "getCommandResult", "(", ...
Returns a list of matching points on the first image. @return The list of matching points on the first image.
[ "Returns", "a", "list", "of", "matching", "points", "on", "the", "first", "image", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java#L67-L73
25,079
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java
FeaturesMatchingResult.getRect1
public Rectangle getRect1() { verifyPropertyPresence(RECT1); //noinspection unchecked return mapToRect((Map<String, Object>) getCommandResult().get(RECT1)); }
java
public Rectangle getRect1() { verifyPropertyPresence(RECT1); //noinspection unchecked return mapToRect((Map<String, Object>) getCommandResult().get(RECT1)); }
[ "public", "Rectangle", "getRect1", "(", ")", "{", "verifyPropertyPresence", "(", "RECT1", ")", ";", "//noinspection unchecked", "return", "mapToRect", "(", "(", "Map", "<", "String", ",", "Object", ">", ")", "getCommandResult", "(", ")", ".", "get", "(", "RE...
Returns a rect for the `points1` list. @return The bounding rect for the `points1` list or a zero rect if not enough matching points were found.
[ "Returns", "a", "rect", "for", "the", "points1", "list", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java#L80-L84
25,080
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java
FeaturesMatchingResult.getPoints2
public List<Point> getPoints2() { verifyPropertyPresence(POINTS2); //noinspection unchecked return ((List<Map<String, Object>>) getCommandResult().get(POINTS2)).stream() .map(ComparisonResult::mapToPoint) .collect(Collectors.toList()); }
java
public List<Point> getPoints2() { verifyPropertyPresence(POINTS2); //noinspection unchecked return ((List<Map<String, Object>>) getCommandResult().get(POINTS2)).stream() .map(ComparisonResult::mapToPoint) .collect(Collectors.toList()); }
[ "public", "List", "<", "Point", ">", "getPoints2", "(", ")", "{", "verifyPropertyPresence", "(", "POINTS2", ")", ";", "//noinspection unchecked", "return", "(", "(", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", ")", "getCommandResult", "(", ...
Returns a list of matching points on the second image. @return The list of matching points on the second image.
[ "Returns", "a", "list", "of", "matching", "points", "on", "the", "second", "image", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java#L91-L97
25,081
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java
FeaturesMatchingResult.getRect2
public Rectangle getRect2() { verifyPropertyPresence(RECT2); //noinspection unchecked return mapToRect((Map<String, Object>) getCommandResult().get(RECT2)); }
java
public Rectangle getRect2() { verifyPropertyPresence(RECT2); //noinspection unchecked return mapToRect((Map<String, Object>) getCommandResult().get(RECT2)); }
[ "public", "Rectangle", "getRect2", "(", ")", "{", "verifyPropertyPresence", "(", "RECT2", ")", ";", "//noinspection unchecked", "return", "mapToRect", "(", "(", "Map", "<", "String", ",", "Object", ">", ")", "getCommandResult", "(", ")", ".", "get", "(", "RE...
Returns a rect for the `points2` list. @return The bounding rect for the `points2` list or a zero rect if not enough matching points were found.
[ "Returns", "a", "rect", "for", "the", "points2", "list", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java#L104-L108
25,082
appium/java-client
src/main/java/io/appium/java_client/battery/BatteryInfo.java
BatteryInfo.getLevel
public double getLevel() { final Object value = getInput().get("level"); if (value instanceof Long) { return ((Long) value).doubleValue(); } return (double) value; }
java
public double getLevel() { final Object value = getInput().get("level"); if (value instanceof Long) { return ((Long) value).doubleValue(); } return (double) value; }
[ "public", "double", "getLevel", "(", ")", "{", "final", "Object", "value", "=", "getInput", "(", ")", ".", "get", "(", "\"level\"", ")", ";", "if", "(", "value", "instanceof", "Long", ")", "{", "return", "(", "(", "Long", ")", "value", ")", ".", "d...
Returns battery level. @return Battery level in range [0.0, 1.0], where 1.0 means 100% charge.
[ "Returns", "battery", "level", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/battery/BatteryInfo.java#L17-L23
25,083
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java
ComparisonResult.verifyPropertyPresence
protected void verifyPropertyPresence(String propertyName) { if (!commandResult.containsKey(propertyName)) { throw new IllegalStateException( String.format("There is no '%s' attribute in the resulting command output %s. " + "Did you set the options pro...
java
protected void verifyPropertyPresence(String propertyName) { if (!commandResult.containsKey(propertyName)) { throw new IllegalStateException( String.format("There is no '%s' attribute in the resulting command output %s. " + "Did you set the options pro...
[ "protected", "void", "verifyPropertyPresence", "(", "String", "propertyName", ")", "{", "if", "(", "!", "commandResult", ".", "containsKey", "(", "propertyName", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "String", ".", "format", "(", "\"There ...
Verifies if the corresponding property is present in the commend result and throws an exception if not. @param propertyName the actual property name to be verified for presence
[ "Verifies", "if", "the", "corresponding", "property", "is", "present", "in", "the", "commend", "result", "and", "throws", "an", "exception", "if", "not", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java#L50-L56
25,084
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java
ComparisonResult.getVisualization
public byte[] getVisualization() { verifyPropertyPresence(VISUALIZATION); return ((String) getCommandResult().get(VISUALIZATION)).getBytes(StandardCharsets.UTF_8); }
java
public byte[] getVisualization() { verifyPropertyPresence(VISUALIZATION); return ((String) getCommandResult().get(VISUALIZATION)).getBytes(StandardCharsets.UTF_8); }
[ "public", "byte", "[", "]", "getVisualization", "(", ")", "{", "verifyPropertyPresence", "(", "VISUALIZATION", ")", ";", "return", "(", "(", "String", ")", "getCommandResult", "(", ")", ".", "get", "(", "VISUALIZATION", ")", ")", ".", "getBytes", "(", "Sta...
Returns the visualization of the matching result. @return The visualization of the matching result represented as base64-encoded PNG image.
[ "Returns", "the", "visualization", "of", "the", "matching", "result", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java#L63-L66
25,085
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java
ComparisonResult.storeVisualization
public void storeVisualization(File destination) throws IOException { final byte[] data = Base64.decodeBase64(getVisualization()); try (OutputStream stream = new FileOutputStream(destination)) { stream.write(data); } }
java
public void storeVisualization(File destination) throws IOException { final byte[] data = Base64.decodeBase64(getVisualization()); try (OutputStream stream = new FileOutputStream(destination)) { stream.write(data); } }
[ "public", "void", "storeVisualization", "(", "File", "destination", ")", "throws", "IOException", "{", "final", "byte", "[", "]", "data", "=", "Base64", ".", "decodeBase64", "(", "getVisualization", "(", ")", ")", ";", "try", "(", "OutputStream", "stream", "...
Stores visualization image into the given file. @param destination file to save image.
[ "Stores", "visualization", "image", "into", "the", "given", "file", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java#L73-L78
25,086
appium/java-client
src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java
ComparisonResult.toSeleniumCoordinate
private static int toSeleniumCoordinate(Object openCVCoordinate) { if (openCVCoordinate instanceof Long) { return ((Long) openCVCoordinate).intValue(); } if (openCVCoordinate instanceof Double) { return ((Double) openCVCoordinate).intValue(); } return (int...
java
private static int toSeleniumCoordinate(Object openCVCoordinate) { if (openCVCoordinate instanceof Long) { return ((Long) openCVCoordinate).intValue(); } if (openCVCoordinate instanceof Double) { return ((Double) openCVCoordinate).intValue(); } return (int...
[ "private", "static", "int", "toSeleniumCoordinate", "(", "Object", "openCVCoordinate", ")", "{", "if", "(", "openCVCoordinate", "instanceof", "Long", ")", "{", "return", "(", "(", "Long", ")", "openCVCoordinate", ")", ".", "intValue", "(", ")", ";", "}", "if...
Converts float OpenCV coordinates to Selenium-compatible format. @param openCVCoordinate the original coordinate value @return The converted value
[ "Converts", "float", "OpenCV", "coordinates", "to", "Selenium", "-", "compatible", "format", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/ComparisonResult.java#L86-L94
25,087
appium/java-client
src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java
AppiumServiceBuilder.withArgument
public AppiumServiceBuilder withArgument(ServerArgument argument, String value) { String argName = argument.getArgument().trim().toLowerCase(); if ("--port".equals(argName) || "-p".equals(argName)) { usingPort(Integer.valueOf(value)); } else if ("--address".equals(argName) || "-a".eq...
java
public AppiumServiceBuilder withArgument(ServerArgument argument, String value) { String argName = argument.getArgument().trim().toLowerCase(); if ("--port".equals(argName) || "-p".equals(argName)) { usingPort(Integer.valueOf(value)); } else if ("--address".equals(argName) || "-a".eq...
[ "public", "AppiumServiceBuilder", "withArgument", "(", "ServerArgument", "argument", ",", "String", "value", ")", "{", "String", "argName", "=", "argument", ".", "getArgument", "(", ")", ".", "trim", "(", ")", ".", "toLowerCase", "(", ")", ";", "if", "(", ...
Adds a server argument. @param argument is an instance which contains the argument name. @param value A non null string value. (Warn!!!) Boolean arguments have a special moment: the presence of an arguments means "true". At this case an empty string should be defined. @return the self-reference.
[ "Adds", "a", "server", "argument", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java#L265-L277
25,088
appium/java-client
src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java
AppiumServiceBuilder.withCapabilities
public AppiumServiceBuilder withCapabilities(DesiredCapabilities capabilities) { if (this.capabilities == null) { this.capabilities = capabilities; } else { DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); desiredCapabilities.merge(this.capabilitie...
java
public AppiumServiceBuilder withCapabilities(DesiredCapabilities capabilities) { if (this.capabilities == null) { this.capabilities = capabilities; } else { DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); desiredCapabilities.merge(this.capabilitie...
[ "public", "AppiumServiceBuilder", "withCapabilities", "(", "DesiredCapabilities", "capabilities", ")", "{", "if", "(", "this", ".", "capabilities", "==", "null", ")", "{", "this", ".", "capabilities", "=", "capabilities", ";", "}", "else", "{", "DesiredCapabilitie...
Adds a desired capabilities. @param capabilities is an instance of {@link DesiredCapabilities}. @return the self-reference.
[ "Adds", "a", "desired", "capabilities", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java#L285-L294
25,089
appium/java-client
src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java
AppiumServiceBuilder.withStartUpTimeOut
public AppiumServiceBuilder withStartUpTimeOut(long time, TimeUnit timeUnit) { checkNotNull(timeUnit); checkArgument(time > 0, "Time value should be greater than zero", time); this.startupTimeout = time; this.timeUnit = timeUnit; return this; }
java
public AppiumServiceBuilder withStartUpTimeOut(long time, TimeUnit timeUnit) { checkNotNull(timeUnit); checkArgument(time > 0, "Time value should be greater than zero", time); this.startupTimeout = time; this.timeUnit = timeUnit; return this; }
[ "public", "AppiumServiceBuilder", "withStartUpTimeOut", "(", "long", "time", ",", "TimeUnit", "timeUnit", ")", "{", "checkNotNull", "(", "timeUnit", ")", ";", "checkArgument", "(", "time", ">", "0", ",", "\"Time value should be greater than zero\"", ",", "time", ")"...
Sets start up timeout. @param time a time value for the service starting up. @param timeUnit a time unit for the service starting up. @return self-reference.
[ "Sets", "start", "up", "timeout", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java#L320-L326
25,090
appium/java-client
src/main/java/io/appium/java_client/MobileCommand.java
MobileCommand.prepareArguments
public static ImmutableMap<String, Object> prepareArguments(String param, Object value) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.put(param, value); return builder.build(); }
java
public static ImmutableMap<String, Object> prepareArguments(String param, Object value) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.put(param, value); return builder.build(); }
[ "public", "static", "ImmutableMap", "<", "String", ",", "Object", ">", "prepareArguments", "(", "String", "param", ",", "Object", "value", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "Object", ">", "builder", "=", "ImmutableMap", ".", "buil...
Prepares single argument. @param param is a parameter name. @param value is the parameter value. @return built {@link ImmutableMap}.
[ "Prepares", "single", "argument", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/MobileCommand.java#L342-L347
25,091
appium/java-client
src/main/java/io/appium/java_client/MobileCommand.java
MobileCommand.prepareArguments
public static ImmutableMap<String, Object> prepareArguments(String[] params, Object[] values) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); for (int i = 0; i < params.length; i++) { if (!StringUtils.is...
java
public static ImmutableMap<String, Object> prepareArguments(String[] params, Object[] values) { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); for (int i = 0; i < params.length; i++) { if (!StringUtils.is...
[ "public", "static", "ImmutableMap", "<", "String", ",", "Object", ">", "prepareArguments", "(", "String", "[", "]", "params", ",", "Object", "[", "]", "values", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "Object", ">", "builder", "=", ...
Prepares collection of arguments. @param params is the array with parameter names. @param values is the array with parameter values. @return built {@link ImmutableMap}.
[ "Prepares", "collection", "of", "arguments", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/MobileCommand.java#L356-L365
25,092
appium/java-client
src/main/java/io/appium/java_client/TouchAction.java
TouchAction.moveTo
public T moveTo(PointOption moveToOptions) { ActionParameter action = new ActionParameter("moveTo", moveToOptions); parameterBuilder.add(action); return (T) this; }
java
public T moveTo(PointOption moveToOptions) { ActionParameter action = new ActionParameter("moveTo", moveToOptions); parameterBuilder.add(action); return (T) this; }
[ "public", "T", "moveTo", "(", "PointOption", "moveToOptions", ")", "{", "ActionParameter", "action", "=", "new", "ActionParameter", "(", "\"moveTo\"", ",", "moveToOptions", ")", ";", "parameterBuilder", ".", "add", "(", "action", ")", ";", "return", "(", "T", ...
Moves current touch to a new position. @param moveToOptions see {@link PointOption} and {@link ElementOption} Important: some older Appium drivers releases have a bug when moveTo coordinates are calculated as relative to the recent pointer position in the chain instead of being absolute. @see <a href="https://github....
[ "Moves", "current", "touch", "to", "a", "new", "position", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/TouchAction.java#L91-L95
25,093
appium/java-client
src/main/java/io/appium/java_client/TouchAction.java
TouchAction.tap
public T tap(TapOptions tapOptions) { ActionParameter action = new ActionParameter("tap", tapOptions); parameterBuilder.add(action); return (T) this; }
java
public T tap(TapOptions tapOptions) { ActionParameter action = new ActionParameter("tap", tapOptions); parameterBuilder.add(action); return (T) this; }
[ "public", "T", "tap", "(", "TapOptions", "tapOptions", ")", "{", "ActionParameter", "action", "=", "new", "ActionParameter", "(", "\"tap\"", ",", "tapOptions", ")", ";", "parameterBuilder", ".", "add", "(", "action", ")", ";", "return", "(", "T", ")", "thi...
Tap on an element. @param tapOptions see {@link TapOptions}. @return this TouchAction, for chaining.
[ "Tap", "on", "an", "element", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/TouchAction.java#L103-L107
25,094
appium/java-client
src/main/java/io/appium/java_client/TouchAction.java
TouchAction.tap
public T tap(PointOption tapOptions) { ActionParameter action = new ActionParameter("tap", tapOptions); parameterBuilder.add(action); return (T) this; }
java
public T tap(PointOption tapOptions) { ActionParameter action = new ActionParameter("tap", tapOptions); parameterBuilder.add(action); return (T) this; }
[ "public", "T", "tap", "(", "PointOption", "tapOptions", ")", "{", "ActionParameter", "action", "=", "new", "ActionParameter", "(", "\"tap\"", ",", "tapOptions", ")", ";", "parameterBuilder", ".", "add", "(", "action", ")", ";", "return", "(", "T", ")", "th...
Tap on a position. @param tapOptions see {@link PointOption} and {@link ElementOption} @return this TouchAction, for chaining.
[ "Tap", "on", "a", "position", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/TouchAction.java#L115-L119
25,095
appium/java-client
src/main/java/io/appium/java_client/TouchAction.java
TouchAction.waitAction
public T waitAction(WaitOptions waitOptions) { ActionParameter action = new ActionParameter("wait", waitOptions); parameterBuilder.add(action); //noinspection unchecked return (T) this; }
java
public T waitAction(WaitOptions waitOptions) { ActionParameter action = new ActionParameter("wait", waitOptions); parameterBuilder.add(action); //noinspection unchecked return (T) this; }
[ "public", "T", "waitAction", "(", "WaitOptions", "waitOptions", ")", "{", "ActionParameter", "action", "=", "new", "ActionParameter", "(", "\"wait\"", ",", "waitOptions", ")", ";", "parameterBuilder", ".", "add", "(", "action", ")", ";", "//noinspection unchecked"...
Waits for specified amount of time to pass before continue to next touch action. @param waitOptions see {@link WaitOptions}. @return this TouchAction, for chaining.
[ "Waits", "for", "specified", "amount", "of", "time", "to", "pass", "before", "continue", "to", "next", "touch", "action", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/TouchAction.java#L139-L144
25,096
appium/java-client
src/main/java/io/appium/java_client/TouchAction.java
TouchAction.getParameters
protected Map<String, List<Object>> getParameters() { List<ActionParameter> actionList = parameterBuilder.build(); return ImmutableMap.of("actions", actionList.stream() .map(ActionParameter::getParameterMap).collect(toList())); }
java
protected Map<String, List<Object>> getParameters() { List<ActionParameter> actionList = parameterBuilder.build(); return ImmutableMap.of("actions", actionList.stream() .map(ActionParameter::getParameterMap).collect(toList())); }
[ "protected", "Map", "<", "String", ",", "List", "<", "Object", ">", ">", "getParameters", "(", ")", "{", "List", "<", "ActionParameter", ">", "actionList", "=", "parameterBuilder", ".", "build", "(", ")", ";", "return", "ImmutableMap", ".", "of", "(", "\...
Get the mjsonwp parameters for this Action. @return A map of parameters for this touch action to pass as part of mjsonwp.
[ "Get", "the", "mjsonwp", "parameters", "for", "this", "Action", "." ]
5a17759b05d6fda8ef425b3ab6e766c73ed2e8df
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/TouchAction.java#L197-L201
25,097
gatling/gatling
gatling-http-client/src/main/java/io/gatling/http/client/util/HttpUtils.java
HttpUtils.computeMultipartBoundary
public static byte[] computeMultipartBoundary() { ThreadLocalRandom random = ThreadLocalRandom.current(); byte[] bytes = new byte[35]; for (int i = 0; i < bytes.length; i++) { bytes[i] = MULTIPART_CHARS[random.nextInt(MULTIPART_CHARS.length)]; } return bytes; }
java
public static byte[] computeMultipartBoundary() { ThreadLocalRandom random = ThreadLocalRandom.current(); byte[] bytes = new byte[35]; for (int i = 0; i < bytes.length; i++) { bytes[i] = MULTIPART_CHARS[random.nextInt(MULTIPART_CHARS.length)]; } return bytes; }
[ "public", "static", "byte", "[", "]", "computeMultipartBoundary", "(", ")", "{", "ThreadLocalRandom", "random", "=", "ThreadLocalRandom", ".", "current", "(", ")", ";", "byte", "[", "]", "bytes", "=", "new", "byte", "[", "35", "]", ";", "for", "(", "int"...
a fixed size of 35
[ "a", "fixed", "size", "of", "35" ]
7652b6ad8e661e8aef102f405b32c11a58d88b2c
https://github.com/gatling/gatling/blob/7652b6ad8e661e8aef102f405b32c11a58d88b2c/gatling-http-client/src/main/java/io/gatling/http/client/util/HttpUtils.java#L122-L129
25,098
AltBeacon/android-beacon-library
lib/src/main/java/org/altbeacon/beacon/service/ScanJobScheduler.java
ScanJobScheduler.scheduleAfterBackgroundWakeup
public void scheduleAfterBackgroundWakeup(Context context, List<ScanResult> scanResults) { if (scanResults != null) { mBackgroundScanResultQueue.addAll(scanResults); } synchronized (this) { // We typically get a bunch of calls in a row here, separated by a few millis. On...
java
public void scheduleAfterBackgroundWakeup(Context context, List<ScanResult> scanResults) { if (scanResults != null) { mBackgroundScanResultQueue.addAll(scanResults); } synchronized (this) { // We typically get a bunch of calls in a row here, separated by a few millis. On...
[ "public", "void", "scheduleAfterBackgroundWakeup", "(", "Context", "context", ",", "List", "<", "ScanResult", ">", "scanResults", ")", "{", "if", "(", "scanResults", "!=", "null", ")", "{", "mBackgroundScanResultQueue", ".", "addAll", "(", "scanResults", ")", ";...
must exist on another branch until the SDKs are released.
[ "must", "exist", "on", "another", "branch", "until", "the", "SDKs", "are", "released", "." ]
f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3
https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/ScanJobScheduler.java#L107-L124
25,099
AltBeacon/android-beacon-library
lib/src/main/java/org/altbeacon/bluetooth/BluetoothMedic.java
BluetoothMedic.enablePowerCycleOnFailures
@SuppressWarnings("unused") @RequiresApi(21) public void enablePowerCycleOnFailures(Context context) { initializeWithContext(context); if (this.mLocalBroadcastManager != null) { this.mLocalBroadcastManager.registerReceiver(this.mBluetoothEventReceiver, new IntentF...
java
@SuppressWarnings("unused") @RequiresApi(21) public void enablePowerCycleOnFailures(Context context) { initializeWithContext(context); if (this.mLocalBroadcastManager != null) { this.mLocalBroadcastManager.registerReceiver(this.mBluetoothEventReceiver, new IntentF...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "@", "RequiresApi", "(", "21", ")", "public", "void", "enablePowerCycleOnFailures", "(", "Context", "context", ")", "{", "initializeWithContext", "(", "context", ")", ";", "if", "(", "this", ".", "mLocalBroadcastM...
If set to true, bluetooth will be power cycled on any tests run that determine bluetooth is in a bad state. @param context
[ "If", "set", "to", "true", "bluetooth", "will", "be", "power", "cycled", "on", "any", "tests", "run", "that", "determine", "bluetooth", "is", "in", "a", "bad", "state", "." ]
f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3
https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/bluetooth/BluetoothMedic.java#L170-L183