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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,100 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java | XmlUtil.newSAXParser | public static SAXParser newSAXParser(String schemaLanguage, File schema) throws SAXException, ParserConfigurationException {
return newSAXParser(schemaLanguage, true, false, schema);
} | java | public static SAXParser newSAXParser(String schemaLanguage, File schema) throws SAXException, ParserConfigurationException {
return newSAXParser(schemaLanguage, true, false, schema);
} | [
"public",
"static",
"SAXParser",
"newSAXParser",
"(",
"String",
"schemaLanguage",
",",
"File",
"schema",
")",
"throws",
"SAXException",
",",
"ParserConfigurationException",
"{",
"return",
"newSAXParser",
"(",
"schemaLanguage",
",",
"true",
",",
"false",
",",
"schema... | Factory method to create a SAXParser configured to validate according to a particular schema language and
a File containing the schema to validate against.
The created SAXParser will be namespace-aware and not validate against DTDs.
@param schemaLanguage the schema language used, e.g. XML Schema or RelaxNG (as per the... | [
"Factory",
"method",
"to",
"create",
"a",
"SAXParser",
"configured",
"to",
"validate",
"according",
"to",
"a",
"particular",
"schema",
"language",
"and",
"a",
"File",
"containing",
"the",
"schema",
"to",
"validate",
"against",
".",
"The",
"created",
"SAXParser",... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java#L274-L276 |
13,101 | apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java | XmlUtil.newSAXParser | public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, File schema) throws SAXException, ParserConfigurationException {
SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);
return newSAXParser(namespaceAware, validating, schemaFactory.... | java | public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, File schema) throws SAXException, ParserConfigurationException {
SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);
return newSAXParser(namespaceAware, validating, schemaFactory.... | [
"public",
"static",
"SAXParser",
"newSAXParser",
"(",
"String",
"schemaLanguage",
",",
"boolean",
"namespaceAware",
",",
"boolean",
"validating",
",",
"File",
"schema",
")",
"throws",
"SAXException",
",",
"ParserConfigurationException",
"{",
"SchemaFactory",
"schemaFact... | Factory method to create a SAXParser configured to validate according to a particular schema language and
a File containing the schema to validate against.
@param schemaLanguage the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)
@param namespaceAware will ... | [
"Factory",
"method",
"to",
"create",
"a",
"SAXParser",
"configured",
"to",
"validate",
"according",
"to",
"a",
"particular",
"schema",
"language",
"and",
"a",
"File",
"containing",
"the",
"schema",
"to",
"validate",
"against",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java#L291-L294 |
13,102 | apache/groovy | src/main/groovy/groovy/lang/GroovyShell.java | GroovyShell.run | public Object run(final File scriptFile, String[] args) throws CompilationFailedException, IOException {
String scriptName = scriptFile.getName();
int p = scriptName.lastIndexOf(".");
if (p++ >= 0) {
if (scriptName.substring(p).equals("java")) {
throw new CompilationF... | java | public Object run(final File scriptFile, String[] args) throws CompilationFailedException, IOException {
String scriptName = scriptFile.getName();
int p = scriptName.lastIndexOf(".");
if (p++ >= 0) {
if (scriptName.substring(p).equals("java")) {
throw new CompilationF... | [
"public",
"Object",
"run",
"(",
"final",
"File",
"scriptFile",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"CompilationFailedException",
",",
"IOException",
"{",
"String",
"scriptName",
"=",
"scriptFile",
".",
"getName",
"(",
")",
";",
"int",
"p",
"=",
... | Runs the given script file name with the given command line arguments
@param scriptFile the file name of the script to run
@param args the command line arguments to pass in | [
"Runs",
"the",
"given",
"script",
"file",
"name",
"with",
"the",
"given",
"command",
"line",
"arguments"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyShell.java#L177-L229 |
13,103 | apache/groovy | src/main/groovy/groovy/lang/GroovyShell.java | GroovyShell.run | public Object run(final String scriptText, final String fileName, String[] args) throws CompilationFailedException {
GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
public GroovyCodeSource run() {
return new GroovyCodeSource(scriptText,... | java | public Object run(final String scriptText, final String fileName, String[] args) throws CompilationFailedException {
GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
public GroovyCodeSource run() {
return new GroovyCodeSource(scriptText,... | [
"public",
"Object",
"run",
"(",
"final",
"String",
"scriptText",
",",
"final",
"String",
"fileName",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"CompilationFailedException",
"{",
"GroovyCodeSource",
"gcs",
"=",
"AccessController",
".",
"doPrivileged",
"(",
... | Runs the given script text with command line arguments
@param scriptText is the text content of the script
@param fileName is the logical file name of the script (which is used to create the class name of the script)
@param args the command line arguments to pass in | [
"Runs",
"the",
"given",
"script",
"text",
"with",
"command",
"line",
"arguments"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyShell.java#L343-L350 |
13,104 | apache/groovy | src/main/groovy/groovy/lang/GroovyShell.java | GroovyShell.evaluate | public Object evaluate(final String scriptText, final String fileName, final String codeBase) throws CompilationFailedException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new GroovyCodeSourcePermission(codeBase));
}
GroovyCodeSou... | java | public Object evaluate(final String scriptText, final String fileName, final String codeBase) throws CompilationFailedException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new GroovyCodeSourcePermission(codeBase));
}
GroovyCodeSou... | [
"public",
"Object",
"evaluate",
"(",
"final",
"String",
"scriptText",
",",
"final",
"String",
"fileName",
",",
"final",
"String",
"codeBase",
")",
"throws",
"CompilationFailedException",
"{",
"SecurityManager",
"sm",
"=",
"System",
".",
"getSecurityManager",
"(",
... | Evaluates some script against the current Binding and returns the result.
The .class file created from the script is given the supplied codeBase | [
"Evaluates",
"some",
"script",
"against",
"the",
"current",
"Binding",
"and",
"returns",
"the",
"result",
".",
"The",
".",
"class",
"file",
"created",
"from",
"the",
"script",
"is",
"given",
"the",
"supplied",
"codeBase"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyShell.java#L467-L480 |
13,105 | apache/groovy | src/main/java/org/apache/groovy/util/SystemUtil.java | SystemUtil.getIntegerSafe | public static Integer getIntegerSafe(String name, Integer def) {
try {
return Integer.getInteger(name, def);
} catch (SecurityException ignore) {
// suppress exception
}
return def;
} | java | public static Integer getIntegerSafe(String name, Integer def) {
try {
return Integer.getInteger(name, def);
} catch (SecurityException ignore) {
// suppress exception
}
return def;
} | [
"public",
"static",
"Integer",
"getIntegerSafe",
"(",
"String",
"name",
",",
"Integer",
"def",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"getInteger",
"(",
"name",
",",
"def",
")",
";",
"}",
"catch",
"(",
"SecurityException",
"ignore",
")",
"{",
"/... | Retrieves an Integer System property
@param name the name of the system property.
@param def the default value
@return value of the Integer system property or false | [
"Retrieves",
"an",
"Integer",
"System",
"property"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/util/SystemUtil.java#L130-L138 |
13,106 | apache/groovy | src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java | SortableASTTransformation.compareExpr | private static BinaryExpression compareExpr(Expression lhv, Expression rhv, boolean reversed) {
return (reversed) ? cmpX(rhv, lhv) : cmpX(lhv, rhv);
} | java | private static BinaryExpression compareExpr(Expression lhv, Expression rhv, boolean reversed) {
return (reversed) ? cmpX(rhv, lhv) : cmpX(lhv, rhv);
} | [
"private",
"static",
"BinaryExpression",
"compareExpr",
"(",
"Expression",
"lhv",
",",
"Expression",
"rhv",
",",
"boolean",
"reversed",
")",
"{",
"return",
"(",
"reversed",
")",
"?",
"cmpX",
"(",
"rhv",
",",
"lhv",
")",
":",
"cmpX",
"(",
"lhv",
",",
"rhv... | Helper method used to build a binary expression that compares two values
with the option to handle reverse order. | [
"Helper",
"method",
"used",
"to",
"build",
"a",
"binary",
"expression",
"that",
"compares",
"two",
"values",
"with",
"the",
"option",
"to",
"handle",
"reverse",
"order",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java#L261-L263 |
13,107 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.dup | public Token dup() {
Token token = new Token(this.type, this.text, this.startLine, this.startColumn);
token.setMeaning(this.meaning);
return token;
} | java | public Token dup() {
Token token = new Token(this.type, this.text, this.startLine, this.startColumn);
token.setMeaning(this.meaning);
return token;
} | [
"public",
"Token",
"dup",
"(",
")",
"{",
"Token",
"token",
"=",
"new",
"Token",
"(",
"this",
".",
"type",
",",
"this",
".",
"text",
",",
"this",
".",
"startLine",
",",
"this",
".",
"startColumn",
")",
";",
"token",
".",
"setMeaning",
"(",
"this",
"... | Returns a copy of this Token. | [
"Returns",
"a",
"copy",
"of",
"this",
"Token",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L65-L70 |
13,108 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newKeyword | public static Token newKeyword(String text, int startLine, int startColumn) {
int type = Types.lookupKeyword(text);
if (type != Types.UNKNOWN) {
return new Token(type, text, startLine, startColumn);
}
return null;
} | java | public static Token newKeyword(String text, int startLine, int startColumn) {
int type = Types.lookupKeyword(text);
if (type != Types.UNKNOWN) {
return new Token(type, text, startLine, startColumn);
}
return null;
} | [
"public",
"static",
"Token",
"newKeyword",
"(",
"String",
"text",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"int",
"type",
"=",
"Types",
".",
"lookupKeyword",
"(",
"text",
")",
";",
"if",
"(",
"type",
"!=",
"Types",
".",
"UNKNOWN",
... | Creates a token that represents a keyword. Returns null if the
specified text isn't a keyword. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"keyword",
".",
"Returns",
"null",
"if",
"the",
"specified",
"text",
"isn",
"t",
"a",
"keyword",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L220-L228 |
13,109 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newString | public static Token newString(String text, int startLine, int startColumn) {
return new Token(Types.STRING, text, startLine, startColumn);
} | java | public static Token newString(String text, int startLine, int startColumn) {
return new Token(Types.STRING, text, startLine, startColumn);
} | [
"public",
"static",
"Token",
"newString",
"(",
"String",
"text",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"Types",
".",
"STRING",
",",
"text",
",",
"startLine",
",",
"startColumn",
")",
";",
"}"
] | Creates a token that represents a double-quoted string. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"double",
"-",
"quoted",
"string",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L233-L235 |
13,110 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newIdentifier | public static Token newIdentifier(String text, int startLine, int startColumn) {
return new Token(Types.IDENTIFIER, text, startLine, startColumn);
} | java | public static Token newIdentifier(String text, int startLine, int startColumn) {
return new Token(Types.IDENTIFIER, text, startLine, startColumn);
} | [
"public",
"static",
"Token",
"newIdentifier",
"(",
"String",
"text",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"Types",
".",
"IDENTIFIER",
",",
"text",
",",
"startLine",
",",
"startColumn",
")",
";",
"}"
] | Creates a token that represents an identifier. | [
"Creates",
"a",
"token",
"that",
"represents",
"an",
"identifier",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L240-L242 |
13,111 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newInteger | public static Token newInteger(String text, int startLine, int startColumn) {
return new Token(Types.INTEGER_NUMBER, text, startLine, startColumn);
} | java | public static Token newInteger(String text, int startLine, int startColumn) {
return new Token(Types.INTEGER_NUMBER, text, startLine, startColumn);
} | [
"public",
"static",
"Token",
"newInteger",
"(",
"String",
"text",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"Types",
".",
"INTEGER_NUMBER",
",",
"text",
",",
"startLine",
",",
"startColumn",
")",
";",
"}"
... | Creates a token that represents an integer. | [
"Creates",
"a",
"token",
"that",
"represents",
"an",
"integer",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L247-L249 |
13,112 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newDecimal | public static Token newDecimal(String text, int startLine, int startColumn) {
return new Token(Types.DECIMAL_NUMBER, text, startLine, startColumn);
} | java | public static Token newDecimal(String text, int startLine, int startColumn) {
return new Token(Types.DECIMAL_NUMBER, text, startLine, startColumn);
} | [
"public",
"static",
"Token",
"newDecimal",
"(",
"String",
"text",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"Types",
".",
"DECIMAL_NUMBER",
",",
"text",
",",
"startLine",
",",
"startColumn",
")",
";",
"}"
... | Creates a token that represents a decimal number. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"decimal",
"number",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L254-L256 |
13,113 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newSymbol | public static Token newSymbol(int type, int startLine, int startColumn) {
return new Token(type, Types.getText(type), startLine, startColumn);
} | java | public static Token newSymbol(int type, int startLine, int startColumn) {
return new Token(type, Types.getText(type), startLine, startColumn);
} | [
"public",
"static",
"Token",
"newSymbol",
"(",
"int",
"type",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"type",
",",
"Types",
".",
"getText",
"(",
"type",
")",
",",
"startLine",
",",
"startColumn",
")",
... | Creates a token that represents a symbol, using a library for the text. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"symbol",
"using",
"a",
"library",
"for",
"the",
"text",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L261-L263 |
13,114 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newSymbol | public static Token newSymbol(String type, int startLine, int startColumn) {
return new Token(Types.lookupSymbol(type), type, startLine, startColumn);
} | java | public static Token newSymbol(String type, int startLine, int startColumn) {
return new Token(Types.lookupSymbol(type), type, startLine, startColumn);
} | [
"public",
"static",
"Token",
"newSymbol",
"(",
"String",
"type",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"Types",
".",
"lookupSymbol",
"(",
"type",
")",
",",
"type",
",",
"startLine",
",",
"startColumn",... | Creates a token that represents a symbol, using a library for the type. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"symbol",
"using",
"a",
"library",
"for",
"the",
"type",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L268-L270 |
13,115 | apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newPlaceholder | public static Token newPlaceholder(int type) {
Token token = new Token(Types.UNKNOWN, "", -1, -1);
token.setMeaning(type);
return token;
} | java | public static Token newPlaceholder(int type) {
Token token = new Token(Types.UNKNOWN, "", -1, -1);
token.setMeaning(type);
return token;
} | [
"public",
"static",
"Token",
"newPlaceholder",
"(",
"int",
"type",
")",
"{",
"Token",
"token",
"=",
"new",
"Token",
"(",
"Types",
".",
"UNKNOWN",
",",
"\"\"",
",",
"-",
"1",
",",
"-",
"1",
")",
";",
"token",
".",
"setMeaning",
"(",
"type",
")",
";"... | Creates a token with the specified meaning. | [
"Creates",
"a",
"token",
"with",
"the",
"specified",
"meaning",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L275-L280 |
13,116 | apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java | AbstractTypeCheckingExtension.makeDynamic | public MethodNode makeDynamic(MethodCall call, ClassNode returnType) {
TypeCheckingContext.EnclosingClosure enclosingClosure = context.getEnclosingClosure();
MethodNode enclosingMethod = context.getEnclosingMethod();
((ASTNode)call).putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, returnTyp... | java | public MethodNode makeDynamic(MethodCall call, ClassNode returnType) {
TypeCheckingContext.EnclosingClosure enclosingClosure = context.getEnclosingClosure();
MethodNode enclosingMethod = context.getEnclosingMethod();
((ASTNode)call).putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, returnTyp... | [
"public",
"MethodNode",
"makeDynamic",
"(",
"MethodCall",
"call",
",",
"ClassNode",
"returnType",
")",
"{",
"TypeCheckingContext",
".",
"EnclosingClosure",
"enclosingClosure",
"=",
"context",
".",
"getEnclosingClosure",
"(",
")",
";",
"MethodNode",
"enclosingMethod",
... | Used to instruct the type checker that the call is a dynamic method call.
Calling this method automatically sets the handled flag to true.
@param call the method call which is a dynamic method call
@param returnType the expected return type of the dynamic call
@return a virtual method node with the same name as the exp... | [
"Used",
"to",
"instruct",
"the",
"type",
"checker",
"that",
"the",
"call",
"is",
"a",
"dynamic",
"method",
"call",
".",
"Calling",
"this",
"method",
"automatically",
"sets",
"the",
"handled",
"flag",
"to",
"true",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java#L275-L289 |
13,117 | apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java | AbstractTypeCheckingExtension.makeDynamic | public void makeDynamic(PropertyExpression pexp, ClassNode returnType) {
context.getEnclosingMethod().putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, Boolean.TRUE);
pexp.putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, returnType);
storeType(pexp, returnType);
setHandled(true)... | java | public void makeDynamic(PropertyExpression pexp, ClassNode returnType) {
context.getEnclosingMethod().putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, Boolean.TRUE);
pexp.putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, returnType);
storeType(pexp, returnType);
setHandled(true)... | [
"public",
"void",
"makeDynamic",
"(",
"PropertyExpression",
"pexp",
",",
"ClassNode",
"returnType",
")",
"{",
"context",
".",
"getEnclosingMethod",
"(",
")",
".",
"putNodeMetaData",
"(",
"StaticTypesMarker",
".",
"DYNAMIC_RESOLUTION",
",",
"Boolean",
".",
"TRUE",
... | Instructs the type checker that a property access is dynamic.
Calling this method automatically sets the handled flag to true.
@param pexp the property or attribute expression
@param returnType the type of the property | [
"Instructs",
"the",
"type",
"checker",
"that",
"a",
"property",
"access",
"is",
"dynamic",
".",
"Calling",
"this",
"method",
"automatically",
"sets",
"the",
"handled",
"flag",
"to",
"true",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java#L306-L314 |
13,118 | apache/groovy | src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java | ClassNodeResolver.getFromClassCache | public ClassNode getFromClassCache(String name) {
// We use here the class cache cachedClasses to prevent
// calls to ClassLoader#loadClass. Disabling this cache will
// cause a major performance hit.
ClassNode cached = cachedClasses.get(name);
return cached;
} | java | public ClassNode getFromClassCache(String name) {
// We use here the class cache cachedClasses to prevent
// calls to ClassLoader#loadClass. Disabling this cache will
// cause a major performance hit.
ClassNode cached = cachedClasses.get(name);
return cached;
} | [
"public",
"ClassNode",
"getFromClassCache",
"(",
"String",
"name",
")",
"{",
"// We use here the class cache cachedClasses to prevent",
"// calls to ClassLoader#loadClass. Disabling this cache will",
"// cause a major performance hit.",
"ClassNode",
"cached",
"=",
"cachedClasses",
".",... | returns whatever is stored in the class cache for the given name
@param name - the name of the class
@return the result of the lookup, which may be null | [
"returns",
"whatever",
"is",
"stored",
"in",
"the",
"class",
"cache",
"for",
"the",
"given",
"name"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L149-L155 |
13,119 | apache/groovy | src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java | ClassNodeResolver.findByClassLoading | private static LookupResult findByClassLoading(String name, CompilationUnit compilationUnit, GroovyClassLoader loader) {
Class cls;
try {
// NOTE: it's important to do no lookup against script files
// here since the GroovyClassLoader would create a new CompilationUnit
... | java | private static LookupResult findByClassLoading(String name, CompilationUnit compilationUnit, GroovyClassLoader loader) {
Class cls;
try {
// NOTE: it's important to do no lookup against script files
// here since the GroovyClassLoader would create a new CompilationUnit
... | [
"private",
"static",
"LookupResult",
"findByClassLoading",
"(",
"String",
"name",
",",
"CompilationUnit",
"compilationUnit",
",",
"GroovyClassLoader",
"loader",
")",
"{",
"Class",
"cls",
";",
"try",
"{",
"// NOTE: it's important to do no lookup against script files",
"// he... | Search for classes using class loading | [
"Search",
"for",
"classes",
"using",
"class",
"loading"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L204-L235 |
13,120 | apache/groovy | src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java | ClassNodeResolver.findDecompiled | private LookupResult findDecompiled(String name, CompilationUnit compilationUnit, GroovyClassLoader loader) {
ClassNode node = ClassHelper.make(name);
if (node.isResolved()) {
return new LookupResult(null, node);
}
DecompiledClassNode asmClass = null;
String fileName... | java | private LookupResult findDecompiled(String name, CompilationUnit compilationUnit, GroovyClassLoader loader) {
ClassNode node = ClassHelper.make(name);
if (node.isResolved()) {
return new LookupResult(null, node);
}
DecompiledClassNode asmClass = null;
String fileName... | [
"private",
"LookupResult",
"findDecompiled",
"(",
"String",
"name",
",",
"CompilationUnit",
"compilationUnit",
",",
"GroovyClassLoader",
"loader",
")",
"{",
"ClassNode",
"node",
"=",
"ClassHelper",
".",
"make",
"(",
"name",
")",
";",
"if",
"(",
"node",
".",
"i... | Search for classes using ASM decompiler | [
"Search",
"for",
"classes",
"using",
"ASM",
"decompiler"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L240-L269 |
13,121 | apache/groovy | src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java | ClassNodeResolver.tryAsScript | private static LookupResult tryAsScript(String name, CompilationUnit compilationUnit, ClassNode oldClass) {
LookupResult lr = null;
if (oldClass!=null) {
lr = new LookupResult(null, oldClass);
}
if (name.startsWith("java.")) return lr;
//TODO: don't ignore in... | java | private static LookupResult tryAsScript(String name, CompilationUnit compilationUnit, ClassNode oldClass) {
LookupResult lr = null;
if (oldClass!=null) {
lr = new LookupResult(null, oldClass);
}
if (name.startsWith("java.")) return lr;
//TODO: don't ignore in... | [
"private",
"static",
"LookupResult",
"tryAsScript",
"(",
"String",
"name",
",",
"CompilationUnit",
"compilationUnit",
",",
"ClassNode",
"oldClass",
")",
"{",
"LookupResult",
"lr",
"=",
"null",
";",
"if",
"(",
"oldClass",
"!=",
"null",
")",
"{",
"lr",
"=",
"n... | try to find a script using the compilation unit class loader. | [
"try",
"to",
"find",
"a",
"script",
"using",
"the",
"compilation",
"unit",
"class",
"loader",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L279-L302 |
13,122 | apache/groovy | src/main/groovy/groovy/util/DelegatingScript.java | DelegatingScript.setDelegate | public void setDelegate(Object delegate) {
this.delegate = delegate;
this.metaClass = InvokerHelper.getMetaClass(delegate.getClass());
} | java | public void setDelegate(Object delegate) {
this.delegate = delegate;
this.metaClass = InvokerHelper.getMetaClass(delegate.getClass());
} | [
"public",
"void",
"setDelegate",
"(",
"Object",
"delegate",
")",
"{",
"this",
".",
"delegate",
"=",
"delegate",
";",
"this",
".",
"metaClass",
"=",
"InvokerHelper",
".",
"getMetaClass",
"(",
"delegate",
".",
"getClass",
"(",
")",
")",
";",
"}"
] | Sets the delegation target. | [
"Sets",
"the",
"delegation",
"target",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/DelegatingScript.java#L101-L104 |
13,123 | apache/groovy | subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java | DefaultJsonGenerator.writeRaw | protected void writeRaw(CharSequence seq, CharBuf buffer) {
if (seq != null) {
buffer.add(seq.toString());
}
} | java | protected void writeRaw(CharSequence seq, CharBuf buffer) {
if (seq != null) {
buffer.add(seq.toString());
}
} | [
"protected",
"void",
"writeRaw",
"(",
"CharSequence",
"seq",
",",
"CharBuf",
"buffer",
")",
"{",
"if",
"(",
"seq",
"!=",
"null",
")",
"{",
"buffer",
".",
"add",
"(",
"seq",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | Serializes any char sequence and writes it into specified buffer
without performing any manipulation of the given text. | [
"Serializes",
"any",
"char",
"sequence",
"and",
"writes",
"it",
"into",
"specified",
"buffer",
"without",
"performing",
"any",
"manipulation",
"of",
"the",
"given",
"text",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java#L264-L268 |
13,124 | apache/groovy | subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java | DefaultJsonGenerator.writeMapEntry | protected void writeMapEntry(String key, Object value, CharBuf buffer) {
buffer.addJsonFieldName(key, disableUnicodeEscaping);
writeObject(key, value, buffer);
} | java | protected void writeMapEntry(String key, Object value, CharBuf buffer) {
buffer.addJsonFieldName(key, disableUnicodeEscaping);
writeObject(key, value, buffer);
} | [
"protected",
"void",
"writeMapEntry",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"CharBuf",
"buffer",
")",
"{",
"buffer",
".",
"addJsonFieldName",
"(",
"key",
",",
"disableUnicodeEscaping",
")",
";",
"writeObject",
"(",
"key",
",",
"value",
",",
"buf... | Serializes a map entry and writes it into specified buffer. | [
"Serializes",
"a",
"map",
"entry",
"and",
"writes",
"it",
"into",
"specified",
"buffer",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java#L385-L388 |
13,125 | apache/groovy | subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java | DefaultJsonGenerator.shouldExcludeType | protected boolean shouldExcludeType(Class<?> type) {
for (Class<?> t : excludedFieldTypes) {
if (t.isAssignableFrom(type)) {
return true;
}
}
return false;
} | java | protected boolean shouldExcludeType(Class<?> type) {
for (Class<?> t : excludedFieldTypes) {
if (t.isAssignableFrom(type)) {
return true;
}
}
return false;
} | [
"protected",
"boolean",
"shouldExcludeType",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"t",
":",
"excludedFieldTypes",
")",
"{",
"if",
"(",
"t",
".",
"isAssignableFrom",
"(",
"type",
")",
")",
"{",
"return",
"... | Indicates whether the given type should be excluded from the generated output.
@param type the type to check
@return {@code true} if the given type should not be output, else {@code false} | [
"Indicates",
"whether",
"the",
"given",
"type",
"should",
"be",
"excluded",
"from",
"the",
"generated",
"output",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/DefaultJsonGenerator.java#L435-L442 |
13,126 | apache/groovy | subprojects/groovy-swing/src/main/groovy/groovy/swing/impl/TableLayoutRow.java | TableLayoutRow.addCell | public void addCell(groovy.swing.impl.TableLayoutCell tag) {
int gridx = 0;
for (Iterator iter = cells.iterator(); iter.hasNext(); ) {
groovy.swing.impl.TableLayoutCell cell = (groovy.swing.impl.TableLayoutCell) iter.next();
gridx += cell.getColspan();
}
tag.getCo... | java | public void addCell(groovy.swing.impl.TableLayoutCell tag) {
int gridx = 0;
for (Iterator iter = cells.iterator(); iter.hasNext(); ) {
groovy.swing.impl.TableLayoutCell cell = (groovy.swing.impl.TableLayoutCell) iter.next();
gridx += cell.getColspan();
}
tag.getCo... | [
"public",
"void",
"addCell",
"(",
"groovy",
".",
"swing",
".",
"impl",
".",
"TableLayoutCell",
"tag",
")",
"{",
"int",
"gridx",
"=",
"0",
";",
"for",
"(",
"Iterator",
"iter",
"=",
"cells",
".",
"iterator",
"(",
")",
";",
"iter",
".",
"hasNext",
"(",
... | Adds a new cell to this row
@param tag the td element | [
"Adds",
"a",
"new",
"cell",
"to",
"this",
"row"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/groovy/groovy/swing/impl/TableLayoutRow.java#L43-L51 |
13,127 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/MetaClassHelper.java | MetaClassHelper.convertToTypeArray | public static Class[] convertToTypeArray(Object[] args) {
if (args == null)
return null;
int s = args.length;
Class[] ans = new Class[s];
for (int i = 0; i < s; i++) {
Object o = args[i];
ans[i] = getClassWithNullAndWrapper(o);
}
return... | java | public static Class[] convertToTypeArray(Object[] args) {
if (args == null)
return null;
int s = args.length;
Class[] ans = new Class[s];
for (int i = 0; i < s; i++) {
Object o = args[i];
ans[i] = getClassWithNullAndWrapper(o);
}
return... | [
"public",
"static",
"Class",
"[",
"]",
"convertToTypeArray",
"(",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
"return",
"null",
";",
"int",
"s",
"=",
"args",
".",
"length",
";",
"Class",
"[",
"]",
"ans",
"=",
"new",
... | param instance array to the type array
@param args the arguments
@return the types of the arguments | [
"param",
"instance",
"array",
"to",
"the",
"type",
"array"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/MetaClassHelper.java#L610-L620 |
13,128 | apache/groovy | src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java | LoaderConfiguration.addFile | public void addFile(File file) {
if (file != null && file.exists()) {
try {
classPath.add(file.toURI().toURL());
} catch (MalformedURLException e) {
throw new AssertionError("converting an existing file to an url should have never thrown an exception!");
... | java | public void addFile(File file) {
if (file != null && file.exists()) {
try {
classPath.add(file.toURI().toURL());
} catch (MalformedURLException e) {
throw new AssertionError("converting an existing file to an url should have never thrown an exception!");
... | [
"public",
"void",
"addFile",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"!=",
"null",
"&&",
"file",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{",
"classPath",
".",
"add",
"(",
"file",
".",
"toURI",
"(",
")",
".",
"toURL",
"(",
")",
")",... | Adds a file to the classpath if it exists.
@param file the file to add | [
"Adds",
"a",
"file",
"to",
"the",
"classpath",
"if",
"it",
"exists",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java#L276-L284 |
13,129 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withObjectOutputStream | public static <T> T withObjectOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectOutputStream(file), closure);
} | java | public static <T> T withObjectOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectOutputStream(file), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectOutputStream",
"(",
"File",
"file",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.ObjectOutputStream\"",
")",
"Closure",
"<",
"T",
">",
"closure",
... | Create a new ObjectOutputStream for this file and then pass it to the
closure. This method ensures the stream is closed after the closure
returns.
@param file a File
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@see IOGroovyMethods#withStream(java... | [
"Create",
"a",
"new",
"ObjectOutputStream",
"for",
"this",
"file",
"and",
"then",
"pass",
"it",
"to",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L149-L151 |
13,130 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newObjectInputStream | public static ObjectInputStream newObjectInputStream(File file, final ClassLoader classLoader) throws IOException {
return IOGroovyMethods.newObjectInputStream(new FileInputStream(file), classLoader);
} | java | public static ObjectInputStream newObjectInputStream(File file, final ClassLoader classLoader) throws IOException {
return IOGroovyMethods.newObjectInputStream(new FileInputStream(file), classLoader);
} | [
"public",
"static",
"ObjectInputStream",
"newObjectInputStream",
"(",
"File",
"file",
",",
"final",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"newObjectInputStream",
"(",
"new",
"FileInputStream",
"(",
"file",
"... | Create an object input stream for this file using the given class loader.
@param file a file
@param classLoader the class loader to use when loading the class
@return an object input stream
@throws IOException if an IOException occurs.
@since 1.5.0 | [
"Create",
"an",
"object",
"input",
"stream",
"for",
"this",
"file",
"using",
"the",
"given",
"class",
"loader",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L174-L176 |
13,131 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachObject | public static void eachObject(File self, Closure closure) throws IOException, ClassNotFoundException {
IOGroovyMethods.eachObject(newObjectInputStream(self), closure);
} | java | public static void eachObject(File self, Closure closure) throws IOException, ClassNotFoundException {
IOGroovyMethods.eachObject(newObjectInputStream(self), closure);
} | [
"public",
"static",
"void",
"eachObject",
"(",
"File",
"self",
",",
"Closure",
"closure",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"IOGroovyMethods",
".",
"eachObject",
"(",
"newObjectInputStream",
"(",
"self",
")",
",",
"closure",
")",
... | Iterates through the given file object by object.
@param self a File
@param closure a closure
@throws IOException if an IOException occurs.
@throws ClassNotFoundException if the class is not found.
@see IOGroovyMethods#eachObject(java.io.ObjectInputStream, groovy.lang.Closure)
@since 1.0 | [
"Iterates",
"through",
"the",
"given",
"file",
"object",
"by",
"object",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L188-L190 |
13,132 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachLine | public static <T> T eachLine(File self, @ClosureParams(value = FromString.class, options = {"String", "String,Integer"}) Closure<T> closure) throws IOException {
return eachLine(self, 1, closure);
} | java | public static <T> T eachLine(File self, @ClosureParams(value = FromString.class, options = {"String", "String,Integer"}) Closure<T> closure) throws IOException {
return eachLine(self, 1, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"File",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",
"Closure",
"<",
"T",
">",
"c... | Iterates through this file line by line. Each line is passed to the
given 1 or 2 arg closure. The file is read using a reader which
is closed before this method returns.
@param self a File
@param closure a closure (arg 1 is line, optional arg 2 is line number starting at line 1)
@return the last value returned by... | [
"Iterates",
"through",
"this",
"file",
"line",
"by",
"line",
".",
"Each",
"line",
"is",
"passed",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"The",
"file",
"is",
"read",
"using",
"a",
"reader",
"which",
"is",
"closed",
"before",
"this... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L235-L237 |
13,133 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.readLines | public static List<String> readLines(File file) throws IOException {
return IOGroovyMethods.readLines(newReader(file));
} | java | public static List<String> readLines(File file) throws IOException {
return IOGroovyMethods.readLines(newReader(file));
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readLines",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"readLines",
"(",
"newReader",
"(",
"file",
")",
")",
";",
"}"
] | Reads the file into a list of Strings, with one item for each line.
@param file a File
@return a List of lines
@throws IOException if an IOException occurs.
@see IOGroovyMethods#readLines(java.io.Reader)
@since 1.0 | [
"Reads",
"the",
"file",
"into",
"a",
"list",
"of",
"Strings",
"with",
"one",
"item",
"for",
"each",
"line",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L524-L526 |
13,134 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.readLines | public static List<String> readLines(URL self, String charset) throws IOException {
return IOGroovyMethods.readLines(newReader(self, charset));
} | java | public static List<String> readLines(URL self, String charset) throws IOException {
return IOGroovyMethods.readLines(newReader(self, charset));
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readLines",
"(",
"URL",
"self",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"readLines",
"(",
"newReader",
"(",
"self",
",",
"charset",
")",
")",
";",
"}"
] | Reads the URL contents into a list, with one element for each line.
@param self a URL
@param charset opens the URL with a specified charset
@return a List of lines
@throws IOException if an IOException occurs.
@see IOGroovyMethods#readLines(java.io.Reader)
@since 1.6.8 | [
"Reads",
"the",
"URL",
"contents",
"into",
"a",
"list",
"with",
"one",
"element",
"for",
"each",
"line",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L565-L567 |
13,135 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.getText | public static String getText(File file, String charset) throws IOException {
return IOGroovyMethods.getText(newReader(file, charset));
} | java | public static String getText(File file, String charset) throws IOException {
return IOGroovyMethods.getText(newReader(file, charset));
} | [
"public",
"static",
"String",
"getText",
"(",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"getText",
"(",
"newReader",
"(",
"file",
",",
"charset",
")",
")",
";",
"}"
] | Read the content of the File using the specified encoding and return it
as a String.
@param file the file whose content we want to read
@param charset the charset used to read the content of the file
@return a String containing the content of the file
@throws IOException if an IOException occurs.
@since 1.0 | [
"Read",
"the",
"content",
"of",
"the",
"File",
"using",
"the",
"specified",
"encoding",
"and",
"return",
"it",
"as",
"a",
"String",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L579-L581 |
13,136 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.getText | public static String getText(URL url) throws IOException {
return getText(url, CharsetToolkit.getDefaultSystemCharset().name());
} | java | public static String getText(URL url) throws IOException {
return getText(url, CharsetToolkit.getDefaultSystemCharset().name());
} | [
"public",
"static",
"String",
"getText",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"return",
"getText",
"(",
"url",
",",
"CharsetToolkit",
".",
"getDefaultSystemCharset",
"(",
")",
".",
"name",
"(",
")",
")",
";",
"}"
] | Read the content of this URL and returns it as a String.
@param url URL to read content from
@return the text from that URL
@throws IOException if an IOException occurs.
@since 1.0 | [
"Read",
"the",
"content",
"of",
"this",
"URL",
"and",
"returns",
"it",
"as",
"a",
"String",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L603-L605 |
13,137 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.getText | public static String getText(URL url, String charset) throws IOException {
BufferedReader reader = newReader(url, charset);
return IOGroovyMethods.getText(reader);
} | java | public static String getText(URL url, String charset) throws IOException {
BufferedReader reader = newReader(url, charset);
return IOGroovyMethods.getText(reader);
} | [
"public",
"static",
"String",
"getText",
"(",
"URL",
"url",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"reader",
"=",
"newReader",
"(",
"url",
",",
"charset",
")",
";",
"return",
"IOGroovyMethods",
".",
"getText",
"(",
"re... | Read the data from this URL and return it as a String. The connection
stream is closed before this method returns.
@param url URL to read content from
@param charset opens the stream with a specified charset
@return the text from that URL
@throws IOException if an IOException occurs.
@see java.net.URLConnection#g... | [
"Read",
"the",
"data",
"from",
"this",
"URL",
"and",
"return",
"it",
"as",
"a",
"String",
".",
"The",
"connection",
"stream",
"is",
"closed",
"before",
"this",
"method",
"returns",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L640-L643 |
13,138 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.setBytes | public static void setBytes(File file, byte[] bytes) throws IOException {
IOGroovyMethods.setBytes(new FileOutputStream(file), bytes);
} | java | public static void setBytes(File file, byte[] bytes) throws IOException {
IOGroovyMethods.setBytes(new FileOutputStream(file), bytes);
} | [
"public",
"static",
"void",
"setBytes",
"(",
"File",
"file",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"IOGroovyMethods",
".",
"setBytes",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
",",
"bytes",
")",
";",
"}"
] | Write the bytes from the byte array to the File.
@param file the file to write to
@param bytes the byte[] to write to the file
@throws IOException if an IOException occurs.
@since 1.7.1 | [
"Write",
"the",
"bytes",
"from",
"the",
"byte",
"array",
"to",
"the",
"File",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L717-L719 |
13,139 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.leftShift | public static File leftShift(File file, byte[] bytes) throws IOException {
append(file, bytes);
return file;
} | java | public static File leftShift(File file, byte[] bytes) throws IOException {
append(file, bytes);
return file;
} | [
"public",
"static",
"File",
"leftShift",
"(",
"File",
"file",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"append",
"(",
"file",
",",
"bytes",
")",
";",
"return",
"file",
";",
"}"
] | Write bytes to a File.
@param file a File
@param bytes the byte array to append to the end of the File
@return the original file
@throws IOException if an IOException occurs.
@since 1.5.0 | [
"Write",
"bytes",
"to",
"a",
"File",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L807-L810 |
13,140 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.write | public static void write(File file, String text, String charset) throws IOException {
write(file, text, charset, false);
} | java | public static void write(File file, String text, String charset) throws IOException {
write(file, text, charset, false);
} | [
"public",
"static",
"void",
"write",
"(",
"File",
"file",
",",
"String",
"text",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"write",
"(",
"file",
",",
"text",
",",
"charset",
",",
"false",
")",
";",
"}"
] | Write the text to the File without writing a BOM,
using the specified encoding.
@param file a File
@param text the text to write to the File
@param charset the charset used
@throws IOException if an IOException occurs.
@since 1.0 | [
"Write",
"the",
"text",
"to",
"the",
"File",
"without",
"writing",
"a",
"BOM",
"using",
"the",
"specified",
"encoding",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L836-L838 |
13,141 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.append | public static void append(File file, Object text) throws IOException {
append(file, text, false);
} | java | public static void append(File file, Object text) throws IOException {
append(file, text, false);
} | [
"public",
"static",
"void",
"append",
"(",
"File",
"file",
",",
"Object",
"text",
")",
"throws",
"IOException",
"{",
"append",
"(",
"file",
",",
"text",
",",
"false",
")",
";",
"}"
] | Append the text at the end of the File without writing a BOM.
@param file a File
@param text the text to append at the end of the File
@throws IOException if an IOException occurs.
@since 1.0 | [
"Append",
"the",
"text",
"at",
"the",
"end",
"of",
"the",
"File",
"without",
"writing",
"a",
"BOM",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L880-L882 |
13,142 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.append | public static void append(File file, Object text, String charset) throws IOException {
append(file, text, charset, false);
} | java | public static void append(File file, Object text, String charset) throws IOException {
append(file, text, charset, false);
} | [
"public",
"static",
"void",
"append",
"(",
"File",
"file",
",",
"Object",
"text",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"append",
"(",
"file",
",",
"text",
",",
"charset",
",",
"false",
")",
";",
"}"
] | Append the text at the end of the File without writing a BOM,
using a specified encoding.
@param file a File
@param text the text to append at the end of the File
@param charset the charset used
@throws IOException if an IOException occurs.
@since 1.0 | [
"Append",
"the",
"text",
"at",
"the",
"end",
"of",
"the",
"File",
"without",
"writing",
"a",
"BOM",
"using",
"a",
"specified",
"encoding",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1011-L1013 |
13,143 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.append | public static void append(File file, Reader reader, String charset) throws IOException {
append(file, reader, charset, false);
} | java | public static void append(File file, Reader reader, String charset) throws IOException {
append(file, reader, charset, false);
} | [
"public",
"static",
"void",
"append",
"(",
"File",
"file",
",",
"Reader",
"reader",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"append",
"(",
"file",
",",
"reader",
",",
"charset",
",",
"false",
")",
";",
"}"
] | Append the text supplied by the Reader at the end of the File
without writing a BOM, using a specified encoding.
@param file a File
@param reader the Reader supplying the text to append at the end of the File
@param charset the charset used
@throws IOException if an IOException occurs.
@since 2.3 | [
"Append",
"the",
"text",
"supplied",
"by",
"the",
"Reader",
"at",
"the",
"end",
"of",
"the",
"File",
"without",
"writing",
"a",
"BOM",
"using",
"a",
"specified",
"encoding",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1108-L1110 |
13,144 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.relativePath | public static String relativePath(File self, File to) throws IOException {
String fromPath = self.getCanonicalPath();
String toPath = to.getCanonicalPath();
// build the path stack info to compare
String[] fromPathStack = getPathStack(fromPath);
String[] toPathStack = getPathSta... | java | public static String relativePath(File self, File to) throws IOException {
String fromPath = self.getCanonicalPath();
String toPath = to.getCanonicalPath();
// build the path stack info to compare
String[] fromPathStack = getPathStack(fromPath);
String[] toPathStack = getPathSta... | [
"public",
"static",
"String",
"relativePath",
"(",
"File",
"self",
",",
"File",
"to",
")",
"throws",
"IOException",
"{",
"String",
"fromPath",
"=",
"self",
".",
"getCanonicalPath",
"(",
")",
";",
"String",
"toPath",
"=",
"to",
".",
"getCanonicalPath",
"(",
... | Relative path to file.
@param self the <code>File</code> to calculate the path from
@param to the <code>File</code> to calculate the path to
@return the relative path between the files | [
"Relative",
"path",
"to",
"file",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1650-L1689 |
13,145 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withInputStream | public static <T> T withInputStream(URL url, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newInputStream(url), closure);
} | java | public static <T> T withInputStream(URL url, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newInputStream(url), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withInputStream",
"(",
"URL",
"url",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.InputStream\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",... | Creates a new InputStream for this URL and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@param url a URL
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@see IOGroovyMethods#withStream(java.io.InputS... | [
"Creates",
"a",
"new",
"InputStream",
"for",
"this",
"URL",
"and",
"passes",
"it",
"into",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1857-L1859 |
13,146 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newWriter | public static BufferedWriter newWriter(File file, String charset) throws IOException {
return newWriter(file, charset, false);
} | java | public static BufferedWriter newWriter(File file, String charset) throws IOException {
return newWriter(file, charset, false);
} | [
"public",
"static",
"BufferedWriter",
"newWriter",
"(",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"newWriter",
"(",
"file",
",",
"charset",
",",
"false",
")",
";",
"}"
] | Creates a buffered writer for this file, writing data without writing a
BOM, using a specified encoding.
@param file a File
@param charset the name of the encoding used to write in this file
@return a BufferedWriter
@throws IOException if an IOException occurs.
@since 1.0 | [
"Creates",
"a",
"buffered",
"writer",
"for",
"this",
"file",
"writing",
"data",
"without",
"writing",
"a",
"BOM",
"using",
"a",
"specified",
"encoding",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1972-L1974 |
13,147 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withWriter | public static <T> T withWriter(File file, @ClosureParams(value = SimpleType.class, options = "java.io.BufferedWriter") Closure<T> closure) throws IOException {
return IOGroovyMethods.withWriter(newWriter(file), closure);
} | java | public static <T> T withWriter(File file, @ClosureParams(value = SimpleType.class, options = "java.io.BufferedWriter") Closure<T> closure) throws IOException {
return IOGroovyMethods.withWriter(newWriter(file), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withWriter",
"(",
"File",
"file",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.BufferedWriter\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",... | Creates a new BufferedWriter for this file, passes it to the closure, and
ensures the stream is flushed and closed after the closure returns.
@param file a File
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 1.5.2 | [
"Creates",
"a",
"new",
"BufferedWriter",
"for",
"this",
"file",
"passes",
"it",
"to",
"the",
"closure",
"and",
"ensures",
"the",
"stream",
"is",
"flushed",
"and",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1986-L1988 |
13,148 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withReader | public static <T> T withReader(URL url, @ClosureParams(value = SimpleType.class, options = "java.io.Reader") Closure<T> closure) throws IOException {
return IOGroovyMethods.withReader(url.openConnection().getInputStream(), closure);
} | java | public static <T> T withReader(URL url, @ClosureParams(value = SimpleType.class, options = "java.io.Reader") Closure<T> closure) throws IOException {
return IOGroovyMethods.withReader(url.openConnection().getInputStream(), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withReader",
"(",
"URL",
"url",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.Reader\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",
"IOExce... | Helper method to create a new BufferedReader for a URL and then
passes it to the closure. The reader is closed after the closure returns.
@param url a URL
@param closure the closure to invoke with the reader
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 1.5.2 | [
"Helper",
"method",
"to",
"create",
"a",
"new",
"BufferedReader",
"for",
"a",
"URL",
"and",
"then",
"passes",
"it",
"to",
"the",
"closure",
".",
"The",
"reader",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2111-L2113 |
13,149 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newInputStream | public static BufferedInputStream newInputStream(URL url) throws MalformedURLException, IOException {
return new BufferedInputStream(configuredInputStream(null, url));
} | java | public static BufferedInputStream newInputStream(URL url) throws MalformedURLException, IOException {
return new BufferedInputStream(configuredInputStream(null, url));
} | [
"public",
"static",
"BufferedInputStream",
"newInputStream",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"return",
"new",
"BufferedInputStream",
"(",
"configuredInputStream",
"(",
"null",
",",
"url",
")",
")",
";",
"}"
] | Creates a buffered input stream for this URL.
@param url a URL
@return a BufferedInputStream for the URL
@throws MalformedURLException is thrown if the URL is not well formed
@throws IOException if an I/O error occurs while creating the input stream
@since 1.5.2 | [
"Creates",
"a",
"buffered",
"input",
"stream",
"for",
"this",
"URL",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2195-L2197 |
13,150 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newReader | public static BufferedReader newReader(URL url) throws MalformedURLException, IOException {
return IOGroovyMethods.newReader(configuredInputStream(null, url));
} | java | public static BufferedReader newReader(URL url) throws MalformedURLException, IOException {
return IOGroovyMethods.newReader(configuredInputStream(null, url));
} | [
"public",
"static",
"BufferedReader",
"newReader",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"newReader",
"(",
"configuredInputStream",
"(",
"null",
",",
"url",
")",
")",
";",
"}"
] | Creates a buffered reader for this URL.
@param url a URL
@return a BufferedReader for the URL
@throws MalformedURLException is thrown if the URL is not well formed
@throws IOException if an I/O error occurs while creating the input stream
@since 1.5.5 | [
"Creates",
"a",
"buffered",
"reader",
"for",
"this",
"URL",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2231-L2233 |
13,151 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachByte | public static void eachByte(URL url, @ClosureParams(value = SimpleType.class, options = "byte") Closure closure) throws IOException {
InputStream is = url.openConnection().getInputStream();
IOGroovyMethods.eachByte(is, closure);
} | java | public static void eachByte(URL url, @ClosureParams(value = SimpleType.class, options = "byte") Closure closure) throws IOException {
InputStream is = url.openConnection().getInputStream();
IOGroovyMethods.eachByte(is, closure);
} | [
"public",
"static",
"void",
"eachByte",
"(",
"URL",
"url",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"byte\"",
")",
"Closure",
"closure",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"u... | Reads the InputStream from this URL, passing each byte to the given
closure. The URL stream will be closed before this method returns.
@param url url to iterate over
@param closure closure to apply to each byte
@throws IOException if an IOException occurs.
@see IOGroovyMethods#eachByte(java.io.InputStream, groovy... | [
"Reads",
"the",
"InputStream",
"from",
"this",
"URL",
"passing",
"each",
"byte",
"to",
"the",
"given",
"closure",
".",
"The",
"URL",
"stream",
"will",
"be",
"closed",
"before",
"this",
"method",
"returns",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2338-L2341 |
13,152 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.filterLine | public static Writable filterLine(File self, @ClosureParams(value = SimpleType.class, options = "java.lang.String") Closure closure) throws IOException {
return IOGroovyMethods.filterLine(newReader(self), closure);
} | java | public static Writable filterLine(File self, @ClosureParams(value = SimpleType.class, options = "java.lang.String") Closure closure) throws IOException {
return IOGroovyMethods.filterLine(newReader(self), closure);
} | [
"public",
"static",
"Writable",
"filterLine",
"(",
"File",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.lang.String\"",
")",
"Closure",
"closure",
")",
"throws",
"IOException",
"{",
"return",
"I... | Filters the lines of a File and creates a Writable in return to
stream the filtered lines.
@param self a File
@param closure a closure which returns a boolean indicating to filter
the line or not
@return a Writable closure
@throws IOException if <code>self</code> is not readable
@see IOGroovyMethods#filterLine(java... | [
"Filters",
"the",
"lines",
"of",
"a",
"File",
"and",
"creates",
"a",
"Writable",
"in",
"return",
"to",
"stream",
"the",
"filtered",
"lines",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2371-L2373 |
13,153 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.readBytes | public static byte[] readBytes(File file) throws IOException {
byte[] bytes = new byte[(int) file.length()];
FileInputStream fileInputStream = new FileInputStream(file);
DataInputStream dis = new DataInputStream(fileInputStream);
try {
dis.readFully(bytes);
InputS... | java | public static byte[] readBytes(File file) throws IOException {
byte[] bytes = new byte[(int) file.length()];
FileInputStream fileInputStream = new FileInputStream(file);
DataInputStream dis = new DataInputStream(fileInputStream);
try {
dis.readFully(bytes);
InputS... | [
"public",
"static",
"byte",
"[",
"]",
"readBytes",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"(",
"int",
")",
"file",
".",
"length",
"(",
")",
"]",
";",
"FileInputStream",
"fileInputStre... | Reads the content of the file into a byte array.
@param file a File
@return a byte array with the contents of the file.
@throws IOException if an IOException occurs.
@since 1.0 | [
"Reads",
"the",
"content",
"of",
"the",
"file",
"into",
"a",
"byte",
"array",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2501-L2514 |
13,154 | apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.parameterizeSAM | public static Tuple2<ClassNode[], ClassNode> parameterizeSAM(ClassNode sam) {
MethodNode methodNode = ClassHelper.findSAM(sam);
final Map<GenericsType, GenericsType> map = makeDeclaringAndActualGenericsTypeMapOfExactType(methodNode.getDeclaringClass(), sam);
ClassNode[] parameterTypes =
... | java | public static Tuple2<ClassNode[], ClassNode> parameterizeSAM(ClassNode sam) {
MethodNode methodNode = ClassHelper.findSAM(sam);
final Map<GenericsType, GenericsType> map = makeDeclaringAndActualGenericsTypeMapOfExactType(methodNode.getDeclaringClass(), sam);
ClassNode[] parameterTypes =
... | [
"public",
"static",
"Tuple2",
"<",
"ClassNode",
"[",
"]",
",",
"ClassNode",
">",
"parameterizeSAM",
"(",
"ClassNode",
"sam",
")",
"{",
"MethodNode",
"methodNode",
"=",
"ClassHelper",
".",
"findSAM",
"(",
"sam",
")",
";",
"final",
"Map",
"<",
"GenericsType",
... | Get the parameter and return types of the abstract method of SAM
If the abstract method is not parameterized, we will get generics placeholders, e.g. T, U
For example, the abstract method of {@link java.util.function.Function} is
<pre>
R apply(T t);
</pre>
We parameterize the above interface as {@code Function<String... | [
"Get",
"the",
"parameter",
"and",
"return",
"types",
"of",
"the",
"abstract",
"method",
"of",
"SAM"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L961-L982 |
13,155 | apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.findActualTypeByGenericsPlaceholderName | public static ClassNode findActualTypeByGenericsPlaceholderName(String placeholderName, Map<GenericsType, GenericsType> genericsPlaceholderAndTypeMap) {
for (Map.Entry<GenericsType, GenericsType> entry : genericsPlaceholderAndTypeMap.entrySet()) {
GenericsType declaringGenericsType = entry.getKey();... | java | public static ClassNode findActualTypeByGenericsPlaceholderName(String placeholderName, Map<GenericsType, GenericsType> genericsPlaceholderAndTypeMap) {
for (Map.Entry<GenericsType, GenericsType> entry : genericsPlaceholderAndTypeMap.entrySet()) {
GenericsType declaringGenericsType = entry.getKey();... | [
"public",
"static",
"ClassNode",
"findActualTypeByGenericsPlaceholderName",
"(",
"String",
"placeholderName",
",",
"Map",
"<",
"GenericsType",
",",
"GenericsType",
">",
"genericsPlaceholderAndTypeMap",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"GenericsType",
",... | Get the actual type according to the placeholder name
@param placeholderName the placeholder name, e.g. T, E
@param genericsPlaceholderAndTypeMap the result of {@link #makeDeclaringAndActualGenericsTypeMap(ClassNode, ClassNode)}
@return the actual type | [
"Get",
"the",
"actual",
"type",
"according",
"to",
"the",
"placeholder",
"name"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L991-L1001 |
13,156 | apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java | TypeTransformers.addTransformer | protected static MethodHandle addTransformer(MethodHandle handle, int pos, Object arg, Class parameter) {
MethodHandle transformer=null;
if (arg instanceof GString) {
transformer = TO_STRING;
} else if (arg instanceof Closure) {
transformer = createSAMTransform(arg, param... | java | protected static MethodHandle addTransformer(MethodHandle handle, int pos, Object arg, Class parameter) {
MethodHandle transformer=null;
if (arg instanceof GString) {
transformer = TO_STRING;
} else if (arg instanceof Closure) {
transformer = createSAMTransform(arg, param... | [
"protected",
"static",
"MethodHandle",
"addTransformer",
"(",
"MethodHandle",
"handle",
",",
"int",
"pos",
",",
"Object",
"arg",
",",
"Class",
"parameter",
")",
"{",
"MethodHandle",
"transformer",
"=",
"null",
";",
"if",
"(",
"arg",
"instanceof",
"GString",
")... | Adds a type transformer applied at runtime.
This method handles transformations to String from GString,
array transformations and number based transformations | [
"Adds",
"a",
"type",
"transformer",
"applied",
"at",
"runtime",
".",
"This",
"method",
"handles",
"transformations",
"to",
"String",
"from",
"GString",
"array",
"transformations",
"and",
"number",
"based",
"transformations"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java#L126-L139 |
13,157 | apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java | TypeTransformers.createSAMTransform | private static MethodHandle createSAMTransform(Object arg, Class parameter) {
Method method = CachedSAMClass.getSAMMethod(parameter);
if (method == null) return null;
// TODO: have to think about how to optimize this!
if (parameter.isInterface()) {
if (Traits.isTrait(paramete... | java | private static MethodHandle createSAMTransform(Object arg, Class parameter) {
Method method = CachedSAMClass.getSAMMethod(parameter);
if (method == null) return null;
// TODO: have to think about how to optimize this!
if (parameter.isInterface()) {
if (Traits.isTrait(paramete... | [
"private",
"static",
"MethodHandle",
"createSAMTransform",
"(",
"Object",
"arg",
",",
"Class",
"parameter",
")",
"{",
"Method",
"method",
"=",
"CachedSAMClass",
".",
"getSAMMethod",
"(",
"parameter",
")",
";",
"if",
"(",
"method",
"==",
"null",
")",
"return",
... | creates a method handle able to transform the given Closure into a SAM type
if the given parameter is a SAM type | [
"creates",
"a",
"method",
"handle",
"able",
"to",
"transform",
"the",
"given",
"Closure",
"into",
"a",
"SAM",
"type",
"if",
"the",
"given",
"parameter",
"is",
"a",
"SAM",
"type"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java#L145-L191 |
13,158 | apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java | TypeTransformers.selectNumberTransformer | private static MethodHandle selectNumberTransformer(Class param, Object arg) {
param = TypeHelper.getWrapperClass(param);
if (param == Byte.class) {
return TO_BYTE;
} else if (param == Character.class || param == Integer.class) {
return TO_INT;
} else if (param ... | java | private static MethodHandle selectNumberTransformer(Class param, Object arg) {
param = TypeHelper.getWrapperClass(param);
if (param == Byte.class) {
return TO_BYTE;
} else if (param == Character.class || param == Integer.class) {
return TO_INT;
} else if (param ... | [
"private",
"static",
"MethodHandle",
"selectNumberTransformer",
"(",
"Class",
"param",
",",
"Object",
"arg",
")",
"{",
"param",
"=",
"TypeHelper",
".",
"getWrapperClass",
"(",
"param",
")",
";",
"if",
"(",
"param",
"==",
"Byte",
".",
"class",
")",
"{",
"re... | returns a transformer later applied as filter to transform one
number into another | [
"returns",
"a",
"transformer",
"later",
"applied",
"as",
"filter",
"to",
"transform",
"one",
"number",
"into",
"another"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/TypeTransformers.java#L211-L241 |
13,159 | apache/groovy | subprojects/groovy-xml/src/main/java/org/codehaus/groovy/runtime/XmlGroovyMethods.java | XmlGroovyMethods.iterator | public static Iterator<Node> iterator(final NodeList nodeList) {
return new Iterator<Node>() {
private int current /* = 0 */;
public boolean hasNext() {
return current < nodeList.getLength();
}
public Node next() {
return nodeList... | java | public static Iterator<Node> iterator(final NodeList nodeList) {
return new Iterator<Node>() {
private int current /* = 0 */;
public boolean hasNext() {
return current < nodeList.getLength();
}
public Node next() {
return nodeList... | [
"public",
"static",
"Iterator",
"<",
"Node",
">",
"iterator",
"(",
"final",
"NodeList",
"nodeList",
")",
"{",
"return",
"new",
"Iterator",
"<",
"Node",
">",
"(",
")",
"{",
"private",
"int",
"current",
"/* = 0 */",
";",
"public",
"boolean",
"hasNext",
"(",
... | Makes NodeList iterable by returning a read-only Iterator which traverses
over each Node.
@param nodeList a NodeList
@return an Iterator for a NodeList
@since 1.0 | [
"Makes",
"NodeList",
"iterable",
"by",
"returning",
"a",
"read",
"-",
"only",
"Iterator",
"which",
"traverses",
"over",
"each",
"Node",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/org/codehaus/groovy/runtime/XmlGroovyMethods.java#L43-L59 |
13,160 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java | StaticTypesCallSiteWriter.setField | private boolean setField(PropertyExpression expression, Expression objectExpression, ClassNode rType, String name) {
if (expression.isSafe()) return false;
FieldNode fn = AsmClassGenerator.getDeclaredFieldOfCurrentClassOrAccessibleFieldOfSuper(controller.getClassNode(), rType, name, false);
if (... | java | private boolean setField(PropertyExpression expression, Expression objectExpression, ClassNode rType, String name) {
if (expression.isSafe()) return false;
FieldNode fn = AsmClassGenerator.getDeclaredFieldOfCurrentClassOrAccessibleFieldOfSuper(controller.getClassNode(), rType, name, false);
if (... | [
"private",
"boolean",
"setField",
"(",
"PropertyExpression",
"expression",
",",
"Expression",
"objectExpression",
",",
"ClassNode",
"rType",
",",
"String",
"name",
")",
"{",
"if",
"(",
"expression",
".",
"isSafe",
"(",
")",
")",
"return",
"false",
";",
"FieldN... | this is just a simple set field handling static and non-static, but not Closure and inner classes | [
"this",
"is",
"just",
"a",
"simple",
"set",
"field",
"handling",
"static",
"and",
"non",
"-",
"static",
"but",
"not",
"Closure",
"and",
"inner",
"classes"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java#L902-L929 |
13,161 | apache/groovy | src/main/java/org/codehaus/groovy/util/ManagedConcurrentLinkedQueue.java | ManagedConcurrentLinkedQueue.add | public void add(T value) {
Element<T> e = new Element<T>(value);
queue.offer(e);
} | java | public void add(T value) {
Element<T> e = new Element<T>(value);
queue.offer(e);
} | [
"public",
"void",
"add",
"(",
"T",
"value",
")",
"{",
"Element",
"<",
"T",
">",
"e",
"=",
"new",
"Element",
"<",
"T",
">",
"(",
"value",
")",
";",
"queue",
".",
"offer",
"(",
"e",
")",
";",
"}"
] | Adds the specified value to the queue.
@param value the value to add | [
"Adds",
"the",
"specified",
"value",
"to",
"the",
"queue",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/util/ManagedConcurrentLinkedQueue.java#L61-L64 |
13,162 | apache/groovy | src/main/java/org/codehaus/groovy/util/ManagedConcurrentLinkedQueue.java | ManagedConcurrentLinkedQueue.values | public List<T> values() {
List<T> result = new ArrayList<T>();
for (Iterator<T> itr = iterator(); itr.hasNext(); ) {
result.add(itr.next());
}
return result;
} | java | public List<T> values() {
List<T> result = new ArrayList<T>();
for (Iterator<T> itr = iterator(); itr.hasNext(); ) {
result.add(itr.next());
}
return result;
} | [
"public",
"List",
"<",
"T",
">",
"values",
"(",
")",
"{",
"List",
"<",
"T",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"T",
">",
"itr",
"=",
"iterator",
"(",
")",
";",
"itr",
".",
"hasNe... | Returns a list containing all values from this queue in the
sequence they were added. | [
"Returns",
"a",
"list",
"containing",
"all",
"values",
"from",
"this",
"queue",
"in",
"the",
"sequence",
"they",
"were",
"added",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/util/ManagedConcurrentLinkedQueue.java#L92-L98 |
13,163 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionWriter.java | BinaryExpressionWriter.writeBitwiseOp | protected boolean writeBitwiseOp(int type, boolean simulate) {
type = type-BITWISE_OR;
if (type<0 || type>2) return false;
if (!simulate) {
int bytecode = getBitwiseOperationBytecode(type);
controller.getMethodVisitor().visitInsn(bytecode);
controller.getOper... | java | protected boolean writeBitwiseOp(int type, boolean simulate) {
type = type-BITWISE_OR;
if (type<0 || type>2) return false;
if (!simulate) {
int bytecode = getBitwiseOperationBytecode(type);
controller.getMethodVisitor().visitInsn(bytecode);
controller.getOper... | [
"protected",
"boolean",
"writeBitwiseOp",
"(",
"int",
"type",
",",
"boolean",
"simulate",
")",
"{",
"type",
"=",
"type",
"-",
"BITWISE_OR",
";",
"if",
"(",
"type",
"<",
"0",
"||",
"type",
">",
"2",
")",
"return",
"false",
";",
"if",
"(",
"!",
"simula... | writes some the bitwise operations. type is one of BITWISE_OR,
BITWISE_AND, BITWISE_XOR
@param type the token type
@return true if a successful bitwise operation write | [
"writes",
"some",
"the",
"bitwise",
"operations",
".",
"type",
"is",
"one",
"of",
"BITWISE_OR",
"BITWISE_AND",
"BITWISE_XOR"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionWriter.java#L238-L248 |
13,164 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionWriter.java | BinaryExpressionWriter.writeShiftOp | protected boolean writeShiftOp(int type, boolean simulate) {
type = type - LEFT_SHIFT;
if (type < 0 || type > 2) return false;
if (!simulate) {
int bytecode = getShiftOperationBytecode(type);
controller.getMethodVisitor().visitInsn(bytecode);
controller.getOp... | java | protected boolean writeShiftOp(int type, boolean simulate) {
type = type - LEFT_SHIFT;
if (type < 0 || type > 2) return false;
if (!simulate) {
int bytecode = getShiftOperationBytecode(type);
controller.getMethodVisitor().visitInsn(bytecode);
controller.getOp... | [
"protected",
"boolean",
"writeShiftOp",
"(",
"int",
"type",
",",
"boolean",
"simulate",
")",
"{",
"type",
"=",
"type",
"-",
"LEFT_SHIFT",
";",
"if",
"(",
"type",
"<",
"0",
"||",
"type",
">",
"2",
")",
"return",
"false",
";",
"if",
"(",
"!",
"simulate... | Write shifting operations.
Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED
@param type the token type
@return true on a successful shift operation write | [
"Write",
"shifting",
"operations",
".",
"Type",
"is",
"one",
"of",
"LEFT_SHIFT",
"RIGHT_SHIFT",
"or",
"RIGHT_SHIFT_UNSIGNED"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionWriter.java#L259-L269 |
13,165 | apache/groovy | subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxEventListener.java | JmxEventListener.handleNotification | public void handleNotification(Notification notification, Object handback) {
Map event = (Map) handback;
if (event != null) {
Object del = event.get("managedObject");
Object callback = event.get("callback");
if (callback != null && callback instanceof Closure) {
... | java | public void handleNotification(Notification notification, Object handback) {
Map event = (Map) handback;
if (event != null) {
Object del = event.get("managedObject");
Object callback = event.get("callback");
if (callback != null && callback instanceof Closure) {
... | [
"public",
"void",
"handleNotification",
"(",
"Notification",
"notification",
",",
"Object",
"handback",
")",
"{",
"Map",
"event",
"=",
"(",
"Map",
")",
"handback",
";",
"if",
"(",
"event",
"!=",
"null",
")",
"{",
"Object",
"del",
"=",
"event",
".",
"get"... | This is the implemented method for NotificationListener. It is called by an event emitter to dispatch
JMX events to listeners. Here it handles internal JmxBuilder events.
@param notification the notification object passed to closure used to handle JmxBuilder events.
@param handback - In this case, the handback i... | [
"This",
"is",
"the",
"implemented",
"method",
"for",
"NotificationListener",
".",
"It",
"is",
"called",
"by",
"an",
"event",
"emitter",
"to",
"dispatch",
"JMX",
"events",
"to",
"listeners",
".",
"Here",
"it",
"handles",
"internal",
"JmxBuilder",
"events",
"."
... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxEventListener.java#L56-L69 |
13,166 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java | ExtendedVerifier.visitAnnotation | private AnnotationNode visitAnnotation(AnnotationNode unvisited) {
ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration());
AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector);
AnnotationNode visited = visitor.visit(unvisited);
this.s... | java | private AnnotationNode visitAnnotation(AnnotationNode unvisited) {
ErrorCollector errorCollector = new ErrorCollector(this.source.getConfiguration());
AnnotationVisitor visitor = new AnnotationVisitor(this.source, errorCollector);
AnnotationNode visited = visitor.visit(unvisited);
this.s... | [
"private",
"AnnotationNode",
"visitAnnotation",
"(",
"AnnotationNode",
"unvisited",
")",
"{",
"ErrorCollector",
"errorCollector",
"=",
"new",
"ErrorCollector",
"(",
"this",
".",
"source",
".",
"getConfiguration",
"(",
")",
")",
";",
"AnnotationVisitor",
"visitor",
"... | Resolve metadata and details of the annotation.
@param unvisited the node to visit
@return the visited node | [
"Resolve",
"metadata",
"and",
"details",
"of",
"the",
"annotation",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java#L323-L329 |
13,167 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.setClasspath | public void setClasspath(String classpath) {
this.classpath = new LinkedList<String>();
StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
while (tokenizer.hasMoreTokens()) {
this.classpath.add(tokenizer.nextToken());
}
} | java | public void setClasspath(String classpath) {
this.classpath = new LinkedList<String>();
StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
while (tokenizer.hasMoreTokens()) {
this.classpath.add(tokenizer.nextToken());
}
} | [
"public",
"void",
"setClasspath",
"(",
"String",
"classpath",
")",
"{",
"this",
".",
"classpath",
"=",
"new",
"LinkedList",
"<",
"String",
">",
"(",
")",
";",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"classpath",
",",
"File",
".",
... | Sets the classpath. | [
"Sets",
"the",
"classpath",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L818-L824 |
13,168 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.setOptimizationOptions | public void setOptimizationOptions(Map<String, Boolean> options) {
if (options == null) throw new IllegalArgumentException("provided option map must not be null");
optimizationOptions = options;
} | java | public void setOptimizationOptions(Map<String, Boolean> options) {
if (options == null) throw new IllegalArgumentException("provided option map must not be null");
optimizationOptions = options;
} | [
"public",
"void",
"setOptimizationOptions",
"(",
"Map",
"<",
"String",
",",
"Boolean",
">",
"options",
")",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"provided option map must not be null\"",
")",
";",
"optimi... | Sets the optimization options for this configuration.
No entry or a true for that entry means to enable that optimization,
a false means the optimization is disabled.
Valid keys are "all" and "int".
@param options the options.
@throws IllegalArgumentException if the options are null | [
"Sets",
"the",
"optimization",
"options",
"for",
"this",
"configuration",
".",
"No",
"entry",
"or",
"a",
"true",
"for",
"that",
"entry",
"means",
"to",
"enable",
"that",
"optimization",
"a",
"false",
"means",
"the",
"optimization",
"is",
"disabled",
".",
"Va... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1047-L1050 |
13,169 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.addCompilationCustomizers | public CompilerConfiguration addCompilationCustomizers(CompilationCustomizer... customizers) {
if (customizers == null) throw new IllegalArgumentException("provided customizers list must not be null");
compilationCustomizers.addAll(Arrays.asList(customizers));
return this;
} | java | public CompilerConfiguration addCompilationCustomizers(CompilationCustomizer... customizers) {
if (customizers == null) throw new IllegalArgumentException("provided customizers list must not be null");
compilationCustomizers.addAll(Arrays.asList(customizers));
return this;
} | [
"public",
"CompilerConfiguration",
"addCompilationCustomizers",
"(",
"CompilationCustomizer",
"...",
"customizers",
")",
"{",
"if",
"(",
"customizers",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"provided customizers list must not be null\"",
")",
... | Adds compilation customizers to the compilation process. A compilation customizer is a class node
operation which performs various operations going from adding imports to access control.
@param customizers the list of customizers to be added
@return this configuration instance | [
"Adds",
"compilation",
"customizers",
"to",
"the",
"compilation",
"process",
".",
"A",
"compilation",
"customizer",
"is",
"a",
"class",
"node",
"operation",
"which",
"performs",
"various",
"operations",
"going",
"from",
"adding",
"imports",
"to",
"access",
"contro... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1058-L1062 |
13,170 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.isIndyEnabled | public boolean isIndyEnabled() {
Boolean indyEnabled = this.getOptimizationOptions().get(INVOKEDYNAMIC);
if (null == indyEnabled) {
return false;
}
return indyEnabled;
} | java | public boolean isIndyEnabled() {
Boolean indyEnabled = this.getOptimizationOptions().get(INVOKEDYNAMIC);
if (null == indyEnabled) {
return false;
}
return indyEnabled;
} | [
"public",
"boolean",
"isIndyEnabled",
"(",
")",
"{",
"Boolean",
"indyEnabled",
"=",
"this",
".",
"getOptimizationOptions",
"(",
")",
".",
"get",
"(",
"INVOKEDYNAMIC",
")",
";",
"if",
"(",
"null",
"==",
"indyEnabled",
")",
"{",
"return",
"false",
";",
"}",
... | Check whether invoke dynamic enabled
@return the result | [
"Check",
"whether",
"invoke",
"dynamic",
"enabled"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1118-L1126 |
13,171 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.isGroovydocEnabled | public boolean isGroovydocEnabled() {
Boolean groovydocEnabled = this.getOptimizationOptions().get(GROOVYDOC);
if (null == groovydocEnabled) {
return false;
}
return groovydocEnabled;
} | java | public boolean isGroovydocEnabled() {
Boolean groovydocEnabled = this.getOptimizationOptions().get(GROOVYDOC);
if (null == groovydocEnabled) {
return false;
}
return groovydocEnabled;
} | [
"public",
"boolean",
"isGroovydocEnabled",
"(",
")",
"{",
"Boolean",
"groovydocEnabled",
"=",
"this",
".",
"getOptimizationOptions",
"(",
")",
".",
"get",
"(",
"GROOVYDOC",
")",
";",
"if",
"(",
"null",
"==",
"groovydocEnabled",
")",
"{",
"return",
"false",
"... | Check whether groovydoc enabled
@return the result | [
"Check",
"whether",
"groovydoc",
"enabled"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1132-L1140 |
13,172 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.isRuntimeGroovydocEnabled | public boolean isRuntimeGroovydocEnabled() {
Boolean runtimeGroovydocEnabled = this.getOptimizationOptions().get(RUNTIME_GROOVYDOC);
if (null == runtimeGroovydocEnabled) {
return false;
}
return runtimeGroovydocEnabled;
} | java | public boolean isRuntimeGroovydocEnabled() {
Boolean runtimeGroovydocEnabled = this.getOptimizationOptions().get(RUNTIME_GROOVYDOC);
if (null == runtimeGroovydocEnabled) {
return false;
}
return runtimeGroovydocEnabled;
} | [
"public",
"boolean",
"isRuntimeGroovydocEnabled",
"(",
")",
"{",
"Boolean",
"runtimeGroovydocEnabled",
"=",
"this",
".",
"getOptimizationOptions",
"(",
")",
".",
"get",
"(",
"RUNTIME_GROOVYDOC",
")",
";",
"if",
"(",
"null",
"==",
"runtimeGroovydocEnabled",
")",
"{... | Check whether runtime groovydoc enabled
@return the result | [
"Check",
"whether",
"runtime",
"groovydoc",
"enabled"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1146-L1154 |
13,173 | apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.isMemStubEnabled | public boolean isMemStubEnabled() {
Object memStubEnabled = this.getJointCompilationOptions().get(MEM_STUB);
if (null == memStubEnabled) {
return false;
}
return "true".equals(memStubEnabled.toString());
} | java | public boolean isMemStubEnabled() {
Object memStubEnabled = this.getJointCompilationOptions().get(MEM_STUB);
if (null == memStubEnabled) {
return false;
}
return "true".equals(memStubEnabled.toString());
} | [
"public",
"boolean",
"isMemStubEnabled",
"(",
")",
"{",
"Object",
"memStubEnabled",
"=",
"this",
".",
"getJointCompilationOptions",
"(",
")",
".",
"get",
"(",
"MEM_STUB",
")",
";",
"if",
"(",
"null",
"==",
"memStubEnabled",
")",
"{",
"return",
"false",
";",
... | Check whether mem stub enabled
@return the result | [
"Check",
"whether",
"mem",
"stub",
"enabled"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1160-L1168 |
13,174 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/memoize/LRUCache.java | LRUCache.cleanUpNullReferences | public void cleanUpNullReferences() {
synchronized (map) {
final Iterator<Map.Entry<K, V>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<K, V> entry = iterator.next();
final Object value = entry.getValue();
... | java | public void cleanUpNullReferences() {
synchronized (map) {
final Iterator<Map.Entry<K, V>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<K, V> entry = iterator.next();
final Object value = entry.getValue();
... | [
"public",
"void",
"cleanUpNullReferences",
"(",
")",
"{",
"synchronized",
"(",
"map",
")",
"{",
"final",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"iterator",
"=",
"map",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",... | Remove all entries holding SoftReferences to gc-evicted objects. | [
"Remove",
"all",
"entries",
"holding",
"SoftReferences",
"to",
"gc",
"-",
"evicted",
"objects",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/memoize/LRUCache.java#L69-L80 |
13,175 | apache/groovy | subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java | GroovyEngine.apply | public Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames,
Vector arguments) throws BSFException {
Object object = eval(source, lineNo, columnNo, funcBody);
if (object instanceof Closure) {
// lets call the function
Cl... | java | public Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames,
Vector arguments) throws BSFException {
Object object = eval(source, lineNo, columnNo, funcBody);
if (object instanceof Closure) {
// lets call the function
Cl... | [
"public",
"Object",
"apply",
"(",
"String",
"source",
",",
"int",
"lineNo",
",",
"int",
"columnNo",
",",
"Object",
"funcBody",
",",
"Vector",
"paramNames",
",",
"Vector",
"arguments",
")",
"throws",
"BSFException",
"{",
"Object",
"object",
"=",
"eval",
"(",
... | Allow an anonymous function to be declared and invoked | [
"Allow",
"an",
"anonymous",
"function",
"to",
"be",
"declared",
"and",
"invoked"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java#L72-L81 |
13,176 | apache/groovy | subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java | GroovyEngine.call | public Object call(Object object, String method, Object[] args) throws BSFException {
return InvokerHelper.invokeMethod(object, method, args);
} | java | public Object call(Object object, String method, Object[] args) throws BSFException {
return InvokerHelper.invokeMethod(object, method, args);
} | [
"public",
"Object",
"call",
"(",
"Object",
"object",
",",
"String",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"BSFException",
"{",
"return",
"InvokerHelper",
".",
"invokeMethod",
"(",
"object",
",",
"method",
",",
"args",
")",
";",
"}"
] | Call the named method of the given object. | [
"Call",
"the",
"named",
"method",
"of",
"the",
"given",
"object",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java#L86-L88 |
13,177 | apache/groovy | subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java | GroovyEngine.declareBean | public void declareBean(BSFDeclaredBean bean) throws BSFException {
shell.setVariable(bean.name, bean.bean);
} | java | public void declareBean(BSFDeclaredBean bean) throws BSFException {
shell.setVariable(bean.name, bean.bean);
} | [
"public",
"void",
"declareBean",
"(",
"BSFDeclaredBean",
"bean",
")",
"throws",
"BSFException",
"{",
"shell",
".",
"setVariable",
"(",
"bean",
".",
"name",
",",
"bean",
".",
"bean",
")",
";",
"}"
] | Declare a bean | [
"Declare",
"a",
"bean"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-bsf/src/main/java/org/codehaus/groovy/bsf/GroovyEngine.java#L136-L138 |
13,178 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java | InvocationWriter.getMatchingConstructor | private static ConstructorNode getMatchingConstructor(List<ConstructorNode> constructors, List<Expression> argumentList) {
ConstructorNode lastMatch = null;
for (int i=0; i<constructors.size(); i++) {
ConstructorNode cn = constructors.get(i);
Parameter[] params = cn.getParameters... | java | private static ConstructorNode getMatchingConstructor(List<ConstructorNode> constructors, List<Expression> argumentList) {
ConstructorNode lastMatch = null;
for (int i=0; i<constructors.size(); i++) {
ConstructorNode cn = constructors.get(i);
Parameter[] params = cn.getParameters... | [
"private",
"static",
"ConstructorNode",
"getMatchingConstructor",
"(",
"List",
"<",
"ConstructorNode",
">",
"constructors",
",",
"List",
"<",
"Expression",
">",
"argumentList",
")",
"{",
"ConstructorNode",
"lastMatch",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"... | we match only on the number of arguments, not anything else | [
"we",
"match",
"only",
"on",
"the",
"number",
"of",
"arguments",
"not",
"anything",
"else"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java#L910-L925 |
13,179 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberPlus.java | NumberNumberPlus.plus | public static Number plus(Number left, Number right) {
return NumberMath.add(left, right);
} | java | public static Number plus(Number left, Number right) {
return NumberMath.add(left, right);
} | [
"public",
"static",
"Number",
"plus",
"(",
"Number",
"left",
",",
"Number",
"right",
")",
"{",
"return",
"NumberMath",
".",
"add",
"(",
"left",
",",
"right",
")",
";",
"}"
] | Add two numbers and return the result.
@param left a Number
@param right another Number to add
@return the addition of both Numbers | [
"Add",
"two",
"numbers",
"and",
"return",
"the",
"result",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberPlus.java#L42-L44 |
13,180 | apache/groovy | src/main/groovy/groovy/lang/Sequence.java | Sequence.checkType | protected void checkType(Object object) {
if (object == null) {
throw new NullPointerException("Sequences cannot contain null, use a List instead");
}
if (type != null) {
if (!type.isInstance(object)) {
throw new IllegalArgumentException(
... | java | protected void checkType(Object object) {
if (object == null) {
throw new NullPointerException("Sequences cannot contain null, use a List instead");
}
if (type != null) {
if (!type.isInstance(object)) {
throw new IllegalArgumentException(
... | [
"protected",
"void",
"checkType",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Sequences cannot contain null, use a List instead\"",
")",
";",
"}",
"if",
"(",
"type",
"!=",
"null"... | Checks that the given object instance is of the correct type
otherwise a runtime exception is thrown | [
"Checks",
"that",
"the",
"given",
"object",
"instance",
"is",
"of",
"the",
"correct",
"type",
"otherwise",
"a",
"runtime",
"exception",
"is",
"thrown"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/Sequence.java#L203-L216 |
13,181 | apache/groovy | src/main/java/org/codehaus/groovy/antlr/treewalker/SourcePrinter.java | SourcePrinter.visitType | public void visitType(GroovySourceAST t,int visit) {
GroovySourceAST parent = getParentNode();
GroovySourceAST modifiers = parent.childOfType(GroovyTokenTypes.MODIFIERS);
// No need to print 'def' if we already have some modifiers
if (modifiers == null || modifiers.getNumberOfChildren()... | java | public void visitType(GroovySourceAST t,int visit) {
GroovySourceAST parent = getParentNode();
GroovySourceAST modifiers = parent.childOfType(GroovyTokenTypes.MODIFIERS);
// No need to print 'def' if we already have some modifiers
if (modifiers == null || modifiers.getNumberOfChildren()... | [
"public",
"void",
"visitType",
"(",
"GroovySourceAST",
"t",
",",
"int",
"visit",
")",
"{",
"GroovySourceAST",
"parent",
"=",
"getParentNode",
"(",
")",
";",
"GroovySourceAST",
"modifiers",
"=",
"parent",
".",
"childOfType",
"(",
"GroovyTokenTypes",
".",
"MODIFIE... | visit TripleDot, not used in the AST | [
"visit",
"TripleDot",
"not",
"used",
"in",
"the",
"AST"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/antlr/treewalker/SourcePrinter.java#L920-L953 |
13,182 | apache/groovy | src/main/java/org/codehaus/groovy/antlr/treewalker/SourcePrinter.java | SourcePrinter.visitDefault | public void visitDefault(GroovySourceAST t,int visit) {
if (visit == OPENING_VISIT) {
print(t,visit,"<" + tokenNames[t.getType()] + ">");
//out.print("<" + t.getType() + ">");
} else {
print(t,visit,"</" + tokenNames[t.getType()] + ">");
//out.print("</" +... | java | public void visitDefault(GroovySourceAST t,int visit) {
if (visit == OPENING_VISIT) {
print(t,visit,"<" + tokenNames[t.getType()] + ">");
//out.print("<" + t.getType() + ">");
} else {
print(t,visit,"</" + tokenNames[t.getType()] + ">");
//out.print("</" +... | [
"public",
"void",
"visitDefault",
"(",
"GroovySourceAST",
"t",
",",
"int",
"visit",
")",
"{",
"if",
"(",
"visit",
"==",
"OPENING_VISIT",
")",
"{",
"print",
"(",
"t",
",",
"visit",
",",
"\"<\"",
"+",
"tokenNames",
"[",
"t",
".",
"getType",
"(",
")",
"... | visit WS - only used by lexer | [
"visit",
"WS",
"-",
"only",
"used",
"by",
"lexer"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/antlr/treewalker/SourcePrinter.java#L1007-L1015 |
13,183 | apache/groovy | src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java | ParameterTypes.fitToVargs | private static Object[] fitToVargs(Object[] argumentArrayOrig, CachedClass[] paramTypes) {
Class vargsClassOrig = paramTypes[paramTypes.length - 1].getTheClass().getComponentType();
Class vargsClass = ReflectionCache.autoboxType(vargsClassOrig);
Object[] argumentArray = argumentArrayOrig.clone()... | java | private static Object[] fitToVargs(Object[] argumentArrayOrig, CachedClass[] paramTypes) {
Class vargsClassOrig = paramTypes[paramTypes.length - 1].getTheClass().getComponentType();
Class vargsClass = ReflectionCache.autoboxType(vargsClassOrig);
Object[] argumentArray = argumentArrayOrig.clone()... | [
"private",
"static",
"Object",
"[",
"]",
"fitToVargs",
"(",
"Object",
"[",
"]",
"argumentArrayOrig",
",",
"CachedClass",
"[",
"]",
"paramTypes",
")",
"{",
"Class",
"vargsClassOrig",
"=",
"paramTypes",
"[",
"paramTypes",
".",
"length",
"-",
"1",
"]",
".",
"... | this method is called when the number of arguments to a method is greater than 1
and if the method is a vargs method. This method will then transform the given
arguments to make the method callable
@param argumentArrayOrig the arguments used to call the method
@param paramTypes the types of the parameters the m... | [
"this",
"method",
"is",
"called",
"when",
"the",
"number",
"of",
"arguments",
"to",
"a",
"method",
"is",
"greater",
"than",
"1",
"and",
"if",
"the",
"method",
"is",
"a",
"vargs",
"method",
".",
"This",
"method",
"will",
"then",
"transform",
"the",
"given... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java#L187-L229 |
13,184 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java | VariableScopeVisitor.checkPropertyOnExplicitThis | private void checkPropertyOnExplicitThis(PropertyExpression pe) {
if (!currentScope.isInStaticContext()) return;
Expression object = pe.getObjectExpression();
if (!(object instanceof VariableExpression)) return;
VariableExpression ve = (VariableExpression) object;
if (!ve.getName... | java | private void checkPropertyOnExplicitThis(PropertyExpression pe) {
if (!currentScope.isInStaticContext()) return;
Expression object = pe.getObjectExpression();
if (!(object instanceof VariableExpression)) return;
VariableExpression ve = (VariableExpression) object;
if (!ve.getName... | [
"private",
"void",
"checkPropertyOnExplicitThis",
"(",
"PropertyExpression",
"pe",
")",
"{",
"if",
"(",
"!",
"currentScope",
".",
"isInStaticContext",
"(",
")",
")",
"return",
";",
"Expression",
"object",
"=",
"pe",
".",
"getObjectExpression",
"(",
")",
";",
"... | a property on "this", like this.x is transformed to a
direct field access, so we need to check the
static context here
@param pe the property expression to check | [
"a",
"property",
"on",
"this",
"like",
"this",
".",
"x",
"is",
"transformed",
"to",
"a",
"direct",
"field",
"access",
"so",
"we",
"need",
"to",
"check",
"the",
"static",
"context",
"here"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java#L292-L303 |
13,185 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java | FinalVariableAnalyzer.fixVar | private void fixVar(Variable var) {
if (getTarget(var) == null && var instanceof VariableExpression && getState() != null && var.getName() != null) {
for (Variable v: getState().keySet()) {
if (var.getName().equals(v.getName())) {
((VariableExpression)var).setAcce... | java | private void fixVar(Variable var) {
if (getTarget(var) == null && var instanceof VariableExpression && getState() != null && var.getName() != null) {
for (Variable v: getState().keySet()) {
if (var.getName().equals(v.getName())) {
((VariableExpression)var).setAcce... | [
"private",
"void",
"fixVar",
"(",
"Variable",
"var",
")",
"{",
"if",
"(",
"getTarget",
"(",
"var",
")",
"==",
"null",
"&&",
"var",
"instanceof",
"VariableExpression",
"&&",
"getState",
"(",
")",
"!=",
"null",
"&&",
"var",
".",
"getName",
"(",
")",
"!="... | This fixes xform declaration expressions but not other synthetic fields which aren't set up correctly | [
"This",
"fixes",
"xform",
"declaration",
"expressions",
"but",
"not",
"other",
"synthetic",
"fields",
"which",
"aren",
"t",
"set",
"up",
"correctly"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java#L446-L455 |
13,186 | apache/groovy | subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java | AntBuilder.nodeCompleted | protected void nodeCompleted(final Object parent, final Object node) {
if (parent == null) insideTask = false;
antElementHandler.onEndElement(null, null, antXmlContext);
lastCompletedNode = node;
if (parent != null && !(parent instanceof Target)) {
log.finest("parent is not ... | java | protected void nodeCompleted(final Object parent, final Object node) {
if (parent == null) insideTask = false;
antElementHandler.onEndElement(null, null, antXmlContext);
lastCompletedNode = node;
if (parent != null && !(parent instanceof Target)) {
log.finest("parent is not ... | [
"protected",
"void",
"nodeCompleted",
"(",
"final",
"Object",
"parent",
",",
"final",
"Object",
"node",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"insideTask",
"=",
"false",
";",
"antElementHandler",
".",
"onEndElement",
"(",
"null",
",",
"null",
"... | Determines, when the ANT Task that is represented by the "node" should perform.
Node must be an ANT Task or no "perform" is called.
If node is an ANT Task, it performs right after complete construction.
If node is nested in a TaskContainer, calling "perform" is delegated to that
TaskContainer.
@param parent note: null... | [
"Determines",
"when",
"the",
"ANT",
"Task",
"that",
"is",
"represented",
"by",
"the",
"node",
"should",
"perform",
".",
"Node",
"must",
"be",
"an",
"ANT",
"Task",
"or",
"no",
"perform",
"is",
"called",
".",
"If",
"node",
"is",
"an",
"ANT",
"Task",
"it"... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java#L230-L313 |
13,187 | apache/groovy | subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java | AntBuilder.performTask | private Object performTask(Task task) {
Throwable reason = null;
try {
// Have to call fireTestStared/fireTestFinished via reflection as they unfortunately have protected access in Project
final Method fireTaskStarted = Project.class.getDeclaredMethod("fireTaskStarted", Task.cla... | java | private Object performTask(Task task) {
Throwable reason = null;
try {
// Have to call fireTestStared/fireTestFinished via reflection as they unfortunately have protected access in Project
final Method fireTaskStarted = Project.class.getDeclaredMethod("fireTaskStarted", Task.cla... | [
"private",
"Object",
"performTask",
"(",
"Task",
"task",
")",
"{",
"Throwable",
"reason",
"=",
"null",
";",
"try",
"{",
"// Have to call fireTestStared/fireTestFinished via reflection as they unfortunately have protected access in Project",
"final",
"Method",
"fireTaskStarted",
... | Copied from org.apache.tools.ant.Task, since we need to get a real thing before it gets nulled in DispatchUtils.execute | [
"Copied",
"from",
"org",
".",
"apache",
".",
"tools",
".",
"ant",
".",
"Task",
"since",
"we",
"need",
"to",
"get",
"a",
"real",
"thing",
"before",
"it",
"gets",
"nulled",
"in",
"DispatchUtils",
".",
"execute"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java#L317-L366 |
13,188 | apache/groovy | src/main/java/org/codehaus/groovy/antlr/SourceBuffer.java | SourceBuffer.getSnippet | public String getSnippet(LineColumn start, LineColumn end) {
// preconditions
if (start == null || end == null) { return null; } // no text to return
if (start.equals(end)) { return null; } // no text to return
if (lines.size() == 1 && current.length() == 0) { return null; } // buffer ha... | java | public String getSnippet(LineColumn start, LineColumn end) {
// preconditions
if (start == null || end == null) { return null; } // no text to return
if (start.equals(end)) { return null; } // no text to return
if (lines.size() == 1 && current.length() == 0) { return null; } // buffer ha... | [
"public",
"String",
"getSnippet",
"(",
"LineColumn",
"start",
",",
"LineColumn",
"end",
")",
"{",
"// preconditions",
"if",
"(",
"start",
"==",
"null",
"||",
"end",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// no text to return",
"if",
"(",
"sta... | Obtains a snippet of the source code within the bounds specified
@param start (inclusive line/ inclusive column)
@param end (inclusive line / exclusive column)
@return specified snippet of source code as a String, or null if no source available | [
"Obtains",
"a",
"snippet",
"of",
"the",
"source",
"code",
"within",
"the",
"bounds",
"specified"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/antlr/SourceBuffer.java#L46-L94 |
13,189 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java | DefaultGroovyMethodsSupport.tryClose | static Throwable tryClose(AutoCloseable closeable, boolean logWarning) {
Throwable thrown = null;
if (closeable != null) {
try {
closeable.close();
} catch (Exception e) {
thrown = e;
if (logWarning) {
LOG.warnin... | java | static Throwable tryClose(AutoCloseable closeable, boolean logWarning) {
Throwable thrown = null;
if (closeable != null) {
try {
closeable.close();
} catch (Exception e) {
thrown = e;
if (logWarning) {
LOG.warnin... | [
"static",
"Throwable",
"tryClose",
"(",
"AutoCloseable",
"closeable",
",",
"boolean",
"logWarning",
")",
"{",
"Throwable",
"thrown",
"=",
"null",
";",
"if",
"(",
"closeable",
"!=",
"null",
")",
"{",
"try",
"{",
"closeable",
".",
"close",
"(",
")",
";",
"... | Attempts to close the closeable returning rather than throwing
any Exception that may occur.
@param closeable the thing to close
@param logWarning if true will log a warning if an exception occurs
@return throwable Exception from the close method, else null | [
"Attempts",
"to",
"close",
"the",
"closeable",
"returning",
"rather",
"than",
"throwing",
"any",
"Exception",
"that",
"may",
"occur",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java#L132-L145 |
13,190 | apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java | DefaultGroovyMethodsSupport.sameType | @SuppressWarnings("unchecked")
protected static boolean sameType(Collection[] cols) {
List all = new LinkedList();
for (Collection col : cols) {
all.addAll(col);
}
if (all.isEmpty())
return true;
Object first = all.get(0);
//trying to determi... | java | @SuppressWarnings("unchecked")
protected static boolean sameType(Collection[] cols) {
List all = new LinkedList();
for (Collection col : cols) {
all.addAll(col);
}
if (all.isEmpty())
return true;
Object first = all.get(0);
//trying to determi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"boolean",
"sameType",
"(",
"Collection",
"[",
"]",
"cols",
")",
"{",
"List",
"all",
"=",
"new",
"LinkedList",
"(",
")",
";",
"for",
"(",
"Collection",
"col",
":",
"cols",
")",
"{... | Determines if all items of this array are of the same type.
@param cols an array of collections
@return true if the collections are all of the same type | [
"Determines",
"if",
"all",
"items",
"of",
"this",
"array",
"are",
"of",
"the",
"same",
"type",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java#L352-L382 |
13,191 | apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.defaultUnitFor | private static TemporalUnit defaultUnitFor(Temporal temporal) {
return DEFAULT_UNITS.entrySet()
.stream()
.filter(e -> e.getKey().isAssignableFrom(temporal.getClass()))
.findFirst()
.map(Map.Entry::getValue)
.orElse(ChronoUnit.SECON... | java | private static TemporalUnit defaultUnitFor(Temporal temporal) {
return DEFAULT_UNITS.entrySet()
.stream()
.filter(e -> e.getKey().isAssignableFrom(temporal.getClass()))
.findFirst()
.map(Map.Entry::getValue)
.orElse(ChronoUnit.SECON... | [
"private",
"static",
"TemporalUnit",
"defaultUnitFor",
"(",
"Temporal",
"temporal",
")",
"{",
"return",
"DEFAULT_UNITS",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"e",
"->",
"e",
".",
"getKey",
"(",
")",
".",
"isAssignableFrom... | A number of extension methods permit a long or int to be provided as a parameter. This method determines
what the unit should be for this number. | [
"A",
"number",
"of",
"extension",
"methods",
"permit",
"a",
"long",
"or",
"int",
"to",
"be",
"provided",
"as",
"a",
"parameter",
".",
"This",
"method",
"determines",
"what",
"the",
"unit",
"should",
"be",
"for",
"this",
"number",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L95-L102 |
13,192 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.negateBoolean | public static void negateBoolean(MethodVisitor mv) {
// code to negate the primitive boolean
Label endLabel = new Label();
Label falseLabel = new Label();
mv.visitJumpInsn(IFNE, falseLabel);
mv.visitInsn(ICONST_1);
mv.visitJumpInsn(GOTO, endLabel);
mv.visitLabel(f... | java | public static void negateBoolean(MethodVisitor mv) {
// code to negate the primitive boolean
Label endLabel = new Label();
Label falseLabel = new Label();
mv.visitJumpInsn(IFNE, falseLabel);
mv.visitInsn(ICONST_1);
mv.visitJumpInsn(GOTO, endLabel);
mv.visitLabel(f... | [
"public",
"static",
"void",
"negateBoolean",
"(",
"MethodVisitor",
"mv",
")",
"{",
"// code to negate the primitive boolean",
"Label",
"endLabel",
"=",
"new",
"Label",
"(",
")",
";",
"Label",
"falseLabel",
"=",
"new",
"Label",
"(",
")",
";",
"mv",
".",
"visitJ... | Negate a boolean on stack. | [
"Negate",
"a",
"boolean",
"on",
"stack",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L225-L235 |
13,193 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.unbox | public static void unbox(MethodVisitor mv, Class type) {
if (type.isPrimitive() && type != Void.TYPE) {
String returnString = "(Ljava/lang/Object;)" + BytecodeHelper.getTypeDescription(type);
mv.visitMethodInsn(INVOKESTATIC, DTT_CLASSNAME, type.getName() + "Unbox", returnString, false);
... | java | public static void unbox(MethodVisitor mv, Class type) {
if (type.isPrimitive() && type != Void.TYPE) {
String returnString = "(Ljava/lang/Object;)" + BytecodeHelper.getTypeDescription(type);
mv.visitMethodInsn(INVOKESTATIC, DTT_CLASSNAME, type.getName() + "Unbox", returnString, false);
... | [
"public",
"static",
"void",
"unbox",
"(",
"MethodVisitor",
"mv",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isPrimitive",
"(",
")",
"&&",
"type",
"!=",
"Void",
".",
"TYPE",
")",
"{",
"String",
"returnString",
"=",
"\"(Ljava/lang/Object;)\"",
... | Generates the bytecode to unbox the current value on the stack | [
"Generates",
"the",
"bytecode",
"to",
"unbox",
"the",
"current",
"value",
"on",
"the",
"stack"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L492-L497 |
13,194 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.box | @Deprecated
public static boolean box(MethodVisitor mv, ClassNode type) {
if (type.isPrimaryClassNode()) return false;
return box(mv, type.getTypeClass());
} | java | @Deprecated
public static boolean box(MethodVisitor mv, ClassNode type) {
if (type.isPrimaryClassNode()) return false;
return box(mv, type.getTypeClass());
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"box",
"(",
"MethodVisitor",
"mv",
",",
"ClassNode",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isPrimaryClassNode",
"(",
")",
")",
"return",
"false",
";",
"return",
"box",
"(",
"mv",
",",
"type",
".",
... | box top level operand | [
"box",
"top",
"level",
"operand"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L507-L511 |
13,195 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.box | @Deprecated
public static boolean box(MethodVisitor mv, Class type) {
if (ReflectionCache.getCachedClass(type).isPrimitive && type != void.class) {
String returnString = "(" + BytecodeHelper.getTypeDescription(type) + ")Ljava/lang/Object;";
mv.visitMethodInsn(INVOKESTATIC, DTT_CLASSN... | java | @Deprecated
public static boolean box(MethodVisitor mv, Class type) {
if (ReflectionCache.getCachedClass(type).isPrimitive && type != void.class) {
String returnString = "(" + BytecodeHelper.getTypeDescription(type) + ")Ljava/lang/Object;";
mv.visitMethodInsn(INVOKESTATIC, DTT_CLASSN... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"box",
"(",
"MethodVisitor",
"mv",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"ReflectionCache",
".",
"getCachedClass",
"(",
"type",
")",
".",
"isPrimitive",
"&&",
"type",
"!=",
"void",
".",
"class",
")",
... | Generates the bytecode to autobox the current value on the stack | [
"Generates",
"the",
"bytecode",
"to",
"autobox",
"the",
"current",
"value",
"on",
"the",
"stack"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L517-L525 |
13,196 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.visitClassLiteral | public static void visitClassLiteral(MethodVisitor mv, ClassNode classNode) {
if (ClassHelper.isPrimitiveType(classNode)) {
mv.visitFieldInsn(
GETSTATIC,
getClassInternalName(ClassHelper.getWrapper(classNode)),
"TYPE",
"... | java | public static void visitClassLiteral(MethodVisitor mv, ClassNode classNode) {
if (ClassHelper.isPrimitiveType(classNode)) {
mv.visitFieldInsn(
GETSTATIC,
getClassInternalName(ClassHelper.getWrapper(classNode)),
"TYPE",
"... | [
"public",
"static",
"void",
"visitClassLiteral",
"(",
"MethodVisitor",
"mv",
",",
"ClassNode",
"classNode",
")",
"{",
"if",
"(",
"ClassHelper",
".",
"isPrimitiveType",
"(",
"classNode",
")",
")",
"{",
"mv",
".",
"visitFieldInsn",
"(",
"GETSTATIC",
",",
"getCla... | Visits a class literal. If the type of the classnode is a primitive type,
the generated bytecode will be a GETSTATIC Integer.TYPE.
If the classnode is not a primitive type, we will generate a LDC instruction. | [
"Visits",
"a",
"class",
"literal",
".",
"If",
"the",
"type",
"of",
"the",
"classnode",
"is",
"a",
"primitive",
"type",
"the",
"generated",
"bytecode",
"will",
"be",
"a",
"GETSTATIC",
"Integer",
".",
"TYPE",
".",
"If",
"the",
"classnode",
"is",
"not",
"a"... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L532-L542 |
13,197 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.isSameCompilationUnit | public static boolean isSameCompilationUnit(ClassNode a, ClassNode b) {
CompileUnit cu1 = a.getCompileUnit();
CompileUnit cu2 = b.getCompileUnit();
return cu1 != null && cu1 == cu2;
} | java | public static boolean isSameCompilationUnit(ClassNode a, ClassNode b) {
CompileUnit cu1 = a.getCompileUnit();
CompileUnit cu2 = b.getCompileUnit();
return cu1 != null && cu1 == cu2;
} | [
"public",
"static",
"boolean",
"isSameCompilationUnit",
"(",
"ClassNode",
"a",
",",
"ClassNode",
"b",
")",
"{",
"CompileUnit",
"cu1",
"=",
"a",
".",
"getCompileUnit",
"(",
")",
";",
"CompileUnit",
"cu2",
"=",
"b",
".",
"getCompileUnit",
"(",
")",
";",
"ret... | Returns true if the two classes share the same compilation unit.
@param a class a
@param b class b
@return true if both classes share the same compilation unit | [
"Returns",
"true",
"if",
"the",
"two",
"classes",
"share",
"the",
"same",
"compilation",
"unit",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L565-L569 |
13,198 | apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.convertPrimitiveToBoolean | public static void convertPrimitiveToBoolean(MethodVisitor mv, ClassNode type) {
if (type == boolean_TYPE) {
return;
}
// Special handling is done for floating point types in order to
// handle checking for 0 or NaN values.
if (type == double_TYPE) {
conve... | java | public static void convertPrimitiveToBoolean(MethodVisitor mv, ClassNode type) {
if (type == boolean_TYPE) {
return;
}
// Special handling is done for floating point types in order to
// handle checking for 0 or NaN values.
if (type == double_TYPE) {
conve... | [
"public",
"static",
"void",
"convertPrimitiveToBoolean",
"(",
"MethodVisitor",
"mv",
",",
"ClassNode",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"boolean_TYPE",
")",
"{",
"return",
";",
"}",
"// Special handling is done for floating point types in order to",
"// handle... | Converts a primitive type to boolean.
@param mv method visitor
@param type primitive type to convert | [
"Converts",
"a",
"primitive",
"type",
"to",
"boolean",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L592-L619 |
13,199 | apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/BeanUtils.java | BeanUtils.getAllProperties | public static List<PropertyNode> getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters) {
return getAllProperties(type, includeSuperProperties, includeStatic, includePseudoGetters, false, false);
} | java | public static List<PropertyNode> getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters) {
return getAllProperties(type, includeSuperProperties, includeStatic, includePseudoGetters, false, false);
} | [
"public",
"static",
"List",
"<",
"PropertyNode",
">",
"getAllProperties",
"(",
"ClassNode",
"type",
",",
"boolean",
"includeSuperProperties",
",",
"boolean",
"includeStatic",
",",
"boolean",
"includePseudoGetters",
")",
"{",
"return",
"getAllProperties",
"(",
"type",
... | Get all properties including JavaBean pseudo properties matching getter conventions.
@param type the ClassNode
@param includeSuperProperties whether to include super properties
@param includeStatic whether to include static properties
@param includePseudoGetters whether to include JavaBean pseudo (getXXX/isYYY) proper... | [
"Get",
"all",
"properties",
"including",
"JavaBean",
"pseudo",
"properties",
"matching",
"getter",
"conventions",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/BeanUtils.java#L51-L53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.