repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
google/closure-compiler | src/com/google/javascript/jscomp/deps/DepsGenerator.java | DepsGenerator.parseSources | private Map<String, DependencyInfo> parseSources(
Set<String> preparsedFiles) throws IOException {
"""
Parses all source files for dependency information.
@param preparsedFiles A set of closure-relative paths.
Files in this set are not parsed if they are encountered in srcs.
@return Returns a map of closu... | java | private Map<String, DependencyInfo> parseSources(
Set<String> preparsedFiles) throws IOException {
Map<String, DependencyInfo> parsedFiles = new LinkedHashMap<>();
JsFileParser jsParser = new JsFileParser(errorManager).setModuleLoader(loader);
Compiler compiler = new Compiler();
compiler.init(Immu... | [
"private",
"Map",
"<",
"String",
",",
"DependencyInfo",
">",
"parseSources",
"(",
"Set",
"<",
"String",
">",
"preparsedFiles",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"DependencyInfo",
">",
"parsedFiles",
"=",
"new",
"LinkedHashMap",
"<>"... | Parses all source files for dependency information.
@param preparsedFiles A set of closure-relative paths.
Files in this set are not parsed if they are encountered in srcs.
@return Returns a map of closure-relative paths -> DependencyInfo for the
newly parsed files.
@throws IOException Occurs upon an IO error. | [
"Parses",
"all",
"source",
"files",
"for",
"dependency",
"information",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsGenerator.java#L477-L506 |
rey5137/material | material/src/main/java/com/rey/material/widget/EditText.java | EditText.setCompoundDrawables | public void setCompoundDrawables (Drawable left, Drawable top, Drawable right, Drawable bottom) {
"""
Sets the Drawables (if any) to appear to the left of, above, to the
right of, and below the text. Use {@code null} if you do not want a
Drawable there. The Drawables must already have had
{@link Drawable#setBou... | java | public void setCompoundDrawables (Drawable left, Drawable top, Drawable right, Drawable bottom){
mInputView.setCompoundDrawables(left, top, right, bottom);
if(mDividerCompoundPadding) {
mDivider.setPadding(mInputView.getTotalPaddingLeft(), mInputView.getTotalPaddingRight());
if(mLabelE... | [
"public",
"void",
"setCompoundDrawables",
"(",
"Drawable",
"left",
",",
"Drawable",
"top",
",",
"Drawable",
"right",
",",
"Drawable",
"bottom",
")",
"{",
"mInputView",
".",
"setCompoundDrawables",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";... | Sets the Drawables (if any) to appear to the left of, above, to the
right of, and below the text. Use {@code null} if you do not want a
Drawable there. The Drawables must already have had
{@link Drawable#setBounds} called.
<p>
Calling this method will overwrite any Drawables previously set using
{@link #setCompoundDraw... | [
"Sets",
"the",
"Drawables",
"(",
"if",
"any",
")",
"to",
"appear",
"to",
"the",
"left",
"of",
"above",
"to",
"the",
"right",
"of",
"and",
"below",
"the",
"text",
".",
"Use",
"{",
"@code",
"null",
"}",
"if",
"you",
"do",
"not",
"want",
"a",
"Drawabl... | train | https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/EditText.java#L2693-L2702 |
WASdev/standards.jsr352.jbatch | com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java | JDBCPersistenceManagerImpl.createIfNotExists | private void createIfNotExists(String tableName, String createTableStatement) throws SQLException {
"""
Creates tableName using the createTableStatement DDL.
@param tableName
@param createTableStatement
@throws SQLException
"""
logger.entering(CLASSNAME, "createIfNotExists", new Object[] {tableName, cr... | java | private void createIfNotExists(String tableName, String createTableStatement) throws SQLException {
logger.entering(CLASSNAME, "createIfNotExists", new Object[] {tableName, createTableStatement});
Connection conn = getConnection();
DatabaseMetaData dbmd = conn.getMetaData();
ResultSet rs = dbmd.getTables(... | [
"private",
"void",
"createIfNotExists",
"(",
"String",
"tableName",
",",
"String",
"createTableStatement",
")",
"throws",
"SQLException",
"{",
"logger",
".",
"entering",
"(",
"CLASSNAME",
",",
"\"createIfNotExists\"",
",",
"new",
"Object",
"[",
"]",
"{",
"tableNam... | Creates tableName using the createTableStatement DDL.
@param tableName
@param createTableStatement
@throws SQLException | [
"Creates",
"tableName",
"using",
"the",
"createTableStatement",
"DDL",
"."
] | train | https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java#L238-L253 |
mguymon/naether | src/main/java/com/tobedevoured/naether/PathClassLoader.java | PathClassLoader.newInstance | public Object newInstance( String name, Object... params ) throws ClassLoaderException {
"""
Create new instance of Object with constructor parameters using the ClassLoader
@param name String
@param params Object parameters for constructor
@return Object
@throws ClassLoaderException exception
"""
... | java | public Object newInstance( String name, Object... params ) throws ClassLoaderException {
return newInstance( name, params, null );
} | [
"public",
"Object",
"newInstance",
"(",
"String",
"name",
",",
"Object",
"...",
"params",
")",
"throws",
"ClassLoaderException",
"{",
"return",
"newInstance",
"(",
"name",
",",
"params",
",",
"null",
")",
";",
"}"
] | Create new instance of Object with constructor parameters using the ClassLoader
@param name String
@param params Object parameters for constructor
@return Object
@throws ClassLoaderException exception | [
"Create",
"new",
"instance",
"of",
"Object",
"with",
"constructor",
"parameters",
"using",
"the",
"ClassLoader"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/PathClassLoader.java#L107-L109 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java | HylaFaxClientSpi.resumeFaxJob | protected void resumeFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception {
"""
This function will resume an existing fax job.
@param client
The client instance
@param faxJob
The fax job object containing the needed information
@throws Exception
Any exception
"""
//get job
... | java | protected void resumeFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception
{
//get job
Job job=faxJob.getHylaFaxJob();
//get job ID
long faxJobID=job.getId();
//resume job
client.retry(faxJobID);
} | [
"protected",
"void",
"resumeFaxJob",
"(",
"HylaFaxJob",
"faxJob",
",",
"HylaFAXClient",
"client",
")",
"throws",
"Exception",
"{",
"//get job",
"Job",
"job",
"=",
"faxJob",
".",
"getHylaFaxJob",
"(",
")",
";",
"//get job ID",
"long",
"faxJobID",
"=",
"job",
".... | This function will resume an existing fax job.
@param client
The client instance
@param faxJob
The fax job object containing the needed information
@throws Exception
Any exception | [
"This",
"function",
"will",
"resume",
"an",
"existing",
"fax",
"job",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L469-L479 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findAll | public static <T> List<T> findAll(List<T> self) {
"""
Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
<p>
Example:
<pre class="groovyTestCase">
def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
</pre>
@par... | java | public static <T> List<T> findAll(List<T> self) {
return findAll(self, Closure.IDENTITY);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"findAll",
"(",
"List",
"<",
"T",
">",
"self",
")",
"{",
"return",
"findAll",
"(",
"self",
",",
"Closure",
".",
"IDENTITY",
")",
";",
"}"
] | Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
<p>
Example:
<pre class="groovyTestCase">
def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
</pre>
@param self a List
@return a List of the values found
@since 2.4.0
@... | [
"Finds",
"the",
"items",
"matching",
"the",
"IDENTITY",
"Closure",
"(",
"i",
".",
"e",
".",
" ",
";",
"matching",
"Groovy",
"truth",
")",
".",
"<p",
">",
"Example",
":",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"items",
"=",
"[",
"1",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4829-L4831 |
stratosphere/stratosphere | stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dag/BulkIterationNode.java | BulkIterationNode.setNextPartialSolution | public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
"""
Sets the nextPartialSolution for this BulkIterationNode.
@param nextPartialSolution The nextPartialSolution to set.
"""
// check if the root of the step function has the same DOP as the itera... | java | public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
// check if the root of the step function has the same DOP as the iteration
if (nextPartialSolution.getDegreeOfParallelism() != getDegreeOfParallelism() ||
nextPartialSolution.getSubtasksPerInstance() !... | [
"public",
"void",
"setNextPartialSolution",
"(",
"OptimizerNode",
"nextPartialSolution",
",",
"OptimizerNode",
"terminationCriterion",
")",
"{",
"// check if the root of the step function has the same DOP as the iteration",
"if",
"(",
"nextPartialSolution",
".",
"getDegreeOfParalleli... | Sets the nextPartialSolution for this BulkIterationNode.
@param nextPartialSolution The nextPartialSolution to set. | [
"Sets",
"the",
"nextPartialSolution",
"for",
"this",
"BulkIterationNode",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dag/BulkIterationNode.java#L119-L159 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/model/JobRecord.java | JobRecord.createRootJobRecord | public static JobRecord createRootJobRecord(Job<?> jobInstance, JobSetting[] settings) {
"""
A factory method for root jobs.
@param jobInstance The non-null user-supplied instance of {@code Job} that
implements the Job that the newly created JobRecord represents.
@param settings Array of {@code JobSetting} to... | java | public static JobRecord createRootJobRecord(Job<?> jobInstance, JobSetting[] settings) {
Key key = generateKey(null, DATA_STORE_KIND);
return new JobRecord(key, jobInstance, settings);
} | [
"public",
"static",
"JobRecord",
"createRootJobRecord",
"(",
"Job",
"<",
"?",
">",
"jobInstance",
",",
"JobSetting",
"[",
"]",
"settings",
")",
"{",
"Key",
"key",
"=",
"generateKey",
"(",
"null",
",",
"DATA_STORE_KIND",
")",
";",
"return",
"new",
"JobRecord"... | A factory method for root jobs.
@param jobInstance The non-null user-supplied instance of {@code Job} that
implements the Job that the newly created JobRecord represents.
@param settings Array of {@code JobSetting} to apply to the newly created
JobRecord. | [
"A",
"factory",
"method",
"for",
"root",
"jobs",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/model/JobRecord.java#L403-L406 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlUtils.java | CmsXmlUtils.createXpathElement | public static String createXpathElement(String path, int index) {
"""
Appends the provided index parameter in square brackets to the given name,
like <code>path[index]</code>.<p>
This method is used if it's clear that some path does not have
a square bracket already appended.<p>
@param path the path append... | java | public static String createXpathElement(String path, int index) {
StringBuffer result = new StringBuffer(path.length() + 5);
result.append(path);
result.append('[');
result.append(index);
result.append(']');
return result.toString();
} | [
"public",
"static",
"String",
"createXpathElement",
"(",
"String",
"path",
",",
"int",
"index",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"path",
".",
"length",
"(",
")",
"+",
"5",
")",
";",
"result",
".",
"append",
"(",
"path"... | Appends the provided index parameter in square brackets to the given name,
like <code>path[index]</code>.<p>
This method is used if it's clear that some path does not have
a square bracket already appended.<p>
@param path the path append the index to
@param index the index to append
@return the simplified Xpath for ... | [
"Appends",
"the",
"provided",
"index",
"parameter",
"in",
"square",
"brackets",
"to",
"the",
"given",
"name",
"like",
"<code",
">",
"path",
"[",
"index",
"]",
"<",
"/",
"code",
">",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L213-L221 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_attachedDomain_domain_GET | public OvhAttachedDomain serviceName_attachedDomain_domain_GET(String serviceName, String domain) throws IOException {
"""
Get this object properties
REST: GET /hosting/web/{serviceName}/attachedDomain/{domain}
@param serviceName [required] The internal name of your hosting
@param domain [required] Domain lin... | java | public OvhAttachedDomain serviceName_attachedDomain_domain_GET(String serviceName, String domain) throws IOException {
String qPath = "/hosting/web/{serviceName}/attachedDomain/{domain}";
StringBuilder sb = path(qPath, serviceName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo... | [
"public",
"OvhAttachedDomain",
"serviceName_attachedDomain_domain_GET",
"(",
"String",
"serviceName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/attachedDomain/{domain}\"",
";",
"StringBuilder",
"sb",
"=",... | Get this object properties
REST: GET /hosting/web/{serviceName}/attachedDomain/{domain}
@param serviceName [required] The internal name of your hosting
@param domain [required] Domain linked (fqdn) | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1948-L1953 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.hasFunction | public static boolean hasFunction(Object object, String functionName, Class[] parameters) {
"""
Checks if Instance has specified function
@param object Instance which function would be checked
@param functionName function name
@param parameters function parameters (array of Class)
@return true if fun... | java | public static boolean hasFunction(Object object, String functionName, Class[] parameters) {
boolean result = false;
try {
Method method = object.getClass().getMethod(functionName, parameters);
if (method != null) {
result = true;
}
}... | [
"public",
"static",
"boolean",
"hasFunction",
"(",
"Object",
"object",
",",
"String",
"functionName",
",",
"Class",
"[",
"]",
"parameters",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"Method",
"method",
"=",
"object",
".",
"getClass",
"(... | Checks if Instance has specified function
@param object Instance which function would be checked
@param functionName function name
@param parameters function parameters (array of Class)
@return true if function is present in Instance | [
"Checks",
"if",
"Instance",
"has",
"specified",
"function"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L307-L321 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asInteger | public static Integer asInteger(String expression, Node node)
throws XPathExpressionException {
"""
Evaluates the specified XPath expression and returns the result as an
Integer.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly... | java | public static Integer asInteger(String expression, Node node)
throws XPathExpressionException {
return asInteger(expression, node, xpath());
} | [
"public",
"static",
"Integer",
"asInteger",
"(",
"String",
"expression",
",",
"Node",
"node",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"asInteger",
"(",
"expression",
",",
"node",
",",
"xpath",
"(",
")",
")",
";",
"}"
] | Evaluates the specified XPath expression and returns the result as an
Integer.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@link #asDouble(String, Node, XPath)} instead. Note {@link XPath} is
not thread-safe and not reentrant.
@param ... | [
"Evaluates",
"the",
"specified",
"XPath",
"expression",
"and",
"returns",
"the",
"result",
"as",
"an",
"Integer",
".",
"<p",
">",
"This",
"method",
"can",
"be",
"expensive",
"as",
"a",
"new",
"xpath",
"is",
"instantiated",
"per",
"invocation",
".",
"Consider... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L277-L280 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java | SuspiciousComparatorReturnValues.visitCode | @Override
public void visitCode(Code obj) {
"""
implements the visitor to check to see what Const were returned from a comparator. If no Const were returned it can't determine anything, however if only
Const were returned, it looks to see if negative positive and zero was returned. It also looks to see if a n... | java | @Override
public void visitCode(Code obj) {
if (getMethod().isSynthetic()) {
return;
}
String methodName = getMethodName();
String methodSig = getMethodSig();
if (methodName.equals(methodInfo.methodName) && methodSig.endsWith(methodInfo.signatureEnding)
... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"if",
"(",
"getMethod",
"(",
")",
".",
"isSynthetic",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"methodName",
"=",
"getMethodName",
"(",
")",
";",
"String",
"methodSi... | implements the visitor to check to see what Const were returned from a comparator. If no Const were returned it can't determine anything, however if only
Const were returned, it looks to see if negative positive and zero was returned. It also looks to see if a non zero value is returned unconditionally.
While it is pos... | [
"implements",
"the",
"visitor",
"to",
"check",
"to",
"see",
"what",
"Const",
"were",
"returned",
"from",
"a",
"comparator",
".",
"If",
"no",
"Const",
"were",
"returned",
"it",
"can",
"t",
"determine",
"anything",
"however",
"if",
"only",
"Const",
"were",
"... | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java#L119-L150 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/WorkerHelper.java | WorkerHelper.closeWTX | public static void closeWTX(final boolean abortTransaction, final INodeWriteTrx wtx, final ISession ses)
throws TTException {
"""
This method closes all open treetank connections concerning a
NodeWriteTrx.
@param abortTransaction
<code>true</code> if the transaction has to be aborted, <code>false</cod... | java | public static void closeWTX(final boolean abortTransaction, final INodeWriteTrx wtx, final ISession ses)
throws TTException {
synchronized (ses) {
if (abortTransaction) {
wtx.abort();
}
ses.close();
}
} | [
"public",
"static",
"void",
"closeWTX",
"(",
"final",
"boolean",
"abortTransaction",
",",
"final",
"INodeWriteTrx",
"wtx",
",",
"final",
"ISession",
"ses",
")",
"throws",
"TTException",
"{",
"synchronized",
"(",
"ses",
")",
"{",
"if",
"(",
"abortTransaction",
... | This method closes all open treetank connections concerning a
NodeWriteTrx.
@param abortTransaction
<code>true</code> if the transaction has to be aborted, <code>false</code> otherwise.
@param wtx
INodeWriteTrx to be closed
@param ses
ISession to be closed
@throws TreetankException | [
"This",
"method",
"closes",
"all",
"open",
"treetank",
"connections",
"concerning",
"a",
"NodeWriteTrx",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/WorkerHelper.java#L195-L203 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.copyStream | public static void copyStream(final InputStream src, OutputStream dest) throws IOException {
"""
Writes the content of an input stream to an output stream
@throws IOException
"""
byte[] buffer = new byte[1024];
int read;
while ((read = src.read(buffer)) > -1) {
dest.w... | java | public static void copyStream(final InputStream src, OutputStream dest) throws IOException {
byte[] buffer = new byte[1024];
int read;
while ((read = src.read(buffer)) > -1) {
dest.write(buffer, 0, read);
}
dest.flush();
} | [
"public",
"static",
"void",
"copyStream",
"(",
"final",
"InputStream",
"src",
",",
"OutputStream",
"dest",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"int",
"read",
";",
"while",
"(",
"(",
... | Writes the content of an input stream to an output stream
@throws IOException | [
"Writes",
"the",
"content",
"of",
"an",
"input",
"stream",
"to",
"an",
"output",
"stream"
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L56-L63 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.getIndirectionTableColName | private String getIndirectionTableColName(TableAlias mnAlias, String path) {
"""
Get the column name from the indirection table.
@param mnAlias
@param path
"""
int dotIdx = path.lastIndexOf(".");
String column = path.substring(dotIdx);
return mnAlias.alias + column;
} | java | private String getIndirectionTableColName(TableAlias mnAlias, String path)
{
int dotIdx = path.lastIndexOf(".");
String column = path.substring(dotIdx);
return mnAlias.alias + column;
} | [
"private",
"String",
"getIndirectionTableColName",
"(",
"TableAlias",
"mnAlias",
",",
"String",
"path",
")",
"{",
"int",
"dotIdx",
"=",
"path",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"String",
"column",
"=",
"path",
".",
"substring",
"(",
"dotIdx",
")",... | Get the column name from the indirection table.
@param mnAlias
@param path | [
"Get",
"the",
"column",
"name",
"from",
"the",
"indirection",
"table",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L748-L753 |
dasein-cloud/dasein-cloud-aws | src/main/java/org/dasein/cloud/aws/AWSCloud.java | AWSCloud.addIndexedParameters | public static void addIndexedParameters( @Nonnull Map<String, String> parameters, @Nonnull String prefix, String ... values ) {
"""
Helper method for adding indexed member parameters, e.g. <i>AlarmNames.member.N</i>. Will overwrite existing
parameters if present. Assumes indexing starts at 1.
@param parameters... | java | public static void addIndexedParameters( @Nonnull Map<String, String> parameters, @Nonnull String prefix, String ... values ) {
if( values == null || values.length == 0 ) {
return;
}
int i = 1;
if( !prefix.endsWith(".") ) {
prefix += ".";
}
for( St... | [
"public",
"static",
"void",
"addIndexedParameters",
"(",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"@",
"Nonnull",
"String",
"prefix",
",",
"String",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"... | Helper method for adding indexed member parameters, e.g. <i>AlarmNames.member.N</i>. Will overwrite existing
parameters if present. Assumes indexing starts at 1.
@param parameters the existing parameters map to add to
@param prefix the prefix value for each parameter key
@param values the values to add | [
"Helper",
"method",
"for",
"adding",
"indexed",
"member",
"parameters",
"e",
".",
"g",
".",
"<i",
">",
"AlarmNames",
".",
"member",
".",
"N<",
"/",
"i",
">",
".",
"Will",
"overwrite",
"existing",
"parameters",
"if",
"present",
".",
"Assumes",
"indexing",
... | train | https://github.com/dasein-cloud/dasein-cloud-aws/blob/05098574197a1f573f77447cadc39a76bf00b99d/src/main/java/org/dasein/cloud/aws/AWSCloud.java#L1393-L1405 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurface.java | AbstractVolatilitySurface.convertFromTo | public double convertFromTo(double optionMaturity, double optionStrike, double value, QuotingConvention fromQuotingConvention, QuotingConvention toQuotingConvention) {
"""
Convert the value of a caplet from one quoting convention to another quoting convention.
@param optionMaturity Option maturity of the caplet... | java | public double convertFromTo(double optionMaturity, double optionStrike, double value, QuotingConvention fromQuotingConvention, QuotingConvention toQuotingConvention) {
return convertFromTo(null, optionMaturity, optionStrike, value, fromQuotingConvention, toQuotingConvention);
} | [
"public",
"double",
"convertFromTo",
"(",
"double",
"optionMaturity",
",",
"double",
"optionStrike",
",",
"double",
"value",
",",
"QuotingConvention",
"fromQuotingConvention",
",",
"QuotingConvention",
"toQuotingConvention",
")",
"{",
"return",
"convertFromTo",
"(",
"nu... | Convert the value of a caplet from one quoting convention to another quoting convention.
@param optionMaturity Option maturity of the caplet.
@param optionStrike Option strike of the caplet.
@param value Value of the caplet given in the form of <code>fromQuotingConvention</code>.
@param fromQuotingConvention The quoti... | [
"Convert",
"the",
"value",
"of",
"a",
"caplet",
"from",
"one",
"quoting",
"convention",
"to",
"another",
"quoting",
"convention",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurface.java#L143-L145 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextServicesSupport.java | ControlBeanContextServicesSupport.addService | public boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider) {
"""
Adds a service to this BeanContext.
<code>BeanContextServiceProvider</code>s call this method
to register a particular service with this context.
If the service has not previously been added, the
<code>BeanContextSe... | java | public boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider) {
// todo: for multithreaded usage this block needs to be synchronized
if (!_serviceProviders.containsKey(serviceClass)) {
_serviceProviders.put(serviceClass, new ServiceProvider(serviceProvider));
... | [
"public",
"boolean",
"addService",
"(",
"Class",
"serviceClass",
",",
"BeanContextServiceProvider",
"serviceProvider",
")",
"{",
"// todo: for multithreaded usage this block needs to be synchronized",
"if",
"(",
"!",
"_serviceProviders",
".",
"containsKey",
"(",
"serviceClass",... | Adds a service to this BeanContext.
<code>BeanContextServiceProvider</code>s call this method
to register a particular service with this context.
If the service has not previously been added, the
<code>BeanContextServices</code> associates
the service with the <code>BeanContextServiceProvider</code> and
fires a <code>B... | [
"Adds",
"a",
"service",
"to",
"this",
"BeanContext",
".",
"<code",
">",
"BeanContextServiceProvider<",
"/",
"code",
">",
"s",
"call",
"this",
"method",
"to",
"register",
"a",
"particular",
"service",
"with",
"this",
"context",
".",
"If",
"the",
"service",
"h... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextServicesSupport.java#L86-L96 |
wildfly/wildfly-core | embedded/src/main/java/org/wildfly/core/embedded/EmbeddedProcessFactory.java | EmbeddedProcessFactory.createHostController | public static HostController createHostController(ModuleLoader moduleLoader, File jbossHomeDir, String[] cmdargs) {
"""
Create an embedded host controller with an already established module loader.
@param moduleLoader the module loader. Cannot be {@code null}
@param jbossHomeDir the location of the root of ser... | java | public static HostController createHostController(ModuleLoader moduleLoader, File jbossHomeDir, String[] cmdargs) {
return createHostController(
Configuration.Builder.of(jbossHomeDir)
.setModuleLoader(moduleLoader)
.setCommandArguments(cmdargs)
... | [
"public",
"static",
"HostController",
"createHostController",
"(",
"ModuleLoader",
"moduleLoader",
",",
"File",
"jbossHomeDir",
",",
"String",
"[",
"]",
"cmdargs",
")",
"{",
"return",
"createHostController",
"(",
"Configuration",
".",
"Builder",
".",
"of",
"(",
"j... | Create an embedded host controller with an already established module loader.
@param moduleLoader the module loader. Cannot be {@code null}
@param jbossHomeDir the location of the root of server installation. Cannot be {@code null} or empty.
@param cmdargs any additional arguments to pass to the embedded host con... | [
"Create",
"an",
"embedded",
"host",
"controller",
"with",
"an",
"already",
"established",
"module",
"loader",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/embedded/src/main/java/org/wildfly/core/embedded/EmbeddedProcessFactory.java#L231-L238 |
radkovo/Pdf2Dom | src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java | CSSBoxTree.renderImage | @Override
protected void renderImage(float x, float y, float width, float height, ImageResource resource) throws IOException {
"""
/*protected void renderRectangle(float x, float y, float width, float height, boolean stroke, boolean fill)
{
DOM element
Element el = createRectangleElement(x, y, width, height... | java | @Override
protected void renderImage(float x, float y, float width, float height, ImageResource resource) throws IOException
{
//DOM element
Element el = createImageElement(x, y, width, height, resource);
curpage.appendChild(el);
//Image box
BlockBox block = createBlock(p... | [
"@",
"Override",
"protected",
"void",
"renderImage",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"width",
",",
"float",
"height",
",",
"ImageResource",
"resource",
")",
"throws",
"IOException",
"{",
"//DOM element",
"Element",
"el",
"=",
"createImageEl... | /*protected void renderRectangle(float x, float y, float width, float height, boolean stroke, boolean fill)
{
DOM element
Element el = createRectangleElement(x, y, width, height, stroke, fill);
curpage.appendChild(el);
Block box
BlockBox block = createBlock(pagebox, el, false);
block.setStyle(createRectangleStyle(x, y,... | [
"/",
"*",
"protected",
"void",
"renderRectangle",
"(",
"float",
"x",
"float",
"y",
"float",
"width",
"float",
"height",
"boolean",
"stroke",
"boolean",
"fill",
")",
"{",
"DOM",
"element",
"Element",
"el",
"=",
"createRectangleElement",
"(",
"x",
"y",
"width"... | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java#L250-L260 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getCompositeEntityRoles | public List<EntityRole> getCompositeEntityRoles(UUID appId, String versionId, UUID cEntityId) {
"""
Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@throws IllegalArgumentException thrown if paramet... | java | public List<EntityRole> getCompositeEntityRoles(UUID appId, String versionId, UUID cEntityId) {
return getCompositeEntityRolesWithServiceResponseAsync(appId, versionId, cEntityId).toBlocking().single().body();
} | [
"public",
"List",
"<",
"EntityRole",
">",
"getCompositeEntityRoles",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
")",
"{",
"return",
"getCompositeEntityRolesWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"cEntityId",
... | Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws Run... | [
"Get",
"All",
"Entity",
"Roles",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L8779-L8781 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java | MapIterate.injectIntoIf | public static <IV, K, V> IV injectIntoIf(
IV initialValue,
Map<K, V> map,
final Predicate<? super V> predicate,
final Function2<? super IV, ? super V, ? extends IV> function) {
"""
Same as {@link #injectInto(Object, Map, Function2)}, but only applies the value to the... | java | public static <IV, K, V> IV injectIntoIf(
IV initialValue,
Map<K, V> map,
final Predicate<? super V> predicate,
final Function2<? super IV, ? super V, ? extends IV> function)
{
Function2<IV, ? super V, IV> ifFunction = new Function2<IV, V, IV>()
{
... | [
"public",
"static",
"<",
"IV",
",",
"K",
",",
"V",
">",
"IV",
"injectIntoIf",
"(",
"IV",
"initialValue",
",",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"Predicate",
"<",
"?",
"super",
"V",
">",
"predicate",
",",
"final",
"Function2",
"<"... | Same as {@link #injectInto(Object, Map, Function2)}, but only applies the value to the function
if the predicate returns true for the value.
@see #injectInto(Object, Map, Function2) | [
"Same",
"as",
"{",
"@link",
"#injectInto",
"(",
"Object",
"Map",
"Function2",
")",
"}",
"but",
"only",
"applies",
"the",
"value",
"to",
"the",
"function",
"if",
"the",
"predicate",
"returns",
"true",
"for",
"the",
"value",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java#L929-L947 |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrFieldConfiguration.java | CmsSolrFieldConfiguration.appendSpellFields | private void appendSpellFields(I_CmsSearchDocument document) {
"""
Copy the content and the title property of the document to a spell field / a language specific spell field.
@param document the document that gets extended by the spell fields.
"""
/*
* Add the content fields (multiple for co... | java | private void appendSpellFields(I_CmsSearchDocument document) {
/*
* Add the content fields (multiple for contents with more than one locale)
*/
// add the content_<locale> fields to this configuration
String title = document.getFieldValueAsString(
CmsPropertyDefini... | [
"private",
"void",
"appendSpellFields",
"(",
"I_CmsSearchDocument",
"document",
")",
"{",
"/*\n * Add the content fields (multiple for contents with more than one locale)\n */",
"// add the content_<locale> fields to this configuration",
"String",
"title",
"=",
"document",
... | Copy the content and the title property of the document to a spell field / a language specific spell field.
@param document the document that gets extended by the spell fields. | [
"Copy",
"the",
"content",
"and",
"the",
"title",
"property",
"of",
"the",
"document",
"to",
"a",
"spell",
"field",
"/",
"a",
"language",
"specific",
"spell",
"field",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrFieldConfiguration.java#L871-L890 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveTargetPathHelper.java | HiveTargetPathHelper.resolvePath | protected static Path resolvePath(String pattern, String database, String table) {
"""
Takes a path with tokens {@link #databaseToken} or {@link #tableToken} and replaces these tokens with the actual
database names and table name. For example, if db is myDatabase, table is myTable, then /data/$DB/$TABLE will be
... | java | protected static Path resolvePath(String pattern, String database, String table) {
pattern = pattern.replace(HiveDataset.DATABASE_TOKEN, database);
if (pattern.contains(HiveDataset.TABLE_TOKEN)) {
pattern = pattern.replace(HiveDataset.TABLE_TOKEN, table);
return new Path(pattern);
} else {
... | [
"protected",
"static",
"Path",
"resolvePath",
"(",
"String",
"pattern",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"pattern",
"=",
"pattern",
".",
"replace",
"(",
"HiveDataset",
".",
"DATABASE_TOKEN",
",",
"database",
")",
";",
"if",
"(",
... | Takes a path with tokens {@link #databaseToken} or {@link #tableToken} and replaces these tokens with the actual
database names and table name. For example, if db is myDatabase, table is myTable, then /data/$DB/$TABLE will be
resolved to /data/myDatabase/myTable. | [
"Takes",
"a",
"path",
"with",
"tokens",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveTargetPathHelper.java#L106-L114 |
Bedework/bw-util | bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java | DirRecord.addAttr | public void addAttr(String attr, Object val) throws NamingException {
"""
Add the attribute value to the table. If an attribute already exists
add it to the end of its values.
@param attr String attribute name
@param val Object value
@throws NamingException
"""
// System.out.println("addAttr " ... | java | public void addAttr(String attr, Object val) throws NamingException {
// System.out.println("addAttr " + attr);
Attribute a = findAttr(attr);
if (a == null) {
setAttr(attr, val);
} else {
a.add(val);
}
} | [
"public",
"void",
"addAttr",
"(",
"String",
"attr",
",",
"Object",
"val",
")",
"throws",
"NamingException",
"{",
"// System.out.println(\"addAttr \" + attr);",
"Attribute",
"a",
"=",
"findAttr",
"(",
"attr",
")",
";",
"if",
"(",
"a",
"==",
"null",
")",
"{",
... | Add the attribute value to the table. If an attribute already exists
add it to the end of its values.
@param attr String attribute name
@param val Object value
@throws NamingException | [
"Add",
"the",
"attribute",
"value",
"to",
"the",
"table",
".",
"If",
"an",
"attribute",
"already",
"exists",
"add",
"it",
"to",
"the",
"end",
"of",
"its",
"values",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L479-L489 |
FasterXML/jackson-jr | jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/ValueReaderLocator.java | ValueReaderLocator.findReader | public ValueReader findReader(Class<?> raw) {
"""
Method used during deserialization to find handler for given
non-generic type.
"""
ClassKey k = (_key == null) ? new ClassKey(raw, _features) : _key.with(raw, _features);
ValueReader vr = _knownReaders.get(k);
if (vr != null) {
... | java | public ValueReader findReader(Class<?> raw)
{
ClassKey k = (_key == null) ? new ClassKey(raw, _features) : _key.with(raw, _features);
ValueReader vr = _knownReaders.get(k);
if (vr != null) {
return vr;
}
vr = createReader(null, raw, raw);
// 15-Jun-2016, t... | [
"public",
"ValueReader",
"findReader",
"(",
"Class",
"<",
"?",
">",
"raw",
")",
"{",
"ClassKey",
"k",
"=",
"(",
"_key",
"==",
"null",
")",
"?",
"new",
"ClassKey",
"(",
"raw",
",",
"_features",
")",
":",
"_key",
".",
"with",
"(",
"raw",
",",
"_featu... | Method used during deserialization to find handler for given
non-generic type. | [
"Method",
"used",
"during",
"deserialization",
"to",
"find",
"handler",
"for",
"given",
"non",
"-",
"generic",
"type",
"."
] | train | https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/ValueReaderLocator.java#L136-L151 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java | ReservoirItemsUnion.toByteArray | public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) {
"""
Returns a byte array representation of this union
@param serDe An instance of ArrayOfItemsSerDe
@return a byte array representation of this union
"""
if ((gadget_ == null) || (gadget_.getNumSamples() == 0)) {
return toByteArray(ser... | java | public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) {
if ((gadget_ == null) || (gadget_.getNumSamples() == 0)) {
return toByteArray(serDe, null);
} else {
return toByteArray(serDe, gadget_.getValueAtPosition(0).getClass());
}
} | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
"final",
"ArrayOfItemsSerDe",
"<",
"T",
">",
"serDe",
")",
"{",
"if",
"(",
"(",
"gadget_",
"==",
"null",
")",
"||",
"(",
"gadget_",
".",
"getNumSamples",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
... | Returns a byte array representation of this union
@param serDe An instance of ArrayOfItemsSerDe
@return a byte array representation of this union | [
"Returns",
"a",
"byte",
"array",
"representation",
"of",
"this",
"union"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java#L235-L241 |
vincentk/joptimizer | src/main/java/com/joptimizer/util/ColtUtils.java | ColtUtils.zMult | public static final DoubleMatrix1D zMult(final DoubleMatrix2D A, final DoubleMatrix1D b, final double beta) {
"""
Returns v = beta * A.b.
Useful in avoiding the need of the copy() in the colt api.
"""
if(A.columns() != b.size()){
throw new IllegalArgumentException("wrong matrices dimensions");
}
... | java | public static final DoubleMatrix1D zMult(final DoubleMatrix2D A, final DoubleMatrix1D b, final double beta){
if(A.columns() != b.size()){
throw new IllegalArgumentException("wrong matrices dimensions");
}
final DoubleMatrix1D ret = DoubleFactory1D.dense.make(A.rows());
if(A instanceof SparseDoubleMatr... | [
"public",
"static",
"final",
"DoubleMatrix1D",
"zMult",
"(",
"final",
"DoubleMatrix2D",
"A",
",",
"final",
"DoubleMatrix1D",
"b",
",",
"final",
"double",
"beta",
")",
"{",
"if",
"(",
"A",
".",
"columns",
"(",
")",
"!=",
"b",
".",
"size",
"(",
")",
")",... | Returns v = beta * A.b.
Useful in avoiding the need of the copy() in the colt api. | [
"Returns",
"v",
"=",
"beta",
"*",
"A",
".",
"b",
".",
"Useful",
"in",
"avoiding",
"the",
"need",
"of",
"the",
"copy",
"()",
"in",
"the",
"colt",
"api",
"."
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/util/ColtUtils.java#L199-L228 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/ItemUtils.java | ItemUtils.getItemStackFromState | public static ItemStack getItemStackFromState(IBlockState state) {
"""
Gets the {@link ItemStack} matching the specified {@link IBlockState}
@param state the state
@return the item stack from state
"""
if (state == null)
return null;
Item item = Item.getItemFromBlock(state.getBlock());
if (item ==... | java | public static ItemStack getItemStackFromState(IBlockState state)
{
if (state == null)
return null;
Item item = Item.getItemFromBlock(state.getBlock());
if (item == null)
return ItemStack.EMPTY;
return new ItemStack(item, 1, state.getBlock().damageDropped(state));
} | [
"public",
"static",
"ItemStack",
"getItemStackFromState",
"(",
"IBlockState",
"state",
")",
"{",
"if",
"(",
"state",
"==",
"null",
")",
"return",
"null",
";",
"Item",
"item",
"=",
"Item",
".",
"getItemFromBlock",
"(",
"state",
".",
"getBlock",
"(",
")",
")... | Gets the {@link ItemStack} matching the specified {@link IBlockState}
@param state the state
@return the item stack from state | [
"Gets",
"the",
"{",
"@link",
"ItemStack",
"}",
"matching",
"the",
"specified",
"{",
"@link",
"IBlockState",
"}"
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/ItemUtils.java#L279-L287 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPDefinitionOptionValueRelWrapper.java | CPDefinitionOptionValueRelWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this cp definition option value rel in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _cpDefinitionOptionValueRel.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_cpDefinitionOptionValueRel",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this cp definition option value rel in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested langu... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"cp",
"definition",
"option",
"value",
"rel",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPDefinitionOptionValueRelWrapper.java#L311-L314 |
advantageous/boon | reflekt/src/main/java/io/advantageous/boon/core/Str.java | Str.slcEnd | public static String slcEnd( String str, int end ) {
"""
Gets end slice of a string.
@param str string
@param end end index of slice
@return new string
"""
return FastStringUtils.noCopyStringFromChars( Chr.slcEnd( FastStringUtils.toCharArray(str), end ) );
} | java | public static String slcEnd( String str, int end ) {
return FastStringUtils.noCopyStringFromChars( Chr.slcEnd( FastStringUtils.toCharArray(str), end ) );
} | [
"public",
"static",
"String",
"slcEnd",
"(",
"String",
"str",
",",
"int",
"end",
")",
"{",
"return",
"FastStringUtils",
".",
"noCopyStringFromChars",
"(",
"Chr",
".",
"slcEnd",
"(",
"FastStringUtils",
".",
"toCharArray",
"(",
"str",
")",
",",
"end",
")",
"... | Gets end slice of a string.
@param str string
@param end end index of slice
@return new string | [
"Gets",
"end",
"slice",
"of",
"a",
"string",
"."
] | train | https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/core/Str.java#L172-L174 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addPrebuilt | public List<PrebuiltEntityExtractor> addPrebuilt(UUID appId, String versionId, List<String> prebuiltExtractorNames) {
"""
Adds a list of prebuilt entity extractors to the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltExtractorNames An array of prebuilt entity ex... | java | public List<PrebuiltEntityExtractor> addPrebuilt(UUID appId, String versionId, List<String> prebuiltExtractorNames) {
return addPrebuiltWithServiceResponseAsync(appId, versionId, prebuiltExtractorNames).toBlocking().single().body();
} | [
"public",
"List",
"<",
"PrebuiltEntityExtractor",
">",
"addPrebuilt",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"String",
">",
"prebuiltExtractorNames",
")",
"{",
"return",
"addPrebuiltWithServiceResponseAsync",
"(",
"appId",
",",
"versionI... | Adds a list of prebuilt entity extractors to the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltExtractorNames An array of prebuilt entity extractor names.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if t... | [
"Adds",
"a",
"list",
"of",
"prebuilt",
"entity",
"extractors",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2090-L2092 |
caelum/vraptor4 | vraptor-core/src/main/java/br/com/caelum/vraptor/validator/beanvalidation/MethodValidator.java | MethodValidator.extractCategory | protected String extractCategory(ValuedParameter[] params, ConstraintViolation<Object> violation) {
"""
Returns the category for this constraint violation. By default, the category returned
is the full path for property. You can override this method if you prefer another strategy.
"""
Iterator<Node> path = ... | java | protected String extractCategory(ValuedParameter[] params, ConstraintViolation<Object> violation) {
Iterator<Node> path = violation.getPropertyPath().iterator();
Node method = path.next();
logger.debug("Constraint violation on method {}: {}", method, violation);
StringBuilder cat = new StringBuilder();
cat.a... | [
"protected",
"String",
"extractCategory",
"(",
"ValuedParameter",
"[",
"]",
"params",
",",
"ConstraintViolation",
"<",
"Object",
">",
"violation",
")",
"{",
"Iterator",
"<",
"Node",
">",
"path",
"=",
"violation",
".",
"getPropertyPath",
"(",
")",
".",
"iterato... | Returns the category for this constraint violation. By default, the category returned
is the full path for property. You can override this method if you prefer another strategy. | [
"Returns",
"the",
"category",
"for",
"this",
"constraint",
"violation",
".",
"By",
"default",
"the",
"category",
"returned",
"is",
"the",
"full",
"path",
"for",
"property",
".",
"You",
"can",
"override",
"this",
"method",
"if",
"you",
"prefer",
"another",
"s... | train | https://github.com/caelum/vraptor4/blob/593ce9ad60f9d38c360881b2132417c56b8cc093/vraptor-core/src/main/java/br/com/caelum/vraptor/validator/beanvalidation/MethodValidator.java#L117-L130 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/util/ClassUtils.java | ClassUtils.getAnnotationValue | public static AnnotationValue getAnnotationValue(TypeElement typeElement, Class<?> annotationClass, String annotationParameter) {
"""
Get a certain annotation parameter of a {@link TypeElement}.
See <a href="https://stackoverflow.com/a/10167558">stackoverflow.com</a> for more information.
@param typeElement th... | java | public static AnnotationValue getAnnotationValue(TypeElement typeElement, Class<?> annotationClass, String annotationParameter) {
AnnotationMirror annotationMirror = getAnnotationMirror(typeElement, annotationClass);
return (annotationMirror != null) ?
getAnnotationValue(annotationMirror, an... | [
"public",
"static",
"AnnotationValue",
"getAnnotationValue",
"(",
"TypeElement",
"typeElement",
",",
"Class",
"<",
"?",
">",
"annotationClass",
",",
"String",
"annotationParameter",
")",
"{",
"AnnotationMirror",
"annotationMirror",
"=",
"getAnnotationMirror",
"(",
"type... | Get a certain annotation parameter of a {@link TypeElement}.
See <a href="https://stackoverflow.com/a/10167558">stackoverflow.com</a> for more information.
@param typeElement the type element, that contains the requested annotation
@param annotationClass the class of the requested annotation
@param annotationParameter... | [
"Get",
"a",
"certain",
"annotation",
"parameter",
"of",
"a",
"{",
"@link",
"TypeElement",
"}",
".",
"See",
"<a",
"href",
"=",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"10167558",
">",
"stackoverflow",
".",
"com<",
"/",
"a",
">",
... | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/util/ClassUtils.java#L127-L132 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedKeyAsync | public ServiceFuture<KeyBundle> recoverDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback) {
"""
Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the delete... | java | public ServiceFuture<KeyBundle> recoverDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"recoverDeletedKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"final",
"ServiceCallback",
"<",
"KeyBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse",
... | Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete opera... | [
"Recovers",
"the",
"deleted",
"key",
"to",
"its",
"latest",
"version",
".",
"The",
"Recover",
"Deleted",
"Key",
"operation",
"is",
"applicable",
"for",
"deleted",
"keys",
"in",
"soft",
"-",
"delete",
"enabled",
"vaults",
".",
"It",
"recovers",
"the",
"delete... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3247-L3249 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java | UtilColor.getDelta | public static double getDelta(ColorRgba a, ColorRgba b) {
"""
Return the delta between two colors.
@param a The first color (must not be <code>null</code>).
@param b The second color (must not be <code>null</code>).
@return The delta between the two colors.
@throws LionEngineException If invalid arguments.
... | java | public static double getDelta(ColorRgba a, ColorRgba b)
{
Check.notNull(a);
Check.notNull(b);
final int dr = a.getRed() - b.getRed();
final int dg = a.getGreen() - b.getGreen();
final int db = a.getBlue() - b.getBlue();
return Math.sqrt(dr * dr + dg * dg + ... | [
"public",
"static",
"double",
"getDelta",
"(",
"ColorRgba",
"a",
",",
"ColorRgba",
"b",
")",
"{",
"Check",
".",
"notNull",
"(",
"a",
")",
";",
"Check",
".",
"notNull",
"(",
"b",
")",
";",
"final",
"int",
"dr",
"=",
"a",
".",
"getRed",
"(",
")",
"... | Return the delta between two colors.
@param a The first color (must not be <code>null</code>).
@param b The second color (must not be <code>null</code>).
@return The delta between the two colors.
@throws LionEngineException If invalid arguments. | [
"Return",
"the",
"delta",
"between",
"two",
"colors",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java#L97-L107 |
j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/servlet/util/MIMETypesSupport.java | MIMETypesSupport.getSupportedProperties | public static Map<Object, Object> getSupportedProperties(Object ref) {
"""
Returns a Map object containing all the supported media extensions,
paired to their MIME type.
@param ref
An object reference to anchor the classpath (any 'this'
reference does).
@return
"""
if (null == supportedMIMETypes) {
... | java | public static Map<Object, Object> getSupportedProperties(Object ref) {
if (null == supportedMIMETypes) {
synchronized (MIMETypesSupport.class) {
if (null == supportedMIMETypes) {
// Load the supported MIME types out of a properties file
try (InputStream is = ClassLoaderResourceUtils.getResourceAsStr... | [
"public",
"static",
"Map",
"<",
"Object",
",",
"Object",
">",
"getSupportedProperties",
"(",
"Object",
"ref",
")",
"{",
"if",
"(",
"null",
"==",
"supportedMIMETypes",
")",
"{",
"synchronized",
"(",
"MIMETypesSupport",
".",
"class",
")",
"{",
"if",
"(",
"nu... | Returns a Map object containing all the supported media extensions,
paired to their MIME type.
@param ref
An object reference to anchor the classpath (any 'this'
reference does).
@return | [
"Returns",
"a",
"Map",
"object",
"containing",
"all",
"the",
"supported",
"media",
"extensions",
"paired",
"to",
"their",
"MIME",
"type",
"."
] | train | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/servlet/util/MIMETypesSupport.java#L51-L72 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java | StatefulBeanReaper.beanDoesNotExistOrHasTimedOut | public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) {
"""
LIDB2018-1 renamed old beanTimedOut method and clarified description.
"""
if (elt == null) {
// Not in the reaper list, but it might be in local
// failover cache if not in reaper list. So che... | java | public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) {
if (elt == null) {
// Not in the reaper list, but it might be in local
// failover cache if not in reaper list. So check it if
// there is a local SfFailoverCache object (e.g. when SFSB
... | [
"public",
"boolean",
"beanDoesNotExistOrHasTimedOut",
"(",
"TimeoutElement",
"elt",
",",
"BeanId",
"beanId",
")",
"{",
"if",
"(",
"elt",
"==",
"null",
")",
"{",
"// Not in the reaper list, but it might be in local",
"// failover cache if not in reaper list. So check it if",
... | LIDB2018-1 renamed old beanTimedOut method and clarified description. | [
"LIDB2018",
"-",
"1",
"renamed",
"old",
"beanTimedOut",
"method",
"and",
"clarified",
"description",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L296-L318 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/style/RtfFontList.java | RtfFontList.getFontNumber | public int getFontNumber(RtfFont font) {
"""
Gets the index of the font in the list of fonts. If the font does not
exist in the list, it is added.
@param font The font to get the id for
@return The index of the font
"""
if(font instanceof RtfParagraphStyle) {
font = new RtfFont(this.do... | java | public int getFontNumber(RtfFont font) {
if(font instanceof RtfParagraphStyle) {
font = new RtfFont(this.document, font);
}
int fontIndex = -1;
for(int i = 0; i < fontList.size(); i++) {
if(fontList.get(i).equals(font)) {
fontIndex = i;
... | [
"public",
"int",
"getFontNumber",
"(",
"RtfFont",
"font",
")",
"{",
"if",
"(",
"font",
"instanceof",
"RtfParagraphStyle",
")",
"{",
"font",
"=",
"new",
"RtfFont",
"(",
"this",
".",
"document",
",",
"font",
")",
";",
"}",
"int",
"fontIndex",
"=",
"-",
"... | Gets the index of the font in the list of fonts. If the font does not
exist in the list, it is added.
@param font The font to get the id for
@return The index of the font | [
"Gets",
"the",
"index",
"of",
"the",
"font",
"in",
"the",
"list",
"of",
"fonts",
".",
"If",
"the",
"font",
"does",
"not",
"exist",
"in",
"the",
"list",
"it",
"is",
"added",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/style/RtfFontList.java#L113-L128 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.getSubPath | private String getSubPath(String[] pathElements, int begin) {
"""
Utility method to return a path fragment.<p>
@param pathElements the path elements
@param begin the begin index
@return the path
"""
String result = "";
for (int i = begin; i < pathElements.length; i++) {
resu... | java | private String getSubPath(String[] pathElements, int begin) {
String result = "";
for (int i = begin; i < pathElements.length; i++) {
result += pathElements[i] + "/";
}
if (result.length() > 0) {
result = result.substring(0, result.length() - 1);
}
... | [
"private",
"String",
"getSubPath",
"(",
"String",
"[",
"]",
"pathElements",
",",
"int",
"begin",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"for",
"(",
"int",
"i",
"=",
"begin",
";",
"i",
"<",
"pathElements",
".",
"length",
";",
"i",
"++",
")",
... | Utility method to return a path fragment.<p>
@param pathElements the path elements
@param begin the begin index
@return the path | [
"Utility",
"method",
"to",
"return",
"a",
"path",
"fragment",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L3980-L3990 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.fetchByG_K | @Override
public CommerceUserSegmentEntry fetchByG_K(long groupId, String key) {
"""
Returns the commerce user segment entry where groupId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param key the key
@return the matching ... | java | @Override
public CommerceUserSegmentEntry fetchByG_K(long groupId, String key) {
return fetchByG_K(groupId, key, true);
} | [
"@",
"Override",
"public",
"CommerceUserSegmentEntry",
"fetchByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"{",
"return",
"fetchByG_K",
"(",
"groupId",
",",
"key",
",",
"true",
")",
";",
"}"
] | Returns the commerce user segment entry where groupId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param key the key
@return the matching commerce user segment entry, or <code>null</code> if a matching commerce user segment entry cou... | [
"Returns",
"the",
"commerce",
"user",
"segment",
"entry",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L1031-L1034 |
banq/jdonframework | src/main/java/com/jdon/container/pico/JdonPicoContainer.java | JdonPicoContainer.registerComponentImplementation | public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
"""
{@inheritDoc} The returned ComponentAdapter will be instantiated by the
{@link ComponentAdapterFactory} passed to the container's constructor.
"""
return regist... | java | public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
return registerComponentImplementation(componentKey, componentImplementation, (Parameter[]) null);
} | [
"public",
"ComponentAdapter",
"registerComponentImplementation",
"(",
"Object",
"componentKey",
",",
"Class",
"componentImplementation",
")",
"throws",
"PicoRegistrationException",
"{",
"return",
"registerComponentImplementation",
"(",
"componentKey",
",",
"componentImplementatio... | {@inheritDoc} The returned ComponentAdapter will be instantiated by the
{@link ComponentAdapterFactory} passed to the container's constructor. | [
"{"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/container/pico/JdonPicoContainer.java#L258-L260 |
h2oai/h2o-2 | src/main/java/water/ga/GoogleAnalytics.java | GoogleAnalytics.processCustomDimensionParameters | private void processCustomDimensionParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) {
"""
Processes the custom dimensions and adds the values to list of parameters, which would be posted to GA.
@param request
@param postParms
"""
Map<String, String... | java | private void processCustomDimensionParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) {
Map<String, String> customDimParms = new HashMap<String, String>();
for (String defaultCustomDimKey : defaultRequest.customDimentions().keySet()) {
customDimParms.pu... | [
"private",
"void",
"processCustomDimensionParameters",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"GoogleAnalyticsRequest",
"request",
",",
"List",
"<",
"NameValuePair",
">",
"postParms",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"customDimPar... | Processes the custom dimensions and adds the values to list of parameters, which would be posted to GA.
@param request
@param postParms | [
"Processes",
"the",
"custom",
"dimensions",
"and",
"adds",
"the",
"values",
"to",
"list",
"of",
"parameters",
"which",
"would",
"be",
"posted",
"to",
"GA",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/ga/GoogleAnalytics.java#L217-L232 |
molgenis/molgenis | molgenis-semantic-search/src/main/java/org/molgenis/semanticsearch/repository/TagRepository.java | TagRepository.getTagEntity | public Tag getTagEntity(String objectIRI, String label, Relation relation, String codeSystemIRI) {
"""
Fetches a tag from the repository. Creates a new one if it does not yet exist.
@param objectIRI IRI of the object
@param label label of the object
@param relation {@link Relation} of the tag
@param codeSyst... | java | public Tag getTagEntity(String objectIRI, String label, Relation relation, String codeSystemIRI) {
Tag tag =
dataService
.query(TAG, Tag.class)
.eq(OBJECT_IRI, objectIRI)
.and()
.eq(RELATION_IRI, relation.getIRI())
.and()
.eq(CODE_SYSTE... | [
"public",
"Tag",
"getTagEntity",
"(",
"String",
"objectIRI",
",",
"String",
"label",
",",
"Relation",
"relation",
",",
"String",
"codeSystemIRI",
")",
"{",
"Tag",
"tag",
"=",
"dataService",
".",
"query",
"(",
"TAG",
",",
"Tag",
".",
"class",
")",
".",
"e... | Fetches a tag from the repository. Creates a new one if it does not yet exist.
@param objectIRI IRI of the object
@param label label of the object
@param relation {@link Relation} of the tag
@param codeSystemIRI the IRI of the code system of the tag
@return {@link Tag} of type {@link TagMetadata} | [
"Fetches",
"a",
"tag",
"from",
"the",
"repository",
".",
"Creates",
"a",
"new",
"one",
"if",
"it",
"does",
"not",
"yet",
"exist",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-semantic-search/src/main/java/org/molgenis/semanticsearch/repository/TagRepository.java#L41-L62 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserDriver.java | CmsUserDriver.internalCreateResourceForOrgUnit | protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, String path, int flags)
throws CmsException {
"""
Creates a folder with the given path an properties, offline AND online.<p>
@param dbc the current database context
@param path the path to create the folder
@param flags the resource ... | java | protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, String path, int flags)
throws CmsException {
// create the offline folder
CmsResource resource = new CmsFolder(
new CmsUUID(),
new CmsUUID(),
path,
CmsResourceTypeFolder.RESOURC... | [
"protected",
"CmsResource",
"internalCreateResourceForOrgUnit",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"path",
",",
"int",
"flags",
")",
"throws",
"CmsException",
"{",
"// create the offline folder",
"CmsResource",
"resource",
"=",
"new",
"CmsFolder",
"(",
"new",
... | Creates a folder with the given path an properties, offline AND online.<p>
@param dbc the current database context
@param path the path to create the folder
@param flags the resource flags
@return the new created offline folder
@throws CmsException if something goes wrong | [
"Creates",
"a",
"folder",
"with",
"the",
"given",
"path",
"an",
"properties",
"offline",
"AND",
"online",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserDriver.java#L2449-L2495 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java | DatabaseClientFactory.newClient | static public DatabaseClient newClient(String host, int port, String database, SecurityContext securityContext) {
"""
Creates a client to access the database by means of a REST server.
The CallManager interface can only call an endpoint for the configured content database
of the appserver. You cannot specify t... | java | static public DatabaseClient newClient(String host, int port, String database, SecurityContext securityContext) {
return newClient(host, port, database, securityContext, null);
} | [
"static",
"public",
"DatabaseClient",
"newClient",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"database",
",",
"SecurityContext",
"securityContext",
")",
"{",
"return",
"newClient",
"(",
"host",
",",
"port",
",",
"database",
",",
"securityContext"... | Creates a client to access the database by means of a REST server.
The CallManager interface can only call an endpoint for the configured content database
of the appserver. You cannot specify the database when constructing a client for working
with a CallManager.
@param host the host with the REST server
@param port ... | [
"Creates",
"a",
"client",
"to",
"access",
"the",
"database",
"by",
"means",
"of",
"a",
"REST",
"server",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java#L1191-L1193 |
cycorp/api-suite | core-api/src/main/java/com/cyc/kb/wrapper/KbTermWrapper.java | KbTermWrapper.provablyNotInstanceOf | @Override
public boolean provablyNotInstanceOf(KbCollection col, Context ctx) {
"""
====| Public methods |==================================================================//
"""
return wrapped().provablyNotInstanceOf(col, ctx);
} | java | @Override
public boolean provablyNotInstanceOf(KbCollection col, Context ctx) {
return wrapped().provablyNotInstanceOf(col, ctx);
} | [
"@",
"Override",
"public",
"boolean",
"provablyNotInstanceOf",
"(",
"KbCollection",
"col",
",",
"Context",
"ctx",
")",
"{",
"return",
"wrapped",
"(",
")",
".",
"provablyNotInstanceOf",
"(",
"col",
",",
"ctx",
")",
";",
"}"
] | ====| Public methods |==================================================================// | [
"====",
"|",
"Public",
"methods",
"|",
"==================================================================",
"//"
] | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/wrapper/KbTermWrapper.java#L52-L55 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.executeSiteAnalysis | public DiagnosticAnalysisInner executeSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) {
"""
Execute Analysis.
Execute Analysis.
@param resourceGroupName Name of the resource group to which the resour... | java | public DiagnosticAnalysisInner executeSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) {
return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName... | [
"public",
"DiagnosticAnalysisInner",
"executeSiteAnalysis",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"analysisName",
",",
"DateTime",
"startTime",
",",
"DateTime",
"endTime",
",",
"String",
"timeG... | Execute Analysis.
Execute Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Category Name
@param analysisName Analysis Resource Name
@param startTime Start Time
@param endTime End Time
@param timeGrain Time Grain
@throws Ill... | [
"Execute",
"Analysis",
".",
"Execute",
"Analysis",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L741-L743 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java | JschUtil.getSession | public static Session getSession(String sshHost, int sshPort, String sshUser, String sshPass) {
"""
获得一个SSH会话,重用已经使用的会话
@param sshHost 主机
@param sshPort 端口
@param sshUser 用户名
@param sshPass 密码
@return SSH会话
"""
return JschSessionPool.INSTANCE.getSession(sshHost, sshPort, sshUser, sshPass);
} | java | public static Session getSession(String sshHost, int sshPort, String sshUser, String sshPass) {
return JschSessionPool.INSTANCE.getSession(sshHost, sshPort, sshUser, sshPass);
} | [
"public",
"static",
"Session",
"getSession",
"(",
"String",
"sshHost",
",",
"int",
"sshPort",
",",
"String",
"sshUser",
",",
"String",
"sshPass",
")",
"{",
"return",
"JschSessionPool",
".",
"INSTANCE",
".",
"getSession",
"(",
"sshHost",
",",
"sshPort",
",",
... | 获得一个SSH会话,重用已经使用的会话
@param sshHost 主机
@param sshPort 端口
@param sshUser 用户名
@param sshPass 密码
@return SSH会话 | [
"获得一个SSH会话,重用已经使用的会话"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L56-L58 |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/GridComponent.java | GridComponent.markCoveredTokens | private Long markCoveredTokens(Map<SNode, Long> markedAndCovered, SNode tok) {
"""
Checks if a token is covered by a matched node but not a match by it self.
@param markedAndCovered A mapping from node to a matched number. The node
must not matched directly, but covered by a matched
node.
@param tok ... | java | private Long markCoveredTokens(Map<SNode, Long> markedAndCovered, SNode tok) {
RelannisNodeFeature f = RelannisNodeFeature.extract(tok);
if (markedAndCovered.containsKey(tok) && f != null && f.getMatchedNode() == null) {
return markedAndCovered.get(tok);
}
return f != null ? f.getMatchedNode() : null;
} | [
"private",
"Long",
"markCoveredTokens",
"(",
"Map",
"<",
"SNode",
",",
"Long",
">",
"markedAndCovered",
",",
"SNode",
"tok",
")",
"{",
"RelannisNodeFeature",
"f",
"=",
"RelannisNodeFeature",
".",
"extract",
"(",
"tok",
")",
";",
"if",
"(",
"markedAndCovered",
... | Checks if a token is covered by a matched node but not a match by it self.
@param markedAndCovered A mapping from node to a matched number. The node
must not matched directly, but covered by a matched
node.
@param tok the checked token.
@return Returns null, if token is not covered neither marked. | [
"Checks",
"if",
"a",
"token",
"is",
"covered",
"by",
"a",
"matched",
"node",
"but",
"not",
"a",
"match",
"by",
"it",
"self",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/GridComponent.java#L424-L430 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogSizing.java | CatalogSizing.getCatalogSizes | public static DatabaseSizes getCatalogSizes(Database dbCatalog, boolean isXDCR) {
"""
Produce a sizing of all significant database objects.
@param dbCatalog database catalog
@param isXDCR Is XDCR enabled
@return database size result object tree
"""
DatabaseSizes dbSizes = new DatabaseSizes();
... | java | public static DatabaseSizes getCatalogSizes(Database dbCatalog, boolean isXDCR) {
DatabaseSizes dbSizes = new DatabaseSizes();
for (Table table: dbCatalog.getTables()) {
dbSizes.addTable(getTableSize(table, isXDCR));
}
return dbSizes;
} | [
"public",
"static",
"DatabaseSizes",
"getCatalogSizes",
"(",
"Database",
"dbCatalog",
",",
"boolean",
"isXDCR",
")",
"{",
"DatabaseSizes",
"dbSizes",
"=",
"new",
"DatabaseSizes",
"(",
")",
";",
"for",
"(",
"Table",
"table",
":",
"dbCatalog",
".",
"getTables",
... | Produce a sizing of all significant database objects.
@param dbCatalog database catalog
@param isXDCR Is XDCR enabled
@return database size result object tree | [
"Produce",
"a",
"sizing",
"of",
"all",
"significant",
"database",
"objects",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogSizing.java#L394-L400 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.getSharedKey | public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
"""
The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
@param re... | java | public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body();
} | [
"public",
"ConnectionSharedKeyInner",
"getSharedKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
")",
"{",
"return",
"getSharedKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayConnectionName",
")",
"... | The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The virtual network gateway connectio... | [
"The",
"Get",
"VirtualNetworkGatewayConnectionSharedKey",
"operation",
"retrieves",
"information",
"about",
"the",
"specified",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"through",
"Network",
"resource",
"provider",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L1025-L1027 |
OpenLiberty/open-liberty | dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractRun.java | SelfExtractRun.getExtractDirectory | private static String getExtractDirectory() {
"""
Determine and return directory to extract into.
Three choices:
1) ${WLP_JAR_EXTRACT_DIR}
2) ${WLP_JAR_EXTRACT_ROOT}/<jar file name>_nnnnnnnnnnnnnnnnnnn
3) default - <home>/wlpExtract/<jar file name>_nnnnnnnnnnnnnnnnnnn
@return extraction directory
"""
... | java | private static String getExtractDirectory() {
createExtractor();
String containerPath = extractor.container.getName();
File containerFile = new File(containerPath);
if (containerFile.isDirectory()) {
extractor.allowNonEmptyInstallDirectory(true);
return containerF... | [
"private",
"static",
"String",
"getExtractDirectory",
"(",
")",
"{",
"createExtractor",
"(",
")",
";",
"String",
"containerPath",
"=",
"extractor",
".",
"container",
".",
"getName",
"(",
")",
";",
"File",
"containerFile",
"=",
"new",
"File",
"(",
"containerPat... | Determine and return directory to extract into.
Three choices:
1) ${WLP_JAR_EXTRACT_DIR}
2) ${WLP_JAR_EXTRACT_ROOT}/<jar file name>_nnnnnnnnnnnnnnnnnnn
3) default - <home>/wlpExtract/<jar file name>_nnnnnnnnnnnnnnnnnnn
@return extraction directory | [
"Determine",
"and",
"return",
"directory",
"to",
"extract",
"into",
".",
"Three",
"choices",
":",
"1",
")",
"$",
"{",
"WLP_JAR_EXTRACT_DIR",
"}",
"2",
")",
"$",
"{",
"WLP_JAR_EXTRACT_ROOT",
"}",
"/",
"<jar",
"file",
"name",
">",
"_nnnnnnnnnnnnnnnnnnn",
"3",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractRun.java#L134-L164 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateIssuerAsync | public Observable<IssuerBundle> deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName) {
"""
Deletes the specified certificate issuer.
The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/del... | java | public Observable<IssuerBundle> deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName) {
return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1<ServiceResponse<IssuerBundle>, IssuerBundle>() {
@Override
public IssuerBundle call(Servic... | [
"public",
"Observable",
"<",
"IssuerBundle",
">",
"deleteCertificateIssuerAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
")",
"{",
"return",
"deleteCertificateIssuerWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"issuerName",
")",
".",
"map",
... | Deletes the specified certificate issuer.
The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param i... | [
"Deletes",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"DeleteCertificateIssuer",
"operation",
"permanently",
"removes",
"the",
"specified",
"certificate",
"issuer",
"from",
"the",
"vault",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6427-L6434 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toDate | public static DateTime toDate(Object o, TimeZone tz) throws PageException {
"""
cast a Object to a DateTime Object
@param o Object to cast
@param tz
@return casted DateTime Object
@throws PageException
"""
return DateCaster.toDateAdvanced(o, tz);
} | java | public static DateTime toDate(Object o, TimeZone tz) throws PageException {
return DateCaster.toDateAdvanced(o, tz);
} | [
"public",
"static",
"DateTime",
"toDate",
"(",
"Object",
"o",
",",
"TimeZone",
"tz",
")",
"throws",
"PageException",
"{",
"return",
"DateCaster",
".",
"toDateAdvanced",
"(",
"o",
",",
"tz",
")",
";",
"}"
] | cast a Object to a DateTime Object
@param o Object to cast
@param tz
@return casted DateTime Object
@throws PageException | [
"cast",
"a",
"Object",
"to",
"a",
"DateTime",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L2873-L2875 |
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) {
"""
this is just a simple set field handling static and non-static, but not Closure and inner classes
"""
if (expression.isSafe()) return false;
FieldNode fn = AsmClassGenerator.... | 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"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java#L902-L929 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java | FlowPath.markActive | public void markActive(@NonNull String nodeName, boolean active) {
"""
This method allows to set specified node active or inactive.
PLEASE NOTE: All nodes using this node as input, will be considered inactive, if this node is set to be inactive.
@param nodeName
@param active
"""
ensureNodeStateExi... | java | public void markActive(@NonNull String nodeName, boolean active) {
ensureNodeStateExists(nodeName);
states.get(nodeName).setActive(active);
} | [
"public",
"void",
"markActive",
"(",
"@",
"NonNull",
"String",
"nodeName",
",",
"boolean",
"active",
")",
"{",
"ensureNodeStateExists",
"(",
"nodeName",
")",
";",
"states",
".",
"get",
"(",
"nodeName",
")",
".",
"setActive",
"(",
"active",
")",
";",
"}"
] | This method allows to set specified node active or inactive.
PLEASE NOTE: All nodes using this node as input, will be considered inactive, if this node is set to be inactive.
@param nodeName
@param active | [
"This",
"method",
"allows",
"to",
"set",
"specified",
"node",
"active",
"or",
"inactive",
".",
"PLEASE",
"NOTE",
":",
"All",
"nodes",
"using",
"this",
"node",
"as",
"input",
"will",
"be",
"considered",
"inactive",
"if",
"this",
"node",
"is",
"set",
"to",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java#L62-L66 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.isKindOf | public static void isKindOf(Type parameter, Type typeToMatch, String name) {
"""
Test if parameter is of requested type and throw exception if not.
@param parameter invocation parameter,
@param typeToMatch type to match,
@param name the name of invocation parameter.
@throws IllegalArgumentException if parame... | java | public static void isKindOf(Type parameter, Type typeToMatch, String name) {
if (!Types.isKindOf(parameter, typeToMatch)) {
throw new IllegalArgumentException(Strings.format("%s is not %s.", name, typeToMatch));
}
} | [
"public",
"static",
"void",
"isKindOf",
"(",
"Type",
"parameter",
",",
"Type",
"typeToMatch",
",",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"Types",
".",
"isKindOf",
"(",
"parameter",
",",
"typeToMatch",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentEx... | Test if parameter is of requested type and throw exception if not.
@param parameter invocation parameter,
@param typeToMatch type to match,
@param name the name of invocation parameter.
@throws IllegalArgumentException if parameter is not of requested type. | [
"Test",
"if",
"parameter",
"is",
"of",
"requested",
"type",
"and",
"throw",
"exception",
"if",
"not",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L541-L545 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.defineInternalFrameCloseButtons | private void defineInternalFrameCloseButtons(UIDefaults d) {
"""
Initialize the internal frame close button settings.
@param d the UI defaults map.
"""
String p = "InternalFrame:InternalFrameTitlePane:\"InternalFrameTitlePane.closeButton\"";
String c = PAINTER_PREFIX + "TitlePaneCloseButtonP... | java | private void defineInternalFrameCloseButtons(UIDefaults d) {
String p = "InternalFrame:InternalFrameTitlePane:\"InternalFrameTitlePane.closeButton\"";
String c = PAINTER_PREFIX + "TitlePaneCloseButtonPainter";
// Set the multiplicity of states for the Close button.
d.put(p + ".States", ... | [
"private",
"void",
"defineInternalFrameCloseButtons",
"(",
"UIDefaults",
"d",
")",
"{",
"String",
"p",
"=",
"\"InternalFrame:InternalFrameTitlePane:\\\"InternalFrameTitlePane.closeButton\\\"\"",
";",
"String",
"c",
"=",
"PAINTER_PREFIX",
"+",
"\"TitlePaneCloseButtonPainter\"",
... | Initialize the internal frame close button settings.
@param d the UI defaults map. | [
"Initialize",
"the",
"internal",
"frame",
"close",
"button",
"settings",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L1234-L1252 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java | ByteArrayList.addNode | protected void addNode( Node nodeToInsert, Node insertBeforeNode ) {
"""
Inserts a new node into the list.
@param nodeToInsert new node to insert
@param insertBeforeNode node to insert before
@throws NullPointerException if either node is null
"""
// Insert node.
nodeToInsert.next = inse... | java | protected void addNode( Node nodeToInsert, Node insertBeforeNode )
{
// Insert node.
nodeToInsert.next = insertBeforeNode;
nodeToInsert.previous = insertBeforeNode.previous;
insertBeforeNode.previous.next = nodeToInsert;
insertBeforeNode.previous = nodeToInsert;
} | [
"protected",
"void",
"addNode",
"(",
"Node",
"nodeToInsert",
",",
"Node",
"insertBeforeNode",
")",
"{",
"// Insert node.",
"nodeToInsert",
".",
"next",
"=",
"insertBeforeNode",
";",
"nodeToInsert",
".",
"previous",
"=",
"insertBeforeNode",
".",
"previous",
";",
"i... | Inserts a new node into the list.
@param nodeToInsert new node to insert
@param insertBeforeNode node to insert before
@throws NullPointerException if either node is null | [
"Inserts",
"a",
"new",
"node",
"into",
"the",
"list",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java#L177-L184 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.print_bytes | public static String print_bytes( byte[] data, int offset, int length ) {
"""
Produce a <code>String</code> representation for the specified array of
<code>byte</code>s. Print each <code>byte</code> as two hexadecimal
digits.
@param data The array to print
@param offset the start offset in <code>data</code>... | java | public static String print_bytes( byte[] data, int offset, int length ) {
int size = 2 * length;
size += ((size / 8) + (size / 64));
char[] buf = new char[size];
int low_mask = 0x0f;
int high_mask = 0xf0;
int buf_pos = 0;
byte b;
int j = 0;
for(... | [
"public",
"static",
"String",
"print_bytes",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"int",
"size",
"=",
"2",
"*",
"length",
";",
"size",
"+=",
"(",
"(",
"size",
"/",
"8",
")",
"+",
"(",
"size",
"/",
... | Produce a <code>String</code> representation for the specified array of
<code>byte</code>s. Print each <code>byte</code> as two hexadecimal
digits.
@param data The array to print
@param offset the start offset in <code>data</code>
@param length the number of <code>byte</code>s to print
@return DOCUMENT ME! | [
"Produce",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"representation",
"for",
"the",
"specified",
"array",
"of",
"<code",
">",
"byte<",
"/",
"code",
">",
"s",
".",
"Print",
"each",
"<code",
">",
"byte<",
"/",
"code",
">",
"as",
"two",
"hexadecima... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L621-L650 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java | GasteigerPEPEPartialCharges.setAntiFlags | private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b) {
"""
Set the Flags to atoms and bonds which are not contained
in an atomContainer.
@param container Container with the flags
@param ac Container to put the flags
@param b True, if the the f... | java | private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b) {
IBond bond = ac.getBond(number);
if (!container.contains(bond)) {
bond.setFlag(CDKConstants.REACTIVE_CENTER, b);
bond.getBegin().setFlag(CDKConstants.REACTIVE_CENTER, b);
... | [
"private",
"IAtomContainer",
"setAntiFlags",
"(",
"IAtomContainer",
"container",
",",
"IAtomContainer",
"ac",
",",
"int",
"number",
",",
"boolean",
"b",
")",
"{",
"IBond",
"bond",
"=",
"ac",
".",
"getBond",
"(",
"number",
")",
";",
"if",
"(",
"!",
"contain... | Set the Flags to atoms and bonds which are not contained
in an atomContainer.
@param container Container with the flags
@param ac Container to put the flags
@param b True, if the the flag is true
@return Container with added flags | [
"Set",
"the",
"Flags",
"to",
"atoms",
"and",
"bonds",
"which",
"are",
"not",
"contained",
"in",
"an",
"atomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L497-L506 |
tobato/FastDFS_Client | src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/BytesUtil.java | BytesUtil.buff2int | public static int buff2int(byte[] bs, int offset) {
"""
buff convert to int
@param bs the buffer (big-endian)
@param offset the start position based 0
@return int number
"""
return ((bs[offset] >= 0 ? bs[offset] : 256 + bs[offset]) << 24)
| ((bs[offset + 1] >= 0 ? bs[offset + 1... | java | public static int buff2int(byte[] bs, int offset) {
return ((bs[offset] >= 0 ? bs[offset] : 256 + bs[offset]) << 24)
| ((bs[offset + 1] >= 0 ? bs[offset + 1] : 256 + bs[offset + 1]) << 16)
| ((bs[offset + 2] >= 0 ? bs[offset + 2] : 256 + bs[offset + 2]) << 8)
| (b... | [
"public",
"static",
"int",
"buff2int",
"(",
"byte",
"[",
"]",
"bs",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"(",
"bs",
"[",
"offset",
"]",
">=",
"0",
"?",
"bs",
"[",
"offset",
"]",
":",
"256",
"+",
"bs",
"[",
"offset",
"]",
")",
"<<",
... | buff convert to int
@param bs the buffer (big-endian)
@param offset the start position based 0
@return int number | [
"buff",
"convert",
"to",
"int"
] | train | https://github.com/tobato/FastDFS_Client/blob/8e3bfe712f1739028beed7f3a6b2cc4579a231e4/src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/BytesUtil.java#L60-L65 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java | GregorianCalendar.getFixedDateMonth1 | private long getFixedDateMonth1(BaseCalendar.Date date, long fixedDate) {
"""
Returns the fixed date of the first date of the month (usually
the 1st of the month) before the specified date.
@param date the date for which the first day of the month is
calculated. The date has to be in the cut-over year (Gregor... | java | private long getFixedDateMonth1(BaseCalendar.Date date, long fixedDate) {
assert date.getNormalizedYear() == gregorianCutoverYear ||
date.getNormalizedYear() == gregorianCutoverYearJulian;
BaseCalendar.Date gCutover = getGregorianCutoverDate();
if (gCutover.getMonth() == BaseCalendar... | [
"private",
"long",
"getFixedDateMonth1",
"(",
"BaseCalendar",
".",
"Date",
"date",
",",
"long",
"fixedDate",
")",
"{",
"assert",
"date",
".",
"getNormalizedYear",
"(",
")",
"==",
"gregorianCutoverYear",
"||",
"date",
".",
"getNormalizedYear",
"(",
")",
"==",
"... | Returns the fixed date of the first date of the month (usually
the 1st of the month) before the specified date.
@param date the date for which the first day of the month is
calculated. The date has to be in the cut-over year (Gregorian
or Julian).
@param fixedDate the fixed date representation of the date | [
"Returns",
"the",
"fixed",
"date",
"of",
"the",
"first",
"date",
"of",
"the",
"month",
"(",
"usually",
"the",
"1st",
"of",
"the",
"month",
")",
"before",
"the",
"specified",
"date",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java#L3192-L3224 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/RuleConditions.java | RuleConditions.createAndCondition | public static Node createAndCondition(Node left, Node right) {
"""
Create an "AND" condition.
<p>
@param left left side of condition
@param right right side of condition
@return the "and" condition
"""
checkNode(left, IN, AND, OR);
checkNode(right, IN, AND, OR);
return new Condition(Node.Type.AND, l... | java | public static Node createAndCondition(Node left, Node right) {
checkNode(left, IN, AND, OR);
checkNode(right, IN, AND, OR);
return new Condition(Node.Type.AND, left, right);
} | [
"public",
"static",
"Node",
"createAndCondition",
"(",
"Node",
"left",
",",
"Node",
"right",
")",
"{",
"checkNode",
"(",
"left",
",",
"IN",
",",
"AND",
",",
"OR",
")",
";",
"checkNode",
"(",
"right",
",",
"IN",
",",
"AND",
",",
"OR",
")",
";",
"ret... | Create an "AND" condition.
<p>
@param left left side of condition
@param right right side of condition
@return the "and" condition | [
"Create",
"an",
"AND",
"condition",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/RuleConditions.java#L52-L56 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/JMProgressiveManager.java | JMProgressiveManager.registerLastResultChangeListener | public JMProgressiveManager<T, R> registerLastResultChangeListener(
Consumer<Optional<R>> resultChangeListener) {
"""
Register last result change listener jm progressive manager.
@param resultChangeListener the result change listener
@return the jm progressive manager
"""
return registerListener(lastR... | java | public JMProgressiveManager<T, R> registerLastResultChangeListener(
Consumer<Optional<R>> resultChangeListener) {
return registerListener(lastResult, resultChangeListener);
} | [
"public",
"JMProgressiveManager",
"<",
"T",
",",
"R",
">",
"registerLastResultChangeListener",
"(",
"Consumer",
"<",
"Optional",
"<",
"R",
">",
">",
"resultChangeListener",
")",
"{",
"return",
"registerListener",
"(",
"lastResult",
",",
"resultChangeListener",
")",
... | Register last result change listener jm progressive manager.
@param resultChangeListener the result change listener
@return the jm progressive manager | [
"Register",
"last",
"result",
"change",
"listener",
"jm",
"progressive",
"manager",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/JMProgressiveManager.java#L202-L205 |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/wrappers/matrix/PairSet.java | PairSet.removeAll | public boolean removeAll(Collection<T> trans, Collection<I> items) {
"""
Removes the pairs obtained from the Cartesian product of transactions and
items
@param trans
collection of transactions
@param items
collection of items
@return <code>true</code> if the set set has been changed
"""
if (trans ==... | java | public boolean removeAll(Collection<T> trans, Collection<I> items) {
if (trans == null || trans.isEmpty() || items == null || items.isEmpty())
return false;
return matrix.removeAll(allTransactions.convert(trans).indices(), allItems.convert(items).indices());
} | [
"public",
"boolean",
"removeAll",
"(",
"Collection",
"<",
"T",
">",
"trans",
",",
"Collection",
"<",
"I",
">",
"items",
")",
"{",
"if",
"(",
"trans",
"==",
"null",
"||",
"trans",
".",
"isEmpty",
"(",
")",
"||",
"items",
"==",
"null",
"||",
"items",
... | Removes the pairs obtained from the Cartesian product of transactions and
items
@param trans
collection of transactions
@param items
collection of items
@return <code>true</code> if the set set has been changed | [
"Removes",
"the",
"pairs",
"obtained",
"from",
"the",
"Cartesian",
"product",
"of",
"transactions",
"and",
"items"
] | train | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/wrappers/matrix/PairSet.java#L554-L558 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/system/systemcpu_stats.java | systemcpu_stats.get | public static systemcpu_stats get(nitro_service service, Long id) throws Exception {
"""
Use this API to fetch statistics of systemcpu_stats resource of given name .
"""
systemcpu_stats obj = new systemcpu_stats();
obj.set_id(id);
systemcpu_stats response = (systemcpu_stats) obj.stat_resource(service);
... | java | public static systemcpu_stats get(nitro_service service, Long id) throws Exception{
systemcpu_stats obj = new systemcpu_stats();
obj.set_id(id);
systemcpu_stats response = (systemcpu_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"systemcpu_stats",
"get",
"(",
"nitro_service",
"service",
",",
"Long",
"id",
")",
"throws",
"Exception",
"{",
"systemcpu_stats",
"obj",
"=",
"new",
"systemcpu_stats",
"(",
")",
";",
"obj",
".",
"set_id",
"(",
"id",
")",
";",
"systemcpu_s... | Use this API to fetch statistics of systemcpu_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"systemcpu_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/system/systemcpu_stats.java#L151-L156 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java | FieldAnnotation.fromReferencedField | public static FieldAnnotation fromReferencedField(DismantleBytecode visitor) {
"""
Factory method. Class name, field name, and field signatures are taken
from the given visitor, which is visiting a reference to the field (i.e.,
a getfield or getstatic instruction).
@param visitor
the visitor which is visitin... | java | public static FieldAnnotation fromReferencedField(DismantleBytecode visitor) {
String className = visitor.getDottedClassConstantOperand();
return new FieldAnnotation(className, visitor.getNameConstantOperand(), visitor.getSigConstantOperand(),
visitor.getRefFieldIsStatic());
} | [
"public",
"static",
"FieldAnnotation",
"fromReferencedField",
"(",
"DismantleBytecode",
"visitor",
")",
"{",
"String",
"className",
"=",
"visitor",
".",
"getDottedClassConstantOperand",
"(",
")",
";",
"return",
"new",
"FieldAnnotation",
"(",
"className",
",",
"visitor... | Factory method. Class name, field name, and field signatures are taken
from the given visitor, which is visiting a reference to the field (i.e.,
a getfield or getstatic instruction).
@param visitor
the visitor which is visiting the field reference
@return the FieldAnnotation object | [
"Factory",
"method",
".",
"Class",
"name",
"field",
"name",
"and",
"field",
"signatures",
"are",
"taken",
"from",
"the",
"given",
"visitor",
"which",
"is",
"visiting",
"a",
"reference",
"to",
"the",
"field",
"(",
"i",
".",
"e",
".",
"a",
"getfield",
"or"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java#L144-L148 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmElements.java | XsdAsmElements.generateClassMethods | private static void generateClassMethods(ClassWriter classWriter, String className, String apiName) {
"""
Creates some class specific methods that all implementations of {@link XsdAbstractElement} should have, which are:
Constructor(ElementVisitor visitor) - Assigns the argument to the visitor field;
Constructor... | java | private static void generateClassMethods(ClassWriter classWriter, String className, String apiName) {
generateClassMethods(classWriter, className, className, apiName, true);
} | [
"private",
"static",
"void",
"generateClassMethods",
"(",
"ClassWriter",
"classWriter",
",",
"String",
"className",
",",
"String",
"apiName",
")",
"{",
"generateClassMethods",
"(",
"classWriter",
",",
"className",
",",
"className",
",",
"apiName",
",",
"true",
")"... | Creates some class specific methods that all implementations of {@link XsdAbstractElement} should have, which are:
Constructor(ElementVisitor visitor) - Assigns the argument to the visitor field;
Constructor(Element parent) - Assigns the argument to the parent field and obtains the visitor of the parent;
Constr... | [
"Creates",
"some",
"class",
"specific",
"methods",
"that",
"all",
"implementations",
"of",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmElements.java#L66-L68 |
joniles/mpxj | src/main/java/net/sf/mpxj/phoenix/PhoenixReader.java | PhoenixReader.findChildTaskByUUID | private Task findChildTaskByUUID(ChildTaskContainer parent, UUID uuid) {
"""
Locates a task within a child task container which matches the supplied UUID.
@param parent child task container
@param uuid required UUID
@return Task instance or null if the task is not found
"""
Task result = null;
... | java | private Task findChildTaskByUUID(ChildTaskContainer parent, UUID uuid)
{
Task result = null;
for (Task task : parent.getChildTasks())
{
if (uuid.equals(task.getGUID()))
{
result = task;
break;
}
}
return result;
} | [
"private",
"Task",
"findChildTaskByUUID",
"(",
"ChildTaskContainer",
"parent",
",",
"UUID",
"uuid",
")",
"{",
"Task",
"result",
"=",
"null",
";",
"for",
"(",
"Task",
"task",
":",
"parent",
".",
"getChildTasks",
"(",
")",
")",
"{",
"if",
"(",
"uuid",
".",... | Locates a task within a child task container which matches the supplied UUID.
@param parent child task container
@param uuid required UUID
@return Task instance or null if the task is not found | [
"Locates",
"a",
"task",
"within",
"a",
"child",
"task",
"container",
"which",
"matches",
"the",
"supplied",
"UUID",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/phoenix/PhoenixReader.java#L609-L623 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/renderer/DefaultTableHeaderCellRenderer.java | DefaultTableHeaderCellRenderer.getIcon | @SuppressWarnings("incomplete-switch")
protected Icon getIcon(JTable table, int column) {
"""
Overloaded to return an icon suitable to the primary sorted column, or null if
the column is not the primary sort key.
@param table the <code>JTable</code>.
@param column the column index.
@return the sort icon, or ... | java | @SuppressWarnings("incomplete-switch")
protected Icon getIcon(JTable table, int column) {
SortKey sortKey = getSortKey(table, column);
if (sortKey != null && table.convertColumnIndexToView(sortKey.getColumn()) == column) {
switch (sortKey.getSortOrder()) {
case ASCENDING:
return UIManage... | [
"@",
"SuppressWarnings",
"(",
"\"incomplete-switch\"",
")",
"protected",
"Icon",
"getIcon",
"(",
"JTable",
"table",
",",
"int",
"column",
")",
"{",
"SortKey",
"sortKey",
"=",
"getSortKey",
"(",
"table",
",",
"column",
")",
";",
"if",
"(",
"sortKey",
"!=",
... | Overloaded to return an icon suitable to the primary sorted column, or null if
the column is not the primary sort key.
@param table the <code>JTable</code>.
@param column the column index.
@return the sort icon, or null if the column is unsorted. | [
"Overloaded",
"to",
"return",
"an",
"icon",
"suitable",
"to",
"the",
"primary",
"sorted",
"column",
"or",
"null",
"if",
"the",
"column",
"is",
"not",
"the",
"primary",
"sort",
"key",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/renderer/DefaultTableHeaderCellRenderer.java#L80-L92 |
RobertStewart/privateer | src/main/java/com/wombatnation/privateer/Privateer.java | Privateer.callMethod | public Object callMethod(Object o, String methodName, Object... args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
"""
Calls the specified method on the Object o with the specified arguments. Returns the
result as an Object. Only methods declared on the class for Object ... | java | public Object callMethod(Object o, String methodName, Object... args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Method method = null;
if (args == null || args.length == 0) {
method = o.getClass().getDeclaredMethod(methodName);
} else {
Class<?>... | [
"public",
"Object",
"callMethod",
"(",
"Object",
"o",
",",
"String",
"methodName",
",",
"Object",
"...",
"args",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Method",
"method",
"=",
"null",
";",
"if... | Calls the specified method on the Object o with the specified arguments. Returns the
result as an Object. Only methods declared on the class for Object o can be called.
<p>
The length of the vararg list of arguments to be passed to the method must match
what the method expects. If no arguments are expected, null can be... | [
"Calls",
"the",
"specified",
"method",
"on",
"the",
"Object",
"o",
"with",
"the",
"specified",
"arguments",
".",
"Returns",
"the",
"result",
"as",
"an",
"Object",
".",
"Only",
"methods",
"declared",
"on",
"the",
"class",
"for",
"Object",
"o",
"can",
"be",
... | train | https://github.com/RobertStewart/privateer/blob/766603021ff406c950e798ce3fb259c9f1f460c7/src/main/java/com/wombatnation/privateer/Privateer.java#L123-L150 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.newInstance | public static <T> T newInstance(Class<T> clazz, Object... params) throws UtilException {
"""
实例化对象
@param <T> 对象类型
@param clazz 类
@param params 构造函数参数
@return 对象
@throws UtilException 包装各类异常
"""
if (ArrayUtil.isEmpty(params)) {
final Constructor<T> constructor = getConstructor(clazz);
try {
... | java | public static <T> T newInstance(Class<T> clazz, Object... params) throws UtilException {
if (ArrayUtil.isEmpty(params)) {
final Constructor<T> constructor = getConstructor(clazz);
try {
return constructor.newInstance();
} catch (Exception e) {
throw new UtilException(e, "Instance class [{}] err... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"...",
"params",
")",
"throws",
"UtilException",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"params",
")",
")",
"{",
"final",
"Constructo... | 实例化对象
@param <T> 对象类型
@param clazz 类
@param params 构造函数参数
@return 对象
@throws UtilException 包装各类异常 | [
"实例化对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L669-L689 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java | ServerAzureADAdministratorsInner.listByServerAsync | public Observable<List<ServerAzureADAdministratorInner>> listByServerAsync(String resourceGroupName, String serverName) {
"""
Returns a list of server Administrators.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API... | java | public Observable<List<ServerAzureADAdministratorInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<ServerAzureADAdministratorInner>>, List<ServerAzureADAdministratorInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"ServerAzureADAdministratorInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverN... | Returns a list of server Administrators.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Returns",
"a",
"list",
"of",
"server",
"Administrators",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java#L542-L549 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.beforeInsertDummies | protected void beforeInsertDummies(int index, int length) {
"""
Inserts length dummies before the specified position into the receiver.
Shifts the element currently at that position (if any) and
any subsequent elements to the right.
@param index index before which to insert dummies (must be in [0,size])..
@p... | java | protected void beforeInsertDummies(int index, int length) {
if (index > size || index < 0)
throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
if (length > 0) {
ensureCapacity(size + length);
System.arraycopy(elements, index, elements, index + length, size-index);
size += length;
... | [
"protected",
"void",
"beforeInsertDummies",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"if",
"(",
"index",
">",
"size",
"||",
"index",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Index: \"",
"+",
"index",
"+",
"\", Size: \""... | Inserts length dummies before the specified position into the receiver.
Shifts the element currently at that position (if any) and
any subsequent elements to the right.
@param index index before which to insert dummies (must be in [0,size])..
@param length number of dummies to be inserted. | [
"Inserts",
"length",
"dummies",
"before",
"the",
"specified",
"position",
"into",
"the",
"receiver",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
"any",
")",
"and",
"any",
"subsequent",
"elements",
"to",
"the",
"right",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L119-L127 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/backgroundpreference/ViewBackgroundPreferenceController.java | ViewBackgroundPreferenceController.getView | @RenderMapping
public String getView(RenderRequest req, Model model) {
"""
Display the main user-facing view of the portlet.
@param request
@return
"""
final String[] images = imageSetSelectionStrategy.getImageSet(req);
model.addAttribute("images", images);
final String[] thum... | java | @RenderMapping
public String getView(RenderRequest req, Model model) {
final String[] images = imageSetSelectionStrategy.getImageSet(req);
model.addAttribute("images", images);
final String[] thumbnailImages = imageSetSelectionStrategy.getImageThumbnailSet(req);
model.addAttribute(... | [
"@",
"RenderMapping",
"public",
"String",
"getView",
"(",
"RenderRequest",
"req",
",",
"Model",
"model",
")",
"{",
"final",
"String",
"[",
"]",
"images",
"=",
"imageSetSelectionStrategy",
".",
"getImageSet",
"(",
"req",
")",
";",
"model",
".",
"addAttribute",
... | Display the main user-facing view of the portlet.
@param request
@return | [
"Display",
"the",
"main",
"user",
"-",
"facing",
"view",
"of",
"the",
"portlet",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/backgroundpreference/ViewBackgroundPreferenceController.java#L42-L66 |
hal/core | flow/core/src/main/java/org/jboss/gwt/flow/client/Async.java | Async.waterfall | @SafeVarargs
public final void waterfall(final C context, final Outcome<C> outcome, final Function<C>... functions) {
"""
Runs an array of functions in series, working on a shared context.
However, if any of the functions pass an error to the callback,
the next function is not executed and the outcome is imm... | java | @SafeVarargs
public final void waterfall(final C context, final Outcome<C> outcome, final Function<C>... functions) {
_series(context, outcome, functions);
} | [
"@",
"SafeVarargs",
"public",
"final",
"void",
"waterfall",
"(",
"final",
"C",
"context",
",",
"final",
"Outcome",
"<",
"C",
">",
"outcome",
",",
"final",
"Function",
"<",
"C",
">",
"...",
"functions",
")",
"{",
"_series",
"(",
"context",
",",
"outcome",... | Runs an array of functions in series, working on a shared context.
However, if any of the functions pass an error to the callback,
the next function is not executed and the outcome is immediately called with the error. | [
"Runs",
"an",
"array",
"of",
"functions",
"in",
"series",
"working",
"on",
"a",
"shared",
"context",
".",
"However",
"if",
"any",
"of",
"the",
"functions",
"pass",
"an",
"error",
"to",
"the",
"callback",
"the",
"next",
"function",
"is",
"not",
"executed",
... | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/flow/core/src/main/java/org/jboss/gwt/flow/client/Async.java#L67-L70 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jbatch.misc_fat/util/src/fat/util/JobWaiter.java | JobWaiter.completeNewJob | public JobExecution completeNewJob(String jobXMLName, Properties jobParameters) throws IllegalStateException {
"""
Wait for {@code JobWaiter#timeout} seconds for BOTH of:
1) BatchStatus to be one of: STOPPED ,FAILED , COMPLETED, ABANDONED
AND
2) exitStatus to be non-null
Returns JobExecution if it ends in ... | java | public JobExecution completeNewJob(String jobXMLName, Properties jobParameters) throws IllegalStateException {
long executionId = jobOp.start(jobXMLName, jobParameters);
JobExecution jobExec = waitForFinish(executionId);
if (jobExec.getBatchStatus().equals(BatchStatus.COMPLETED)) {
l... | [
"public",
"JobExecution",
"completeNewJob",
"(",
"String",
"jobXMLName",
",",
"Properties",
"jobParameters",
")",
"throws",
"IllegalStateException",
"{",
"long",
"executionId",
"=",
"jobOp",
".",
"start",
"(",
"jobXMLName",
",",
"jobParameters",
")",
";",
"JobExecut... | Wait for {@code JobWaiter#timeout} seconds for BOTH of:
1) BatchStatus to be one of: STOPPED ,FAILED , COMPLETED, ABANDONED
AND
2) exitStatus to be non-null
Returns JobExecution if it ends in <b>COMPLETED</b> status, otherwise throws
<b>IllegalStateException</b>
@param jobXMLName
@param jobParameters
@return JobExec... | [
"Wait",
"for",
"{",
"@code",
"JobWaiter#timeout",
"}",
"seconds",
"for",
"BOTH",
"of",
":"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jbatch.misc_fat/util/src/fat/util/JobWaiter.java#L103-L112 |
dnsjava/dnsjava | org/xbill/DNS/SIG0.java | SIG0.verifyMessage | public static void
verifyMessage(Message message, byte [] b, KEYRecord key, SIGRecord previous)
throws DNSSEC.DNSSECException {
"""
Verify a message using SIG(0).
@param message The message to be signed
@param b An array containing the message in unparsed form. This is
necessary since SIG(0) signs the message... | java | public static void
verifyMessage(Message message, byte [] b, KEYRecord key, SIGRecord previous)
throws DNSSEC.DNSSECException
{
SIGRecord sig = null;
Record [] additional = message.getSectionArray(Section.ADDITIONAL);
for (int i = 0; i < additional.length; i++) {
if (additional[i].getType() != Type.SIG)
contin... | [
"public",
"static",
"void",
"verifyMessage",
"(",
"Message",
"message",
",",
"byte",
"[",
"]",
"b",
",",
"KEYRecord",
"key",
",",
"SIGRecord",
"previous",
")",
"throws",
"DNSSEC",
".",
"DNSSECException",
"{",
"SIGRecord",
"sig",
"=",
"null",
";",
"Record",
... | Verify a message using SIG(0).
@param message The message to be signed
@param b An array containing the message in unparsed form. This is
necessary since SIG(0) signs the message in wire format, and we can't
recreate the exact wire format (with the same name compression).
@param key The KEY record to verify the signat... | [
"Verify",
"a",
"message",
"using",
"SIG",
"(",
"0",
")",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/SIG0.java#L62-L77 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.withDataInputStream | public static <T> T withDataInputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.DataInputStream") Closure<T> closure) throws IOException {
"""
Create a new DataInputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure return... | java | public static <T> T withDataInputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.DataInputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newDataInputStream(self), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withDataInputStream",
"(",
"Path",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.DataInputStream\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
... | Create a new DataInputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@param self a Path
@param closure a closure
@return the value returned by the closure
@throws java.io.IOException if an IOException occurs.
@see org.codehaus.groovy.runtime.... | [
"Create",
"a",
"new",
"DataInputStream",
"for",
"this",
"file",
"and",
"passes",
"it",
"into",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1530-L1532 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/lineage/LineageInfo.java | LineageInfo.putDestination | public void putDestination(List<Descriptor> descriptors, int branchId, State state) {
"""
Put data {@link Descriptor}s of a destination dataset to a state
@param descriptors It can be a single item list which just has the dataset descriptor or a list
of dataset partition descriptors
"""
if (!hasLineag... | java | public void putDestination(List<Descriptor> descriptors, int branchId, State state) {
if (!hasLineageInfo(state)) {
log.warn("State has no lineage info but branch " + branchId + " puts {} descriptors", descriptors.size());
return;
}
log.info(String.format("Put destination %s for branch %d", De... | [
"public",
"void",
"putDestination",
"(",
"List",
"<",
"Descriptor",
">",
"descriptors",
",",
"int",
"branchId",
",",
"State",
"state",
")",
"{",
"if",
"(",
"!",
"hasLineageInfo",
"(",
"state",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"State has no lineage... | Put data {@link Descriptor}s of a destination dataset to a state
@param descriptors It can be a single item list which just has the dataset descriptor or a list
of dataset partition descriptors | [
"Put",
"data",
"{",
"@link",
"Descriptor",
"}",
"s",
"of",
"a",
"destination",
"dataset",
"to",
"a",
"state"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/lineage/LineageInfo.java#L144-L173 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java | ThreadScopeContext.setBean | public void setBean(String name, Object object) {
"""
Set a bean in the context.
@param name bean name
@param object bean value
"""
Bean bean = beans.get(name);
if (null == bean) {
bean = new Bean();
beans.put(name, bean);
}
bean.object = object;
} | java | public void setBean(String name, Object object) {
Bean bean = beans.get(name);
if (null == bean) {
bean = new Bean();
beans.put(name, bean);
}
bean.object = object;
} | [
"public",
"void",
"setBean",
"(",
"String",
"name",
",",
"Object",
"object",
")",
"{",
"Bean",
"bean",
"=",
"beans",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"null",
"==",
"bean",
")",
"{",
"bean",
"=",
"new",
"Bean",
"(",
")",
";",
"beans",... | Set a bean in the context.
@param name bean name
@param object bean value | [
"Set",
"a",
"bean",
"in",
"the",
"context",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java#L47-L54 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginCaptureAsync | public Observable<VirtualMachineCaptureResultInner> beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
"""
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
@param resourceGroupName The nam... | java | public Observable<VirtualMachineCaptureResultInner> beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineCaptureResultInner>, Virtual... | [
"public",
"Observable",
"<",
"VirtualMachineCaptureResultInner",
">",
"beginCaptureAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineCaptureParameters",
"parameters",
")",
"{",
"return",
"beginCaptureWithServiceResponseAsync",
"(",
"reso... | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Capture Virtual Machine operation.
@throws IllegalA... | [
"Captures",
"the",
"VM",
"by",
"copying",
"virtual",
"hard",
"disks",
"of",
"the",
"VM",
"and",
"outputs",
"a",
"template",
"that",
"can",
"be",
"used",
"to",
"create",
"similar",
"VMs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L482-L489 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.findLocalAddressListeningOnPort | private static InetAddress findLocalAddressListeningOnPort(String pHost, int pPort) throws UnknownHostException, SocketException {
"""
Check for an non-loopback, local adress listening on the given port
"""
InetAddress address = InetAddress.getByName(pHost);
if (address.isLoopbackAddress()) {
... | java | private static InetAddress findLocalAddressListeningOnPort(String pHost, int pPort) throws UnknownHostException, SocketException {
InetAddress address = InetAddress.getByName(pHost);
if (address.isLoopbackAddress()) {
// First check local address
InetAddress localAddress = getLoc... | [
"private",
"static",
"InetAddress",
"findLocalAddressListeningOnPort",
"(",
"String",
"pHost",
",",
"int",
"pPort",
")",
"throws",
"UnknownHostException",
",",
"SocketException",
"{",
"InetAddress",
"address",
"=",
"InetAddress",
".",
"getByName",
"(",
"pHost",
")",
... | Check for an non-loopback, local adress listening on the given port | [
"Check",
"for",
"an",
"non",
"-",
"loopback",
"local",
"adress",
"listening",
"on",
"the",
"given",
"port"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L236-L252 |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java | HazelcastPortableProgramFormatter.appendCollectionTypeField | private void appendCollectionTypeField(JField field, PDescriptor descriptor) {
"""
Append a specific list type field to the definition.
@param field JField to append.
<pre>
{@code
.addShortArrayField("shortValues")
}
</pre>
"""
switch (descriptor.getType()) {
case BYTE:
... | java | private void appendCollectionTypeField(JField field, PDescriptor descriptor) {
switch (descriptor.getType()) {
case BYTE:
case BINARY:
writer.formatln(".addByteArrayField(\"%s\")", field.name());
break;
case BOOL:
writer.formatl... | [
"private",
"void",
"appendCollectionTypeField",
"(",
"JField",
"field",
",",
"PDescriptor",
"descriptor",
")",
"{",
"switch",
"(",
"descriptor",
".",
"getType",
"(",
")",
")",
"{",
"case",
"BYTE",
":",
"case",
"BINARY",
":",
"writer",
".",
"formatln",
"(",
... | Append a specific list type field to the definition.
@param field JField to append.
<pre>
{@code
.addShortArrayField("shortValues")
}
</pre> | [
"Append",
"a",
"specific",
"list",
"type",
"field",
"to",
"the",
"definition",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java#L333-L370 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java | StringConcatenation.appendImmediate | public void appendImmediate(Object object, String indentation) {
"""
Add the string representation of the given object to this sequence immediately. That is, all the trailing
whitespace of this sequence will be ignored and the string is appended directly after the last segment that
contains something besides whi... | java | public void appendImmediate(Object object, String indentation) {
for (int i = segments.size() - 1; i >= 0; i--) {
String segment = segments.get(i);
for (int j = 0; j < segment.length(); j++) {
if (!WhitespaceMatcher.isWhitespace(segment.charAt(j))) {
append(object, indentation, i + 1);
return;
... | [
"public",
"void",
"appendImmediate",
"(",
"Object",
"object",
",",
"String",
"indentation",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"segments",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"String",
"segment",
"=",... | Add the string representation of the given object to this sequence immediately. That is, all the trailing
whitespace of this sequence will be ignored and the string is appended directly after the last segment that
contains something besides whitespace. The given indentation will be prepended to each line except the fir... | [
"Add",
"the",
"string",
"representation",
"of",
"the",
"given",
"object",
"to",
"this",
"sequence",
"immediately",
".",
"That",
"is",
"all",
"the",
"trailing",
"whitespace",
"of",
"this",
"sequence",
"will",
"be",
"ignored",
"and",
"the",
"string",
"is",
"ap... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java#L350-L361 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.deleteImagesAsync | public Observable<Void> deleteImagesAsync(UUID projectId, List<String> imageIds) {
"""
Delete images from the set of training images.
@param projectId The project id
@param imageIds Ids of the images to be deleted. Limted to 256 images per batch
@throws IllegalArgumentException thrown if parameters fail the v... | java | public Observable<Void> deleteImagesAsync(UUID projectId, List<String> imageIds) {
return deleteImagesWithServiceResponseAsync(projectId, imageIds).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteImagesAsync",
"(",
"UUID",
"projectId",
",",
"List",
"<",
"String",
">",
"imageIds",
")",
"{",
"return",
"deleteImagesWithServiceResponseAsync",
"(",
"projectId",
",",
"imageIds",
")",
".",
"map",
"(",
"new",
"F... | Delete images from the set of training images.
@param projectId The project id
@param imageIds Ids of the images to be deleted. Limted to 256 images per batch
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Delete",
"images",
"from",
"the",
"set",
"of",
"training",
"images",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4039-L4046 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getTotalTime | private long getTotalTime(ProjectCalendarDateRanges hours, Date startDate, Date endDate) {
"""
This method calculates the total amount of working time in a single
day, which intersects with the supplied time range.
@param hours collection of working hours in a day
@param startDate time range start
@param end... | java | private long getTotalTime(ProjectCalendarDateRanges hours, Date startDate, Date endDate)
{
long total = 0;
if (startDate.getTime() != endDate.getTime())
{
Date start = DateHelper.getCanonicalTime(startDate);
Date end = DateHelper.getCanonicalTime(endDate);
for (DateRange... | [
"private",
"long",
"getTotalTime",
"(",
"ProjectCalendarDateRanges",
"hours",
",",
"Date",
"startDate",
",",
"Date",
"endDate",
")",
"{",
"long",
"total",
"=",
"0",
";",
"if",
"(",
"startDate",
".",
"getTime",
"(",
")",
"!=",
"endDate",
".",
"getTime",
"("... | This method calculates the total amount of working time in a single
day, which intersects with the supplied time range.
@param hours collection of working hours in a day
@param startDate time range start
@param endDate time range end
@return length of time in milliseconds | [
"This",
"method",
"calculates",
"the",
"total",
"amount",
"of",
"working",
"time",
"in",
"a",
"single",
"day",
"which",
"intersects",
"with",
"the",
"supplied",
"time",
"range",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L1460-L1502 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java | ExcelUtil.readBySax | public static void readBySax(InputStream in, int sheetIndex, RowHandler rowHandler) {
"""
通过Sax方式读取Excel,同时支持03和07格式
@param in Excel流
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0
"""
in = IoUtil.toMarkSupportStream(in);
if (ExcelFileUtil.isXlsx(in)) {
read07BySax(in, sheetIndex... | java | public static void readBySax(InputStream in, int sheetIndex, RowHandler rowHandler) {
in = IoUtil.toMarkSupportStream(in);
if (ExcelFileUtil.isXlsx(in)) {
read07BySax(in, sheetIndex, rowHandler);
} else {
read03BySax(in, sheetIndex, rowHandler);
}
} | [
"public",
"static",
"void",
"readBySax",
"(",
"InputStream",
"in",
",",
"int",
"sheetIndex",
",",
"RowHandler",
"rowHandler",
")",
"{",
"in",
"=",
"IoUtil",
".",
"toMarkSupportStream",
"(",
"in",
")",
";",
"if",
"(",
"ExcelFileUtil",
".",
"isXlsx",
"(",
"i... | 通过Sax方式读取Excel,同时支持03和07格式
@param in Excel流
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0 | [
"通过Sax方式读取Excel,同时支持03和07格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L71-L78 |
akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/ModuleXmlReader.java | ModuleXmlReader.getChildElement | protected static Element getChildElement(final Element parent, final String tagName) {
"""
Get a single child element.
@param parent The parent element
@param tagName The child element name
@return Element The first child element by that name
"""
List<Element> elements = getElements(parent, tagName... | java | protected static Element getChildElement(final Element parent, final String tagName) {
List<Element> elements = getElements(parent, tagName);
if (elements.size() > 0) {
return elements.get(0);
} else {
return null;
}
} | [
"protected",
"static",
"Element",
"getChildElement",
"(",
"final",
"Element",
"parent",
",",
"final",
"String",
"tagName",
")",
"{",
"List",
"<",
"Element",
">",
"elements",
"=",
"getElements",
"(",
"parent",
",",
"tagName",
")",
";",
"if",
"(",
"elements",
... | Get a single child element.
@param parent The parent element
@param tagName The child element name
@return Element The first child element by that name | [
"Get",
"a",
"single",
"child",
"element",
"."
] | train | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/ModuleXmlReader.java#L108-L115 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hllmap/CouponHashMap.java | CouponHashMap.findKey | @Override
int findKey(final byte[] key) {
"""
Returns entryIndex if the given key is found. If not found, returns one's complement index
of an empty slot for insertion, which may be over a deleted key.
@param key the given key
@return the entryIndex
"""
final long[] hash = MurmurHash3.hash(key, SEED);... | java | @Override
int findKey(final byte[] key) {
final long[] hash = MurmurHash3.hash(key, SEED);
int entryIndex = getIndex(hash[0], tableEntries_);
int firstDeletedIndex = -1;
final int loopIndex = entryIndex;
do {
if (curCountsArr_[entryIndex] == 0) {
return firstDeletedIndex == -1 ? ~ent... | [
"@",
"Override",
"int",
"findKey",
"(",
"final",
"byte",
"[",
"]",
"key",
")",
"{",
"final",
"long",
"[",
"]",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"key",
",",
"SEED",
")",
";",
"int",
"entryIndex",
"=",
"getIndex",
"(",
"hash",
"[",
"0",
... | Returns entryIndex if the given key is found. If not found, returns one's complement index
of an empty slot for insertion, which may be over a deleted key.
@param key the given key
@return the entryIndex | [
"Returns",
"entryIndex",
"if",
"the",
"given",
"key",
"is",
"found",
".",
"If",
"not",
"found",
"returns",
"one",
"s",
"complement",
"index",
"of",
"an",
"empty",
"slot",
"for",
"insertion",
"which",
"may",
"be",
"over",
"a",
"deleted",
"key",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hllmap/CouponHashMap.java#L139-L159 |
milaboratory/milib | src/main/java/com/milaboratory/core/io/util/IOUtil.java | IOUtil.writeRawVarint64 | public static void writeRawVarint64(OutputStream os, long value) throws IOException {
"""
Encode and write a varint.
<p>Copied from com.google.protobuf.CodedOutputStream from Google's protobuf library.</p>
"""
while (true) {
if ((value & ~0x7FL) == 0) {
os.write((int) val... | java | public static void writeRawVarint64(OutputStream os, long value) throws IOException {
while (true) {
if ((value & ~0x7FL) == 0) {
os.write((int) value);
return;
} else {
os.write(((int) value & 0x7F) | 0x80);
value >>>= 7;
... | [
"public",
"static",
"void",
"writeRawVarint64",
"(",
"OutputStream",
"os",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"(",
"value",
"&",
"~",
"0x7F",
"L",
")",
"==",
"0",
")",
"{",
"os",
".",
... | Encode and write a varint.
<p>Copied from com.google.protobuf.CodedOutputStream from Google's protobuf library.</p> | [
"Encode",
"and",
"write",
"a",
"varint",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/io/util/IOUtil.java#L115-L125 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/InjectionHelper.java | InjectionHelper.injectWebServiceContext | public static void injectWebServiceContext(final Object instance, final WebServiceContext ctx) {
"""
Injects @Resource annotated accessible objects referencing WebServiceContext.
@param instance to operate on
@param ctx current web service context
"""
final Class<?> instanceClass = instance.getClass(... | java | public static void injectWebServiceContext(final Object instance, final WebServiceContext ctx)
{
final Class<?> instanceClass = instance.getClass();
// inject @Resource annotated methods accepting WebServiceContext parameter
Collection<Method> resourceAnnotatedMethods = WEB_SERVICE_CONTEXT_METHOD_... | [
"public",
"static",
"void",
"injectWebServiceContext",
"(",
"final",
"Object",
"instance",
",",
"final",
"WebServiceContext",
"ctx",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"instanceClass",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"// inject @Resource... | Injects @Resource annotated accessible objects referencing WebServiceContext.
@param instance to operate on
@param ctx current web service context | [
"Injects",
"@Resource",
"annotated",
"accessible",
"objects",
"referencing",
"WebServiceContext",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java#L62-L95 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java | ProfilesConfigFileWriter.modifyOrInsertProfiles | public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
"""
Modify or insert new profiles into an existing credentials file by
in-place modification. Only the properties of the affected profiles will
be modified; all the unaffected profiles and comment lines will remain
the same. This... | java | public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (Profile profile : profiles) {
modifications.put(profile.getProfileName(), profile);
}
modifyProfiles(desti... | [
"public",
"static",
"void",
"modifyOrInsertProfiles",
"(",
"File",
"destination",
",",
"Profile",
"...",
"profiles",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Profile",
">",
"modifications",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Profile",
">",... | Modify or insert new profiles into an existing credentials file by
in-place modification. Only the properties of the affected profiles will
be modified; all the unaffected profiles and comment lines will remain
the same. This method does not support renaming a profile.
@param destination
The destination file to modify... | [
"Modify",
"or",
"insert",
"new",
"profiles",
"into",
"an",
"existing",
"credentials",
"file",
"by",
"in",
"-",
"place",
"modification",
".",
"Only",
"the",
"properties",
"of",
"the",
"affected",
"profiles",
"will",
"be",
"modified",
";",
"all",
"the",
"unaff... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java#L105-L112 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpUtil.java | HttpUtil.addParam | private static void addParam(Map<String, List<String>> params, String name, String value, String charset) {
"""
将键值对加入到值为List类型的Map中
@param params 参数
@param name key
@param value value
@param charset 编码
"""
name = URLUtil.decode(name, charset);
value = URLUtil.decode(value, charset);
List<String... | java | private static void addParam(Map<String, List<String>> params, String name, String value, String charset) {
name = URLUtil.decode(name, charset);
value = URLUtil.decode(value, charset);
List<String> values = params.get(name);
if (values == null) {
values = new ArrayList<String>(1); // 一般是一个参数
params... | [
"private",
"static",
"void",
"addParam",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"params",
",",
"String",
"name",
",",
"String",
"value",
",",
"String",
"charset",
")",
"{",
"name",
"=",
"URLUtil",
".",
"decode",
"(",
"name",
... | 将键值对加入到值为List类型的Map中
@param params 参数
@param name key
@param value value
@param charset 编码 | [
"将键值对加入到值为List类型的Map中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L763-L772 |
Squarespace/cldr | runtime/src/main/java/com/squarespace/cldr/MessageArgsUnitParser.java | MessageArgsUnitParser.selectExactUnit | protected static Unit selectExactUnit(String compact, UnitConverter converter) {
"""
Some categories only have a single possible unit depending the locale.
"""
if (compact != null) {
switch (compact) {
case "consumption":
return converter.consumptionUnit();
case "light":
... | java | protected static Unit selectExactUnit(String compact, UnitConverter converter) {
if (compact != null) {
switch (compact) {
case "consumption":
return converter.consumptionUnit();
case "light":
return Unit.LUX;
case "speed":
return converter.speedUnit();
... | [
"protected",
"static",
"Unit",
"selectExactUnit",
"(",
"String",
"compact",
",",
"UnitConverter",
"converter",
")",
"{",
"if",
"(",
"compact",
"!=",
"null",
")",
"{",
"switch",
"(",
"compact",
")",
"{",
"case",
"\"consumption\"",
":",
"return",
"converter",
... | Some categories only have a single possible unit depending the locale. | [
"Some",
"categories",
"only",
"have",
"a",
"single",
"possible",
"unit",
"depending",
"the",
"locale",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/MessageArgsUnitParser.java#L93-L110 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentService.java | CmsContentService.getFileEncoding | protected String getFileEncoding(CmsObject cms, CmsResource file) {
"""
Helper method to determine the encoding of the given file in the VFS,
which must be set using the "content-encoding" property.<p>
@param cms the CmsObject
@param file the file which is to be checked
@return the encoding for the file
... | java | protected String getFileEncoding(CmsObject cms, CmsResource file) {
String result;
try {
result = cms.readPropertyObject(file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(
OpenCms.getSystemInfo().getDefaultEncoding());
} catch (CmsException e) {
... | [
"protected",
"String",
"getFileEncoding",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"file",
")",
"{",
"String",
"result",
";",
"try",
"{",
"result",
"=",
"cms",
".",
"readPropertyObject",
"(",
"file",
",",
"CmsPropertyDefinition",
".",
"PROPERTY_CONTENT_ENCODIN... | Helper method to determine the encoding of the given file in the VFS,
which must be set using the "content-encoding" property.<p>
@param cms the CmsObject
@param file the file which is to be checked
@return the encoding for the file | [
"Helper",
"method",
"to",
"determine",
"the",
"encoding",
"of",
"the",
"given",
"file",
"in",
"the",
"VFS",
"which",
"must",
"be",
"set",
"using",
"the",
"content",
"-",
"encoding",
"property",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentService.java#L1050-L1060 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.notEmpty | public static void notEmpty(Collection<?> collection, Supplier<String> message) {
"""
Asserts that the {@link Collection} is not empty.
The assertion holds if and only if the {@link Collection} is not {@literal null} and contains at least 1 element.
@param collection {@link Collection} to evaluate.
@param m... | java | public static void notEmpty(Collection<?> collection, Supplier<String> message) {
if (isEmpty(collection)) {
throw new IllegalArgumentException(message.get());
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"Supplier",
"<",
"String",
">",
"message",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"collection",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"mess... | Asserts that the {@link Collection} is not empty.
The assertion holds if and only if the {@link Collection} is not {@literal null} and contains at least 1 element.
@param collection {@link Collection} to evaluate.
@param message {@link Supplier} containing the message using in the {@link IllegalArgumentException} thr... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Collection",
"}",
"is",
"not",
"empty",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L1049-L1053 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.